/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { lazySchema as lazySchema$, safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type LinkedWorktag = { /** * The unique identifier for the worktag. */ id?: string | undefined; /** * The value of the worktag. */ value?: string | null | undefined; }; /** @internal */ export const LinkedWorktag$inboundSchema: z.ZodType< LinkedWorktag, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ id: types.optional(types.string()), value: z.nullable(types.string()).optional(), }) ); /** @internal */ export type LinkedWorktag$Outbound = { id?: string | undefined; value?: string | null | undefined; }; /** @internal */ export const LinkedWorktag$outboundSchema: z.ZodType< LinkedWorktag$Outbound, z.ZodTypeDef, LinkedWorktag > = /* @__PURE__ */ lazySchema$(() => z.object({ id: z.string().optional(), value: z.nullable(z.string()).optional(), }) ); export function linkedWorktagToJSON(linkedWorktag: LinkedWorktag): string { return JSON.stringify(LinkedWorktag$outboundSchema.parse(linkedWorktag)); } export function linkedWorktagFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LinkedWorktag$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LinkedWorktag' from JSON`, ); }