/* * 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 { CatalogTypeSchemaV2, CatalogTypeSchemaV2$inboundSchema, CatalogTypeSchemaV2$Outbound, CatalogTypeSchemaV2$outboundSchema, } from "./catalogtypeschemav2.js"; export const Categories = { Customer: "customer", IssueTracker: "issue-tracker", ProductFeature: "product-feature", Service: "service", OnCall: "on-call", Team: "team", User: "user", } as const; export type Categories = ClosedEnum; /** * Sets the display color of this type in the dashboard */ export const Color = { Yellow: "yellow", Green: "green", Blue: "blue", Violet: "violet", Pink: "pink", Cyan: "cyan", Orange: "orange", } as const; /** * Sets the display color of this type in the dashboard */ export type Color = ClosedEnum; /** * Sets the display icon of this type in the dashboard */ export const Icon = { Alert: "alert", Bolt: "bolt", Box: "box", Briefcase: "briefcase", Browser: "browser", Bulb: "bulb", Calendar: "calendar", Clock: "clock", Cog: "cog", Components: "components", Database: "database", Doc: "doc", Email: "email", EscalationPath: "escalation-path", Files: "files", Flag: "flag", Folder: "folder", Globe: "globe", Money: "money", Server: "server", Severity: "severity", StatusPage: "status-page", Store: "store", Star: "star", Tag: "tag", User: "user", Users: "users", } as const; /** * Sets the display icon of this type in the dashboard */ export type Icon = ClosedEnum; export type CatalogTypeV2 = { /** * Annotations that can track metadata about this type */ annotations: { [k: string]: string }; /** * What categories is this type considered part of */ categories: Array; /** * Sets the display color of this type in the dashboard */ color: Color; /** * When this type was created */ createdAt: Date; /** * Human readble description of this type */ description: string; /** * If this is a dynamic catalog type, this will be the unique parameter for identitfying this resource externally. */ dynamicResourceParameter?: string | undefined; /** * If populated, gives an estimated count of entries for this type */ estimatedCount?: number | undefined; /** * Sets the display icon of this type in the dashboard */ icon: Icon; /** * ID of this catalog type */ id: string; /** * Catalog types that are synced with external resources can't be edited */ isEditable: boolean; /** * When this type was last synced (if it's ever been sync'd) */ lastSyncedAt?: Date | undefined; /** * Name is the human readable name of this type */ name: string; /** * If this type should be ranked */ ranked: boolean; /** * The registry resource this type is synced from, if any */ registryType?: string | undefined; /** * If populated, the integrations required for this type */ requiredIntegrations?: Array | undefined; schema: CatalogTypeSchemaV2; /** * Semantic type of this resource (unused) */ semanticType: string; /** * The url of the external repository where this type is managed */ sourceRepoUrl?: string | undefined; /** * The type name of this catalog type, to be used when defining attributes. This is immutable once a CatalogType has been created. For non-externally sync types, it must follow the pattern Custom["SomeName "] */ typeName: string; /** * When this type was last updated */ updatedAt: Date; }; /** @internal */ export const Categories$inboundSchema: z.ZodNativeEnum = z .nativeEnum(Categories); /** @internal */ export const Categories$outboundSchema: z.ZodNativeEnum = Categories$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Categories$ { /** @deprecated use `Categories$inboundSchema` instead. */ export const inboundSchema = Categories$inboundSchema; /** @deprecated use `Categories$outboundSchema` instead. */ export const outboundSchema = Categories$outboundSchema; } /** @internal */ export const Color$inboundSchema: z.ZodNativeEnum = z.nativeEnum( Color, ); /** @internal */ export const Color$outboundSchema: z.ZodNativeEnum = Color$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Color$ { /** @deprecated use `Color$inboundSchema` instead. */ export const inboundSchema = Color$inboundSchema; /** @deprecated use `Color$outboundSchema` instead. */ export const outboundSchema = Color$outboundSchema; } /** @internal */ export const Icon$inboundSchema: z.ZodNativeEnum = z.nativeEnum( Icon, ); /** @internal */ export const Icon$outboundSchema: z.ZodNativeEnum = Icon$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Icon$ { /** @deprecated use `Icon$inboundSchema` instead. */ export const inboundSchema = Icon$inboundSchema; /** @deprecated use `Icon$outboundSchema` instead. */ export const outboundSchema = Icon$outboundSchema; } /** @internal */ export const CatalogTypeV2$inboundSchema: z.ZodType< CatalogTypeV2, z.ZodTypeDef, unknown > = z.object({ annotations: z.record(z.string()), categories: z.array(Categories$inboundSchema), color: Color$inboundSchema, created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), description: z.string(), dynamic_resource_parameter: z.string().optional(), estimated_count: z.number().int().optional(), icon: Icon$inboundSchema, id: z.string(), is_editable: z.boolean(), last_synced_at: z.string().datetime({ offset: true }).transform(v => new Date(v) ).optional(), name: z.string(), ranked: z.boolean(), registry_type: z.string().optional(), required_integrations: z.array(z.string()).optional(), schema: CatalogTypeSchemaV2$inboundSchema, semantic_type: z.string(), source_repo_url: z.string().optional(), type_name: z.string(), updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), }).transform((v) => { return remap$(v, { "created_at": "createdAt", "dynamic_resource_parameter": "dynamicResourceParameter", "estimated_count": "estimatedCount", "is_editable": "isEditable", "last_synced_at": "lastSyncedAt", "registry_type": "registryType", "required_integrations": "requiredIntegrations", "semantic_type": "semanticType", "source_repo_url": "sourceRepoUrl", "type_name": "typeName", "updated_at": "updatedAt", }); }); /** @internal */ export type CatalogTypeV2$Outbound = { annotations: { [k: string]: string }; categories: Array; color: string; created_at: string; description: string; dynamic_resource_parameter?: string | undefined; estimated_count?: number | undefined; icon: string; id: string; is_editable: boolean; last_synced_at?: string | undefined; name: string; ranked: boolean; registry_type?: string | undefined; required_integrations?: Array | undefined; schema: CatalogTypeSchemaV2$Outbound; semantic_type: string; source_repo_url?: string | undefined; type_name: string; updated_at: string; }; /** @internal */ export const CatalogTypeV2$outboundSchema: z.ZodType< CatalogTypeV2$Outbound, z.ZodTypeDef, CatalogTypeV2 > = z.object({ annotations: z.record(z.string()), categories: z.array(Categories$outboundSchema), color: Color$outboundSchema, createdAt: z.date().transform(v => v.toISOString()), description: z.string(), dynamicResourceParameter: z.string().optional(), estimatedCount: z.number().int().optional(), icon: Icon$outboundSchema, id: z.string(), isEditable: z.boolean(), lastSyncedAt: z.date().transform(v => v.toISOString()).optional(), name: z.string(), ranked: z.boolean(), registryType: z.string().optional(), requiredIntegrations: z.array(z.string()).optional(), schema: CatalogTypeSchemaV2$outboundSchema, semanticType: z.string(), sourceRepoUrl: z.string().optional(), typeName: z.string(), updatedAt: z.date().transform(v => v.toISOString()), }).transform((v) => { return remap$(v, { createdAt: "created_at", dynamicResourceParameter: "dynamic_resource_parameter", estimatedCount: "estimated_count", isEditable: "is_editable", lastSyncedAt: "last_synced_at", registryType: "registry_type", requiredIntegrations: "required_integrations", semanticType: "semantic_type", sourceRepoUrl: "source_repo_url", typeName: "type_name", 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 CatalogTypeV2$ { /** @deprecated use `CatalogTypeV2$inboundSchema` instead. */ export const inboundSchema = CatalogTypeV2$inboundSchema; /** @deprecated use `CatalogTypeV2$outboundSchema` instead. */ export const outboundSchema = CatalogTypeV2$outboundSchema; /** @deprecated use `CatalogTypeV2$Outbound` instead. */ export type Outbound = CatalogTypeV2$Outbound; }