/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { OptionInstruction, OptionInstruction$inboundSchema, OptionInstruction$Outbound, OptionInstruction$outboundSchema, } from "./optioninstruction.js"; /** * Response containing a paginated list of option instructions */ export type ListOptionInstructionsResponse = { /** * The list of instruction resources matching the request. */ instructions?: Array | undefined; /** * A token to retrieve the next page of results, or empty if there are no more results in the list. */ nextPageToken?: string | undefined; }; /** @internal */ export const ListOptionInstructionsResponse$inboundSchema: z.ZodType< ListOptionInstructionsResponse, z.ZodTypeDef, unknown > = z.object({ instructions: z.array(OptionInstruction$inboundSchema).optional(), next_page_token: z.string().optional(), }).transform((v) => { return remap$(v, { "next_page_token": "nextPageToken", }); }); /** @internal */ export type ListOptionInstructionsResponse$Outbound = { instructions?: Array | undefined; next_page_token?: string | undefined; }; /** @internal */ export const ListOptionInstructionsResponse$outboundSchema: z.ZodType< ListOptionInstructionsResponse$Outbound, z.ZodTypeDef, ListOptionInstructionsResponse > = z.object({ instructions: z.array(OptionInstruction$outboundSchema).optional(), nextPageToken: z.string().optional(), }).transform((v) => { return remap$(v, { nextPageToken: "next_page_token", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ListOptionInstructionsResponse$ { /** @deprecated use `ListOptionInstructionsResponse$inboundSchema` instead. */ export const inboundSchema = ListOptionInstructionsResponse$inboundSchema; /** @deprecated use `ListOptionInstructionsResponse$outboundSchema` instead. */ export const outboundSchema = ListOptionInstructionsResponse$outboundSchema; /** @deprecated use `ListOptionInstructionsResponse$Outbound` instead. */ export type Outbound = ListOptionInstructionsResponse$Outbound; } export function listOptionInstructionsResponseToJSON( listOptionInstructionsResponse: ListOptionInstructionsResponse, ): string { return JSON.stringify( ListOptionInstructionsResponse$outboundSchema.parse( listOptionInstructionsResponse, ), ); } export function listOptionInstructionsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListOptionInstructionsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListOptionInstructionsResponse' from JSON`, ); }