/* * 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type AccountsGetLegalNaturalPersonRequest = { /** * The legalNaturalPerson id. */ legalNaturalPersonId: string; }; export type AccountsGetLegalNaturalPersonResponse = { httpMeta: components.HTTPMetadata; /** * OK */ legalNaturalPerson?: components.LegalNaturalPerson | undefined; /** * INVALID_ARGUMENT: The request is not valid, additional information may be present in the BadRequest details. */ status?: components.Status | undefined; }; /** @internal */ export const AccountsGetLegalNaturalPersonRequest$inboundSchema: z.ZodType< AccountsGetLegalNaturalPersonRequest, z.ZodTypeDef, unknown > = z.object({ legalNaturalPerson_id: z.string(), }).transform((v) => { return remap$(v, { "legalNaturalPerson_id": "legalNaturalPersonId", }); }); /** @internal */ export type AccountsGetLegalNaturalPersonRequest$Outbound = { legalNaturalPerson_id: string; }; /** @internal */ export const AccountsGetLegalNaturalPersonRequest$outboundSchema: z.ZodType< AccountsGetLegalNaturalPersonRequest$Outbound, z.ZodTypeDef, AccountsGetLegalNaturalPersonRequest > = z.object({ legalNaturalPersonId: z.string(), }).transform((v) => { return remap$(v, { legalNaturalPersonId: "legalNaturalPerson_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountsGetLegalNaturalPersonRequest$ { /** @deprecated use `AccountsGetLegalNaturalPersonRequest$inboundSchema` instead. */ export const inboundSchema = AccountsGetLegalNaturalPersonRequest$inboundSchema; /** @deprecated use `AccountsGetLegalNaturalPersonRequest$outboundSchema` instead. */ export const outboundSchema = AccountsGetLegalNaturalPersonRequest$outboundSchema; /** @deprecated use `AccountsGetLegalNaturalPersonRequest$Outbound` instead. */ export type Outbound = AccountsGetLegalNaturalPersonRequest$Outbound; } export function accountsGetLegalNaturalPersonRequestToJSON( accountsGetLegalNaturalPersonRequest: AccountsGetLegalNaturalPersonRequest, ): string { return JSON.stringify( AccountsGetLegalNaturalPersonRequest$outboundSchema.parse( accountsGetLegalNaturalPersonRequest, ), ); } export function accountsGetLegalNaturalPersonRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountsGetLegalNaturalPersonRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountsGetLegalNaturalPersonRequest' from JSON`, ); } /** @internal */ export const AccountsGetLegalNaturalPersonResponse$inboundSchema: z.ZodType< AccountsGetLegalNaturalPersonResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, LegalNaturalPerson: components.LegalNaturalPerson$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "LegalNaturalPerson": "legalNaturalPerson", "Status": "status", }); }); /** @internal */ export type AccountsGetLegalNaturalPersonResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; LegalNaturalPerson?: components.LegalNaturalPerson$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AccountsGetLegalNaturalPersonResponse$outboundSchema: z.ZodType< AccountsGetLegalNaturalPersonResponse$Outbound, z.ZodTypeDef, AccountsGetLegalNaturalPersonResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, legalNaturalPerson: components.LegalNaturalPerson$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", legalNaturalPerson: "LegalNaturalPerson", status: "Status", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountsGetLegalNaturalPersonResponse$ { /** @deprecated use `AccountsGetLegalNaturalPersonResponse$inboundSchema` instead. */ export const inboundSchema = AccountsGetLegalNaturalPersonResponse$inboundSchema; /** @deprecated use `AccountsGetLegalNaturalPersonResponse$outboundSchema` instead. */ export const outboundSchema = AccountsGetLegalNaturalPersonResponse$outboundSchema; /** @deprecated use `AccountsGetLegalNaturalPersonResponse$Outbound` instead. */ export type Outbound = AccountsGetLegalNaturalPersonResponse$Outbound; } export function accountsGetLegalNaturalPersonResponseToJSON( accountsGetLegalNaturalPersonResponse: AccountsGetLegalNaturalPersonResponse, ): string { return JSON.stringify( AccountsGetLegalNaturalPersonResponse$outboundSchema.parse( accountsGetLegalNaturalPersonResponse, ), ); } export function accountsGetLegalNaturalPersonResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountsGetLegalNaturalPersonResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountsGetLegalNaturalPersonResponse' from JSON`, ); }