"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.TopSearchQueriesResponseBody$outboundSchema = exports.TopSearchQueriesResponseBody$inboundSchema = exports.Data$outboundSchema = exports.Data$inboundSchema = exports.Result$outboundSchema = exports.Result$inboundSchema = exports.TopSearchQueriesRequest$outboundSchema = exports.TopSearchQueriesRequest$inboundSchema = void 0;
exports.topSearchQueriesRequestToJSON = topSearchQueriesRequestToJSON;
exports.topSearchQueriesRequestFromJSON = topSearchQueriesRequestFromJSON;
exports.resultToJSON = resultToJSON;
exports.resultFromJSON = resultFromJSON;
exports.dataToJSON = dataToJSON;
exports.dataFromJSON = dataFromJSON;
exports.topSearchQueriesResponseBodyToJSON = topSearchQueriesResponseBodyToJSON;
exports.topSearchQueriesResponseBodyFromJSON = topSearchQueriesResponseBodyFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
/** @internal */
exports.TopSearchQueriesRequest$inboundSchema = z.object({
    after: z.string().optional(),
    project_id: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "project_id": "projectId",
    });
});
/** @internal */
exports.TopSearchQueriesRequest$outboundSchema = z.object({
    after: z.string().optional(),
    projectId: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        projectId: "project_id",
    });
});
function topSearchQueriesRequestToJSON(topSearchQueriesRequest) {
    return JSON.stringify(exports.TopSearchQueriesRequest$outboundSchema.parse(topSearchQueriesRequest));
}
function topSearchQueriesRequestFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TopSearchQueriesRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TopSearchQueriesRequest' from JSON`);
}
/** @internal */
exports.Result$inboundSchema = z
    .object({
    search_query: z.string(),
    count: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "search_query": "searchQuery",
    });
});
/** @internal */
exports.Result$outboundSchema = z.object({
    searchQuery: z.string(),
    count: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        searchQuery: "search_query",
    });
});
function resultToJSON(result) {
    return JSON.stringify(exports.Result$outboundSchema.parse(result));
}
function resultFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Result$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Result' from JSON`);
}
/** @internal */
exports.Data$inboundSchema = z
    .object({
    result: z.array(z.lazy(() => exports.Result$inboundSchema)),
    total: z.number(),
});
/** @internal */
exports.Data$outboundSchema = z.object({
    result: z.array(z.lazy(() => exports.Result$outboundSchema)),
    total: z.number(),
});
function dataToJSON(data) {
    return JSON.stringify(exports.Data$outboundSchema.parse(data));
}
function dataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Data$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Data' from JSON`);
}
/** @internal */
exports.TopSearchQueriesResponseBody$inboundSchema = z.object({
    data: z.lazy(() => exports.Data$inboundSchema),
});
/** @internal */
exports.TopSearchQueriesResponseBody$outboundSchema = z.object({
    data: z.lazy(() => exports.Data$outboundSchema),
});
function topSearchQueriesResponseBodyToJSON(topSearchQueriesResponseBody) {
    return JSON.stringify(exports.TopSearchQueriesResponseBody$outboundSchema.parse(topSearchQueriesResponseBody));
}
function topSearchQueriesResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TopSearchQueriesResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TopSearchQueriesResponseBody' from JSON`);
}
//# sourceMappingURL=topsearchqueries.js.map