/* * 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 AccountsCreateInterestedPartyRequest = { /** * The account id. */ accountId: string; interestedPartyCreate: components.InterestedPartyCreate; }; export type AccountsCreateInterestedPartyResponse = { httpMeta: components.HTTPMetadata; /** * OK */ interestedParty?: components.InterestedParty | undefined; /** * INVALID_ARGUMENT: The request is not valid, additional information may be present in the BadRequest details. */ status?: components.Status | undefined; }; /** @internal */ export const AccountsCreateInterestedPartyRequest$inboundSchema: z.ZodType< AccountsCreateInterestedPartyRequest, z.ZodTypeDef, unknown > = z.object({ account_id: z.string(), InterestedPartyCreate: components.InterestedPartyCreate$inboundSchema, }).transform((v) => { return remap$(v, { "account_id": "accountId", "InterestedPartyCreate": "interestedPartyCreate", }); }); /** @internal */ export type AccountsCreateInterestedPartyRequest$Outbound = { account_id: string; InterestedPartyCreate: components.InterestedPartyCreate$Outbound; }; /** @internal */ export const AccountsCreateInterestedPartyRequest$outboundSchema: z.ZodType< AccountsCreateInterestedPartyRequest$Outbound, z.ZodTypeDef, AccountsCreateInterestedPartyRequest > = z.object({ accountId: z.string(), interestedPartyCreate: components.InterestedPartyCreate$outboundSchema, }).transform((v) => { return remap$(v, { accountId: "account_id", interestedPartyCreate: "InterestedPartyCreate", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountsCreateInterestedPartyRequest$ { /** @deprecated use `AccountsCreateInterestedPartyRequest$inboundSchema` instead. */ export const inboundSchema = AccountsCreateInterestedPartyRequest$inboundSchema; /** @deprecated use `AccountsCreateInterestedPartyRequest$outboundSchema` instead. */ export const outboundSchema = AccountsCreateInterestedPartyRequest$outboundSchema; /** @deprecated use `AccountsCreateInterestedPartyRequest$Outbound` instead. */ export type Outbound = AccountsCreateInterestedPartyRequest$Outbound; } export function accountsCreateInterestedPartyRequestToJSON( accountsCreateInterestedPartyRequest: AccountsCreateInterestedPartyRequest, ): string { return JSON.stringify( AccountsCreateInterestedPartyRequest$outboundSchema.parse( accountsCreateInterestedPartyRequest, ), ); } export function accountsCreateInterestedPartyRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountsCreateInterestedPartyRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountsCreateInterestedPartyRequest' from JSON`, ); } /** @internal */ export const AccountsCreateInterestedPartyResponse$inboundSchema: z.ZodType< AccountsCreateInterestedPartyResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, InterestedParty: components.InterestedParty$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "InterestedParty": "interestedParty", "Status": "status", }); }); /** @internal */ export type AccountsCreateInterestedPartyResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; InterestedParty?: components.InterestedParty$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AccountsCreateInterestedPartyResponse$outboundSchema: z.ZodType< AccountsCreateInterestedPartyResponse$Outbound, z.ZodTypeDef, AccountsCreateInterestedPartyResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, interestedParty: components.InterestedParty$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", interestedParty: "InterestedParty", 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 AccountsCreateInterestedPartyResponse$ { /** @deprecated use `AccountsCreateInterestedPartyResponse$inboundSchema` instead. */ export const inboundSchema = AccountsCreateInterestedPartyResponse$inboundSchema; /** @deprecated use `AccountsCreateInterestedPartyResponse$outboundSchema` instead. */ export const outboundSchema = AccountsCreateInterestedPartyResponse$outboundSchema; /** @deprecated use `AccountsCreateInterestedPartyResponse$Outbound` instead. */ export type Outbound = AccountsCreateInterestedPartyResponse$Outbound; } export function accountsCreateInterestedPartyResponseToJSON( accountsCreateInterestedPartyResponse: AccountsCreateInterestedPartyResponse, ): string { return JSON.stringify( AccountsCreateInterestedPartyResponse$outboundSchema.parse( accountsCreateInterestedPartyResponse, ), ); } export function accountsCreateInterestedPartyResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountsCreateInterestedPartyResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountsCreateInterestedPartyResponse' from JSON`, ); }