/* * 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 AccountsReplacePartyRequest = { /** * The account id. */ accountId: string; /** * The party id. */ partyId: string; replacePartyRequestCreate: components.ReplacePartyRequestCreate; }; export type AccountsReplacePartyResponse = { httpMeta: components.HTTPMetadata; /** * OK */ party?: components.Party | undefined; /** * INVALID_ARGUMENT: The request is not valid, additional information may be present in the BadRequest details. */ status?: components.Status | undefined; }; /** @internal */ export const AccountsReplacePartyRequest$inboundSchema: z.ZodType< AccountsReplacePartyRequest, z.ZodTypeDef, unknown > = z.object({ account_id: z.string(), party_id: z.string(), ReplacePartyRequestCreate: components.ReplacePartyRequestCreate$inboundSchema, }).transform((v) => { return remap$(v, { "account_id": "accountId", "party_id": "partyId", "ReplacePartyRequestCreate": "replacePartyRequestCreate", }); }); /** @internal */ export type AccountsReplacePartyRequest$Outbound = { account_id: string; party_id: string; ReplacePartyRequestCreate: components.ReplacePartyRequestCreate$Outbound; }; /** @internal */ export const AccountsReplacePartyRequest$outboundSchema: z.ZodType< AccountsReplacePartyRequest$Outbound, z.ZodTypeDef, AccountsReplacePartyRequest > = z.object({ accountId: z.string(), partyId: z.string(), replacePartyRequestCreate: components.ReplacePartyRequestCreate$outboundSchema, }).transform((v) => { return remap$(v, { accountId: "account_id", partyId: "party_id", replacePartyRequestCreate: "ReplacePartyRequestCreate", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountsReplacePartyRequest$ { /** @deprecated use `AccountsReplacePartyRequest$inboundSchema` instead. */ export const inboundSchema = AccountsReplacePartyRequest$inboundSchema; /** @deprecated use `AccountsReplacePartyRequest$outboundSchema` instead. */ export const outboundSchema = AccountsReplacePartyRequest$outboundSchema; /** @deprecated use `AccountsReplacePartyRequest$Outbound` instead. */ export type Outbound = AccountsReplacePartyRequest$Outbound; } export function accountsReplacePartyRequestToJSON( accountsReplacePartyRequest: AccountsReplacePartyRequest, ): string { return JSON.stringify( AccountsReplacePartyRequest$outboundSchema.parse( accountsReplacePartyRequest, ), ); } export function accountsReplacePartyRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountsReplacePartyRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountsReplacePartyRequest' from JSON`, ); } /** @internal */ export const AccountsReplacePartyResponse$inboundSchema: z.ZodType< AccountsReplacePartyResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, Party: components.Party$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Party": "party", "Status": "status", }); }); /** @internal */ export type AccountsReplacePartyResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; Party?: components.Party$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AccountsReplacePartyResponse$outboundSchema: z.ZodType< AccountsReplacePartyResponse$Outbound, z.ZodTypeDef, AccountsReplacePartyResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, party: components.Party$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", party: "Party", 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 AccountsReplacePartyResponse$ { /** @deprecated use `AccountsReplacePartyResponse$inboundSchema` instead. */ export const inboundSchema = AccountsReplacePartyResponse$inboundSchema; /** @deprecated use `AccountsReplacePartyResponse$outboundSchema` instead. */ export const outboundSchema = AccountsReplacePartyResponse$outboundSchema; /** @deprecated use `AccountsReplacePartyResponse$Outbound` instead. */ export type Outbound = AccountsReplacePartyResponse$Outbound; } export function accountsReplacePartyResponseToJSON( accountsReplacePartyResponse: AccountsReplacePartyResponse, ): string { return JSON.stringify( AccountsReplacePartyResponse$outboundSchema.parse( accountsReplacePartyResponse, ), ); } export function accountsReplacePartyResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountsReplacePartyResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountsReplacePartyResponse' from JSON`, ); }