/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { PostalAddressCreate, PostalAddressCreate$inboundSchema, PostalAddressCreate$Outbound, PostalAddressCreate$outboundSchema, } from "./postaladdresscreate.js"; /** * Travel rule entity party */ export type TravelRuleEntityPartyCreate = { /** * Represents a postal address, e.g. for postal delivery or payments addresses. Given a postal address, a postal service can deliver items to a premise, P.O. Box or similar. It is not intended to model geographical locations (roads, towns, mountains). * * @remarks * * In typical usage an address would be created via user input or from importing existing data, depending on the type of process. * * Advice on address input / editing: - Use an i18n-ready address widget such as https://github.com/google/libaddressinput) - Users should not be presented with UI elements for input or editing of fields outside countries where that field is used. * * For more guidance on how to use this schema, please see: https://support.google.com/business/answer/6397478 */ address: PostalAddressCreate; /** * The tax identification number of the entity */ taxId?: string | undefined; /** * The name of the entity */ title: string; }; /** @internal */ export const TravelRuleEntityPartyCreate$inboundSchema: z.ZodType< TravelRuleEntityPartyCreate, z.ZodTypeDef, unknown > = z.object({ address: PostalAddressCreate$inboundSchema, tax_id: z.string().optional(), title: z.string(), }).transform((v) => { return remap$(v, { "tax_id": "taxId", }); }); /** @internal */ export type TravelRuleEntityPartyCreate$Outbound = { address: PostalAddressCreate$Outbound; tax_id?: string | undefined; title: string; }; /** @internal */ export const TravelRuleEntityPartyCreate$outboundSchema: z.ZodType< TravelRuleEntityPartyCreate$Outbound, z.ZodTypeDef, TravelRuleEntityPartyCreate > = z.object({ address: PostalAddressCreate$outboundSchema, taxId: z.string().optional(), title: z.string(), }).transform((v) => { return remap$(v, { taxId: "tax_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace TravelRuleEntityPartyCreate$ { /** @deprecated use `TravelRuleEntityPartyCreate$inboundSchema` instead. */ export const inboundSchema = TravelRuleEntityPartyCreate$inboundSchema; /** @deprecated use `TravelRuleEntityPartyCreate$outboundSchema` instead. */ export const outboundSchema = TravelRuleEntityPartyCreate$outboundSchema; /** @deprecated use `TravelRuleEntityPartyCreate$Outbound` instead. */ export type Outbound = TravelRuleEntityPartyCreate$Outbound; } export function travelRuleEntityPartyCreateToJSON( travelRuleEntityPartyCreate: TravelRuleEntityPartyCreate, ): string { return JSON.stringify( TravelRuleEntityPartyCreate$outboundSchema.parse( travelRuleEntityPartyCreate, ), ); } export function travelRuleEntityPartyCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TravelRuleEntityPartyCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TravelRuleEntityPartyCreate' from JSON`, ); }