"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.StepLog$ = exports.StepLog$outboundSchema = exports.StepLog$inboundSchema = exports.StepLogResponse$ = exports.StepLogResponse$outboundSchema = exports.StepLogResponse$inboundSchema = exports.RequestT$ = exports.RequestT$outboundSchema = exports.RequestT$inboundSchema = exports.Url$ = exports.Url$outboundSchema = exports.Url$inboundSchema = void 0;
exports.urlToJSON = urlToJSON;
exports.urlFromJSON = urlFromJSON;
exports.requestToJSON = requestToJSON;
exports.requestFromJSON = requestFromJSON;
exports.stepLogResponseToJSON = stepLogResponseToJSON;
exports.stepLogResponseFromJSON = stepLogResponseFromJSON;
exports.stepLogToJSON = stepLogToJSON;
exports.stepLogFromJSON = stepLogFromJSON;
const z = __importStar(require("zod/v3"));
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.Url$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.Url$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 Url$;
(function (Url$) {
    /** @deprecated use `Url$inboundSchema` instead. */
    Url$.inboundSchema = exports.Url$inboundSchema;
    /** @deprecated use `Url$outboundSchema` instead. */
    Url$.outboundSchema = exports.Url$outboundSchema;
})(Url$ || (exports.Url$ = Url$ = {}));
function urlToJSON(url) {
    return JSON.stringify(exports.Url$outboundSchema.parse(url));
}
function urlFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Url$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Url' from JSON`);
}
/** @internal */
exports.RequestT$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.Url$inboundSchema)).optional(),
});
/** @internal */
exports.RequestT$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.Url$outboundSchema)).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var RequestT$;
(function (RequestT$) {
    /** @deprecated use `RequestT$inboundSchema` instead. */
    RequestT$.inboundSchema = exports.RequestT$inboundSchema;
    /** @deprecated use `RequestT$outboundSchema` instead. */
    RequestT$.outboundSchema = exports.RequestT$outboundSchema;
})(RequestT$ || (exports.RequestT$ = RequestT$ = {}));
function requestToJSON(requestT) {
    return JSON.stringify(exports.RequestT$outboundSchema.parse(requestT));
}
function requestFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.RequestT$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RequestT' from JSON`);
}
/** @internal */
exports.StepLogResponse$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.StepLogResponse$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 StepLogResponse$;
(function (StepLogResponse$) {
    /** @deprecated use `StepLogResponse$inboundSchema` instead. */
    StepLogResponse$.inboundSchema = exports.StepLogResponse$inboundSchema;
    /** @deprecated use `StepLogResponse$outboundSchema` instead. */
    StepLogResponse$.outboundSchema = exports.StepLogResponse$outboundSchema;
})(StepLogResponse$ || (exports.StepLogResponse$ = StepLogResponse$ = {}));
function stepLogResponseToJSON(stepLogResponse) {
    return JSON.stringify(exports.StepLogResponse$outboundSchema.parse(stepLogResponse));
}
function stepLogResponseFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.StepLogResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StepLogResponse' from JSON`);
}
/** @internal */
exports.StepLog$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(),
    http_method: z.nullable(z.string()).optional(),
    id: 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.RequestT$inboundSchema)).optional(),
    request_id: z.nullable(z.string()).optional(),
    resource: z.nullable(z.string()).optional(),
    response: z.nullable(z.lazy(() => exports.StepLogResponse$inboundSchema))
        .optional(),
    service: z.nullable(z.string()).optional(),
    source_ip: 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",
        "http_method": "httpMethod",
        "is_worker": "isWorker",
        "project_id": "projectId",
        "request_id": "requestId",
        "source_ip": "sourceIp",
        "start_time": "startTime",
        "sub_resource": "subResource",
    });
});
/** @internal */
exports.StepLog$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(),
    httpMethod: z.nullable(z.string()).optional(),
    id: 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.RequestT$outboundSchema)).optional(),
    requestId: z.nullable(z.string()).optional(),
    resource: z.nullable(z.string()).optional(),
    response: z.nullable(z.lazy(() => exports.StepLogResponse$outboundSchema)).optional(),
    service: z.nullable(z.string()).optional(),
    sourceIp: 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",
        httpMethod: "http_method",
        isWorker: "is_worker",
        projectId: "project_id",
        requestId: "request_id",
        sourceIp: "source_ip",
        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 StepLog$;
(function (StepLog$) {
    /** @deprecated use `StepLog$inboundSchema` instead. */
    StepLog$.inboundSchema = exports.StepLog$inboundSchema;
    /** @deprecated use `StepLog$outboundSchema` instead. */
    StepLog$.outboundSchema = exports.StepLog$outboundSchema;
})(StepLog$ || (exports.StepLog$ = StepLog$ = {}));
function stepLogToJSON(stepLog) {
    return JSON.stringify(exports.StepLog$outboundSchema.parse(stepLog));
}
function stepLogFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.StepLog$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StepLog' from JSON`);
}
//# sourceMappingURL=steplog.js.map