/* * 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 LinkedFrom = { acceptedAt?: number | undefined; acceptedString?: string | undefined; name?: string | undefined; pcid?: string | undefined; scopes?: Array | undefined; }; /** @internal */ export const LinkedFrom$inboundSchema: z.ZodType< LinkedFrom, z.ZodTypeDef, unknown > = z.object({ acceptedAt: z.number().int().optional(), acceptedString: z.string().optional(), name: z.string().optional(), pcid: z.string().optional(), scopes: z.array(z.string()).optional(), }); /** @internal */ export type LinkedFrom$Outbound = { acceptedAt?: number | undefined; acceptedString?: string | undefined; name?: string | undefined; pcid?: string | undefined; scopes?: Array | undefined; }; /** @internal */ export const LinkedFrom$outboundSchema: z.ZodType< LinkedFrom$Outbound, z.ZodTypeDef, LinkedFrom > = z.object({ acceptedAt: z.number().int().optional(), acceptedString: z.string().optional(), name: z.string().optional(), pcid: 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 LinkedFrom$ { /** @deprecated use `LinkedFrom$inboundSchema` instead. */ export const inboundSchema = LinkedFrom$inboundSchema; /** @deprecated use `LinkedFrom$outboundSchema` instead. */ export const outboundSchema = LinkedFrom$outboundSchema; /** @deprecated use `LinkedFrom$Outbound` instead. */ export type Outbound = LinkedFrom$Outbound; } export function linkedFromToJSON(linkedFrom: LinkedFrom): string { return JSON.stringify(LinkedFrom$outboundSchema.parse(linkedFrom)); } export function linkedFromFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LinkedFrom$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LinkedFrom' from JSON`, ); }