/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The color of the tag. */ export const LinkTagSchemaColor = { Red: "red", Yellow: "yellow", Green: "green", Blue: "blue", Purple: "purple", Brown: "brown", Gray: "gray", Pink: "pink", } as const; /** * The color of the tag. */ export type LinkTagSchemaColor = ClosedEnum; export type LinkTagSchema = { /** * The unique ID of the tag. */ id: string; /** * The name of the tag. */ name: string; /** * The color of the tag. */ color: LinkTagSchemaColor; }; /** @internal */ export const LinkTagSchemaColor$inboundSchema: z.ZodNativeEnum< typeof LinkTagSchemaColor > = z.nativeEnum(LinkTagSchemaColor); /** @internal */ export const LinkTagSchemaColor$outboundSchema: z.ZodNativeEnum< typeof LinkTagSchemaColor > = LinkTagSchemaColor$inboundSchema; /** @internal */ export const LinkTagSchema$inboundSchema: z.ZodType< LinkTagSchema, z.ZodTypeDef, unknown > = z.object({ id: z.string(), name: z.string(), color: LinkTagSchemaColor$inboundSchema, }); /** @internal */ export type LinkTagSchema$Outbound = { id: string; name: string; color: string; }; /** @internal */ export const LinkTagSchema$outboundSchema: z.ZodType< LinkTagSchema$Outbound, z.ZodTypeDef, LinkTagSchema > = z.object({ id: z.string(), name: z.string(), color: LinkTagSchemaColor$outboundSchema, }); export function linkTagSchemaToJSON(linkTagSchema: LinkTagSchema): string { return JSON.stringify(LinkTagSchema$outboundSchema.parse(linkTagSchema)); } export function linkTagSchemaFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LinkTagSchema$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LinkTagSchema' from JSON`, ); }