/* * 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 { SDKValidationError } from "./sdk-validation-error.js"; import { Status, Status$inboundSchema } from "./status.js"; export type Plan = { createdAt?: Date | undefined; createdBy?: string | undefined; description?: string | undefined; displayOrder?: number | undefined; environmentId?: string | undefined; id?: string | undefined; lookupKey?: string | undefined; metadata?: { [k: string]: string } | undefined; name?: string | undefined; status?: Status | undefined; tenantId?: string | undefined; updatedAt?: Date | undefined; updatedBy?: string | undefined; }; /** @internal */ export const Plan$inboundSchema: z.ZodMiniType = z.pipe( z.object({ created_at: types.optional(types.date()), created_by: types.optional(types.string()), description: types.optional(types.string()), display_order: types.optional(types.number()), environment_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())), name: types.optional(types.string()), status: types.optional(Status$inboundSchema), tenant_id: types.optional(types.string()), updated_at: types.optional(types.date()), updated_by: types.optional(types.string()), }), z.transform((v) => { return remap$(v, { "created_at": "createdAt", "created_by": "createdBy", "display_order": "displayOrder", "environment_id": "environmentId", "lookup_key": "lookupKey", "tenant_id": "tenantId", "updated_at": "updatedAt", "updated_by": "updatedBy", }); }), ); export function planFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Plan$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Plan' from JSON`, ); }