"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.ListIdentitiesResponseBody$inboundSchema = exports.ListIdentitiesData$inboundSchema = exports.ListIdentitiesMetrics$inboundSchema = exports.ListIdentitiesObject$inboundSchema = exports.ListIdentitiesRequest$outboundSchema = exports.QueryParamFilterBy$outboundSchema = exports.ListIdentitiesObject = void 0;
exports.queryParamFilterByToJSON = queryParamFilterByToJSON;
exports.listIdentitiesRequestToJSON = listIdentitiesRequestToJSON;
exports.listIdentitiesMetricsFromJSON = listIdentitiesMetricsFromJSON;
exports.listIdentitiesDataFromJSON = listIdentitiesDataFromJSON;
exports.listIdentitiesResponseBodyFromJSON = listIdentitiesResponseBodyFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
exports.ListIdentitiesObject = {
    List: "list",
};
/** @internal */
exports.QueryParamFilterBy$outboundSchema = z.object({
    tags: z.array(z.string()).optional(),
});
function queryParamFilterByToJSON(queryParamFilterBy) {
    return JSON.stringify(exports.QueryParamFilterBy$outboundSchema.parse(queryParamFilterBy));
}
/** @internal */
exports.ListIdentitiesRequest$outboundSchema = z.object({
    limit: z.number().int().default(10),
    startingAfter: z.string().optional(),
    endingBefore: z.string().optional(),
    search: 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 listIdentitiesRequestToJSON(listIdentitiesRequest) {
    return JSON.stringify(exports.ListIdentitiesRequest$outboundSchema.parse(listIdentitiesRequest));
}
/** @internal */
exports.ListIdentitiesObject$inboundSchema = z.nativeEnum(exports.ListIdentitiesObject);
/** @internal */
exports.ListIdentitiesMetrics$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",
    });
});
function listIdentitiesMetricsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ListIdentitiesMetrics$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListIdentitiesMetrics' from JSON`);
}
/** @internal */
exports.ListIdentitiesData$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("2026-05-26T22:06:01.786Z").transform(v => new Date(v)),
    metrics: z.lazy(() => exports.ListIdentitiesMetrics$inboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "_id": "id",
        "external_id": "externalId",
        "display_name": "displayName",
        "avatar_url": "avatarUrl",
    });
});
function listIdentitiesDataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ListIdentitiesData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListIdentitiesData' from JSON`);
}
/** @internal */
exports.ListIdentitiesResponseBody$inboundSchema = z.object({
    object: exports.ListIdentitiesObject$inboundSchema,
    data: z.array(z.lazy(() => exports.ListIdentitiesData$inboundSchema)),
    has_more: z.boolean(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "has_more": "hasMore",
    });
});
function listIdentitiesResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ListIdentitiesResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListIdentitiesResponseBody' from JSON`);
}
//# sourceMappingURL=listidentities.js.map