/* * 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 IdentityAttribute = { attributeType?: string | undefined; attributeValue?: string | undefined; }; /** @internal */ export const IdentityAttribute$inboundSchema: z.ZodType< IdentityAttribute, z.ZodTypeDef, unknown > = z.object({ attributeType: z.string().optional(), attributeValue: z.string().optional(), }); /** @internal */ export type IdentityAttribute$Outbound = { attributeType?: string | undefined; attributeValue?: string | undefined; }; /** @internal */ export const IdentityAttribute$outboundSchema: z.ZodType< IdentityAttribute$Outbound, z.ZodTypeDef, IdentityAttribute > = z.object({ attributeType: z.string().optional(), attributeValue: 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 IdentityAttribute$ { /** @deprecated use `IdentityAttribute$inboundSchema` instead. */ export const inboundSchema = IdentityAttribute$inboundSchema; /** @deprecated use `IdentityAttribute$outboundSchema` instead. */ export const outboundSchema = IdentityAttribute$outboundSchema; /** @deprecated use `IdentityAttribute$Outbound` instead. */ export type Outbound = IdentityAttribute$Outbound; } export function identityAttributeToJSON( identityAttribute: IdentityAttribute, ): string { return JSON.stringify( IdentityAttribute$outboundSchema.parse(identityAttribute), ); } export function identityAttributeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => IdentityAttribute$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IdentityAttribute' from JSON`, ); }