export type DeleteApiAccountAccessConsentsConsentIdArgs = {ConsentId: string, 'x-fapi-auth-date'?: string | undefined, 'x-fapi-customer-ip-address'?: string | undefined, 'x-fapi-interaction-id'?: string | undefined, Authorization: string, 'x-customer-user-agent'?: string | undefined, 'x-client-id'?: string | undefined}; export type DeleteApiAccountAccessConsentsConsentIdOptions = {baseUrl: string, TPPOAuth2Security?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an Account Access Consent * * DELETE /account-access-consents/{ConsentId} */ export const deleteApiAccountAccessConsentsConsentId = async (args: DeleteApiAccountAccessConsentsConsentIdArgs, options: DeleteApiAccountAccessConsentsConsentIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, TPPOAuth2Security} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['x-fapi-auth-date'] != null) headers.set("x-fapi-auth-date", String(args['x-fapi-auth-date'])) if (args['x-fapi-customer-ip-address'] != null) headers.set("x-fapi-customer-ip-address", String(args['x-fapi-customer-ip-address'])) if (args['x-fapi-interaction-id'] != null) headers.set("x-fapi-interaction-id", String(args['x-fapi-interaction-id'])) if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) if (args['x-customer-user-agent'] != null) headers.set("x-customer-user-agent", String(args['x-customer-user-agent'])) if (args['x-client-id'] != null) headers.set("x-client-id", String(args['x-client-id'])) if (TPPOAuth2Security !== undefined) headers.set('authorization', `Bearer ${TPPOAuth2Security}`) const url = `${baseUrl.replace(/\/+$/, '')}/account-access-consents/${encodeURIComponent(String(args.ConsentId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };