/* * 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 RequestsFrom = { name?: string | undefined; pcid?: string | undefined; requestedAt?: number | undefined; requestedString?: string | undefined; scopes?: Array | undefined; }; /** @internal */ export const RequestsFrom$inboundSchema: z.ZodType< RequestsFrom, 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 RequestsFrom$Outbound = { name?: string | undefined; pcid?: string | undefined; requestedAt?: number | undefined; requestedString?: string | undefined; scopes?: Array | undefined; }; /** @internal */ export const RequestsFrom$outboundSchema: z.ZodType< RequestsFrom$Outbound, z.ZodTypeDef, RequestsFrom > = 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 RequestsFrom$ { /** @deprecated use `RequestsFrom$inboundSchema` instead. */ export const inboundSchema = RequestsFrom$inboundSchema; /** @deprecated use `RequestsFrom$outboundSchema` instead. */ export const outboundSchema = RequestsFrom$outboundSchema; /** @deprecated use `RequestsFrom$Outbound` instead. */ export type Outbound = RequestsFrom$Outbound; } export function requestsFromToJSON(requestsFrom: RequestsFrom): string { return JSON.stringify(RequestsFrom$outboundSchema.parse(requestsFrom)); } export function requestsFromFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RequestsFrom$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RequestsFrom' from JSON`, ); }