/* * 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 { CreditGrantResponse, CreditGrantResponse$inboundSchema, } from "./credit-grant-response.js"; import { EntitlementResponse, EntitlementResponse$inboundSchema, } from "./entitlement-response.js"; import { PriceResponse, PriceResponse$inboundSchema, } from "./price-response.js"; import { SDKValidationError } from "./sdk-validation-error.js"; import { Status, Status$inboundSchema } from "./status.js"; export type AddonResponse = { createdAt?: Date | undefined; createdBy?: string | undefined; creditGrants?: Array | undefined; description?: string | undefined; entitlements?: Array | undefined; environmentId?: string | undefined; id?: string | undefined; lookupKey?: string | undefined; metadata?: { [k: string]: any } | undefined; name?: string | undefined; /** * Optional expanded fields */ prices?: Array | undefined; status?: Status | undefined; tenantId?: string | undefined; updatedAt?: Date | undefined; updatedBy?: string | undefined; }; /** @internal */ export const AddonResponse$inboundSchema: z.ZodMiniType< AddonResponse, unknown > = z.pipe( z.object({ created_at: types.optional(types.date()), created_by: types.optional(types.string()), credit_grants: types.optional(z.array(CreditGrantResponse$inboundSchema)), description: types.optional(types.string()), entitlements: types.optional( z.array(z.lazy(() => EntitlementResponse$inboundSchema)), ), environment_id: types.optional(types.string()), id: types.optional(types.string()), lookup_key: types.optional(types.string()), metadata: types.optional(z.record(z.string(), z.any())), name: types.optional(types.string()), prices: types.optional(z.array(z.lazy(() => PriceResponse$inboundSchema))), 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", "credit_grants": "creditGrants", "environment_id": "environmentId", "lookup_key": "lookupKey", "tenant_id": "tenantId", "updated_at": "updatedAt", "updated_by": "updatedBy", }); }), ); export function addonResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AddonResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AddonResponse' from JSON`, ); }