/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { lazySchema as lazySchema$, safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { AccountingBankAccount, AccountingBankAccount$inboundSchema, } from "./accountingbankaccount.js"; import { Links, Links$inboundSchema } from "./links.js"; import { Meta, Meta$inboundSchema } from "./meta.js"; /** * Bank Accounts */ export type GetBankAccountsResponse = { /** * HTTP Response Status Code */ statusCode: number; /** * HTTP Response Status */ status: string; /** * Apideck ID of service provider */ service?: string | undefined; /** * Unified API resource name */ resource?: string | undefined; /** * Operation performed */ operation?: string | undefined; data: Array; /** * Response metadata */ meta?: Meta | undefined; /** * Links to navigate to previous or next pages through the API */ links?: Links | undefined; }; /** @internal */ export const GetBankAccountsResponse$inboundSchema: z.ZodType< GetBankAccountsResponse, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ status_code: types.number(), status: types.string(), service: types.optional(types.string()), resource: types.optional(types.string()), operation: types.optional(types.string()), data: z.array(AccountingBankAccount$inboundSchema), meta: types.optional(Meta$inboundSchema), links: types.optional(Links$inboundSchema), }).transform((v) => { return remap$(v, { "status_code": "statusCode", }); }) ); export function getBankAccountsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetBankAccountsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetBankAccountsResponse' from JSON`, ); }