"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.PlatformLog$ = exports.PlatformLog$outboundSchema = exports.PlatformLog$inboundSchema = void 0;
exports.platformLogToJSON = platformLogToJSON;
exports.platformLogFromJSON = platformLogFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../../lib/primitives.js");
const schemas_js_1 = require("../../../lib/schemas.js");
/** @internal */
exports.PlatformLog$inboundSchema = z.object({
    account_id: z.nullable(z.string()).optional(),
    action: z.nullable(z.string()).optional(),
    category: z.nullable(z.string()).optional(),
    child_resource: z.nullable(z.string()).optional(),
    duration: z.nullable(z.number()).optional(),
    end_time: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    event_datetime: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    http_method: z.nullable(z.string()).optional(),
    path: z.nullable(z.string()).optional(),
    project_id: z.nullable(z.string()).optional(),
    request_id: z.nullable(z.string()).optional(),
    resource: z.nullable(z.string()).optional(),
    source_id: z.nullable(z.string()).optional(),
    source_ip: z.nullable(z.string()).optional(),
    source_type: z.nullable(z.string()).optional(),
    source_value: z.nullable(z.string()).optional(),
    start_time: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    status: z.nullable(z.number()).optional(),
    sub_resource: z.nullable(z.string()).optional(),
    success: z.nullable(z.boolean()).optional(),
    url: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "account_id": "accountId",
        "child_resource": "childResource",
        "end_time": "endTime",
        "event_datetime": "eventDatetime",
        "http_method": "httpMethod",
        "project_id": "projectId",
        "request_id": "requestId",
        "source_id": "sourceId",
        "source_ip": "sourceIp",
        "source_type": "sourceType",
        "source_value": "sourceValue",
        "start_time": "startTime",
        "sub_resource": "subResource",
    });
});
/** @internal */
exports.PlatformLog$outboundSchema = z.object({
    accountId: z.nullable(z.string()).optional(),
    action: z.nullable(z.string()).optional(),
    category: z.nullable(z.string()).optional(),
    childResource: z.nullable(z.string()).optional(),
    duration: z.nullable(z.number()).optional(),
    endTime: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    eventDatetime: z.nullable(z.date().transform(v => v.toISOString()))
        .optional(),
    httpMethod: z.nullable(z.string()).optional(),
    path: z.nullable(z.string()).optional(),
    projectId: z.nullable(z.string()).optional(),
    requestId: z.nullable(z.string()).optional(),
    resource: z.nullable(z.string()).optional(),
    sourceId: z.nullable(z.string()).optional(),
    sourceIp: z.nullable(z.string()).optional(),
    sourceType: z.nullable(z.string()).optional(),
    sourceValue: z.nullable(z.string()).optional(),
    startTime: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    status: z.nullable(z.number()).optional(),
    subResource: z.nullable(z.string()).optional(),
    success: z.nullable(z.boolean()).optional(),
    url: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        accountId: "account_id",
        childResource: "child_resource",
        endTime: "end_time",
        eventDatetime: "event_datetime",
        httpMethod: "http_method",
        projectId: "project_id",
        requestId: "request_id",
        sourceId: "source_id",
        sourceIp: "source_ip",
        sourceType: "source_type",
        sourceValue: "source_value",
        startTime: "start_time",
        subResource: "sub_resource",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var PlatformLog$;
(function (PlatformLog$) {
    /** @deprecated use `PlatformLog$inboundSchema` instead. */
    PlatformLog$.inboundSchema = exports.PlatformLog$inboundSchema;
    /** @deprecated use `PlatformLog$outboundSchema` instead. */
    PlatformLog$.outboundSchema = exports.PlatformLog$outboundSchema;
})(PlatformLog$ || (exports.PlatformLog$ = PlatformLog$ = {}));
function platformLogToJSON(platformLog) {
    return JSON.stringify(exports.PlatformLog$outboundSchema.parse(platformLog));
}
function platformLogFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.PlatformLog$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PlatformLog' from JSON`);
}
//# sourceMappingURL=platformlog.js.map