export type DeleteApiV1CustomerProfilesCustomerProfileSidEntityAssignmentsSidArgs = {CustomerProfileSid: string, Sid: string}; export type DeleteApiV1CustomerProfilesCustomerProfileSidEntityAssignmentsSidOptions = {baseUrl?: string | undefined, accountSidAuthToken?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Remove an Assignment Item Instance. * * DELETE /v1/CustomerProfiles/{CustomerProfileSid}/EntityAssignments/{Sid} */ export const deleteApiV1CustomerProfilesCustomerProfileSidEntityAssignmentsSid = async (args: DeleteApiV1CustomerProfilesCustomerProfileSidEntityAssignmentsSidArgs, options?: DeleteApiV1CustomerProfilesCustomerProfileSidEntityAssignmentsSidOptions) => { const {baseUrl = "https://trusthub.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/CustomerProfiles/${encodeURIComponent(String(args.CustomerProfileSid))}/EntityAssignments/${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 };