"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.unifiedLogsFromJSON = exports.unifiedLogsToJSON = exports.UnifiedLogs$ = exports.UnifiedLogs$outboundSchema = exports.UnifiedLogs$inboundSchema = exports.unifiedLogsResponseFromJSON = exports.unifiedLogsResponseToJSON = exports.UnifiedLogsResponse$ = exports.UnifiedLogsResponse$outboundSchema = exports.UnifiedLogsResponse$inboundSchema = exports.unifiedLogsRequestFromJSON = exports.unifiedLogsRequestToJSON = exports.UnifiedLogsRequest$ = exports.UnifiedLogsRequest$outboundSchema = exports.UnifiedLogsRequest$inboundSchema = exports.unifiedLogsUrlFromJSON = exports.unifiedLogsUrlToJSON = exports.UnifiedLogsUrl$ = exports.UnifiedLogsUrl$outboundSchema = exports.UnifiedLogsUrl$inboundSchema = void 0;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../../lib/primitives.js");
const schemas_js_1 = require("../../../lib/schemas.js");
const custommappingerror_js_1 = require("./custommappingerror.js");
const providererror_js_1 = require("./providererror.js");
/** @internal */
exports.UnifiedLogsUrl$inboundSchema = z.object({
    hostname: z.nullable(z.string()).optional(),
    path: z.nullable(z.string()).optional(),
    query_params: z.nullable(z.record(z.any())).optional(),
    url: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "query_params": "queryParams",
    });
});
/** @internal */
exports.UnifiedLogsUrl$outboundSchema = z.object({
    hostname: z.nullable(z.string()).optional(),
    path: z.nullable(z.string()).optional(),
    queryParams: z.nullable(z.record(z.any())).optional(),
    url: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        queryParams: "query_params",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var UnifiedLogsUrl$;
(function (UnifiedLogsUrl$) {
    /** @deprecated use `UnifiedLogsUrl$inboundSchema` instead. */
    UnifiedLogsUrl$.inboundSchema = exports.UnifiedLogsUrl$inboundSchema;
    /** @deprecated use `UnifiedLogsUrl$outboundSchema` instead. */
    UnifiedLogsUrl$.outboundSchema = exports.UnifiedLogsUrl$outboundSchema;
})(UnifiedLogsUrl$ || (exports.UnifiedLogsUrl$ = UnifiedLogsUrl$ = {}));
function unifiedLogsUrlToJSON(unifiedLogsUrl) {
    return JSON.stringify(exports.UnifiedLogsUrl$outboundSchema.parse(unifiedLogsUrl));
}
exports.unifiedLogsUrlToJSON = unifiedLogsUrlToJSON;
function unifiedLogsUrlFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UnifiedLogsUrl$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UnifiedLogsUrl' from JSON`);
}
exports.unifiedLogsUrlFromJSON = unifiedLogsUrlFromJSON;
/** @internal */
exports.UnifiedLogsRequest$inboundSchema = z.object({
    body: z.nullable(z.any()).optional(),
    headers: z.nullable(z.record(z.any())).optional(),
    id: z.nullable(z.string()).optional(),
    method: z.nullable(z.string()).optional(),
    url: z.nullable(z.lazy(() => exports.UnifiedLogsUrl$inboundSchema)).optional(),
});
/** @internal */
exports.UnifiedLogsRequest$outboundSchema = z.object({
    body: z.nullable(z.any()).optional(),
    headers: z.nullable(z.record(z.any())).optional(),
    id: z.nullable(z.string()).optional(),
    method: z.nullable(z.string()).optional(),
    url: z.nullable(z.lazy(() => exports.UnifiedLogsUrl$outboundSchema)).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var UnifiedLogsRequest$;
(function (UnifiedLogsRequest$) {
    /** @deprecated use `UnifiedLogsRequest$inboundSchema` instead. */
    UnifiedLogsRequest$.inboundSchema = exports.UnifiedLogsRequest$inboundSchema;
    /** @deprecated use `UnifiedLogsRequest$outboundSchema` instead. */
    UnifiedLogsRequest$.outboundSchema = exports.UnifiedLogsRequest$outboundSchema;
})(UnifiedLogsRequest$ || (exports.UnifiedLogsRequest$ = UnifiedLogsRequest$ = {}));
function unifiedLogsRequestToJSON(unifiedLogsRequest) {
    return JSON.stringify(exports.UnifiedLogsRequest$outboundSchema.parse(unifiedLogsRequest));
}
exports.unifiedLogsRequestToJSON = unifiedLogsRequestToJSON;
function unifiedLogsRequestFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UnifiedLogsRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UnifiedLogsRequest' from JSON`);
}
exports.unifiedLogsRequestFromJSON = unifiedLogsRequestFromJSON;
/** @internal */
exports.UnifiedLogsResponse$inboundSchema = z.object({
    body: z.nullable(z.any()).optional(),
    custom_mapping_errors: z.nullable(z.array(custommappingerror_js_1.CustomMappingError$inboundSchema))
        .optional(),
    headers: z.nullable(z.record(z.any())).optional(),
    provider_errors: z.nullable(z.array(providererror_js_1.ProviderError$inboundSchema)).optional(),
    status_code: z.nullable(z.number()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "custom_mapping_errors": "customMappingErrors",
        "provider_errors": "providerErrors",
        "status_code": "statusCode",
    });
});
/** @internal */
exports.UnifiedLogsResponse$outboundSchema = z.object({
    body: z.nullable(z.any()).optional(),
    customMappingErrors: z.nullable(z.array(custommappingerror_js_1.CustomMappingError$outboundSchema))
        .optional(),
    headers: z.nullable(z.record(z.any())).optional(),
    providerErrors: z.nullable(z.array(providererror_js_1.ProviderError$outboundSchema)).optional(),
    statusCode: z.nullable(z.number()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        customMappingErrors: "custom_mapping_errors",
        providerErrors: "provider_errors",
        statusCode: "status_code",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var UnifiedLogsResponse$;
(function (UnifiedLogsResponse$) {
    /** @deprecated use `UnifiedLogsResponse$inboundSchema` instead. */
    UnifiedLogsResponse$.inboundSchema = exports.UnifiedLogsResponse$inboundSchema;
    /** @deprecated use `UnifiedLogsResponse$outboundSchema` instead. */
    UnifiedLogsResponse$.outboundSchema = exports.UnifiedLogsResponse$outboundSchema;
})(UnifiedLogsResponse$ || (exports.UnifiedLogsResponse$ = UnifiedLogsResponse$ = {}));
function unifiedLogsResponseToJSON(unifiedLogsResponse) {
    return JSON.stringify(exports.UnifiedLogsResponse$outboundSchema.parse(unifiedLogsResponse));
}
exports.unifiedLogsResponseToJSON = unifiedLogsResponseToJSON;
function unifiedLogsResponseFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UnifiedLogsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UnifiedLogsResponse' from JSON`);
}
exports.unifiedLogsResponseFromJSON = unifiedLogsResponseFromJSON;
/** @internal */
exports.UnifiedLogs$inboundSchema = z.object({
    account_id: z.nullable(z.string()).optional(),
    action: 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(),
    is_worker: z.nullable(z.boolean()).optional(),
    path: z.nullable(z.string()).optional(),
    project_id: z.nullable(z.string()).optional(),
    provider: z.nullable(z.string()).optional(),
    request: z.nullable(z.lazy(() => exports.UnifiedLogsRequest$inboundSchema))
        .optional(),
    request_id: z.nullable(z.string()).optional(),
    resource: z.nullable(z.string()).optional(),
    response: z.nullable(z.lazy(() => exports.UnifiedLogsResponse$inboundSchema))
        .optional(),
    service: z.nullable(z.string()).optional(),
    source_id: 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(),
    step_requests: z.nullable(z.array(z.string())).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",
        "is_worker": "isWorker",
        "project_id": "projectId",
        "request_id": "requestId",
        "source_id": "sourceId",
        "source_type": "sourceType",
        "source_value": "sourceValue",
        "start_time": "startTime",
        "step_requests": "stepRequests",
        "sub_resource": "subResource",
    });
});
/** @internal */
exports.UnifiedLogs$outboundSchema = z.object({
    accountId: z.nullable(z.string()).optional(),
    action: 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(),
    isWorker: z.nullable(z.boolean()).optional(),
    path: z.nullable(z.string()).optional(),
    projectId: z.nullable(z.string()).optional(),
    provider: z.nullable(z.string()).optional(),
    request: z.nullable(z.lazy(() => exports.UnifiedLogsRequest$outboundSchema))
        .optional(),
    requestId: z.nullable(z.string()).optional(),
    resource: z.nullable(z.string()).optional(),
    response: z.nullable(z.lazy(() => exports.UnifiedLogsResponse$outboundSchema))
        .optional(),
    service: z.nullable(z.string()).optional(),
    sourceId: 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(),
    stepRequests: z.nullable(z.array(z.string())).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",
        isWorker: "is_worker",
        projectId: "project_id",
        requestId: "request_id",
        sourceId: "source_id",
        sourceType: "source_type",
        sourceValue: "source_value",
        startTime: "start_time",
        stepRequests: "step_requests",
        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 UnifiedLogs$;
(function (UnifiedLogs$) {
    /** @deprecated use `UnifiedLogs$inboundSchema` instead. */
    UnifiedLogs$.inboundSchema = exports.UnifiedLogs$inboundSchema;
    /** @deprecated use `UnifiedLogs$outboundSchema` instead. */
    UnifiedLogs$.outboundSchema = exports.UnifiedLogs$outboundSchema;
})(UnifiedLogs$ || (exports.UnifiedLogs$ = UnifiedLogs$ = {}));
function unifiedLogsToJSON(unifiedLogs) {
    return JSON.stringify(exports.UnifiedLogs$outboundSchema.parse(unifiedLogs));
}
exports.unifiedLogsToJSON = unifiedLogsToJSON;
function unifiedLogsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UnifiedLogs$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UnifiedLogs' from JSON`);
}
exports.unifiedLogsFromJSON = unifiedLogsFromJSON;
//# sourceMappingURL=unifiedlogs.js.map