/* * 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$ } from "../../lib/schemas.js"; import { SupplierCreateInput, SupplierCreateInput$Outbound, SupplierCreateInput$outboundSchema, } from "./suppliercreateinput.js"; export type BatchSuppliersRequestItems = { /** * A caller-supplied reference for this item, echoed back on the matching result so each outcome can be tied to the record it came from. Must be unique within the request. Never sent to the connector. */ ref?: string | undefined; /** * The writable shape of Supplier for a batch create. Identical to [Supplier](the model returned on reads) with the read-only properties removed — the same properties the single-record create endpoint rejects, so a batched record and a single-record create accept exactly the same body. */ data: SupplierCreateInput; }; /** * A batch of suppliers to write in a single request. Each item is processed independently: some may succeed while others fail, and the response carries one result per item in the order they were sent. */ export type BatchSuppliersRequest = { /** * The records to write. The per-connector limit is the real cap and is usually lower than the ceiling here: read `batch_support.resources[].max_items` on the Connector API for the connector you are calling, or the resource gotchas. This ceiling exists so an oversized array is rejected by request validation before any per-item work runs, rather than after it. */ items: Array; }; /** @internal */ export type BatchSuppliersRequestItems$Outbound = { _ref?: string | undefined; data: SupplierCreateInput$Outbound; }; /** @internal */ export const BatchSuppliersRequestItems$outboundSchema: z.ZodType< BatchSuppliersRequestItems$Outbound, z.ZodTypeDef, BatchSuppliersRequestItems > = /* @__PURE__ */ lazySchema$(() => z.object({ ref: z.string().optional(), data: SupplierCreateInput$outboundSchema, }).transform((v) => { return remap$(v, { ref: "_ref", }); }) ); export function batchSuppliersRequestItemsToJSON( batchSuppliersRequestItems: BatchSuppliersRequestItems, ): string { return JSON.stringify( BatchSuppliersRequestItems$outboundSchema.parse(batchSuppliersRequestItems), ); } /** @internal */ export type BatchSuppliersRequest$Outbound = { items: Array; }; /** @internal */ export const BatchSuppliersRequest$outboundSchema: z.ZodType< BatchSuppliersRequest$Outbound, z.ZodTypeDef, BatchSuppliersRequest > = /* @__PURE__ */ lazySchema$(() => z.object({ items: z.array(z.lazy(() => BatchSuppliersRequestItems$outboundSchema)), }) ); export function batchSuppliersRequestToJSON( batchSuppliersRequest: BatchSuppliersRequest, ): string { return JSON.stringify( BatchSuppliersRequest$outboundSchema.parse(batchSuppliersRequest), ); }