"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.IamRole$inboundSchema = exports.IamRoleType$inboundSchema = exports.IamRoleValue$inboundSchema = exports.IamRoleSourceValue$inboundSchema = exports.IamRole4$inboundSchema = exports.IamRoleValue = void 0;
exports.iamRole4FromJSON = iamRole4FromJSON;
exports.iamRoleSourceValueFromJSON = iamRoleSourceValueFromJSON;
exports.iamRoleTypeFromJSON = iamRoleTypeFromJSON;
exports.iamRoleFromJSON = iamRoleFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../../lib/primitives.js");
const schemas_js_1 = require("../../../lib/schemas.js");
const openEnums = __importStar(require("../../types/enums.js"));
const iampolicy_js_1 = require("./iampolicy.js");
var IamRoleValue;
(function (IamRoleValue) {
    IamRoleValue["Admin"] = "admin";
    IamRoleValue["Viewer"] = "viewer";
    IamRoleValue["Editor"] = "editor";
    IamRoleValue["Basic"] = "basic";
    IamRoleValue["Guest"] = "guest";
    IamRoleValue["Unassigned"] = "unassigned";
    IamRoleValue["Restricted"] = "restricted";
    IamRoleValue["UnmappedValue"] = "unmapped_value";
})(IamRoleValue || (exports.IamRoleValue = IamRoleValue = {}));
/** @internal */
exports.IamRole4$inboundSchema = z.object({});
function iamRole4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.IamRole4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IamRole4' from JSON`);
}
/** @internal */
exports.IamRoleSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.IamRole4$inboundSchema),
    z.array(z.any()),
]);
function iamRoleSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.IamRoleSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IamRoleSourceValue' from JSON`);
}
/** @internal */
exports.IamRoleValue$inboundSchema = openEnums.inboundSchema(IamRoleValue);
/** @internal */
exports.IamRoleType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.IamRole4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.IamRoleValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function iamRoleTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.IamRoleType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IamRoleType' from JSON`);
}
/** @internal */
exports.IamRole$inboundSchema = z.object({
    created_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    description: z.nullable(z.string()).optional(),
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    policies: z.nullable(z.array(iampolicy_js_1.IamPolicy$inboundSchema)).optional(),
    remote_id: z.nullable(z.string()).optional(),
    type: z.nullable(z.lazy(() => exports.IamRoleType$inboundSchema)).optional(),
    updated_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "created_at": "createdAt",
        "remote_id": "remoteId",
        "updated_at": "updatedAt",
    });
});
function iamRoleFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.IamRole$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IamRole' from JSON`);
}
//# sourceMappingURL=iamrole.js.map