"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.PostV2AgentsA2aResponseBody$inboundSchema = exports.A2a$inboundSchema = exports.PostV2AgentsA2aMetrics$inboundSchema = exports.PostV2AgentsA2aType$inboundSchema = exports.PostV2AgentsA2aRequestBody$outboundSchema = exports.Headers$outboundSchema = exports.PostV2AgentsA2aType = void 0;
exports.headersToJSON = headersToJSON;
exports.postV2AgentsA2aRequestBodyToJSON = postV2AgentsA2aRequestBodyToJSON;
exports.postV2AgentsA2aMetricsFromJSON = postV2AgentsA2aMetricsFromJSON;
exports.a2aFromJSON = a2aFromJSON;
exports.postV2AgentsA2aResponseBodyFromJSON = postV2AgentsA2aResponseBodyFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
exports.PostV2AgentsA2aType = {
    A2a: "a2a",
    Internal: "internal",
};
/** @internal */
exports.Headers$outboundSchema = z.object({
    value: z.string(),
    encrypted: z.boolean().default(false),
});
function headersToJSON(headers) {
    return JSON.stringify(exports.Headers$outboundSchema.parse(headers));
}
/** @internal */
exports.PostV2AgentsA2aRequestBody$outboundSchema = z.object({
    key: z.string(),
    displayName: z.string(),
    description: z.string(),
    path: z.string(),
    agentUrl: z.string(),
    cardUrl: z.string().optional(),
    headers: z.record(z.lazy(() => exports.Headers$outboundSchema)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        displayName: "display_name",
        agentUrl: "agent_url",
        cardUrl: "card_url",
    });
});
function postV2AgentsA2aRequestBodyToJSON(postV2AgentsA2aRequestBody) {
    return JSON.stringify(exports.PostV2AgentsA2aRequestBody$outboundSchema.parse(postV2AgentsA2aRequestBody));
}
/** @internal */
exports.PostV2AgentsA2aType$inboundSchema = z.nativeEnum(exports.PostV2AgentsA2aType);
/** @internal */
exports.PostV2AgentsA2aMetrics$inboundSchema = z.object({
    total_cost: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "total_cost": "totalCost",
    });
});
function postV2AgentsA2aMetricsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.PostV2AgentsA2aMetrics$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2AgentsA2aMetrics' from JSON`);
}
/** @internal */
exports.A2a$inboundSchema = z
    .object({
    agent_url: z.string(),
    card_url: z.string().optional(),
    headers: z.record(z.any()),
    cached_card: z.any().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "agent_url": "agentUrl",
        "card_url": "cardUrl",
        "cached_card": "cachedCard",
    });
});
function a2aFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.A2a$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'A2a' from JSON`);
}
/** @internal */
exports.PostV2AgentsA2aResponseBody$inboundSchema = z.object({
    _id: z.string(),
    type: exports.PostV2AgentsA2aType$inboundSchema,
    key: z.string(),
    display_name: z.string(),
    description: z.string(),
    workspace_id: z.string(),
    project_id: z.string(),
    created_by_id: z.nullable(z.string()).optional(),
    updated_by_id: z.nullable(z.string()).optional(),
    role: z.string().optional(),
    instructions: z.string().optional(),
    status: z.string(),
    path: z.string(),
    metrics: z.lazy(() => exports.PostV2AgentsA2aMetrics$inboundSchema),
    memory_stores: z.array(z.string()),
    team_of_agents: z.array(z.any()),
    created: z.string().optional(),
    updated: z.string().optional(),
    a2a: z.lazy(() => exports.A2a$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "_id": "id",
        "display_name": "displayName",
        "workspace_id": "workspaceId",
        "project_id": "projectId",
        "created_by_id": "createdById",
        "updated_by_id": "updatedById",
        "memory_stores": "memoryStores",
        "team_of_agents": "teamOfAgents",
    });
});
function postV2AgentsA2aResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.PostV2AgentsA2aResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2AgentsA2aResponseBody' from JSON`);
}
//# sourceMappingURL=postv2agentsa2a.js.map