export type LinkedOperationsMap = {id?: number | undefined, genericOperationType?: (string | null) | undefined, operationId?: (number | null) | undefined, externalOperationId?: (number | null) | undefined}; export type UpdateApiV1AccountsAccountIdLinkedOperationsArgs = {accountId: number, body: Array}; export type UpdateApiV1AccountsAccountIdLinkedOperationsOptions = {baseUrl: string, OAuth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * PUT /v1/Accounts/{accountId}/linkedOperations */ export const updateApiV1AccountsAccountIdLinkedOperations = async (args: UpdateApiV1AccountsAccountIdLinkedOperationsArgs, options: UpdateApiV1AccountsAccountIdLinkedOperationsOptions) => { const {baseUrl, fetch: fetchFn = fetch, OAuth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json-patch+json; x-api-version=1.0") if (OAuth2 !== undefined) headers.set('authorization', `Bearer ${OAuth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/Accounts/${encodeURIComponent(String(args.accountId))}/linkedOperations${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 undefined };