/* * 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 AccountAccreditationServiceGetAccountAccreditationRequest = { /** * The account id. */ accountId: string; }; export type AccountAccreditationServiceGetAccountAccreditationResponse = { httpMeta: components.HTTPMetadata; /** * OK */ accountAccreditation?: components.AccountAccreditation | undefined; /** * INVALID_ARGUMENT: The request has an invalid argument. * * @remarks * FAILED_PRECONDITION: The operation was rejected because the system is not in a state required for the operation's execution. */ status?: components.Status | undefined; }; /** @internal */ export const AccountAccreditationServiceGetAccountAccreditationRequest$inboundSchema: z.ZodType< AccountAccreditationServiceGetAccountAccreditationRequest, z.ZodTypeDef, unknown > = z.object({ account_id: z.string(), }).transform((v) => { return remap$(v, { "account_id": "accountId", }); }); /** @internal */ export type AccountAccreditationServiceGetAccountAccreditationRequest$Outbound = { account_id: string; }; /** @internal */ export const AccountAccreditationServiceGetAccountAccreditationRequest$outboundSchema: z.ZodType< AccountAccreditationServiceGetAccountAccreditationRequest$Outbound, z.ZodTypeDef, AccountAccreditationServiceGetAccountAccreditationRequest > = z.object({ accountId: z.string(), }).transform((v) => { return remap$(v, { accountId: "account_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountAccreditationServiceGetAccountAccreditationRequest$ { /** @deprecated use `AccountAccreditationServiceGetAccountAccreditationRequest$inboundSchema` instead. */ export const inboundSchema = AccountAccreditationServiceGetAccountAccreditationRequest$inboundSchema; /** @deprecated use `AccountAccreditationServiceGetAccountAccreditationRequest$outboundSchema` instead. */ export const outboundSchema = AccountAccreditationServiceGetAccountAccreditationRequest$outboundSchema; /** @deprecated use `AccountAccreditationServiceGetAccountAccreditationRequest$Outbound` instead. */ export type Outbound = AccountAccreditationServiceGetAccountAccreditationRequest$Outbound; } export function accountAccreditationServiceGetAccountAccreditationRequestToJSON( accountAccreditationServiceGetAccountAccreditationRequest: AccountAccreditationServiceGetAccountAccreditationRequest, ): string { return JSON.stringify( AccountAccreditationServiceGetAccountAccreditationRequest$outboundSchema .parse(accountAccreditationServiceGetAccountAccreditationRequest), ); } export function accountAccreditationServiceGetAccountAccreditationRequestFromJSON( jsonString: string, ): SafeParseResult< AccountAccreditationServiceGetAccountAccreditationRequest, SDKValidationError > { return safeParse( jsonString, (x) => AccountAccreditationServiceGetAccountAccreditationRequest$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'AccountAccreditationServiceGetAccountAccreditationRequest' from JSON`, ); } /** @internal */ export const AccountAccreditationServiceGetAccountAccreditationResponse$inboundSchema: z.ZodType< AccountAccreditationServiceGetAccountAccreditationResponse, 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 AccountAccreditationServiceGetAccountAccreditationResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; AccountAccreditation?: components.AccountAccreditation$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AccountAccreditationServiceGetAccountAccreditationResponse$outboundSchema: z.ZodType< AccountAccreditationServiceGetAccountAccreditationResponse$Outbound, z.ZodTypeDef, AccountAccreditationServiceGetAccountAccreditationResponse > = 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 AccountAccreditationServiceGetAccountAccreditationResponse$ { /** @deprecated use `AccountAccreditationServiceGetAccountAccreditationResponse$inboundSchema` instead. */ export const inboundSchema = AccountAccreditationServiceGetAccountAccreditationResponse$inboundSchema; /** @deprecated use `AccountAccreditationServiceGetAccountAccreditationResponse$outboundSchema` instead. */ export const outboundSchema = AccountAccreditationServiceGetAccountAccreditationResponse$outboundSchema; /** @deprecated use `AccountAccreditationServiceGetAccountAccreditationResponse$Outbound` instead. */ export type Outbound = AccountAccreditationServiceGetAccountAccreditationResponse$Outbound; } export function accountAccreditationServiceGetAccountAccreditationResponseToJSON( accountAccreditationServiceGetAccountAccreditationResponse: AccountAccreditationServiceGetAccountAccreditationResponse, ): string { return JSON.stringify( AccountAccreditationServiceGetAccountAccreditationResponse$outboundSchema .parse(accountAccreditationServiceGetAccountAccreditationResponse), ); } export function accountAccreditationServiceGetAccountAccreditationResponseFromJSON( jsonString: string, ): SafeParseResult< AccountAccreditationServiceGetAccountAccreditationResponse, SDKValidationError > { return safeParse( jsonString, (x) => AccountAccreditationServiceGetAccountAccreditationResponse$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'AccountAccreditationServiceGetAccountAccreditationResponse' from JSON`, ); }