/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type ListAuthenticatorsRequest = { /** * An opaque cursor for pagination */ cursor?: string | null | undefined; /** * The number of items per page (must be greater than 0 and less than or equal to 100) */ pageSize?: number | undefined; }; export type ListAuthenticatorsResponse = { result: components.AuthenticatorList; }; /** @internal */ export const ListAuthenticatorsRequest$inboundSchema: z.ZodType< ListAuthenticatorsRequest, z.ZodTypeDef, unknown > = z.object({ cursor: z.nullable(z.string()).optional(), page_size: z.number().int().default(10), }).transform((v) => { return remap$(v, { "page_size": "pageSize", }); }); /** @internal */ export type ListAuthenticatorsRequest$Outbound = { cursor?: string | null | undefined; page_size: number; }; /** @internal */ export const ListAuthenticatorsRequest$outboundSchema: z.ZodType< ListAuthenticatorsRequest$Outbound, z.ZodTypeDef, ListAuthenticatorsRequest > = z.object({ cursor: z.nullable(z.string()).optional(), pageSize: z.number().int().default(10), }).transform((v) => { return remap$(v, { pageSize: "page_size", }); }); export function listAuthenticatorsRequestToJSON( listAuthenticatorsRequest: ListAuthenticatorsRequest, ): string { return JSON.stringify( ListAuthenticatorsRequest$outboundSchema.parse(listAuthenticatorsRequest), ); } export function listAuthenticatorsRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListAuthenticatorsRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListAuthenticatorsRequest' from JSON`, ); } /** @internal */ export const ListAuthenticatorsResponse$inboundSchema: z.ZodType< ListAuthenticatorsResponse, z.ZodTypeDef, unknown > = z.object({ Result: components.AuthenticatorList$inboundSchema, }).transform((v) => { return remap$(v, { "Result": "result", }); }); /** @internal */ export type ListAuthenticatorsResponse$Outbound = { Result: components.AuthenticatorList$Outbound; }; /** @internal */ export const ListAuthenticatorsResponse$outboundSchema: z.ZodType< ListAuthenticatorsResponse$Outbound, z.ZodTypeDef, ListAuthenticatorsResponse > = z.object({ result: components.AuthenticatorList$outboundSchema, }).transform((v) => { return remap$(v, { result: "Result", }); }); export function listAuthenticatorsResponseToJSON( listAuthenticatorsResponse: ListAuthenticatorsResponse, ): string { return JSON.stringify( ListAuthenticatorsResponse$outboundSchema.parse(listAuthenticatorsResponse), ); } export function listAuthenticatorsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListAuthenticatorsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListAuthenticatorsResponse' from JSON`, ); }