"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.IamGroup$inboundSchema = exports.IamGroupType$inboundSchema = exports.IamGroupValue$inboundSchema = exports.IamGroupSourceValue$inboundSchema = exports.IamGroup4$inboundSchema = exports.IamGroupValue = void 0;
exports.iamGroup4FromJSON = iamGroup4FromJSON;
exports.iamGroupSourceValueFromJSON = iamGroupSourceValueFromJSON;
exports.iamGroupTypeFromJSON = iamGroupTypeFromJSON;
exports.iamGroupFromJSON = iamGroupFromJSON;
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 iamrole_js_1 = require("./iamrole.js");
var IamGroupValue;
(function (IamGroupValue) {
    IamGroupValue["Workspace"] = "workspace";
    IamGroupValue["Team"] = "team";
    IamGroupValue["Department"] = "department";
    IamGroupValue["Group"] = "group";
    IamGroupValue["Organization"] = "organization";
    IamGroupValue["UnmappedValue"] = "unmapped_value";
    IamGroupValue["CostCenter"] = "cost_center";
})(IamGroupValue || (exports.IamGroupValue = IamGroupValue = {}));
/** @internal */
exports.IamGroup4$inboundSchema = z.object({});
function iamGroup4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.IamGroup4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IamGroup4' from JSON`);
}
/** @internal */
exports.IamGroupSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.IamGroup4$inboundSchema),
    z.array(z.any()),
]);
function iamGroupSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.IamGroupSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IamGroupSourceValue' from JSON`);
}
/** @internal */
exports.IamGroupValue$inboundSchema = openEnums.inboundSchema(IamGroupValue);
/** @internal */
exports.IamGroupType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.IamGroup4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.IamGroupValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function iamGroupTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.IamGroupType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IamGroupType' from JSON`);
}
/** @internal */
exports.IamGroup$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(),
    parent_id: z.nullable(z.string()).optional(),
    remote_id: z.nullable(z.string()).optional(),
    remote_parent_id: z.nullable(z.string()).optional(),
    roles: z.nullable(z.array(iamrole_js_1.IamRole$inboundSchema)).optional(),
    type: z.nullable(z.lazy(() => exports.IamGroupType$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",
        "parent_id": "parentId",
        "remote_id": "remoteId",
        "remote_parent_id": "remoteParentId",
        "updated_at": "updatedAt",
    });
});
function iamGroupFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.IamGroup$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IamGroup' from JSON`);
}
//# sourceMappingURL=iamgroup.js.map