export type Scim2PatchConnectionConfigRequest = {syncToUserManagement: boolean}; export type PatchApiResourcesV1ConfigurationsScim2IdArgs = {id: string, 'frontegg-tenant-id'?: string | undefined, body: Scim2PatchConnectionConfigRequest}; export type PatchApiResourcesV1ConfigurationsScim2IdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a SCIM configuration * * PATCH /resources/v1/configurations/scim2/{id} */ export const patchApiResourcesV1ConfigurationsScim2Id = async (args: PatchApiResourcesV1ConfigurationsScim2IdArgs, options?: PatchApiResourcesV1ConfigurationsScim2IdOptions) => { const {baseUrl = "http://localhost:8181", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['frontegg-tenant-id'] != null) headers.set("frontegg-tenant-id", String(args['frontegg-tenant-id'])) const url = `${baseUrl.replace(/\/+$/, '')}/resources/v1/configurations/scim2/${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 };