"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.ListContactsResponseBody$outboundSchema = exports.ListContactsResponseBody$inboundSchema = exports.Data$outboundSchema = exports.Data$inboundSchema = exports.ListContactsMetrics$outboundSchema = exports.ListContactsMetrics$inboundSchema = exports.ObjectT$outboundSchema = exports.ObjectT$inboundSchema = exports.ListContactsRequest$outboundSchema = exports.ListContactsRequest$inboundSchema = exports.QueryParamFilterBy$outboundSchema = exports.QueryParamFilterBy$inboundSchema = exports.ObjectT = void 0;
exports.queryParamFilterByToJSON = queryParamFilterByToJSON;
exports.queryParamFilterByFromJSON = queryParamFilterByFromJSON;
exports.listContactsRequestToJSON = listContactsRequestToJSON;
exports.listContactsRequestFromJSON = listContactsRequestFromJSON;
exports.listContactsMetricsToJSON = listContactsMetricsToJSON;
exports.listContactsMetricsFromJSON = listContactsMetricsFromJSON;
exports.dataToJSON = dataToJSON;
exports.dataFromJSON = dataFromJSON;
exports.listContactsResponseBodyToJSON = listContactsResponseBodyToJSON;
exports.listContactsResponseBodyFromJSON = listContactsResponseBodyFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
exports.ObjectT = {
    List: "list",
};
/** @internal */
exports.QueryParamFilterBy$inboundSchema = z.object({
    tags: z.array(z.string()).optional(),
});
/** @internal */
exports.QueryParamFilterBy$outboundSchema = z.object({
    tags: z.array(z.string()).optional(),
});
function queryParamFilterByToJSON(queryParamFilterBy) {
    return JSON.stringify(exports.QueryParamFilterBy$outboundSchema.parse(queryParamFilterBy));
}
function queryParamFilterByFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.QueryParamFilterBy$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'QueryParamFilterBy' from JSON`);
}
/** @internal */
exports.ListContactsRequest$inboundSchema = z.object({
    limit: z.number().default(10),
    starting_after: z.string().optional(),
    ending_before: z.string().optional(),
    filter_by: z.lazy(() => exports.QueryParamFilterBy$inboundSchema).optional(),
    include_metrics: z.nullable(z.boolean().default(false)),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "starting_after": "startingAfter",
        "ending_before": "endingBefore",
        "filter_by": "filterBy",
        "include_metrics": "includeMetrics",
    });
});
/** @internal */
exports.ListContactsRequest$outboundSchema = z.object({
    limit: z.number().default(10),
    startingAfter: z.string().optional(),
    endingBefore: z.string().optional(),
    filterBy: z.lazy(() => exports.QueryParamFilterBy$outboundSchema).optional(),
    includeMetrics: z.nullable(z.boolean().default(false)),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        startingAfter: "starting_after",
        endingBefore: "ending_before",
        filterBy: "filter_by",
        includeMetrics: "include_metrics",
    });
});
function listContactsRequestToJSON(listContactsRequest) {
    return JSON.stringify(exports.ListContactsRequest$outboundSchema.parse(listContactsRequest));
}
function listContactsRequestFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ListContactsRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListContactsRequest' from JSON`);
}
/** @internal */
exports.ObjectT$inboundSchema = z
    .nativeEnum(exports.ObjectT);
/** @internal */
exports.ObjectT$outboundSchema = exports.ObjectT$inboundSchema;
/** @internal */
exports.ListContactsMetrics$inboundSchema = z.object({
    total_cost: z.number(),
    total_tokens: z.number(),
    total_requests: z.number(),
    error_rate: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "total_cost": "totalCost",
        "total_tokens": "totalTokens",
        "total_requests": "totalRequests",
        "error_rate": "errorRate",
    });
});
/** @internal */
exports.ListContactsMetrics$outboundSchema = z.object({
    totalCost: z.number(),
    totalTokens: z.number(),
    totalRequests: z.number(),
    errorRate: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        totalCost: "total_cost",
        totalTokens: "total_tokens",
        totalRequests: "total_requests",
        errorRate: "error_rate",
    });
});
function listContactsMetricsToJSON(listContactsMetrics) {
    return JSON.stringify(exports.ListContactsMetrics$outboundSchema.parse(listContactsMetrics));
}
function listContactsMetricsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ListContactsMetrics$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListContactsMetrics' from JSON`);
}
/** @internal */
exports.Data$inboundSchema = z
    .object({
    _id: z.string(),
    external_id: z.string(),
    display_name: z.nullable(z.string()).optional(),
    email: z.nullable(z.string()).optional(),
    avatar_url: z.nullable(z.string()).optional(),
    tags: z.array(z.string()).optional(),
    metadata: z.record(z.any()).optional(),
    created: z.string().datetime({ offset: true }).transform(v => new Date(v))
        .optional(),
    updated: z.string().datetime({ offset: true }).default("2025-11-25T16:24:23.366Z").transform(v => new Date(v)),
    metrics: z.lazy(() => exports.ListContactsMetrics$inboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "_id": "id",
        "external_id": "externalId",
        "display_name": "displayName",
        "avatar_url": "avatarUrl",
    });
});
/** @internal */
exports.Data$outboundSchema = z.object({
    id: z.string(),
    externalId: z.string(),
    displayName: z.nullable(z.string()).optional(),
    email: z.nullable(z.string()).optional(),
    avatarUrl: z.nullable(z.string()).optional(),
    tags: z.array(z.string()).optional(),
    metadata: z.record(z.any()).optional(),
    created: z.date().transform(v => v.toISOString()).optional(),
    updated: z.date().default(() => new Date("2025-11-25T16:24:23.366Z"))
        .transform(v => v.toISOString()),
    metrics: z.lazy(() => exports.ListContactsMetrics$outboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        id: "_id",
        externalId: "external_id",
        displayName: "display_name",
        avatarUrl: "avatar_url",
    });
});
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.ListContactsResponseBody$inboundSchema = z.object({
    object: exports.ObjectT$inboundSchema,
    data: z.array(z.lazy(() => exports.Data$inboundSchema)),
    has_more: z.boolean(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "has_more": "hasMore",
    });
});
/** @internal */
exports.ListContactsResponseBody$outboundSchema = z.object({
    object: exports.ObjectT$outboundSchema,
    data: z.array(z.lazy(() => exports.Data$outboundSchema)),
    hasMore: z.boolean(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        hasMore: "has_more",
    });
});
function listContactsResponseBodyToJSON(listContactsResponseBody) {
    return JSON.stringify(exports.ListContactsResponseBody$outboundSchema.parse(listContactsResponseBody));
}
function listContactsResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ListContactsResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListContactsResponseBody' from JSON`);
}
//# sourceMappingURL=listcontacts.js.map