/* * 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 AccountsGetLegalEntityRequest = { /** * The legalEntity id. */ legalEntityId: string; }; export type AccountsGetLegalEntityResponse = { httpMeta: components.HTTPMetadata; /** * OK */ legalEntity?: components.LegalEntity | undefined; /** * INVALID_ARGUMENT: The request is not valid, additional information may be present in the BadRequest details. */ status?: components.Status | undefined; }; /** @internal */ export const AccountsGetLegalEntityRequest$inboundSchema: z.ZodType< AccountsGetLegalEntityRequest, z.ZodTypeDef, unknown > = z.object({ legalEntity_id: z.string(), }).transform((v) => { return remap$(v, { "legalEntity_id": "legalEntityId", }); }); /** @internal */ export type AccountsGetLegalEntityRequest$Outbound = { legalEntity_id: string; }; /** @internal */ export const AccountsGetLegalEntityRequest$outboundSchema: z.ZodType< AccountsGetLegalEntityRequest$Outbound, z.ZodTypeDef, AccountsGetLegalEntityRequest > = z.object({ legalEntityId: z.string(), }).transform((v) => { return remap$(v, { legalEntityId: "legalEntity_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountsGetLegalEntityRequest$ { /** @deprecated use `AccountsGetLegalEntityRequest$inboundSchema` instead. */ export const inboundSchema = AccountsGetLegalEntityRequest$inboundSchema; /** @deprecated use `AccountsGetLegalEntityRequest$outboundSchema` instead. */ export const outboundSchema = AccountsGetLegalEntityRequest$outboundSchema; /** @deprecated use `AccountsGetLegalEntityRequest$Outbound` instead. */ export type Outbound = AccountsGetLegalEntityRequest$Outbound; } export function accountsGetLegalEntityRequestToJSON( accountsGetLegalEntityRequest: AccountsGetLegalEntityRequest, ): string { return JSON.stringify( AccountsGetLegalEntityRequest$outboundSchema.parse( accountsGetLegalEntityRequest, ), ); } export function accountsGetLegalEntityRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountsGetLegalEntityRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountsGetLegalEntityRequest' from JSON`, ); } /** @internal */ export const AccountsGetLegalEntityResponse$inboundSchema: z.ZodType< AccountsGetLegalEntityResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, LegalEntity: components.LegalEntity$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "LegalEntity": "legalEntity", "Status": "status", }); }); /** @internal */ export type AccountsGetLegalEntityResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; LegalEntity?: components.LegalEntity$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AccountsGetLegalEntityResponse$outboundSchema: z.ZodType< AccountsGetLegalEntityResponse$Outbound, z.ZodTypeDef, AccountsGetLegalEntityResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, legalEntity: components.LegalEntity$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", legalEntity: "LegalEntity", 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 AccountsGetLegalEntityResponse$ { /** @deprecated use `AccountsGetLegalEntityResponse$inboundSchema` instead. */ export const inboundSchema = AccountsGetLegalEntityResponse$inboundSchema; /** @deprecated use `AccountsGetLegalEntityResponse$outboundSchema` instead. */ export const outboundSchema = AccountsGetLegalEntityResponse$outboundSchema; /** @deprecated use `AccountsGetLegalEntityResponse$Outbound` instead. */ export type Outbound = AccountsGetLegalEntityResponse$Outbound; } export function accountsGetLegalEntityResponseToJSON( accountsGetLegalEntityResponse: AccountsGetLegalEntityResponse, ): string { return JSON.stringify( AccountsGetLegalEntityResponse$outboundSchema.parse( accountsGetLegalEntityResponse, ), ); } export function accountsGetLegalEntityResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountsGetLegalEntityResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountsGetLegalEntityResponse' from JSON`, ); }