/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { ClosedEnum } from "../../types/enums.js"; import { CatalogTypeAttributePathItemV2, CatalogTypeAttributePathItemV2$inboundSchema, CatalogTypeAttributePathItemV2$Outbound, CatalogTypeAttributePathItemV2$outboundSchema, } from "./catalogtypeattributepathitemv2.js"; /** * Controls how this attribute is modified */ export const CatalogTypeAttributeV2Mode = { Unknown: "", Manual: "manual", External: "external", Internal: "internal", Dynamic: "dynamic", Backlink: "backlink", Path: "path", } as const; /** * Controls how this attribute is modified */ export type CatalogTypeAttributeV2Mode = ClosedEnum< typeof CatalogTypeAttributeV2Mode >; export type CatalogTypeAttributeV2 = { /** * Whether this attribute is an array */ array: boolean; /** * The attribute to use (if this is a backlink) */ backlinkAttribute?: string | undefined; /** * The ID of this attribute */ id: string; /** * Controls how this attribute is modified */ mode: CatalogTypeAttributeV2Mode; /** * Unique name of this attribute */ name: string; /** * The path to use (if this is a path attribute) */ path?: Array | undefined; /** * Catalog type name for this attribute */ type: string; }; /** @internal */ export const CatalogTypeAttributeV2Mode$inboundSchema: z.ZodNativeEnum< typeof CatalogTypeAttributeV2Mode > = z.nativeEnum(CatalogTypeAttributeV2Mode); /** @internal */ export const CatalogTypeAttributeV2Mode$outboundSchema: z.ZodNativeEnum< typeof CatalogTypeAttributeV2Mode > = CatalogTypeAttributeV2Mode$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CatalogTypeAttributeV2Mode$ { /** @deprecated use `CatalogTypeAttributeV2Mode$inboundSchema` instead. */ export const inboundSchema = CatalogTypeAttributeV2Mode$inboundSchema; /** @deprecated use `CatalogTypeAttributeV2Mode$outboundSchema` instead. */ export const outboundSchema = CatalogTypeAttributeV2Mode$outboundSchema; } /** @internal */ export const CatalogTypeAttributeV2$inboundSchema: z.ZodType< CatalogTypeAttributeV2, z.ZodTypeDef, unknown > = z.object({ array: z.boolean(), backlink_attribute: z.string().optional(), id: z.string(), mode: CatalogTypeAttributeV2Mode$inboundSchema, name: z.string(), path: z.array(CatalogTypeAttributePathItemV2$inboundSchema).optional(), type: z.string(), }).transform((v) => { return remap$(v, { "backlink_attribute": "backlinkAttribute", }); }); /** @internal */ export type CatalogTypeAttributeV2$Outbound = { array: boolean; backlink_attribute?: string | undefined; id: string; mode: string; name: string; path?: Array | undefined; type: string; }; /** @internal */ export const CatalogTypeAttributeV2$outboundSchema: z.ZodType< CatalogTypeAttributeV2$Outbound, z.ZodTypeDef, CatalogTypeAttributeV2 > = z.object({ array: z.boolean(), backlinkAttribute: z.string().optional(), id: z.string(), mode: CatalogTypeAttributeV2Mode$outboundSchema, name: z.string(), path: z.array(CatalogTypeAttributePathItemV2$outboundSchema).optional(), type: z.string(), }).transform((v) => { return remap$(v, { backlinkAttribute: "backlink_attribute", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CatalogTypeAttributeV2$ { /** @deprecated use `CatalogTypeAttributeV2$inboundSchema` instead. */ export const inboundSchema = CatalogTypeAttributeV2$inboundSchema; /** @deprecated use `CatalogTypeAttributeV2$outboundSchema` instead. */ export const outboundSchema = CatalogTypeAttributeV2$outboundSchema; /** @deprecated use `CatalogTypeAttributeV2$Outbound` instead. */ export type Outbound = CatalogTypeAttributeV2$Outbound; }