export type DeleteApiV1TrunksTrunkSidCredentialListsSidArgs = {TrunkSid: string, Sid: string}; export type DeleteApiV1TrunksTrunkSidCredentialListsSidOptions = {baseUrl?: string | undefined, accountSidAuthToken?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * DELETE /v1/Trunks/{TrunkSid}/CredentialLists/{Sid} */ export const deleteApiV1TrunksTrunkSidCredentialListsSid = async (args: DeleteApiV1TrunksTrunkSidCredentialListsSidArgs, options?: DeleteApiV1TrunksTrunkSidCredentialListsSidOptions) => { const {baseUrl = "https://trunking.twilio.com", fetch: fetchFn = fetch, accountSidAuthToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (accountSidAuthToken !== undefined) headers.set('authorization', `Basic ${btoa(`${accountSidAuthToken.username}:${accountSidAuthToken.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/Trunks/${encodeURIComponent(String(args.TrunkSid))}/CredentialLists/${encodeURIComponent(String(args.Sid))}${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 };