/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type RequestsTo = { name?: string | undefined; pcid?: string | undefined; requestedAt?: number | undefined; requestedString?: string | undefined; scopes?: Array | undefined; }; /** @internal */ export const RequestsTo$inboundSchema: z.ZodType< RequestsTo, z.ZodTypeDef, unknown > = z.object({ name: z.string().optional(), pcid: z.string().optional(), requestedAt: z.number().int().optional(), requestedString: z.string().optional(), scopes: z.array(z.string()).optional(), }); /** @internal */ export type RequestsTo$Outbound = { name?: string | undefined; pcid?: string | undefined; requestedAt?: number | undefined; requestedString?: string | undefined; scopes?: Array | undefined; }; /** @internal */ export const RequestsTo$outboundSchema: z.ZodType< RequestsTo$Outbound, z.ZodTypeDef, RequestsTo > = z.object({ name: z.string().optional(), pcid: z.string().optional(), requestedAt: z.number().int().optional(), requestedString: z.string().optional(), scopes: z.array(z.string()).optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace RequestsTo$ { /** @deprecated use `RequestsTo$inboundSchema` instead. */ export const inboundSchema = RequestsTo$inboundSchema; /** @deprecated use `RequestsTo$outboundSchema` instead. */ export const outboundSchema = RequestsTo$outboundSchema; /** @deprecated use `RequestsTo$Outbound` instead. */ export type Outbound = RequestsTo$Outbound; } export function requestsToToJSON(requestsTo: RequestsTo): string { return JSON.stringify(RequestsTo$outboundSchema.parse(requestsTo)); } export function requestsToFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RequestsTo$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RequestsTo' from JSON`, ); }