"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 (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.iamGroupFromJSON = exports.iamGroupToJSON = exports.IamGroup$ = exports.IamGroup$outboundSchema = exports.IamGroup$inboundSchema = exports.iamGroupTypeFromJSON = exports.iamGroupTypeToJSON = exports.IamGroupType$ = exports.IamGroupType$outboundSchema = exports.IamGroupType$inboundSchema = exports.IamGroupValue$ = exports.IamGroupValue$outboundSchema = exports.IamGroupValue$inboundSchema = exports.iamGroupSourceValueFromJSON = exports.iamGroupSourceValueToJSON = exports.IamGroupSourceValue$ = exports.IamGroupSourceValue$outboundSchema = exports.IamGroupSourceValue$inboundSchema = exports.iamGroup4FromJSON = exports.iamGroup4ToJSON = exports.IamGroup4$ = exports.IamGroup4$outboundSchema = exports.IamGroup4$inboundSchema = exports.IamGroupValue = void 0;
const z = __importStar(require("zod"));
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));
}
exports.iamGroup4ToJSON = iamGroup4ToJSON;
function iamGroup4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.IamGroup4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IamGroup4' from JSON`);
}
exports.iamGroup4FromJSON = iamGroup4FromJSON;
/** @internal */
exports.IamGroupSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.IamGroup4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.IamGroupSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.IamGroup4$outboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    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));
}
exports.iamGroupSourceValueToJSON = iamGroupSourceValueToJSON;
function iamGroupSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.IamGroupSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IamGroupSourceValue' from JSON`);
}
exports.iamGroupSourceValueFromJSON = iamGroupSourceValueFromJSON;
/** @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.lazy(() => exports.IamGroup4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        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.lazy(() => exports.IamGroup4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        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));
}
exports.iamGroupTypeToJSON = iamGroupTypeToJSON;
function iamGroupTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.IamGroupType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IamGroupType' from JSON`);
}
exports.iamGroupTypeFromJSON = iamGroupTypeFromJSON;
/** @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));
}
exports.iamGroupToJSON = iamGroupToJSON;
function iamGroupFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.IamGroup$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IamGroup' from JSON`);
}
exports.iamGroupFromJSON = iamGroupFromJSON;
//# sourceMappingURL=iamgroup.js.map