"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.Session$outboundSchema = exports.Theme$outboundSchema = exports.Settings$outboundSchema = exports.AllowActions$outboundSchema = exports.AllowActions = void 0;
exports.settingsToJSON = settingsToJSON;
exports.themeToJSON = themeToJSON;
exports.sessionToJSON = sessionToJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const openEnums = __importStar(require("../../types/enums.js"));
const consumermetadata_js_1 = require("./consumermetadata.js");
const unifiedapiid_js_1 = require("./unifiedapiid.js");
exports.AllowActions = {
    Delete: "delete",
    Disconnect: "disconnect",
    Reauthorize: "reauthorize",
    Disable: "disable",
};
/** @internal */
exports.AllowActions$outboundSchema = openEnums.outboundSchema(exports.AllowActions);
/** @internal */
exports.Settings$outboundSchema = z.object({
    unifiedApis: z.array(unifiedapiid_js_1.UnifiedApiId$outboundSchema).optional(),
    hideResourceSettings: z.boolean().default(false),
    sandboxMode: z.boolean().default(false),
    isolationMode: z.boolean().default(false),
    sessionLength: z.string().default("1h"),
    showLogs: z.boolean().default(true),
    showSuggestions: z.boolean().default(false),
    showSidebar: z.boolean().default(true),
    autoRedirect: z.boolean().default(false),
    hideGuides: z.boolean().default(false),
    allowActions: z.array(exports.AllowActions$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        unifiedApis: "unified_apis",
        hideResourceSettings: "hide_resource_settings",
        sandboxMode: "sandbox_mode",
        isolationMode: "isolation_mode",
        sessionLength: "session_length",
        showLogs: "show_logs",
        showSuggestions: "show_suggestions",
        showSidebar: "show_sidebar",
        autoRedirect: "auto_redirect",
        hideGuides: "hide_guides",
        allowActions: "allow_actions",
    });
});
function settingsToJSON(settings) {
    return JSON.stringify(exports.Settings$outboundSchema.parse(settings));
}
/** @internal */
exports.Theme$outboundSchema = z.object({
    favicon: z.string().optional(),
    logo: z.string().optional(),
    primaryColor: z.string().optional(),
    sidepanelBackgroundColor: z.string().optional(),
    sidepanelTextColor: z.string().optional(),
    vaultName: z.string().optional(),
    privacyUrl: z.string().optional(),
    termsUrl: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        primaryColor: "primary_color",
        sidepanelBackgroundColor: "sidepanel_background_color",
        sidepanelTextColor: "sidepanel_text_color",
        vaultName: "vault_name",
        privacyUrl: "privacy_url",
        termsUrl: "terms_url",
    });
});
function themeToJSON(theme) {
    return JSON.stringify(exports.Theme$outboundSchema.parse(theme));
}
/** @internal */
exports.Session$outboundSchema = z.object({
    consumerMetadata: consumermetadata_js_1.ConsumerMetadata$outboundSchema.optional(),
    redirectUri: z.string().optional(),
    settings: z.lazy(() => exports.Settings$outboundSchema).optional(),
    theme: z.lazy(() => exports.Theme$outboundSchema).optional(),
    customConsumerSettings: z.record(z.any()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        consumerMetadata: "consumer_metadata",
        redirectUri: "redirect_uri",
        customConsumerSettings: "custom_consumer_settings",
    });
});
function sessionToJSON(session) {
    return JSON.stringify(exports.Session$outboundSchema.parse(session));
}
//# sourceMappingURL=session.js.map