export type PatchApiCampaignsCallCampaignscalllistuuidMaxretryNewMaxRetryArgs = {campaignscalllistuuid: string, newMaxRetry: string}; export type PatchApiCampaignsCallCampaignscalllistuuidMaxretryNewMaxRetryOptions = {baseUrl?: string | undefined, Authorization?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update maximum retry attempts * * PATCH /campaigns/call/{campaignscalllistuuid}/maxretry/{newMaxRetry} */ export const patchApiCampaignsCallCampaignscalllistuuidMaxretryNewMaxRetry = async (args: PatchApiCampaignsCallCampaignscalllistuuidMaxretryNewMaxRetryArgs, options?: PatchApiCampaignsCallCampaignscalllistuuidMaxretryNewMaxRetryOptions) => { const {baseUrl = "https://public-api.ringover.com/v2", fetch: fetchFn = fetch, Authorization} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (Authorization !== undefined) headers.set("Authorization", Authorization) const url = `${baseUrl.replace(/\/+$/, '')}/campaigns/call/${encodeURIComponent(String(args.campaignscalllistuuid))}/maxretry/${encodeURIComponent(String(args.newMaxRetry))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };