import { WorkspaceScopedResource, extractData } from './base.js';
export class AgentsResource extends WorkspaceScopedResource {
    async create(body) {
        return extractData(await this.client.POST('/v1/{workspace_id}/agents', {
            params: { path: { workspace_id: this.workspaceId } },
            body,
        }));
    }
    async list(params) {
        return extractData(await this.client.GET('/v1/{workspace_id}/agents', {
            params: { path: { workspace_id: this.workspaceId }, query: params },
        }));
    }
    listAutoPaging(params) {
        return this.iteratePaginatedList((pageParams) => this.list(pageParams), params);
    }
    async get(agentId) {
        return extractData(await this.client.GET('/v1/{workspace_id}/agents/{agent_id}', {
            params: { path: { workspace_id: this.workspaceId, agent_id: agentId } },
        }));
    }
    async update(agentId, body) {
        return extractData(await this.client.PUT('/v1/{workspace_id}/agents/{agent_id}', {
            params: { path: { workspace_id: this.workspaceId, agent_id: agentId } },
            body,
        }));
    }
    async delete(agentId) {
        await this.client.DELETE('/v1/{workspace_id}/agents/{agent_id}', {
            params: { path: { workspace_id: this.workspaceId, agent_id: agentId } },
        });
    }
    async listVersions(agentId, params) {
        return extractData(await this.client.GET('/v1/{workspace_id}/agents/{agent_id}/versions', {
            params: { path: { workspace_id: this.workspaceId, agent_id: agentId }, query: params },
        }));
    }
    listVersionsAutoPaging(agentId, params) {
        return this.iteratePaginatedList((pageParams) => this.listVersions(agentId, pageParams), params);
    }
    async getVersion(agentId, version) {
        return extractData(await this.client.GET('/v1/{workspace_id}/agents/{agent_id}/versions/{version}', {
            params: {
                path: { workspace_id: this.workspaceId, agent_id: agentId, version: String(version) },
            },
        }));
    }
    async createVersion(agentId, body) {
        return extractData(await this.client.POST('/v1/{workspace_id}/agents/{agent_id}/versions', {
            params: { path: { workspace_id: this.workspaceId, agent_id: agentId } },
            body,
        }));
    }
}
//# sourceMappingURL=agents.js.map