export type UpdateTesterGroup = {name: string}; export type PatchApiApiV3TesterGroupsTesterGroupIdArgs = {tester_group_id: string, body: UpdateTesterGroup}; export type PatchApiApiV3TesterGroupsTesterGroupIdOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a tester group * * PATCH /api/v3/tester-groups/{tester_group_id} */ export const patchApiApiV3TesterGroupsTesterGroupId = async (args: PatchApiApiV3TesterGroupsTesterGroupIdArgs, options?: PatchApiApiV3TesterGroupsTesterGroupIdOptions) => { const {baseUrl = "https://codemagic.io", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (apiKey !== undefined) headers.set("x-auth-token", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/v3/tester-groups/${encodeURIComponent(String(args.tester_group_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 };