/* * 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 AccountAccreditationServiceSetAccountAccreditationTypeRequest = { /** * The account id. */ accountId: string; setAccountAccreditationTypeRequestCreate: components.SetAccountAccreditationTypeRequestCreate; }; export type AccountAccreditationServiceSetAccountAccreditationTypeResponse = { httpMeta: components.HTTPMetadata; /** * OK */ accountAccreditation?: components.AccountAccreditation | undefined; /** * INVALID_ARGUMENT: The request has an invalid argument. */ status?: components.Status | undefined; }; /** @internal */ export const AccountAccreditationServiceSetAccountAccreditationTypeRequest$inboundSchema: z.ZodType< AccountAccreditationServiceSetAccountAccreditationTypeRequest, z.ZodTypeDef, unknown > = z.object({ account_id: z.string(), SetAccountAccreditationTypeRequestCreate: components.SetAccountAccreditationTypeRequestCreate$inboundSchema, }).transform((v) => { return remap$(v, { "account_id": "accountId", "SetAccountAccreditationTypeRequestCreate": "setAccountAccreditationTypeRequestCreate", }); }); /** @internal */ export type AccountAccreditationServiceSetAccountAccreditationTypeRequest$Outbound = { account_id: string; SetAccountAccreditationTypeRequestCreate: components.SetAccountAccreditationTypeRequestCreate$Outbound; }; /** @internal */ export const AccountAccreditationServiceSetAccountAccreditationTypeRequest$outboundSchema: z.ZodType< AccountAccreditationServiceSetAccountAccreditationTypeRequest$Outbound, z.ZodTypeDef, AccountAccreditationServiceSetAccountAccreditationTypeRequest > = z.object({ accountId: z.string(), setAccountAccreditationTypeRequestCreate: components.SetAccountAccreditationTypeRequestCreate$outboundSchema, }).transform((v) => { return remap$(v, { accountId: "account_id", setAccountAccreditationTypeRequestCreate: "SetAccountAccreditationTypeRequestCreate", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountAccreditationServiceSetAccountAccreditationTypeRequest$ { /** @deprecated use `AccountAccreditationServiceSetAccountAccreditationTypeRequest$inboundSchema` instead. */ export const inboundSchema = AccountAccreditationServiceSetAccountAccreditationTypeRequest$inboundSchema; /** @deprecated use `AccountAccreditationServiceSetAccountAccreditationTypeRequest$outboundSchema` instead. */ export const outboundSchema = AccountAccreditationServiceSetAccountAccreditationTypeRequest$outboundSchema; /** @deprecated use `AccountAccreditationServiceSetAccountAccreditationTypeRequest$Outbound` instead. */ export type Outbound = AccountAccreditationServiceSetAccountAccreditationTypeRequest$Outbound; } export function accountAccreditationServiceSetAccountAccreditationTypeRequestToJSON( accountAccreditationServiceSetAccountAccreditationTypeRequest: AccountAccreditationServiceSetAccountAccreditationTypeRequest, ): string { return JSON.stringify( AccountAccreditationServiceSetAccountAccreditationTypeRequest$outboundSchema .parse(accountAccreditationServiceSetAccountAccreditationTypeRequest), ); } export function accountAccreditationServiceSetAccountAccreditationTypeRequestFromJSON( jsonString: string, ): SafeParseResult< AccountAccreditationServiceSetAccountAccreditationTypeRequest, SDKValidationError > { return safeParse( jsonString, (x) => AccountAccreditationServiceSetAccountAccreditationTypeRequest$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'AccountAccreditationServiceSetAccountAccreditationTypeRequest' from JSON`, ); } /** @internal */ export const AccountAccreditationServiceSetAccountAccreditationTypeResponse$inboundSchema: z.ZodType< AccountAccreditationServiceSetAccountAccreditationTypeResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, AccountAccreditation: components.AccountAccreditation$inboundSchema .optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "AccountAccreditation": "accountAccreditation", "Status": "status", }); }); /** @internal */ export type AccountAccreditationServiceSetAccountAccreditationTypeResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; AccountAccreditation?: components.AccountAccreditation$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AccountAccreditationServiceSetAccountAccreditationTypeResponse$outboundSchema: z.ZodType< AccountAccreditationServiceSetAccountAccreditationTypeResponse$Outbound, z.ZodTypeDef, AccountAccreditationServiceSetAccountAccreditationTypeResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, accountAccreditation: components.AccountAccreditation$outboundSchema .optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", accountAccreditation: "AccountAccreditation", 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 AccountAccreditationServiceSetAccountAccreditationTypeResponse$ { /** @deprecated use `AccountAccreditationServiceSetAccountAccreditationTypeResponse$inboundSchema` instead. */ export const inboundSchema = AccountAccreditationServiceSetAccountAccreditationTypeResponse$inboundSchema; /** @deprecated use `AccountAccreditationServiceSetAccountAccreditationTypeResponse$outboundSchema` instead. */ export const outboundSchema = AccountAccreditationServiceSetAccountAccreditationTypeResponse$outboundSchema; /** @deprecated use `AccountAccreditationServiceSetAccountAccreditationTypeResponse$Outbound` instead. */ export type Outbound = AccountAccreditationServiceSetAccountAccreditationTypeResponse$Outbound; } export function accountAccreditationServiceSetAccountAccreditationTypeResponseToJSON( accountAccreditationServiceSetAccountAccreditationTypeResponse: AccountAccreditationServiceSetAccountAccreditationTypeResponse, ): string { return JSON.stringify( AccountAccreditationServiceSetAccountAccreditationTypeResponse$outboundSchema .parse(accountAccreditationServiceSetAccountAccreditationTypeResponse), ); } export function accountAccreditationServiceSetAccountAccreditationTypeResponseFromJSON( jsonString: string, ): SafeParseResult< AccountAccreditationServiceSetAccountAccreditationTypeResponse, SDKValidationError > { return safeParse( jsonString, (x) => AccountAccreditationServiceSetAccountAccreditationTypeResponse$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'AccountAccreditationServiceSetAccountAccreditationTypeResponse' from JSON`, ); }