export type ApprovalPayoutDestinationUpdateEvent = {account_id: string, event: 'approval_payout_destination_update', event_delivery: string, payout_destination_case: {id: string, created_at: string, created_by?: string | undefined, updated_at: string, payout_destination_id: string, payout_destination_name?: string | undefined, payout_destination_description?: string | undefined, payout_reference: string, organization_number: string, case_status: 'ACTIVE' | 'DECLINED' | 'UNDER_MANUAL_REVIEW' | 'AUTOMATIC_REVIEW' | 'WAITING_FOR_SIGNATURE' | 'WAITING_FOR_DECLARATION' | 'ERROR'}}; export type CreateApiExamplesApprovalPayoutDestinationUpdateArgs = {event: string, 'event-delivery': string, 'event-signature'?: string | undefined, 'content-type': string, body: ApprovalPayoutDestinationUpdateEvent}; export type CreateApiExamplesApprovalPayoutDestinationUpdateOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * example_approval_payout_destination_update_event * * POST /examples/approval_payout_destination_update */ export const createApiExamplesApprovalPayoutDestinationUpdate = async (args: CreateApiExamplesApprovalPayoutDestinationUpdateArgs, options?: CreateApiExamplesApprovalPayoutDestinationUpdateOptions) => { const {baseUrl = "https://api.dintero.com/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.event != null) headers.set("event", String(args.event)) if (args['event-delivery'] != null) headers.set("event-delivery", String(args['event-delivery'])) if (args['event-signature'] != null) headers.set("event-signature", String(args['event-signature'])) if (args['content-type'] != null) headers.set("content-type", String(args['content-type'])) const url = `${baseUrl.replace(/\/+$/, '')}/examples/approval_payout_destination_update${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 undefined };