"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.MetadataRuleCreate$ = exports.MetadataRuleCreate$outboundSchema = exports.MetadataRuleCreate$inboundSchema = exports.MetadataRuleCreateState$ = exports.MetadataRuleCreateState$outboundSchema = exports.MetadataRuleCreateState$inboundSchema = exports.MetadataRuleCreateResult$ = exports.MetadataRuleCreateResult$outboundSchema = exports.MetadataRuleCreateResult$inboundSchema = exports.MetadataRuleCreateCondition$ = exports.MetadataRuleCreateCondition$outboundSchema = exports.MetadataRuleCreateCondition$inboundSchema = exports.MetadataRuleCreateState = void 0;
exports.metadataRuleCreateConditionToJSON = metadataRuleCreateConditionToJSON;
exports.metadataRuleCreateConditionFromJSON = metadataRuleCreateConditionFromJSON;
exports.metadataRuleCreateResultToJSON = metadataRuleCreateResultToJSON;
exports.metadataRuleCreateResultFromJSON = metadataRuleCreateResultFromJSON;
exports.metadataRuleCreateToJSON = metadataRuleCreateToJSON;
exports.metadataRuleCreateFromJSON = metadataRuleCreateFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
/**
 * The state of the rule.
 */
exports.MetadataRuleCreateState = {
    Active: "active",
    Inactive: "inactive",
};
/** @internal */
exports.MetadataRuleCreateCondition$inboundSchema = z.object({});
/** @internal */
exports.MetadataRuleCreateCondition$outboundSchema = z.object({});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var MetadataRuleCreateCondition$;
(function (MetadataRuleCreateCondition$) {
    /** @deprecated use `MetadataRuleCreateCondition$inboundSchema` instead. */
    MetadataRuleCreateCondition$.inboundSchema = exports.MetadataRuleCreateCondition$inboundSchema;
    /** @deprecated use `MetadataRuleCreateCondition$outboundSchema` instead. */
    MetadataRuleCreateCondition$.outboundSchema = exports.MetadataRuleCreateCondition$outboundSchema;
})(MetadataRuleCreateCondition$ || (exports.MetadataRuleCreateCondition$ = MetadataRuleCreateCondition$ = {}));
function metadataRuleCreateConditionToJSON(metadataRuleCreateCondition) {
    return JSON.stringify(exports.MetadataRuleCreateCondition$outboundSchema.parse(metadataRuleCreateCondition));
}
function metadataRuleCreateConditionFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MetadataRuleCreateCondition$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MetadataRuleCreateCondition' from JSON`);
}
/** @internal */
exports.MetadataRuleCreateResult$inboundSchema = z.object({});
/** @internal */
exports.MetadataRuleCreateResult$outboundSchema = z.object({});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var MetadataRuleCreateResult$;
(function (MetadataRuleCreateResult$) {
    /** @deprecated use `MetadataRuleCreateResult$inboundSchema` instead. */
    MetadataRuleCreateResult$.inboundSchema = exports.MetadataRuleCreateResult$inboundSchema;
    /** @deprecated use `MetadataRuleCreateResult$outboundSchema` instead. */
    MetadataRuleCreateResult$.outboundSchema = exports.MetadataRuleCreateResult$outboundSchema;
})(MetadataRuleCreateResult$ || (exports.MetadataRuleCreateResult$ = MetadataRuleCreateResult$ = {}));
function metadataRuleCreateResultToJSON(metadataRuleCreateResult) {
    return JSON.stringify(exports.MetadataRuleCreateResult$outboundSchema.parse(metadataRuleCreateResult));
}
function metadataRuleCreateResultFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MetadataRuleCreateResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MetadataRuleCreateResult' from JSON`);
}
/** @internal */
exports.MetadataRuleCreateState$inboundSchema = z.nativeEnum(exports.MetadataRuleCreateState);
/** @internal */
exports.MetadataRuleCreateState$outboundSchema = exports.MetadataRuleCreateState$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var MetadataRuleCreateState$;
(function (MetadataRuleCreateState$) {
    /** @deprecated use `MetadataRuleCreateState$inboundSchema` instead. */
    MetadataRuleCreateState$.inboundSchema = exports.MetadataRuleCreateState$inboundSchema;
    /** @deprecated use `MetadataRuleCreateState$outboundSchema` instead. */
    MetadataRuleCreateState$.outboundSchema = exports.MetadataRuleCreateState$outboundSchema;
})(MetadataRuleCreateState$ || (exports.MetadataRuleCreateState$ = MetadataRuleCreateState$ = {}));
/** @internal */
exports.MetadataRuleCreate$inboundSchema = z.object({
    metadata_field_id: z.string(),
    name: z.string(),
    condition: z.lazy(() => exports.MetadataRuleCreateCondition$inboundSchema),
    result: z.lazy(() => exports.MetadataRuleCreateResult$inboundSchema),
    state: exports.MetadataRuleCreateState$inboundSchema.optional(),
    position: z.number().int().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "metadata_field_id": "metadataFieldId",
    });
});
/** @internal */
exports.MetadataRuleCreate$outboundSchema = z.object({
    metadataFieldId: z.string(),
    name: z.string(),
    condition: z.lazy(() => exports.MetadataRuleCreateCondition$outboundSchema),
    result: z.lazy(() => exports.MetadataRuleCreateResult$outboundSchema),
    state: exports.MetadataRuleCreateState$outboundSchema.optional(),
    position: z.number().int().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        metadataFieldId: "metadata_field_id",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var MetadataRuleCreate$;
(function (MetadataRuleCreate$) {
    /** @deprecated use `MetadataRuleCreate$inboundSchema` instead. */
    MetadataRuleCreate$.inboundSchema = exports.MetadataRuleCreate$inboundSchema;
    /** @deprecated use `MetadataRuleCreate$outboundSchema` instead. */
    MetadataRuleCreate$.outboundSchema = exports.MetadataRuleCreate$outboundSchema;
})(MetadataRuleCreate$ || (exports.MetadataRuleCreate$ = MetadataRuleCreate$ = {}));
function metadataRuleCreateToJSON(metadataRuleCreate) {
    return JSON.stringify(exports.MetadataRuleCreate$outboundSchema.parse(metadataRuleCreate));
}
function metadataRuleCreateFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MetadataRuleCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MetadataRuleCreate' from JSON`);
}
//# sourceMappingURL=metadatarulecreate.js.map