/* * 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 AccountsCreateLegalEntityResponse = { 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 AccountsCreateLegalEntityResponse$inboundSchema: z.ZodType< AccountsCreateLegalEntityResponse, 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 AccountsCreateLegalEntityResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; LegalEntity?: components.LegalEntity$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AccountsCreateLegalEntityResponse$outboundSchema: z.ZodType< AccountsCreateLegalEntityResponse$Outbound, z.ZodTypeDef, AccountsCreateLegalEntityResponse > = 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 AccountsCreateLegalEntityResponse$ { /** @deprecated use `AccountsCreateLegalEntityResponse$inboundSchema` instead. */ export const inboundSchema = AccountsCreateLegalEntityResponse$inboundSchema; /** @deprecated use `AccountsCreateLegalEntityResponse$outboundSchema` instead. */ export const outboundSchema = AccountsCreateLegalEntityResponse$outboundSchema; /** @deprecated use `AccountsCreateLegalEntityResponse$Outbound` instead. */ export type Outbound = AccountsCreateLegalEntityResponse$Outbound; } export function accountsCreateLegalEntityResponseToJSON( accountsCreateLegalEntityResponse: AccountsCreateLegalEntityResponse, ): string { return JSON.stringify( AccountsCreateLegalEntityResponse$outboundSchema.parse( accountsCreateLegalEntityResponse, ), ); } export function accountsCreateLegalEntityResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountsCreateLegalEntityResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountsCreateLegalEntityResponse' from JSON`, ); }