"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$ = exports.IamGroup$outboundSchema = exports.IamGroup$inboundSchema = exports.IamGroupType$ = exports.IamGroupType$outboundSchema = exports.IamGroupType$inboundSchema = exports.IamGroupValue$ = exports.IamGroupValue$outboundSchema = exports.IamGroupValue$inboundSchema = exports.IamGroupSourceValue$ = exports.IamGroupSourceValue$outboundSchema = exports.IamGroupSourceValue$inboundSchema = exports.IamGroup4$ = exports.IamGroup4$outboundSchema = exports.IamGroup4$inboundSchema = exports.IamGroupValue = void 0;
exports.iamGroup4ToJSON = iamGroup4ToJSON;
exports.iamGroup4FromJSON = iamGroup4FromJSON;
exports.iamGroupSourceValueToJSON = iamGroupSourceValueToJSON;
exports.iamGroupSourceValueFromJSON = iamGroupSourceValueFromJSON;
exports.iamGroupTypeToJSON = iamGroupTypeToJSON;
exports.iamGroupTypeFromJSON = iamGroupTypeFromJSON;
exports.iamGroupToJSON = iamGroupToJSON;
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 enums_js_1 = 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({});
/** @internal */
exports.IamGroup4$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 IamGroup4$;
(function (IamGroup4$) {
    /** @deprecated use `IamGroup4$inboundSchema` instead. */
    IamGroup4$.inboundSchema = exports.IamGroup4$inboundSchema;
    /** @deprecated use `IamGroup4$outboundSchema` instead. */
    IamGroup4$.outboundSchema = exports.IamGroup4$outboundSchema;
})(IamGroup4$ || (exports.IamGroup4$ = IamGroup4$ = {}));
function iamGroup4ToJSON(iamGroup4) {
    return JSON.stringify(exports.IamGroup4$outboundSchema.parse(iamGroup4));
}
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()),
]);
/** @internal */
exports.IamGroupSourceValue$outboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.IamGroup4$outboundSchema),
    z.array(z.any()),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var IamGroupSourceValue$;
(function (IamGroupSourceValue$) {
    /** @deprecated use `IamGroupSourceValue$inboundSchema` instead. */
    IamGroupSourceValue$.inboundSchema = exports.IamGroupSourceValue$inboundSchema;
    /** @deprecated use `IamGroupSourceValue$outboundSchema` instead. */
    IamGroupSourceValue$.outboundSchema = exports.IamGroupSourceValue$outboundSchema;
})(IamGroupSourceValue$ || (exports.IamGroupSourceValue$ = IamGroupSourceValue$ = {}));
function iamGroupSourceValueToJSON(iamGroupSourceValue) {
    return JSON.stringify(exports.IamGroupSourceValue$outboundSchema.parse(iamGroupSourceValue));
}
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 = z
    .union([
    z.nativeEnum(IamGroupValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.IamGroupValue$outboundSchema = z.union([
    z.nativeEnum(IamGroupValue),
    z.string().and(z.custom()),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var IamGroupValue$;
(function (IamGroupValue$) {
    /** @deprecated use `IamGroupValue$inboundSchema` instead. */
    IamGroupValue$.inboundSchema = exports.IamGroupValue$inboundSchema;
    /** @deprecated use `IamGroupValue$outboundSchema` instead. */
    IamGroupValue$.outboundSchema = exports.IamGroupValue$outboundSchema;
})(IamGroupValue$ || (exports.IamGroupValue$ = 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",
    });
});
/** @internal */
exports.IamGroupType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.IamGroup4$outboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.IamGroupValue$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        sourceValue: "source_value",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var IamGroupType$;
(function (IamGroupType$) {
    /** @deprecated use `IamGroupType$inboundSchema` instead. */
    IamGroupType$.inboundSchema = exports.IamGroupType$inboundSchema;
    /** @deprecated use `IamGroupType$outboundSchema` instead. */
    IamGroupType$.outboundSchema = exports.IamGroupType$outboundSchema;
})(IamGroupType$ || (exports.IamGroupType$ = IamGroupType$ = {}));
function iamGroupTypeToJSON(iamGroupType) {
    return JSON.stringify(exports.IamGroupType$outboundSchema.parse(iamGroupType));
}
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",
    });
});
/** @internal */
exports.IamGroup$outboundSchema = z.object({
    createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    description: z.nullable(z.string()).optional(),
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    parentId: z.nullable(z.string()).optional(),
    remoteId: z.nullable(z.string()).optional(),
    remoteParentId: z.nullable(z.string()).optional(),
    roles: z.nullable(z.array(iamrole_js_1.IamRole$outboundSchema)).optional(),
    type: z.nullable(z.lazy(() => exports.IamGroupType$outboundSchema)).optional(),
    updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        createdAt: "created_at",
        parentId: "parent_id",
        remoteId: "remote_id",
        remoteParentId: "remote_parent_id",
        updatedAt: "updated_at",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var IamGroup$;
(function (IamGroup$) {
    /** @deprecated use `IamGroup$inboundSchema` instead. */
    IamGroup$.inboundSchema = exports.IamGroup$inboundSchema;
    /** @deprecated use `IamGroup$outboundSchema` instead. */
    IamGroup$.outboundSchema = exports.IamGroup$outboundSchema;
})(IamGroup$ || (exports.IamGroup$ = IamGroup$ = {}));
function iamGroupToJSON(iamGroup) {
    return JSON.stringify(exports.IamGroup$outboundSchema.parse(iamGroup));
}
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