"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.MetadataRuleUpdate$ = exports.MetadataRuleUpdate$outboundSchema = exports.MetadataRuleUpdate$inboundSchema = exports.MetadataRuleUpdateState$ = exports.MetadataRuleUpdateState$outboundSchema = exports.MetadataRuleUpdateState$inboundSchema = exports.MetadataRuleUpdateResult$ = exports.MetadataRuleUpdateResult$outboundSchema = exports.MetadataRuleUpdateResult$inboundSchema = exports.MetadataRuleUpdateCondition$ = exports.MetadataRuleUpdateCondition$outboundSchema = exports.MetadataRuleUpdateCondition$inboundSchema = exports.MetadataRuleUpdateState = void 0;
exports.metadataRuleUpdateConditionToJSON = metadataRuleUpdateConditionToJSON;
exports.metadataRuleUpdateConditionFromJSON = metadataRuleUpdateConditionFromJSON;
exports.metadataRuleUpdateResultToJSON = metadataRuleUpdateResultToJSON;
exports.metadataRuleUpdateResultFromJSON = metadataRuleUpdateResultFromJSON;
exports.metadataRuleUpdateToJSON = metadataRuleUpdateToJSON;
exports.metadataRuleUpdateFromJSON = metadataRuleUpdateFromJSON;
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.MetadataRuleUpdateState = {
    Active: "active",
    Inactive: "inactive",
};
/** @internal */
exports.MetadataRuleUpdateCondition$inboundSchema = z.object({});
/** @internal */
exports.MetadataRuleUpdateCondition$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 MetadataRuleUpdateCondition$;
(function (MetadataRuleUpdateCondition$) {
    /** @deprecated use `MetadataRuleUpdateCondition$inboundSchema` instead. */
    MetadataRuleUpdateCondition$.inboundSchema = exports.MetadataRuleUpdateCondition$inboundSchema;
    /** @deprecated use `MetadataRuleUpdateCondition$outboundSchema` instead. */
    MetadataRuleUpdateCondition$.outboundSchema = exports.MetadataRuleUpdateCondition$outboundSchema;
})(MetadataRuleUpdateCondition$ || (exports.MetadataRuleUpdateCondition$ = MetadataRuleUpdateCondition$ = {}));
function metadataRuleUpdateConditionToJSON(metadataRuleUpdateCondition) {
    return JSON.stringify(exports.MetadataRuleUpdateCondition$outboundSchema.parse(metadataRuleUpdateCondition));
}
function metadataRuleUpdateConditionFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MetadataRuleUpdateCondition$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MetadataRuleUpdateCondition' from JSON`);
}
/** @internal */
exports.MetadataRuleUpdateResult$inboundSchema = z.object({});
/** @internal */
exports.MetadataRuleUpdateResult$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 MetadataRuleUpdateResult$;
(function (MetadataRuleUpdateResult$) {
    /** @deprecated use `MetadataRuleUpdateResult$inboundSchema` instead. */
    MetadataRuleUpdateResult$.inboundSchema = exports.MetadataRuleUpdateResult$inboundSchema;
    /** @deprecated use `MetadataRuleUpdateResult$outboundSchema` instead. */
    MetadataRuleUpdateResult$.outboundSchema = exports.MetadataRuleUpdateResult$outboundSchema;
})(MetadataRuleUpdateResult$ || (exports.MetadataRuleUpdateResult$ = MetadataRuleUpdateResult$ = {}));
function metadataRuleUpdateResultToJSON(metadataRuleUpdateResult) {
    return JSON.stringify(exports.MetadataRuleUpdateResult$outboundSchema.parse(metadataRuleUpdateResult));
}
function metadataRuleUpdateResultFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MetadataRuleUpdateResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MetadataRuleUpdateResult' from JSON`);
}
/** @internal */
exports.MetadataRuleUpdateState$inboundSchema = z.nativeEnum(exports.MetadataRuleUpdateState);
/** @internal */
exports.MetadataRuleUpdateState$outboundSchema = exports.MetadataRuleUpdateState$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var MetadataRuleUpdateState$;
(function (MetadataRuleUpdateState$) {
    /** @deprecated use `MetadataRuleUpdateState$inboundSchema` instead. */
    MetadataRuleUpdateState$.inboundSchema = exports.MetadataRuleUpdateState$inboundSchema;
    /** @deprecated use `MetadataRuleUpdateState$outboundSchema` instead. */
    MetadataRuleUpdateState$.outboundSchema = exports.MetadataRuleUpdateState$outboundSchema;
})(MetadataRuleUpdateState$ || (exports.MetadataRuleUpdateState$ = MetadataRuleUpdateState$ = {}));
/** @internal */
exports.MetadataRuleUpdate$inboundSchema = z.object({
    metadata_field_id: z.string().optional(),
    name: z.string().optional(),
    condition: z.lazy(() => exports.MetadataRuleUpdateCondition$inboundSchema).optional(),
    result: z.lazy(() => exports.MetadataRuleUpdateResult$inboundSchema).optional(),
    state: exports.MetadataRuleUpdateState$inboundSchema.optional(),
    position: z.number().int().optional(),
    external_id: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "metadata_field_id": "metadataFieldId",
        "external_id": "externalId",
    });
});
/** @internal */
exports.MetadataRuleUpdate$outboundSchema = z.object({
    metadataFieldId: z.string().optional(),
    name: z.string().optional(),
    condition: z.lazy(() => exports.MetadataRuleUpdateCondition$outboundSchema)
        .optional(),
    result: z.lazy(() => exports.MetadataRuleUpdateResult$outboundSchema).optional(),
    state: exports.MetadataRuleUpdateState$outboundSchema.optional(),
    position: z.number().int().optional(),
    externalId: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        metadataFieldId: "metadata_field_id",
        externalId: "external_id",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var MetadataRuleUpdate$;
(function (MetadataRuleUpdate$) {
    /** @deprecated use `MetadataRuleUpdate$inboundSchema` instead. */
    MetadataRuleUpdate$.inboundSchema = exports.MetadataRuleUpdate$inboundSchema;
    /** @deprecated use `MetadataRuleUpdate$outboundSchema` instead. */
    MetadataRuleUpdate$.outboundSchema = exports.MetadataRuleUpdate$outboundSchema;
})(MetadataRuleUpdate$ || (exports.MetadataRuleUpdate$ = MetadataRuleUpdate$ = {}));
function metadataRuleUpdateToJSON(metadataRuleUpdate) {
    return JSON.stringify(exports.MetadataRuleUpdate$outboundSchema.parse(metadataRuleUpdate));
}
function metadataRuleUpdateFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MetadataRuleUpdate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MetadataRuleUpdate' from JSON`);
}
//# sourceMappingURL=metadataruleupdate.js.map