/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { ProductFeatureType, ProductFeatureType$inboundSchema, ProductFeatureType$outboundSchema, } from "./productfeaturetype.js"; export type FeatureEntity = { /** * Unique identifier for the feature. */ id: string; /** * The type of the feature: privateNote (custom note), file (downloadable files), or licenseKey (license key). */ type: ProductFeatureType; /** * A brief description of the feature. */ description: string; }; /** @internal */ export const FeatureEntity$inboundSchema: z.ZodType< FeatureEntity, z.ZodTypeDef, unknown > = z.object({ id: z.string(), type: ProductFeatureType$inboundSchema, description: z.string(), }); /** @internal */ export type FeatureEntity$Outbound = { id: string; type: string; description: string; }; /** @internal */ export const FeatureEntity$outboundSchema: z.ZodType< FeatureEntity$Outbound, z.ZodTypeDef, FeatureEntity > = z.object({ id: z.string(), type: ProductFeatureType$outboundSchema, description: z.string(), }); export function featureEntityToJSON(featureEntity: FeatureEntity): string { return JSON.stringify(FeatureEntity$outboundSchema.parse(featureEntity)); } export function featureEntityFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FeatureEntity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FeatureEntity' from JSON`, ); }