export type GetApiPlatformV2CustomersCustomerIdDocumentsDocumentIdContentArgs = {customerId: string, documentId: string}; export type GetApiPlatformV2CustomersCustomerIdDocumentsDocumentIdContentOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Download customer document * * GET /platform/v2/customers/{customerId}/documents/{documentId}/content */ export const getApiPlatformV2CustomersCustomerIdDocumentsDocumentIdContent = async (args: GetApiPlatformV2CustomersCustomerIdDocumentsDocumentIdContentArgs, options?: GetApiPlatformV2CustomersCustomerIdDocumentsDocumentIdContentOptions) => { const {baseUrl = "https://api.sandbox.bvnk.com", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/octet-stream") if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/platform/v2/customers/${encodeURIComponent(String(args.customerId))}/documents/${encodeURIComponent(String(args.documentId))}/content${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };