"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.EcommerceProduct$inboundSchema = exports.EcommerceProductCategories$inboundSchema = exports.Variants$inboundSchema = exports.EcommerceProductImages$inboundSchema = exports.EcommerceProductVariantsOptions$inboundSchema = exports.EcommerceProductOptions$inboundSchema = exports.Images$inboundSchema = exports.ProductStatus$inboundSchema = exports.ProductStatus = void 0;
exports.imagesFromJSON = imagesFromJSON;
exports.ecommerceProductOptionsFromJSON = ecommerceProductOptionsFromJSON;
exports.ecommerceProductVariantsOptionsFromJSON = ecommerceProductVariantsOptionsFromJSON;
exports.ecommerceProductImagesFromJSON = ecommerceProductImagesFromJSON;
exports.variantsFromJSON = variantsFromJSON;
exports.ecommerceProductCategoriesFromJSON = ecommerceProductCategoriesFromJSON;
exports.ecommerceProductFromJSON = ecommerceProductFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
/**
 * The current status of the product (active or archived).
 */
exports.ProductStatus = {
    Active: "active",
    Archived: "archived",
};
/** @internal */
exports.ProductStatus$inboundSchema = z.nativeEnum(exports.ProductStatus);
/** @internal */
exports.Images$inboundSchema = z
    .object({
    id: z.nullable(z.string()).optional(),
    url: z.nullable(z.string()).optional(),
});
function imagesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Images$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Images' from JSON`);
}
/** @internal */
exports.EcommerceProductOptions$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    values: z.array(z.nullable(z.string())).optional(),
});
function ecommerceProductOptionsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.EcommerceProductOptions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EcommerceProductOptions' from JSON`);
}
/** @internal */
exports.EcommerceProductVariantsOptions$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    value: z.nullable(z.string()).optional(),
});
function ecommerceProductVariantsOptionsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.EcommerceProductVariantsOptions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EcommerceProductVariantsOptions' from JSON`);
}
/** @internal */
exports.EcommerceProductImages$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    url: z.nullable(z.string()).optional(),
});
function ecommerceProductImagesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.EcommerceProductImages$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EcommerceProductImages' from JSON`);
}
/** @internal */
exports.Variants$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    price: z.nullable(z.string()).optional(),
    sku: z.nullable(z.string()).optional(),
    inventory_quantity: z.nullable(z.string()).optional(),
    weight: z.nullable(z.string()).optional(),
    weight_unit: z.nullable(z.string()).optional(),
    options: z.array(z.lazy(() => exports.EcommerceProductVariantsOptions$inboundSchema))
        .optional(),
    images: z.array(z.lazy(() => exports.EcommerceProductImages$inboundSchema))
        .optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "inventory_quantity": "inventoryQuantity",
        "weight_unit": "weightUnit",
    });
});
function variantsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Variants$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Variants' from JSON`);
}
/** @internal */
exports.EcommerceProductCategories$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
});
function ecommerceProductCategoriesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.EcommerceProductCategories$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EcommerceProductCategories' from JSON`);
}
/** @internal */
exports.EcommerceProduct$inboundSchema = z.object({
    id: z.string(),
    name: z.nullable(z.string()).optional(),
    description: z.nullable(z.string()).optional(),
    status: z.nullable(exports.ProductStatus$inboundSchema).optional(),
    price: z.nullable(z.string()).optional(),
    sku: z.nullable(z.string()).optional(),
    inventory_quantity: z.nullable(z.string()).optional(),
    images: z.nullable(z.array(z.lazy(() => exports.Images$inboundSchema))).optional(),
    weight: z.nullable(z.string()).optional(),
    weight_unit: z.nullable(z.string()).optional(),
    options: z.array(z.lazy(() => exports.EcommerceProductOptions$inboundSchema))
        .optional(),
    variants: z.array(z.lazy(() => exports.Variants$inboundSchema)).optional(),
    tags: z.array(z.nullable(z.string())).optional(),
    categories: z.array(z.lazy(() => exports.EcommerceProductCategories$inboundSchema))
        .optional(),
    custom_mappings: z.nullable(z.record(z.any())).optional(),
    created_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    updated_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "inventory_quantity": "inventoryQuantity",
        "weight_unit": "weightUnit",
        "custom_mappings": "customMappings",
        "created_at": "createdAt",
        "updated_at": "updatedAt",
    });
});
function ecommerceProductFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.EcommerceProduct$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EcommerceProduct' from JSON`);
}
//# sourceMappingURL=ecommerceproduct.js.map