export type DeleteApiCreditorAgentsIcaPaymentProfilesCreditorProfileIdPaymentControlsArgs = {ica: string, creditor_profile_id: string}; export type DeleteApiCreditorAgentsIcaPaymentProfilesCreditorProfileIdPaymentControlsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete All Creditor Payment Controls * * DELETE /creditor-agents/{ica}/payment-profiles/{creditor_profile_id}/payment-controls */ export const deleteApiCreditorAgentsIcaPaymentProfilesCreditorProfileIdPaymentControls = async (args: DeleteApiCreditorAgentsIcaPaymentProfilesCreditorProfileIdPaymentControlsArgs, options?: DeleteApiCreditorAgentsIcaPaymentProfilesCreditorProfileIdPaymentControlsOptions) => { const {baseUrl = "https://api.mastercard.com/commercial/payments", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/creditor-agents/${encodeURIComponent(String(args.ica))}/payment-profiles/${encodeURIComponent(String(args.creditor_profile_id))}/payment-controls${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 };