export type DeleteApiV1CustomerSubscriptionsIdArgs = {'User-Agent'?: string | undefined, 'X-Idempotency-Key'?: string | undefined, id: string}; export type DeleteApiV1CustomerSubscriptionsIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Excluir a Assinatura * * DELETE /v1/customer_subscriptions/{id} */ export const deleteApiV1CustomerSubscriptionsId = async (args: DeleteApiV1CustomerSubscriptionsIdArgs, options?: DeleteApiV1CustomerSubscriptionsIdOptions) => { const {baseUrl = "https://api-sandbox.kobana.com.br", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['User-Agent'] != null) headers.set("User-Agent", String(args['User-Agent'])) if (args['X-Idempotency-Key'] != null) headers.set("X-Idempotency-Key", String(args['X-Idempotency-Key'])) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/customer_subscriptions/${encodeURIComponent(String(args.id))}${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 };