export type RemoveTeamMemberPayload = {replacement: string}; export type DeleteApiApiPublicV1TeamTeamMembersUserArgs = {'X-VO-Api-Id': string, 'X-VO-Api-Key': string, team: string, user: string, body: RemoveTeamMemberPayload}; export type DeleteApiApiPublicV1TeamTeamMembersUserOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove a team member * * DELETE /api-public/v1/team/{team}/members/{user} */ export const deleteApiApiPublicV1TeamTeamMembersUser = async (args: DeleteApiApiPublicV1TeamTeamMembersUserArgs, options?: DeleteApiApiPublicV1TeamTeamMembersUserOptions) => { const {baseUrl = "https://api.victorops.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['X-VO-Api-Id'] != null) headers.set("X-VO-Api-Id", String(args['X-VO-Api-Id'])) if (args['X-VO-Api-Key'] != null) headers.set("X-VO-Api-Key", String(args['X-VO-Api-Key'])) const url = `${baseUrl.replace(/\/+$/, '')}/api-public/v1/team/${encodeURIComponent(String(args.team))}/members/${encodeURIComponent(String(args.user))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };