export type DeleteApiV1ServicesServiceSidSessionsSessionSidParticipantsSidArgs = {ServiceSid: string, SessionSid: string, Sid: string}; export type DeleteApiV1ServicesServiceSidSessionsSessionSidParticipantsSidOptions = {baseUrl?: string | undefined, accountSidAuthToken?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Delete a specific Participant. This is a soft-delete. The participant remains associated with the session and cannot be re-added. Participants are only permanently deleted when the [Session](https://www.twilio.com/docs/proxy/api/session) is deleted. * * DELETE /v1/Services/{ServiceSid}/Sessions/{SessionSid}/Participants/{Sid} */ export const deleteApiV1ServicesServiceSidSessionsSessionSidParticipantsSid = async (args: DeleteApiV1ServicesServiceSidSessionsSessionSidParticipantsSidArgs, options?: DeleteApiV1ServicesServiceSidSessionsSessionSidParticipantsSidOptions) => { const {baseUrl = "https://proxy.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/Services/${encodeURIComponent(String(args.ServiceSid))}/Sessions/${encodeURIComponent(String(args.SessionSid))}/Participants/${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 };