export type AssetBatchExportItemSchema = {asset_id: string, file_name?: (string | null) | undefined, format_id?: (string | null) | undefined}; export type AssetBatchExportSchema = {assets: Array, export_metadata?: (boolean | null) | undefined, export_to_asset_folder?: (boolean | null) | undefined, metadata_format?: ('CSV' | 'JSON' | 'XML' | 'null' | null) | undefined, metadata_view?: (string | null) | undefined, overwrite?: (boolean | null) | undefined, preferred_original_storage_id?: (string | null) | undefined, transcode_profile_ids?: (Array | null) | undefined}; export type CreateApiV1AssetsExportLocationsExportLocationIdArgs = {'App-ID': string, 'Auth-Token': string, export_location_id: string, allow_host_transfer?: boolean | undefined, body: AssetBatchExportSchema}; export type CreateApiV1AssetsExportLocationsExportLocationIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Export multiple assets to export location * * POST /v1/assets/export_locations/{export_location_id}/ */ export const createApiV1AssetsExportLocationsExportLocationId = async (args: CreateApiV1AssetsExportLocationsExportLocationIdArgs, options: CreateApiV1AssetsExportLocationsExportLocationIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['App-ID'] != null) headers.set("App-ID", String(args['App-ID'])) if (args['Auth-Token'] != null) headers.set("Auth-Token", String(args['Auth-Token'])) if (args.allow_host_transfer != null) query.append("allow_host_transfer", String(args.allow_host_transfer)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/assets/export_locations/${encodeURIComponent(String(args.export_location_id))}/${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 };