export type IdentityMfaMethodPingidRequest = {method_id?: string | undefined, settings_file_base64?: string | undefined, username_format?: string | undefined}; export type CreateApiIdentityMfaMethodPingidMethodIdArgs = {body: IdentityMfaMethodPingidRequest}; export type CreateApiIdentityMfaMethodPingidMethodIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Update or create a configuration for the given MFA method * * POST /identity/mfa/method/pingid/{method_id} */ export const createApiIdentityMfaMethodPingidMethodId = async (args: CreateApiIdentityMfaMethodPingidMethodIdArgs, options: CreateApiIdentityMfaMethodPingidMethodIdOptions) => { 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/mfa/method/pingid/${encodeURIComponent(String(args.method_id))}${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 };