"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.iamResourceFromJSON = exports.iamResourceToJSON = exports.IamResource$ = exports.IamResource$outboundSchema = exports.IamResource$inboundSchema = exports.iamResourceTypeFromJSON = exports.iamResourceTypeToJSON = exports.IamResourceType$ = exports.IamResourceType$outboundSchema = exports.IamResourceType$inboundSchema = exports.IamResourceValue$ = exports.IamResourceValue$outboundSchema = exports.IamResourceValue$inboundSchema = exports.iamResourceSourceValueFromJSON = exports.iamResourceSourceValueToJSON = exports.IamResourceSourceValue$ = exports.IamResourceSourceValue$outboundSchema = exports.IamResourceSourceValue$inboundSchema = exports.iamResource4FromJSON = exports.iamResource4ToJSON = exports.IamResource4$ = exports.IamResource4$outboundSchema = exports.IamResource4$inboundSchema = exports.IamResourceValue = 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");
/**
 * The type of the resource, e.g. user, group, permission, etc.
 */
var IamResourceValue;
(function (IamResourceValue) {
    IamResourceValue["Project"] = "project";
    IamResourceValue["File"] = "file";
    IamResourceValue["Folder"] = "folder";
    IamResourceValue["Product"] = "product";
    IamResourceValue["Property"] = "property";
    IamResourceValue["User"] = "user";
    IamResourceValue["UnmappedValue"] = "unmapped_value";
})(IamResourceValue || (exports.IamResourceValue = IamResourceValue = {}));
/** @internal */
exports.IamResource4$inboundSchema = z.object({});
/** @internal */
exports.IamResource4$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 IamResource4$;
(function (IamResource4$) {
    /** @deprecated use `IamResource4$inboundSchema` instead. */
    IamResource4$.inboundSchema = exports.IamResource4$inboundSchema;
    /** @deprecated use `IamResource4$outboundSchema` instead. */
    IamResource4$.outboundSchema = exports.IamResource4$outboundSchema;
})(IamResource4$ || (exports.IamResource4$ = IamResource4$ = {}));
function iamResource4ToJSON(iamResource4) {
    return JSON.stringify(exports.IamResource4$outboundSchema.parse(iamResource4));
}
exports.iamResource4ToJSON = iamResource4ToJSON;
function iamResource4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.IamResource4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IamResource4' from JSON`);
}
exports.iamResource4FromJSON = iamResource4FromJSON;
/** @internal */
exports.IamResourceSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.IamResource4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.IamResourceSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.IamResource4$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 IamResourceSourceValue$;
(function (IamResourceSourceValue$) {
    /** @deprecated use `IamResourceSourceValue$inboundSchema` instead. */
    IamResourceSourceValue$.inboundSchema = exports.IamResourceSourceValue$inboundSchema;
    /** @deprecated use `IamResourceSourceValue$outboundSchema` instead. */
    IamResourceSourceValue$.outboundSchema = exports.IamResourceSourceValue$outboundSchema;
})(IamResourceSourceValue$ || (exports.IamResourceSourceValue$ = IamResourceSourceValue$ = {}));
function iamResourceSourceValueToJSON(iamResourceSourceValue) {
    return JSON.stringify(exports.IamResourceSourceValue$outboundSchema.parse(iamResourceSourceValue));
}
exports.iamResourceSourceValueToJSON = iamResourceSourceValueToJSON;
function iamResourceSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.IamResourceSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IamResourceSourceValue' from JSON`);
}
exports.iamResourceSourceValueFromJSON = iamResourceSourceValueFromJSON;
/** @internal */
exports.IamResourceValue$inboundSchema = z
    .union([
    z.nativeEnum(IamResourceValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.IamResourceValue$outboundSchema = z.union([
    z.nativeEnum(IamResourceValue),
    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 IamResourceValue$;
(function (IamResourceValue$) {
    /** @deprecated use `IamResourceValue$inboundSchema` instead. */
    IamResourceValue$.inboundSchema = exports.IamResourceValue$inboundSchema;
    /** @deprecated use `IamResourceValue$outboundSchema` instead. */
    IamResourceValue$.outboundSchema = exports.IamResourceValue$outboundSchema;
})(IamResourceValue$ || (exports.IamResourceValue$ = IamResourceValue$ = {}));
/** @internal */
exports.IamResourceType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.IamResource4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.IamResourceValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.IamResourceType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.IamResource4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.IamResourceValue$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 IamResourceType$;
(function (IamResourceType$) {
    /** @deprecated use `IamResourceType$inboundSchema` instead. */
    IamResourceType$.inboundSchema = exports.IamResourceType$inboundSchema;
    /** @deprecated use `IamResourceType$outboundSchema` instead. */
    IamResourceType$.outboundSchema = exports.IamResourceType$outboundSchema;
})(IamResourceType$ || (exports.IamResourceType$ = IamResourceType$ = {}));
function iamResourceTypeToJSON(iamResourceType) {
    return JSON.stringify(exports.IamResourceType$outboundSchema.parse(iamResourceType));
}
exports.iamResourceTypeToJSON = iamResourceTypeToJSON;
function iamResourceTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.IamResourceType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IamResourceType' from JSON`);
}
exports.iamResourceTypeFromJSON = iamResourceTypeFromJSON;
/** @internal */
exports.IamResource$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(),
    location: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    remote_id: z.nullable(z.string()).optional(),
    type: z.nullable(z.lazy(() => exports.IamResourceType$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",
    });
});
/** @internal */
exports.IamResource$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(),
    location: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    remoteId: z.nullable(z.string()).optional(),
    type: z.nullable(z.lazy(() => exports.IamResourceType$outboundSchema)).optional(),
    updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        createdAt: "created_at",
        remoteId: "remote_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 IamResource$;
(function (IamResource$) {
    /** @deprecated use `IamResource$inboundSchema` instead. */
    IamResource$.inboundSchema = exports.IamResource$inboundSchema;
    /** @deprecated use `IamResource$outboundSchema` instead. */
    IamResource$.outboundSchema = exports.IamResource$outboundSchema;
})(IamResource$ || (exports.IamResource$ = IamResource$ = {}));
function iamResourceToJSON(iamResource) {
    return JSON.stringify(exports.IamResource$outboundSchema.parse(iamResource));
}
exports.iamResourceToJSON = iamResourceToJSON;
function iamResourceFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.IamResource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IamResource' from JSON`);
}
exports.iamResourceFromJSON = iamResourceFromJSON;
//# sourceMappingURL=iamresource.js.map