/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; export type TagResource = { id?: number | undefined; label?: string | null | undefined; }; /** @internal */ export const TagResource$inboundSchema: z.ZodType< TagResource, z.ZodTypeDef, unknown > = z.object({ id: z.number().int().optional(), label: z.nullable(z.string()).optional(), }); /** @internal */ export type TagResource$Outbound = { id?: number | undefined; label?: string | null | undefined; }; /** @internal */ export const TagResource$outboundSchema: z.ZodType< TagResource$Outbound, z.ZodTypeDef, TagResource > = z.object({ id: z.number().int().optional(), label: z.nullable(z.string()).optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace TagResource$ { /** @deprecated use `TagResource$inboundSchema` instead. */ export const inboundSchema = TagResource$inboundSchema; /** @deprecated use `TagResource$outboundSchema` instead. */ export const outboundSchema = TagResource$outboundSchema; /** @deprecated use `TagResource$Outbound` instead. */ export type Outbound = TagResource$Outbound; } export function tagResourceToJSON(tagResource: TagResource): string { return JSON.stringify(TagResource$outboundSchema.parse(tagResource)); } export function tagResourceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TagResource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TagResource' from JSON`, ); }