export type CreateApiV1UsersUserSidDeactivateArgs = {user_sid: string}; export type CreateApiV1UsersUserSidDeactivateOptions = {baseUrl?: string | undefined, apiKey?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Deactivate User * * POST /v1/users/{user_sid}/deactivate * * Also accepts auth: bearer-auth */ export const createApiV1UsersUserSidDeactivate = async (args: CreateApiV1UsersUserSidDeactivateArgs, options?: CreateApiV1UsersUserSidDeactivateOptions) => { const {baseUrl = "https://api.prod-us.streem.cloud", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set('authorization', `Basic ${btoa(`${apiKey.username}:${apiKey.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/users/${encodeURIComponent(String(args.user_sid))}/deactivate${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };