/* * 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 { AlertSettings, AlertSettings$inboundSchema, } from "./alert-settings.js"; import { FeatureType, FeatureType$inboundSchema } from "./feature-type.js"; import { GroupGroup, GroupGroup$inboundSchema } from "./group-group.js"; import { ReportingUnit, ReportingUnit$inboundSchema, } from "./reporting-unit.js"; import { SDKValidationError } from "./sdk-validation-error.js"; import { Status, Status$inboundSchema } from "./status.js"; export type Feature = { alertSettings?: AlertSettings | undefined; createdAt?: Date | undefined; createdBy?: string | undefined; description?: string | undefined; environmentId?: string | undefined; group?: GroupGroup | undefined; groupId?: string | undefined; id?: string | undefined; lookupKey?: string | undefined; metadata?: { [k: string]: string } | undefined; meterId?: string | undefined; name?: string | undefined; reportingUnit?: ReportingUnit | undefined; status?: Status | undefined; tenantId?: string | undefined; type?: FeatureType | undefined; unitPlural?: string | undefined; unitSingular?: string | undefined; updatedAt?: Date | undefined; updatedBy?: string | undefined; }; /** @internal */ export const Feature$inboundSchema: z.ZodMiniType = z.pipe( z.object({ alert_settings: types.optional(AlertSettings$inboundSchema), created_at: types.optional(types.date()), created_by: types.optional(types.string()), description: types.optional(types.string()), environment_id: types.optional(types.string()), group: types.optional(GroupGroup$inboundSchema), 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()), reporting_unit: types.optional(ReportingUnit$inboundSchema), status: types.optional(Status$inboundSchema), tenant_id: types.optional(types.string()), type: types.optional(FeatureType$inboundSchema), unit_plural: types.optional(types.string()), unit_singular: types.optional(types.string()), updated_at: types.optional(types.date()), updated_by: types.optional(types.string()), }), z.transform((v) => { return remap$(v, { "alert_settings": "alertSettings", "created_at": "createdAt", "created_by": "createdBy", "environment_id": "environmentId", "group_id": "groupId", "lookup_key": "lookupKey", "meter_id": "meterId", "reporting_unit": "reportingUnit", "tenant_id": "tenantId", "unit_plural": "unitPlural", "unit_singular": "unitSingular", "updated_at": "updatedAt", "updated_by": "updatedBy", }); }), ); export function featureFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Feature$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Feature' from JSON`, ); }