/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { CatalogEntryEngineParamBindingV2, CatalogEntryEngineParamBindingV2$inboundSchema, CatalogEntryEngineParamBindingV2$Outbound, CatalogEntryEngineParamBindingV2$outboundSchema, } from "./catalogentryengineparambindingv2.js"; export type CatalogEntryV2 = { /** * Optional aliases that can be used to reference this entry */ aliases: Array; /** * When this entry was archived */ archivedAt?: Date | undefined; /** * Values of this entry */ attributeValues: { [k: string]: CatalogEntryEngineParamBindingV2 }; /** * ID of this catalog type */ catalogTypeId: string; /** * When this entry was created */ createdAt: Date; /** * An optional alternative ID for this entry, which is ensured to be unique for the type */ externalId?: string | undefined; /** * ID of this catalog entry */ id: string; /** * Name is the human readable name of this entry */ name: string; /** * When catalog type is ranked, this is used to help order things */ rank: number; /** * When this entry was last updated */ updatedAt: Date; }; /** @internal */ export const CatalogEntryV2$inboundSchema: z.ZodType< CatalogEntryV2, z.ZodTypeDef, unknown > = z.object({ aliases: z.array(z.string()), archived_at: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), attribute_values: z.record(CatalogEntryEngineParamBindingV2$inboundSchema), catalog_type_id: z.string(), created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), external_id: z.string().optional(), id: z.string(), name: z.string(), rank: z.number().int(), updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), }).transform((v) => { return remap$(v, { "archived_at": "archivedAt", "attribute_values": "attributeValues", "catalog_type_id": "catalogTypeId", "created_at": "createdAt", "external_id": "externalId", "updated_at": "updatedAt", }); }); /** @internal */ export type CatalogEntryV2$Outbound = { aliases: Array; archived_at?: string | undefined; attribute_values: { [k: string]: CatalogEntryEngineParamBindingV2$Outbound }; catalog_type_id: string; created_at: string; external_id?: string | undefined; id: string; name: string; rank: number; updated_at: string; }; /** @internal */ export const CatalogEntryV2$outboundSchema: z.ZodType< CatalogEntryV2$Outbound, z.ZodTypeDef, CatalogEntryV2 > = z.object({ aliases: z.array(z.string()), archivedAt: z.date().transform(v => v.toISOString()).optional(), attributeValues: z.record(CatalogEntryEngineParamBindingV2$outboundSchema), catalogTypeId: z.string(), createdAt: z.date().transform(v => v.toISOString()), externalId: z.string().optional(), id: z.string(), name: z.string(), rank: z.number().int(), updatedAt: z.date().transform(v => v.toISOString()), }).transform((v) => { return remap$(v, { archivedAt: "archived_at", attributeValues: "attribute_values", catalogTypeId: "catalog_type_id", createdAt: "created_at", externalId: "external_id", updatedAt: "updated_at", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CatalogEntryV2$ { /** @deprecated use `CatalogEntryV2$inboundSchema` instead. */ export const inboundSchema = CatalogEntryV2$inboundSchema; /** @deprecated use `CatalogEntryV2$outboundSchema` instead. */ export const outboundSchema = CatalogEntryV2$outboundSchema; /** @deprecated use `CatalogEntryV2$Outbound` instead. */ export type Outbound = CatalogEntryV2$Outbound; }