export type IdentityOidcClientRequest = {access_token_ttl?: number | undefined, assignments?: Array | undefined, client_type?: string | undefined, id_token_ttl?: number | undefined, key?: string | undefined, redirect_uris?: Array | undefined}; export type CreateApiIdentityOidcClientNameArgs = {body: IdentityOidcClientRequest}; export type CreateApiIdentityOidcClientNameOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * POST /identity/oidc/client/{name} */ export const createApiIdentityOidcClientName = async (args: CreateApiIdentityOidcClientNameArgs, options: CreateApiIdentityOidcClientNameOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/identity/oidc/client/${encodeURIComponent(String(args.name))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };