export type DeleteApiV2PaymentLinksUuidArgs = {uuid: string, 'X-Token-Api': string, 'Content-Type'?: 'application/json' | undefined, 'x-idempotency-key'?: string | undefined, 'x-ip-origin-request'?: string | undefined}; export type DeleteApiV2PaymentLinksUuidOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletar link de pagamento * * DELETE /v2/payment-links/{uuid} */ export const deleteApiV2PaymentLinksUuid = async (args: DeleteApiV2PaymentLinksUuidArgs, options?: DeleteApiV2PaymentLinksUuidOptions) => { const {baseUrl = "https://api.barte.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Token-Api'] != null) headers.set("X-Token-Api", String(args['X-Token-Api'])) if (args['Content-Type'] != null) headers.set("Content-Type", String(args['Content-Type'])) if (args['x-idempotency-key'] != null) headers.set("x-idempotency-key", String(args['x-idempotency-key'])) if (args['x-ip-origin-request'] != null) headers.set("x-ip-origin-request", String(args['x-ip-origin-request'])) if (ApiKeyAuth !== undefined) headers.set("X-Token-Api", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v2/payment-links/${encodeURIComponent(String(args.uuid))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };