/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; 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"; /** * In the case of masked fields, they should be handled carefully. * * @remarks * * Fields also must consider: * - Not providing a *fields* in parameters will not result in a change to any configured value * - Providing a value in a *masked field* with ****** (exactly 6 asterisks) will not change the configured value * - Providing *field* with null will clear the configured value * - Providing *field* with any other value will change the configured value and may affect the behavior of the account. */ export type FedExConnectExistingOwnAccountParameters = { /** * First name of the account holder */ firstName: string; /** * Last name of the account holder */ lastName: string; /** * Phone number of the account holder */ phoneNumber: string; /** * Street address of the account holder */ fromAddressSt: string; /** * City of the account holder */ fromAddressCity: string; /** * State of the account holder */ fromAddressState: string; /** * Zip code of the account holder */ fromAddressZip: string; /** * Country of the account holder */ fromAddressCountryIso2: string; }; /** @internal */ export const FedExConnectExistingOwnAccountParameters$inboundSchema: z.ZodMiniType = z.pipe( z.object({ first_name: z.string(), last_name: z.string(), phone_number: z.string(), from_address_st: z.string(), from_address_city: z.string(), from_address_state: z.string(), from_address_zip: z.string(), from_address_country_iso2: z.string(), }), z.transform((v) => { return remap$(v, { "first_name": "firstName", "last_name": "lastName", "phone_number": "phoneNumber", "from_address_st": "fromAddressSt", "from_address_city": "fromAddressCity", "from_address_state": "fromAddressState", "from_address_zip": "fromAddressZip", "from_address_country_iso2": "fromAddressCountryIso2", }); }), ); /** @internal */ export type FedExConnectExistingOwnAccountParameters$Outbound = { first_name: string; last_name: string; phone_number: string; from_address_st: string; from_address_city: string; from_address_state: string; from_address_zip: string; from_address_country_iso2: string; }; /** @internal */ export const FedExConnectExistingOwnAccountParameters$outboundSchema: z.ZodMiniType< FedExConnectExistingOwnAccountParameters$Outbound, FedExConnectExistingOwnAccountParameters > = z.pipe( z.object({ firstName: z.string(), lastName: z.string(), phoneNumber: z.string(), fromAddressSt: z.string(), fromAddressCity: z.string(), fromAddressState: z.string(), fromAddressZip: z.string(), fromAddressCountryIso2: z.string(), }), z.transform((v) => { return remap$(v, { firstName: "first_name", lastName: "last_name", phoneNumber: "phone_number", fromAddressSt: "from_address_st", fromAddressCity: "from_address_city", fromAddressState: "from_address_state", fromAddressZip: "from_address_zip", fromAddressCountryIso2: "from_address_country_iso2", }); }), ); export function fedExConnectExistingOwnAccountParametersToJSON( fedExConnectExistingOwnAccountParameters: FedExConnectExistingOwnAccountParameters, ): string { return JSON.stringify( FedExConnectExistingOwnAccountParameters$outboundSchema.parse( fedExConnectExistingOwnAccountParameters, ), ); } export function fedExConnectExistingOwnAccountParametersFromJSON( jsonString: string, ): SafeParseResult< FedExConnectExistingOwnAccountParameters, SDKValidationError > { return safeParse( jsonString, (x) => FedExConnectExistingOwnAccountParameters$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'FedExConnectExistingOwnAccountParameters' from JSON`, ); }