/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; 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 CollectionTag = { /** * A unique identifier for an object. */ id: string | null; /** * The name of the tag. */ name?: string | null | undefined; /** * When custom mappings are configured on the resource, the result is included here. */ customMappings?: { [k: string]: any } | null | undefined; }; /** @internal */ export const CollectionTag$inboundSchema: z.ZodType< CollectionTag, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ id: types.nullable(types.string()), name: z.nullable(types.string()).optional(), custom_mappings: z.nullable(z.record(z.any())).optional(), }).transform((v) => { return remap$(v, { "custom_mappings": "customMappings", }); }) ); export function collectionTagFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CollectionTag$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CollectionTag' from JSON`, ); }