"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.MetadataRuleResponse$ = exports.MetadataRuleResponse$outboundSchema = exports.MetadataRuleResponse$inboundSchema = exports.MetadataRuleResponseState$ = exports.MetadataRuleResponseState$outboundSchema = exports.MetadataRuleResponseState$inboundSchema = exports.MetadataRuleResponseResult$ = exports.MetadataRuleResponseResult$outboundSchema = exports.MetadataRuleResponseResult$inboundSchema = exports.MetadataRuleResponseCondition$ = exports.MetadataRuleResponseCondition$outboundSchema = exports.MetadataRuleResponseCondition$inboundSchema = exports.MetadataRuleResponseState = void 0;
exports.metadataRuleResponseConditionToJSON = metadataRuleResponseConditionToJSON;
exports.metadataRuleResponseConditionFromJSON = metadataRuleResponseConditionFromJSON;
exports.metadataRuleResponseResultToJSON = metadataRuleResponseResultToJSON;
exports.metadataRuleResponseResultFromJSON = metadataRuleResponseResultFromJSON;
exports.metadataRuleResponseToJSON = metadataRuleResponseToJSON;
exports.metadataRuleResponseFromJSON = metadataRuleResponseFromJSON;
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.MetadataRuleResponseState = {
    Active: "active",
    Inactive: "inactive",
};
/** @internal */
exports.MetadataRuleResponseCondition$inboundSchema = z.object({});
/** @internal */
exports.MetadataRuleResponseCondition$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 MetadataRuleResponseCondition$;
(function (MetadataRuleResponseCondition$) {
    /** @deprecated use `MetadataRuleResponseCondition$inboundSchema` instead. */
    MetadataRuleResponseCondition$.inboundSchema = exports.MetadataRuleResponseCondition$inboundSchema;
    /** @deprecated use `MetadataRuleResponseCondition$outboundSchema` instead. */
    MetadataRuleResponseCondition$.outboundSchema = exports.MetadataRuleResponseCondition$outboundSchema;
})(MetadataRuleResponseCondition$ || (exports.MetadataRuleResponseCondition$ = MetadataRuleResponseCondition$ = {}));
function metadataRuleResponseConditionToJSON(metadataRuleResponseCondition) {
    return JSON.stringify(exports.MetadataRuleResponseCondition$outboundSchema.parse(metadataRuleResponseCondition));
}
function metadataRuleResponseConditionFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MetadataRuleResponseCondition$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MetadataRuleResponseCondition' from JSON`);
}
/** @internal */
exports.MetadataRuleResponseResult$inboundSchema = z.object({});
/** @internal */
exports.MetadataRuleResponseResult$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 MetadataRuleResponseResult$;
(function (MetadataRuleResponseResult$) {
    /** @deprecated use `MetadataRuleResponseResult$inboundSchema` instead. */
    MetadataRuleResponseResult$.inboundSchema = exports.MetadataRuleResponseResult$inboundSchema;
    /** @deprecated use `MetadataRuleResponseResult$outboundSchema` instead. */
    MetadataRuleResponseResult$.outboundSchema = exports.MetadataRuleResponseResult$outboundSchema;
})(MetadataRuleResponseResult$ || (exports.MetadataRuleResponseResult$ = MetadataRuleResponseResult$ = {}));
function metadataRuleResponseResultToJSON(metadataRuleResponseResult) {
    return JSON.stringify(exports.MetadataRuleResponseResult$outboundSchema.parse(metadataRuleResponseResult));
}
function metadataRuleResponseResultFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MetadataRuleResponseResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MetadataRuleResponseResult' from JSON`);
}
/** @internal */
exports.MetadataRuleResponseState$inboundSchema = z.nativeEnum(exports.MetadataRuleResponseState);
/** @internal */
exports.MetadataRuleResponseState$outboundSchema = exports.MetadataRuleResponseState$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var MetadataRuleResponseState$;
(function (MetadataRuleResponseState$) {
    /** @deprecated use `MetadataRuleResponseState$inboundSchema` instead. */
    MetadataRuleResponseState$.inboundSchema = exports.MetadataRuleResponseState$inboundSchema;
    /** @deprecated use `MetadataRuleResponseState$outboundSchema` instead. */
    MetadataRuleResponseState$.outboundSchema = exports.MetadataRuleResponseState$outboundSchema;
})(MetadataRuleResponseState$ || (exports.MetadataRuleResponseState$ = MetadataRuleResponseState$ = {}));
/** @internal */
exports.MetadataRuleResponse$inboundSchema = z.object({
    metadata_field_id: z.string().optional(),
    name: z.string().optional(),
    condition: z.lazy(() => exports.MetadataRuleResponseCondition$inboundSchema)
        .optional(),
    result: z.lazy(() => exports.MetadataRuleResponseResult$inboundSchema).optional(),
    state: exports.MetadataRuleResponseState$inboundSchema.optional(),
    position: z.number().int().optional(),
    external_id: z.string().optional(),
    condition_signature: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "metadata_field_id": "metadataFieldId",
        "external_id": "externalId",
        "condition_signature": "conditionSignature",
    });
});
/** @internal */
exports.MetadataRuleResponse$outboundSchema = z.object({
    metadataFieldId: z.string().optional(),
    name: z.string().optional(),
    condition: z.lazy(() => exports.MetadataRuleResponseCondition$outboundSchema)
        .optional(),
    result: z.lazy(() => exports.MetadataRuleResponseResult$outboundSchema).optional(),
    state: exports.MetadataRuleResponseState$outboundSchema.optional(),
    position: z.number().int().optional(),
    externalId: z.string().optional(),
    conditionSignature: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        metadataFieldId: "metadata_field_id",
        externalId: "external_id",
        conditionSignature: "condition_signature",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var MetadataRuleResponse$;
(function (MetadataRuleResponse$) {
    /** @deprecated use `MetadataRuleResponse$inboundSchema` instead. */
    MetadataRuleResponse$.inboundSchema = exports.MetadataRuleResponse$inboundSchema;
    /** @deprecated use `MetadataRuleResponse$outboundSchema` instead. */
    MetadataRuleResponse$.outboundSchema = exports.MetadataRuleResponse$outboundSchema;
})(MetadataRuleResponse$ || (exports.MetadataRuleResponse$ = MetadataRuleResponse$ = {}));
function metadataRuleResponseToJSON(metadataRuleResponse) {
    return JSON.stringify(exports.MetadataRuleResponse$outboundSchema.parse(metadataRuleResponse));
}
function metadataRuleResponseFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MetadataRuleResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MetadataRuleResponse' from JSON`);
}
//# sourceMappingURL=metadataruleresponse.js.map