export type CreateApiAccountsAccountIdWireDrawdownsWireIdApproveArgs = {account_id: string, wire_id: string, 'x-entity-id'?: string | undefined}; export type CreateApiAccountsAccountIdWireDrawdownsWireIdApproveOptions = {baseUrl?: string | undefined, apiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Approve Wire Drawdown Request * * POST /accounts/{account_id}/wire-drawdowns/{wire_id}/approve */ export const createApiAccountsAccountIdWireDrawdownsWireIdApprove = async (args: CreateApiAccountsAccountIdWireDrawdownsWireIdApproveArgs, options?: CreateApiAccountsAccountIdWireDrawdownsWireIdApproveOptions) => { const {baseUrl = "https://api.meow.com/v1", fetch: fetchFn = fetch, apiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['x-entity-id'] != null) headers.set("x-entity-id", String(args['x-entity-id'])) if (apiKeyAuth !== undefined) headers.set("x-api-key", apiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/accounts/${encodeURIComponent(String(args.account_id))}/wire-drawdowns/${encodeURIComponent(String(args.wire_id))}/approve${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };