"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.UpdateMetadataFieldDatasourceResponse$ = exports.UpdateMetadataFieldDatasourceResponse$outboundSchema = exports.UpdateMetadataFieldDatasourceResponse$inboundSchema = exports.UpdateMetadataFieldDatasourceRequest$ = exports.UpdateMetadataFieldDatasourceRequest$outboundSchema = exports.UpdateMetadataFieldDatasourceRequest$inboundSchema = exports.UpdateMetadataFieldDatasourceRequestBody$ = exports.UpdateMetadataFieldDatasourceRequestBody$outboundSchema = exports.UpdateMetadataFieldDatasourceRequestBody$inboundSchema = exports.Value$ = exports.Value$outboundSchema = exports.Value$inboundSchema = exports.State$ = exports.State$outboundSchema = exports.State$inboundSchema = exports.UpdateMetadataFieldDatasourceGlobals$ = exports.UpdateMetadataFieldDatasourceGlobals$outboundSchema = exports.UpdateMetadataFieldDatasourceGlobals$inboundSchema = exports.State = void 0;
exports.updateMetadataFieldDatasourceGlobalsToJSON = updateMetadataFieldDatasourceGlobalsToJSON;
exports.updateMetadataFieldDatasourceGlobalsFromJSON = updateMetadataFieldDatasourceGlobalsFromJSON;
exports.valueToJSON = valueToJSON;
exports.valueFromJSON = valueFromJSON;
exports.updateMetadataFieldDatasourceRequestBodyToJSON = updateMetadataFieldDatasourceRequestBodyToJSON;
exports.updateMetadataFieldDatasourceRequestBodyFromJSON = updateMetadataFieldDatasourceRequestBodyFromJSON;
exports.updateMetadataFieldDatasourceRequestToJSON = updateMetadataFieldDatasourceRequestToJSON;
exports.updateMetadataFieldDatasourceRequestFromJSON = updateMetadataFieldDatasourceRequestFromJSON;
exports.updateMetadataFieldDatasourceResponseToJSON = updateMetadataFieldDatasourceResponseToJSON;
exports.updateMetadataFieldDatasourceResponseFromJSON = updateMetadataFieldDatasourceResponseFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
const components = __importStar(require("../components/index.js"));
/**
 * The state of the option.
 */
exports.State = {
    Active: "active",
    Inactive: "inactive",
};
/** @internal */
exports.UpdateMetadataFieldDatasourceGlobals$inboundSchema = z.object({
    cloud_name: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "cloud_name": "cloudName",
    });
});
/** @internal */
exports.UpdateMetadataFieldDatasourceGlobals$outboundSchema = z.object({
    cloudName: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        cloudName: "cloud_name",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var UpdateMetadataFieldDatasourceGlobals$;
(function (UpdateMetadataFieldDatasourceGlobals$) {
    /** @deprecated use `UpdateMetadataFieldDatasourceGlobals$inboundSchema` instead. */
    UpdateMetadataFieldDatasourceGlobals$.inboundSchema = exports.UpdateMetadataFieldDatasourceGlobals$inboundSchema;
    /** @deprecated use `UpdateMetadataFieldDatasourceGlobals$outboundSchema` instead. */
    UpdateMetadataFieldDatasourceGlobals$.outboundSchema = exports.UpdateMetadataFieldDatasourceGlobals$outboundSchema;
})(UpdateMetadataFieldDatasourceGlobals$ || (exports.UpdateMetadataFieldDatasourceGlobals$ = UpdateMetadataFieldDatasourceGlobals$ = {}));
function updateMetadataFieldDatasourceGlobalsToJSON(updateMetadataFieldDatasourceGlobals) {
    return JSON.stringify(exports.UpdateMetadataFieldDatasourceGlobals$outboundSchema.parse(updateMetadataFieldDatasourceGlobals));
}
function updateMetadataFieldDatasourceGlobalsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateMetadataFieldDatasourceGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateMetadataFieldDatasourceGlobals' from JSON`);
}
/** @internal */
exports.State$inboundSchema = z.nativeEnum(exports.State);
/** @internal */
exports.State$outboundSchema = exports.State$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var State$;
(function (State$) {
    /** @deprecated use `State$inboundSchema` instead. */
    State$.inboundSchema = exports.State$inboundSchema;
    /** @deprecated use `State$outboundSchema` instead. */
    State$.outboundSchema = exports.State$outboundSchema;
})(State$ || (exports.State$ = State$ = {}));
/** @internal */
exports.Value$inboundSchema = z
    .object({
    external_id: z.string().optional(),
    value: z.string().optional(),
    position: z.number().int().optional(),
    state: exports.State$inboundSchema.optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "external_id": "externalId",
    });
});
/** @internal */
exports.Value$outboundSchema = z.object({
    externalId: z.string().optional(),
    value: z.string().optional(),
    position: z.number().int().optional(),
    state: exports.State$outboundSchema.optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        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 Value$;
(function (Value$) {
    /** @deprecated use `Value$inboundSchema` instead. */
    Value$.inboundSchema = exports.Value$inboundSchema;
    /** @deprecated use `Value$outboundSchema` instead. */
    Value$.outboundSchema = exports.Value$outboundSchema;
})(Value$ || (exports.Value$ = Value$ = {}));
function valueToJSON(value) {
    return JSON.stringify(exports.Value$outboundSchema.parse(value));
}
function valueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Value$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Value' from JSON`);
}
/** @internal */
exports.UpdateMetadataFieldDatasourceRequestBody$inboundSchema = z.object({
    values: z.array(z.lazy(() => exports.Value$inboundSchema)).optional(),
});
/** @internal */
exports.UpdateMetadataFieldDatasourceRequestBody$outboundSchema = z.object({
    values: z.array(z.lazy(() => exports.Value$outboundSchema)).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var UpdateMetadataFieldDatasourceRequestBody$;
(function (UpdateMetadataFieldDatasourceRequestBody$) {
    /** @deprecated use `UpdateMetadataFieldDatasourceRequestBody$inboundSchema` instead. */
    UpdateMetadataFieldDatasourceRequestBody$.inboundSchema = exports.UpdateMetadataFieldDatasourceRequestBody$inboundSchema;
    /** @deprecated use `UpdateMetadataFieldDatasourceRequestBody$outboundSchema` instead. */
    UpdateMetadataFieldDatasourceRequestBody$.outboundSchema = exports.UpdateMetadataFieldDatasourceRequestBody$outboundSchema;
})(UpdateMetadataFieldDatasourceRequestBody$ || (exports.UpdateMetadataFieldDatasourceRequestBody$ = UpdateMetadataFieldDatasourceRequestBody$ = {}));
function updateMetadataFieldDatasourceRequestBodyToJSON(updateMetadataFieldDatasourceRequestBody) {
    return JSON.stringify(exports.UpdateMetadataFieldDatasourceRequestBody$outboundSchema.parse(updateMetadataFieldDatasourceRequestBody));
}
function updateMetadataFieldDatasourceRequestBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateMetadataFieldDatasourceRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateMetadataFieldDatasourceRequestBody' from JSON`);
}
/** @internal */
exports.UpdateMetadataFieldDatasourceRequest$inboundSchema = z.object({
    external_id: z.string(),
    RequestBody: z.lazy(() => exports.UpdateMetadataFieldDatasourceRequestBody$inboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "external_id": "externalId",
        "RequestBody": "requestBody",
    });
});
/** @internal */
exports.UpdateMetadataFieldDatasourceRequest$outboundSchema = z.object({
    externalId: z.string(),
    requestBody: z.lazy(() => exports.UpdateMetadataFieldDatasourceRequestBody$outboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        externalId: "external_id",
        requestBody: "RequestBody",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var UpdateMetadataFieldDatasourceRequest$;
(function (UpdateMetadataFieldDatasourceRequest$) {
    /** @deprecated use `UpdateMetadataFieldDatasourceRequest$inboundSchema` instead. */
    UpdateMetadataFieldDatasourceRequest$.inboundSchema = exports.UpdateMetadataFieldDatasourceRequest$inboundSchema;
    /** @deprecated use `UpdateMetadataFieldDatasourceRequest$outboundSchema` instead. */
    UpdateMetadataFieldDatasourceRequest$.outboundSchema = exports.UpdateMetadataFieldDatasourceRequest$outboundSchema;
})(UpdateMetadataFieldDatasourceRequest$ || (exports.UpdateMetadataFieldDatasourceRequest$ = UpdateMetadataFieldDatasourceRequest$ = {}));
function updateMetadataFieldDatasourceRequestToJSON(updateMetadataFieldDatasourceRequest) {
    return JSON.stringify(exports.UpdateMetadataFieldDatasourceRequest$outboundSchema.parse(updateMetadataFieldDatasourceRequest));
}
function updateMetadataFieldDatasourceRequestFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateMetadataFieldDatasourceRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateMetadataFieldDatasourceRequest' from JSON`);
}
/** @internal */
exports.UpdateMetadataFieldDatasourceResponse$inboundSchema = z.object({
    values: z.array(components.MetadataFieldDatasourceValue$inboundSchema)
        .optional(),
});
/** @internal */
exports.UpdateMetadataFieldDatasourceResponse$outboundSchema = z.object({
    values: z.array(components.MetadataFieldDatasourceValue$outboundSchema)
        .optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var UpdateMetadataFieldDatasourceResponse$;
(function (UpdateMetadataFieldDatasourceResponse$) {
    /** @deprecated use `UpdateMetadataFieldDatasourceResponse$inboundSchema` instead. */
    UpdateMetadataFieldDatasourceResponse$.inboundSchema = exports.UpdateMetadataFieldDatasourceResponse$inboundSchema;
    /** @deprecated use `UpdateMetadataFieldDatasourceResponse$outboundSchema` instead. */
    UpdateMetadataFieldDatasourceResponse$.outboundSchema = exports.UpdateMetadataFieldDatasourceResponse$outboundSchema;
})(UpdateMetadataFieldDatasourceResponse$ || (exports.UpdateMetadataFieldDatasourceResponse$ = UpdateMetadataFieldDatasourceResponse$ = {}));
function updateMetadataFieldDatasourceResponseToJSON(updateMetadataFieldDatasourceResponse) {
    return JSON.stringify(exports.UpdateMetadataFieldDatasourceResponse$outboundSchema.parse(updateMetadataFieldDatasourceResponse));
}
function updateMetadataFieldDatasourceResponseFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateMetadataFieldDatasourceResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateMetadataFieldDatasourceResponse' from JSON`);
}
//# sourceMappingURL=updatemetadatafielddatasource.js.map