/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
export const CategoryStatus = {
    Active: "active",
    Tobedeleted: "tobedeleted",
};
/** @internal */
export const CategoryStatus$inboundSchema = z.nativeEnum(CategoryStatus);
/** @internal */
export const CategoryStatus$outboundSchema = CategoryStatus$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var CategoryStatus$;
(function (CategoryStatus$) {
    /** @deprecated use `CategoryStatus$inboundSchema` instead. */
    CategoryStatus$.inboundSchema = CategoryStatus$inboundSchema;
    /** @deprecated use `CategoryStatus$outboundSchema` instead. */
    CategoryStatus$.outboundSchema = CategoryStatus$outboundSchema;
})(CategoryStatus$ || (CategoryStatus$ = {}));
/** @internal */
export const Category$inboundSchema = z.object({
    sourcedId: z.string().optional(),
    status: CategoryStatus$inboundSchema,
    dateLastModified: z.string().datetime({ offset: true }).transform(v => new Date(v)).optional(),
    metadata: z.nullable(z.record(z.any())).optional(),
    title: z.string(),
    weight: z.nullable(z.number()).optional(),
});
/** @internal */
export const Category$outboundSchema = z.object({
    sourcedId: z.string().optional(),
    status: CategoryStatus$outboundSchema,
    dateLastModified: z.date().transform(v => v.toISOString()).optional(),
    metadata: z.nullable(z.record(z.any())).optional(),
    title: z.string(),
    weight: z.nullable(z.number()).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Category$;
(function (Category$) {
    /** @deprecated use `Category$inboundSchema` instead. */
    Category$.inboundSchema = Category$inboundSchema;
    /** @deprecated use `Category$outboundSchema` instead. */
    Category$.outboundSchema = Category$outboundSchema;
})(Category$ || (Category$ = {}));
export function categoryToJSON(category) {
    return JSON.stringify(Category$outboundSchema.parse(category));
}
export function categoryFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Category$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Category' from JSON`);
}
//# sourceMappingURL=category.js.map