/* * 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 * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; import { PassThroughBody, PassThroughBody$Outbound, PassThroughBody$outboundSchema, } from "./passthroughbody.js"; /** * Based on the status some functionality is enabled or disabled. */ export const TrackingCategoryCreateInputTrackingCategoryStatus = { Active: "active", Inactive: "inactive", } as const; /** * Based on the status some functionality is enabled or disabled. */ export type TrackingCategoryCreateInputTrackingCategoryStatus = OpenEnum< typeof TrackingCategoryCreateInputTrackingCategoryStatus >; export type TrackingCategoryCreateInputSubsidiaries = { /** * The ID of the subsidiary. */ id?: string | undefined; }; /** * The writable shape of TrackingCategory for a batch create. Identical to [TrackingCategory](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. */ export type TrackingCategoryCreateInput = { /** * A unique identifier for an object. */ parentId?: string | null | undefined; /** * The name of the parent tracking category. */ parentName?: string | null | undefined; /** * The name of the tracking category. */ name?: string | undefined; /** * The code of the tracking category. */ code?: string | null | undefined; /** * Based on the status some functionality is enabled or disabled. */ status?: TrackingCategoryCreateInputTrackingCategoryStatus | undefined; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ rowVersion?: string | null | undefined; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ passThrough?: Array | undefined; /** * The subsidiaries the account belongs to. */ subsidiaries?: Array | undefined; }; /** @internal */ export const TrackingCategoryCreateInputTrackingCategoryStatus$outboundSchema: z.ZodType< string, z.ZodTypeDef, TrackingCategoryCreateInputTrackingCategoryStatus > = /* @__PURE__ */ lazySchema$(() => openEnums.outboundSchema(TrackingCategoryCreateInputTrackingCategoryStatus) ); /** @internal */ export type TrackingCategoryCreateInputSubsidiaries$Outbound = { id?: string | undefined; }; /** @internal */ export const TrackingCategoryCreateInputSubsidiaries$outboundSchema: z.ZodType< TrackingCategoryCreateInputSubsidiaries$Outbound, z.ZodTypeDef, TrackingCategoryCreateInputSubsidiaries > = /* @__PURE__ */ lazySchema$(() => z.object({ id: z.string().optional(), }) ); export function trackingCategoryCreateInputSubsidiariesToJSON( trackingCategoryCreateInputSubsidiaries: TrackingCategoryCreateInputSubsidiaries, ): string { return JSON.stringify( TrackingCategoryCreateInputSubsidiaries$outboundSchema.parse( trackingCategoryCreateInputSubsidiaries, ), ); } /** @internal */ export type TrackingCategoryCreateInput$Outbound = { parent_id?: string | null | undefined; parent_name?: string | null | undefined; name?: string | undefined; code?: string | null | undefined; status?: string | undefined; row_version?: string | null | undefined; pass_through?: Array | undefined; subsidiaries?: | Array | undefined; }; /** @internal */ export const TrackingCategoryCreateInput$outboundSchema: z.ZodType< TrackingCategoryCreateInput$Outbound, z.ZodTypeDef, TrackingCategoryCreateInput > = /* @__PURE__ */ lazySchema$(() => z.object({ parentId: z.nullable(z.string()).optional(), parentName: z.nullable(z.string()).optional(), name: z.string().optional(), code: z.nullable(z.string()).optional(), status: TrackingCategoryCreateInputTrackingCategoryStatus$outboundSchema .optional(), rowVersion: z.nullable(z.string()).optional(), passThrough: z.array(PassThroughBody$outboundSchema).optional(), subsidiaries: z.array( z.lazy(() => TrackingCategoryCreateInputSubsidiaries$outboundSchema), ).optional(), }).transform((v) => { return remap$(v, { parentId: "parent_id", parentName: "parent_name", rowVersion: "row_version", passThrough: "pass_through", }); }) ); export function trackingCategoryCreateInputToJSON( trackingCategoryCreateInput: TrackingCategoryCreateInput, ): string { return JSON.stringify( TrackingCategoryCreateInput$outboundSchema.parse( trackingCategoryCreateInput, ), ); }