export type OrganizationalEmailAddressInputDto = {email: string, purpose: 'personal' | 'work' | null, isPrimary?: boolean | undefined}; export type OrganizationalPhoneNumberInputDto = {phoneNumber: string, purpose: 'personal' | 'work' | null, isPrimary?: boolean | undefined}; export type UpdateTeamDto = {name?: string | undefined, avatarUrl?: (string | null) | undefined, description?: (string | null) | undefined, emailAddresses?: Array | undefined, phoneNumbers?: Array | undefined}; export type PatchApiTeamsIdArgs = {id: string, body: UpdateTeamDto}; export type PatchApiTeamsIdOptions = {baseUrl: string, xApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a team * * PATCH /teams/{id} */ export const patchApiTeamsId = async (args: PatchApiTeamsIdArgs, options: PatchApiTeamsIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, xApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (xApiKey !== undefined) headers.set("x-api-key", xApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/teams/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 };