/* * 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 CreatePriceUnitResponse = { baseCurrency?: string | undefined; code?: string | undefined; conversionRate?: string | undefined; createdAt?: Date | undefined; createdBy?: string | undefined; environmentId?: string | undefined; id?: string | undefined; metadata?: { [k: string]: string } | undefined; name?: string | undefined; status?: Status | undefined; symbol?: string | undefined; tenantId?: string | undefined; updatedAt?: Date | undefined; updatedBy?: string | undefined; }; /** @internal */ export const CreatePriceUnitResponse$inboundSchema: z.ZodMiniType< CreatePriceUnitResponse, unknown > = z.pipe( z.object({ base_currency: types.optional(types.string()), code: types.optional(types.string()), conversion_rate: types.optional(types.string()), created_at: types.optional(types.date()), created_by: types.optional(types.string()), environment_id: types.optional(types.string()), id: types.optional(types.string()), metadata: types.optional(z.record(z.string(), types.string())), name: types.optional(types.string()), status: types.optional(Status$inboundSchema), symbol: types.optional(types.string()), tenant_id: types.optional(types.string()), updated_at: types.optional(types.date()), updated_by: types.optional(types.string()), }), z.transform((v) => { return remap$(v, { "base_currency": "baseCurrency", "conversion_rate": "conversionRate", "created_at": "createdAt", "created_by": "createdBy", "environment_id": "environmentId", "tenant_id": "tenantId", "updated_at": "updatedAt", "updated_by": "updatedBy", }); }), ); export function createPriceUnitResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreatePriceUnitResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreatePriceUnitResponse' from JSON`, ); }