export type DeleteApiOrgsOrgNameTeamsTeamSlugArgs = {org_name: string, team_slug: string}; export type DeleteApiOrgsOrgNameTeamsTeamSlugOptions = {baseUrl: string, JWTAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a Team * * DELETE /orgs/{org_name}/teams/{team_slug} * * Also accepts auth: APIKeyAuth */ export const deleteApiOrgsOrgNameTeamsTeamSlug = async (args: DeleteApiOrgsOrgNameTeamsTeamSlugArgs, options: DeleteApiOrgsOrgNameTeamsTeamSlugOptions) => { const {baseUrl, fetch: fetchFn = fetch, JWTAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (JWTAuth !== undefined) headers.set('authorization', `Bearer ${JWTAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/orgs/${encodeURIComponent(String(args.org_name))}/teams/${encodeURIComponent(String(args.team_slug))}${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 };