export type CreateSSODomainConfigurationRequest = {allowVerifiedUsersToAddDomains: boolean, skipDomainVerification: boolean, bypassDomainCrossValidation: boolean}; export type UpdateApiResourcesSsoV1ConfigurationsDomainsArgs = {body: CreateSSODomainConfigurationRequest}; export type UpdateApiResourcesSsoV1ConfigurationsDomainsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create or update SSO domains configuration * * PUT /resources/sso/v1/configurations/domains */ export const updateApiResourcesSsoV1ConfigurationsDomains = async (args: UpdateApiResourcesSsoV1ConfigurationsDomainsArgs, options?: UpdateApiResourcesSsoV1ConfigurationsDomainsOptions) => { const {baseUrl = "http://localhost:8181", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/resources/sso/v1/configurations/domains${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 };