/* * 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"; import { IdentityItem, IdentityItem$inboundSchema, IdentityItem$Outbound, IdentityItem$outboundSchema, } from "./identityitem.js"; /** * Response body for the V3 Identity Cross Domain API. */ export type V3CrossDomainIdentityResponse = { /** * The number of items in the Identities array. */ count: number; /** * The list of identities from other linked accounts. */ identities: Array; }; /** @internal */ export const V3CrossDomainIdentityResponse$inboundSchema: z.ZodType< V3CrossDomainIdentityResponse, z.ZodTypeDef, unknown > = z.object({ count: z.number().int(), identities: z.array(IdentityItem$inboundSchema), }); /** @internal */ export type V3CrossDomainIdentityResponse$Outbound = { count: number; identities: Array; }; /** @internal */ export const V3CrossDomainIdentityResponse$outboundSchema: z.ZodType< V3CrossDomainIdentityResponse$Outbound, z.ZodTypeDef, V3CrossDomainIdentityResponse > = z.object({ count: z.number().int(), identities: z.array(IdentityItem$outboundSchema), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace V3CrossDomainIdentityResponse$ { /** @deprecated use `V3CrossDomainIdentityResponse$inboundSchema` instead. */ export const inboundSchema = V3CrossDomainIdentityResponse$inboundSchema; /** @deprecated use `V3CrossDomainIdentityResponse$outboundSchema` instead. */ export const outboundSchema = V3CrossDomainIdentityResponse$outboundSchema; /** @deprecated use `V3CrossDomainIdentityResponse$Outbound` instead. */ export type Outbound = V3CrossDomainIdentityResponse$Outbound; } export function v3CrossDomainIdentityResponseToJSON( v3CrossDomainIdentityResponse: V3CrossDomainIdentityResponse, ): string { return JSON.stringify( V3CrossDomainIdentityResponse$outboundSchema.parse( v3CrossDomainIdentityResponse, ), ); } export function v3CrossDomainIdentityResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3CrossDomainIdentityResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3CrossDomainIdentityResponse' from JSON`, ); }