/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { UnifiedId, UnifiedId$inboundSchema, UnifiedId$Outbound, UnifiedId$outboundSchema, } from "./unifiedid.js"; /** * LedgerAccount updated */ export type UpdateLedgerAccountResponse = { /** * HTTP Response Status Code */ statusCode: number; /** * HTTP Response Status */ status: string; /** * Apideck ID of service provider */ service: string; /** * Unified API resource name */ resource: string; /** * Operation performed */ operation: string; data: UnifiedId; }; /** @internal */ export const UpdateLedgerAccountResponse$inboundSchema: z.ZodType< UpdateLedgerAccountResponse, z.ZodTypeDef, unknown > = z.object({ status_code: z.number().int(), status: z.string(), service: z.string(), resource: z.string(), operation: z.string(), data: UnifiedId$inboundSchema, }).transform((v) => { return remap$(v, { "status_code": "statusCode", }); }); /** @internal */ export type UpdateLedgerAccountResponse$Outbound = { status_code: number; status: string; service: string; resource: string; operation: string; data: UnifiedId$Outbound; }; /** @internal */ export const UpdateLedgerAccountResponse$outboundSchema: z.ZodType< UpdateLedgerAccountResponse$Outbound, z.ZodTypeDef, UpdateLedgerAccountResponse > = z.object({ statusCode: z.number().int(), status: z.string(), service: z.string(), resource: z.string(), operation: z.string(), data: UnifiedId$outboundSchema, }).transform((v) => { return remap$(v, { statusCode: "status_code", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace UpdateLedgerAccountResponse$ { /** @deprecated use `UpdateLedgerAccountResponse$inboundSchema` instead. */ export const inboundSchema = UpdateLedgerAccountResponse$inboundSchema; /** @deprecated use `UpdateLedgerAccountResponse$outboundSchema` instead. */ export const outboundSchema = UpdateLedgerAccountResponse$outboundSchema; /** @deprecated use `UpdateLedgerAccountResponse$Outbound` instead. */ export type Outbound = UpdateLedgerAccountResponse$Outbound; } export function updateLedgerAccountResponseToJSON( updateLedgerAccountResponse: UpdateLedgerAccountResponse, ): string { return JSON.stringify( UpdateLedgerAccountResponse$outboundSchema.parse( updateLedgerAccountResponse, ), ); } export function updateLedgerAccountResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpdateLedgerAccountResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateLedgerAccountResponse' from JSON`, ); }