export type WebhookDeliveryResendObject = {resource_owner_id?: (number | null) | undefined, webhook_id?: (number | null) | undefined, uid?: (string | null) | undefined, response_code?: (number | null) | undefined, event_code?: (string | null) | undefined, status?: (number | null) | undefined, created_from?: (string | null) | undefined, created_to?: (string | null) | undefined}; export type UpdateApiV1WebhookDeliveriesResendArgs = {'User-Agent'?: string | undefined, body: WebhookDeliveryResendObject}; export type UpdateApiV1WebhookDeliveriesResendOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Reenviar Webhooks Enviados * * PUT /v1/webhook_deliveries/resend */ export const updateApiV1WebhookDeliveriesResend = async (args: UpdateApiV1WebhookDeliveriesResendArgs, options?: UpdateApiV1WebhookDeliveriesResendOptions) => { const {baseUrl = "https://api-sandbox.kobana.com.br", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (args['User-Agent'] != null) headers.set("User-Agent", String(args['User-Agent'])) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/webhook_deliveries/resend${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return (await res.json()) as unknown };