/* * 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 { AlertSettings, AlertSettings$Outbound, AlertSettings$outboundSchema, } from "./alert-settings.js"; import { CreateMeterRequest, CreateMeterRequest$Outbound, CreateMeterRequest$outboundSchema, } from "./create-meter-request.js"; import { FeatureType, FeatureType$outboundSchema } from "./feature-type.js"; import { ReportingUnit, ReportingUnit$Outbound, ReportingUnit$outboundSchema, } from "./reporting-unit.js"; export type CreateFeatureRequest = { alertSettings?: AlertSettings | undefined; description?: string | undefined; /** * GroupID is the id of the group to add the feature to */ groupId?: string | undefined; lookupKey?: string | undefined; metadata?: { [k: string]: string } | undefined; meter?: CreateMeterRequest | undefined; meterId?: string | undefined; name: string; reportingUnit?: ReportingUnit | undefined; type: FeatureType; unitPlural?: string | undefined; unitSingular?: string | undefined; }; /** @internal */ export type CreateFeatureRequest$Outbound = { alert_settings?: AlertSettings$Outbound | undefined; description?: string | undefined; group_id?: string | undefined; lookup_key?: string | undefined; metadata?: { [k: string]: string } | undefined; meter?: CreateMeterRequest$Outbound | undefined; meter_id?: string | undefined; name: string; reporting_unit?: ReportingUnit$Outbound | undefined; type: string; unit_plural?: string | undefined; unit_singular?: string | undefined; }; /** @internal */ export const CreateFeatureRequest$outboundSchema: z.ZodMiniType< CreateFeatureRequest$Outbound, CreateFeatureRequest > = z.pipe( z.object({ alertSettings: z.optional(AlertSettings$outboundSchema), description: z.optional(z.string()), groupId: z.optional(z.string()), lookupKey: z.optional(z.string()), metadata: z.optional(z.record(z.string(), z.string())), meter: z.optional(CreateMeterRequest$outboundSchema), meterId: z.optional(z.string()), name: z.string(), reportingUnit: z.optional(ReportingUnit$outboundSchema), type: FeatureType$outboundSchema, unitPlural: z.optional(z.string()), unitSingular: z.optional(z.string()), }), z.transform((v) => { return remap$(v, { alertSettings: "alert_settings", groupId: "group_id", lookupKey: "lookup_key", meterId: "meter_id", reportingUnit: "reporting_unit", unitPlural: "unit_plural", unitSingular: "unit_singular", }); }), ); export function createFeatureRequestToJSON( createFeatureRequest: CreateFeatureRequest, ): string { return JSON.stringify( CreateFeatureRequest$outboundSchema.parse(createFeatureRequest), ); }