/* * 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"; /** * The view to return. Defaults to `FULL`. */ export enum QueryParamView { AccountViewUnspecified = "ACCOUNT_VIEW_UNSPECIFIED", Basic = "BASIC", Full = "FULL", } export type AccountsGetAccountRequest = { /** * The account id. */ accountId: string; /** * The view to return. Defaults to `FULL`. */ view?: QueryParamView | undefined; }; export type AccountsGetAccountResponse = { httpMeta: components.HTTPMetadata; /** * OK */ account?: components.Account | undefined; /** * INVALID_ARGUMENT: The request is not valid, additional information may be present in the BadRequest details. */ status?: components.Status | undefined; }; /** @internal */ export const QueryParamView$inboundSchema: z.ZodNativeEnum< typeof QueryParamView > = z.nativeEnum(QueryParamView); /** @internal */ export const QueryParamView$outboundSchema: z.ZodNativeEnum< typeof QueryParamView > = QueryParamView$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace QueryParamView$ { /** @deprecated use `QueryParamView$inboundSchema` instead. */ export const inboundSchema = QueryParamView$inboundSchema; /** @deprecated use `QueryParamView$outboundSchema` instead. */ export const outboundSchema = QueryParamView$outboundSchema; } /** @internal */ export const AccountsGetAccountRequest$inboundSchema: z.ZodType< AccountsGetAccountRequest, z.ZodTypeDef, unknown > = z.object({ account_id: z.string(), view: QueryParamView$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "account_id": "accountId", }); }); /** @internal */ export type AccountsGetAccountRequest$Outbound = { account_id: string; view?: string | undefined; }; /** @internal */ export const AccountsGetAccountRequest$outboundSchema: z.ZodType< AccountsGetAccountRequest$Outbound, z.ZodTypeDef, AccountsGetAccountRequest > = z.object({ accountId: z.string(), view: QueryParamView$outboundSchema.optional(), }).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 AccountsGetAccountRequest$ { /** @deprecated use `AccountsGetAccountRequest$inboundSchema` instead. */ export const inboundSchema = AccountsGetAccountRequest$inboundSchema; /** @deprecated use `AccountsGetAccountRequest$outboundSchema` instead. */ export const outboundSchema = AccountsGetAccountRequest$outboundSchema; /** @deprecated use `AccountsGetAccountRequest$Outbound` instead. */ export type Outbound = AccountsGetAccountRequest$Outbound; } export function accountsGetAccountRequestToJSON( accountsGetAccountRequest: AccountsGetAccountRequest, ): string { return JSON.stringify( AccountsGetAccountRequest$outboundSchema.parse(accountsGetAccountRequest), ); } export function accountsGetAccountRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountsGetAccountRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountsGetAccountRequest' from JSON`, ); } /** @internal */ export const AccountsGetAccountResponse$inboundSchema: z.ZodType< AccountsGetAccountResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, Account: components.Account$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Account": "account", "Status": "status", }); }); /** @internal */ export type AccountsGetAccountResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; Account?: components.Account$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AccountsGetAccountResponse$outboundSchema: z.ZodType< AccountsGetAccountResponse$Outbound, z.ZodTypeDef, AccountsGetAccountResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, account: components.Account$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", account: "Account", 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 AccountsGetAccountResponse$ { /** @deprecated use `AccountsGetAccountResponse$inboundSchema` instead. */ export const inboundSchema = AccountsGetAccountResponse$inboundSchema; /** @deprecated use `AccountsGetAccountResponse$outboundSchema` instead. */ export const outboundSchema = AccountsGetAccountResponse$outboundSchema; /** @deprecated use `AccountsGetAccountResponse$Outbound` instead. */ export type Outbound = AccountsGetAccountResponse$Outbound; } export function accountsGetAccountResponseToJSON( accountsGetAccountResponse: AccountsGetAccountResponse, ): string { return JSON.stringify( AccountsGetAccountResponse$outboundSchema.parse(accountsGetAccountResponse), ); } export function accountsGetAccountResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountsGetAccountResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountsGetAccountResponse' from JSON`, ); }