/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { CreateBankTransactions, CreateBankTransactions$inboundSchema, } from "./createbanktransactions.js"; import { DataType, DataType$inboundSchema } from "./datatype.js"; import { PushOperationChange, PushOperationChange$inboundSchema, } from "./pushoperationchange.js"; import { PushOperationStatus, PushOperationStatus$inboundSchema, } from "./pushoperationstatus.js"; import { Validation, Validation$inboundSchema } from "./validation.js"; export type CreateBankTransactionsResponse = { data?: CreateBankTransactions | undefined; /** * Contains a single entry that communicates which record has changed and the manner in which it changed. */ changes?: Array | null | undefined; /** * Available data types */ dataType?: DataType | undefined; /** * Unique identifier for your SMB in Codat. */ companyId: string; /** * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. */ pushOperationKey: string; /** * Unique identifier for a company's data connection. */ dataConnectionKey: string; /** * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: * * @remarks * * ``` * 2020-10-08T22:40:50Z * 2021-01-01T00:00:00 * ``` * * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: * * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` * - Unqualified local time: `2021-11-15T01:00:00` * - UTC time offsets: `2021-11-15T01:00:00-05:00` * * > Time zones * > * > Not all dates from Codat will contain information about time zones. * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. */ requestedOnUtc: string; /** * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: * * @remarks * * ``` * 2020-10-08T22:40:50Z * 2021-01-01T00:00:00 * ``` * * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: * * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` * - Unqualified local time: `2021-11-15T01:00:00` * - UTC time offsets: `2021-11-15T01:00:00-05:00` * * > Time zones * > * > Not all dates from Codat will contain information about time zones. * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. */ completedOnUtc?: string | undefined; /** * Number of minutes the push operation must complete within before it times out. */ timeoutInMinutes?: number | null | undefined; /** * Number of seconds the push operation must complete within before it times out. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ timeoutInSeconds?: number | null | undefined; /** * The current status of the push operation. */ status: PushOperationStatus; /** * A message about the error. */ errorMessage?: string | null | undefined; /** * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. */ validation?: Validation | undefined; /** * Push status code. */ statusCode: number; }; /** @internal */ export const CreateBankTransactionsResponse$inboundSchema: z.ZodType< CreateBankTransactionsResponse, z.ZodTypeDef, unknown > = z.object({ data: CreateBankTransactions$inboundSchema.optional(), changes: z.nullable(z.array(PushOperationChange$inboundSchema)).optional(), dataType: DataType$inboundSchema.optional(), companyId: z.string(), pushOperationKey: z.string(), dataConnectionKey: z.string(), requestedOnUtc: z.string(), completedOnUtc: z.string().optional(), timeoutInMinutes: z.nullable(z.number().int()).optional(), timeoutInSeconds: z.nullable(z.number().int()).optional(), status: PushOperationStatus$inboundSchema, errorMessage: z.nullable(z.string()).optional(), validation: Validation$inboundSchema.optional(), statusCode: z.number().int(), }); export function createBankTransactionsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateBankTransactionsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateBankTransactionsResponse' from JSON`, ); }