export type CoreGroupRequest = {name?: string | undefined}; export type UpdateApiV1OrgsOrgIdGroupGroupIdArgs = {org_id: string, group_id: string, body: CoreGroupRequest}; export type UpdateApiV1OrgsOrgIdGroupGroupIdOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Updates the group with given id * * PUT /v1/orgs/{org_id}/group/{group_id} */ export const updateApiV1OrgsOrgIdGroupGroupId = async (args: UpdateApiV1OrgsOrgIdGroupGroupIdArgs, options?: UpdateApiV1OrgsOrgIdGroupGroupIdOptions) => { const {baseUrl = "https://api.edgedelta.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ApiKeyAuth !== undefined) headers.set("X-ED-API-Token", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v1/orgs/${encodeURIComponent(String(args.org_id))}/group/${encodeURIComponent(String(args.group_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };