/* * 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 { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { AccountUpdaterInquirySummary, AccountUpdaterInquirySummary$inboundSchema, } from "./accountupdaterinquirysummary.js"; export type AccountUpdaterJob = { /** * Always `account-updater-job` */ type: "account-updater-job"; /** * The ID for the account updater job. */ id: string; /** * The ID of the merchant account this job belongs to. */ merchantAccountId: string; /** * A list of the payment methods that have been scheduled for an update. */ inquiries: Array; /** * The date and time when this payment method was first created in our system. */ createdAt: Date; /** * The date and time when this payment method was last updated in our system. */ updatedAt: Date; }; /** @internal */ export const AccountUpdaterJob$inboundSchema: z.ZodType< AccountUpdaterJob, z.ZodTypeDef, unknown > = z.object({ type: z.literal("account-updater-job").default("account-updater-job"), id: z.string(), merchant_account_id: z.string(), inquiries: z.array(AccountUpdaterInquirySummary$inboundSchema), created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), }).transform((v) => { return remap$(v, { "merchant_account_id": "merchantAccountId", "created_at": "createdAt", "updated_at": "updatedAt", }); }); export function accountUpdaterJobFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountUpdaterJob$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountUpdaterJob' from JSON`, ); }