"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.connectSessionFromJSON = exports.connectSessionToJSON = exports.ConnectSession$ = exports.ConnectSession$outboundSchema = exports.ConnectSession$inboundSchema = exports.Categories$ = exports.Categories$outboundSchema = exports.Categories$inboundSchema = exports.Categories = void 0;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../../lib/primitives.js");
const schemas_js_1 = require("../../../lib/schemas.js");
var Categories;
(function (Categories) {
    Categories["Ats"] = "ats";
    Categories["Hris"] = "hris";
    Categories["HrisLegacy"] = "hris-legacy";
    Categories["Crm"] = "crm";
    Categories["Iam"] = "iam";
    Categories["Marketing"] = "marketing";
    Categories["Lms"] = "lms";
    Categories["Stackone"] = "stackone";
    Categories["Documents"] = "documents";
})(Categories || (exports.Categories = Categories = {}));
/** @internal */
exports.Categories$inboundSchema = z
    .nativeEnum(Categories);
/** @internal */
exports.Categories$outboundSchema = exports.Categories$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Categories$;
(function (Categories$) {
    /** @deprecated use `Categories$inboundSchema` instead. */
    Categories$.inboundSchema = exports.Categories$inboundSchema;
    /** @deprecated use `Categories$outboundSchema` instead. */
    Categories$.outboundSchema = exports.Categories$outboundSchema;
})(Categories$ || (exports.Categories$ = Categories$ = {}));
/** @internal */
exports.ConnectSession$inboundSchema = z.object({
    account_id: z.nullable(z.string()).optional(),
    categories: z.nullable(z.array(exports.Categories$inboundSchema)).optional(),
    created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
    id: z.number(),
    label: z.nullable(z.string()).optional(),
    organization_id: z.number(),
    origin_owner_id: z.string(),
    origin_owner_name: z.string(),
    origin_username: z.nullable(z.string()).optional(),
    project_id: z.string(),
    provider: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "account_id": "accountId",
        "created_at": "createdAt",
        "organization_id": "organizationId",
        "origin_owner_id": "originOwnerId",
        "origin_owner_name": "originOwnerName",
        "origin_username": "originUsername",
        "project_id": "projectId",
    });
});
/** @internal */
exports.ConnectSession$outboundSchema = z.object({
    accountId: z.nullable(z.string()).optional(),
    categories: z.nullable(z.array(exports.Categories$outboundSchema)).optional(),
    createdAt: z.date().transform(v => v.toISOString()),
    id: z.number(),
    label: z.nullable(z.string()).optional(),
    organizationId: z.number(),
    originOwnerId: z.string(),
    originOwnerName: z.string(),
    originUsername: z.nullable(z.string()).optional(),
    projectId: z.string(),
    provider: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        accountId: "account_id",
        createdAt: "created_at",
        organizationId: "organization_id",
        originOwnerId: "origin_owner_id",
        originOwnerName: "origin_owner_name",
        originUsername: "origin_username",
        projectId: "project_id",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var ConnectSession$;
(function (ConnectSession$) {
    /** @deprecated use `ConnectSession$inboundSchema` instead. */
    ConnectSession$.inboundSchema = exports.ConnectSession$inboundSchema;
    /** @deprecated use `ConnectSession$outboundSchema` instead. */
    ConnectSession$.outboundSchema = exports.ConnectSession$outboundSchema;
})(ConnectSession$ || (exports.ConnectSession$ = ConnectSession$ = {}));
function connectSessionToJSON(connectSession) {
    return JSON.stringify(exports.ConnectSession$outboundSchema.parse(connectSession));
}
exports.connectSessionToJSON = connectSessionToJSON;
function connectSessionFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ConnectSession$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConnectSession' from JSON`);
}
exports.connectSessionFromJSON = connectSessionFromJSON;
//# sourceMappingURL=connectsession.js.map