/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { FeatureType, FeatureType$inboundSchema } from "./feature-type.js"; import { SDKValidationError } from "./sdk-validation-error.js"; export type WebhookDtoFeature = { description?: string | undefined; groupId?: string | undefined; id?: string | undefined; lookupKey?: string | undefined; metadata?: { [k: string]: string } | undefined; meterId?: string | undefined; name?: string | undefined; type?: FeatureType | undefined; unitPlural?: string | undefined; unitSingular?: string | undefined; }; /** @internal */ export const WebhookDtoFeature$inboundSchema: z.ZodMiniType< WebhookDtoFeature, unknown > = z.pipe( z.object({ description: types.optional(types.string()), group_id: types.optional(types.string()), id: types.optional(types.string()), lookup_key: types.optional(types.string()), metadata: types.optional(z.record(z.string(), types.string())), meter_id: types.optional(types.string()), name: types.optional(types.string()), type: types.optional(FeatureType$inboundSchema), unit_plural: types.optional(types.string()), unit_singular: types.optional(types.string()), }), z.transform((v) => { return remap$(v, { "group_id": "groupId", "lookup_key": "lookupKey", "meter_id": "meterId", "unit_plural": "unitPlural", "unit_singular": "unitSingular", }); }), ); export function webhookDtoFeatureFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookDtoFeature$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookDtoFeature' from JSON`, ); }