import { WorkspaceScopedResource, extractData } from './base.js';
/**
 * Manage services — external service configurations that agents can call.
 * Services represent integrations like scheduling systems, EHRs, or CRMs
 * that skills can interact with via their tool definitions.
 */
export class ServicesResource extends WorkspaceScopedResource {
    async create(body) {
        return extractData(await this.client.POST('/v1/{workspace_id}/services', {
            params: { path: { workspace_id: this.workspaceId } },
            body,
        }));
    }
    async list(params) {
        return extractData(await this.client.GET('/v1/{workspace_id}/services', {
            params: { path: { workspace_id: this.workspaceId }, query: params },
        }));
    }
    listAutoPaging(params) {
        return this.iteratePaginatedList((pageParams) => this.list(pageParams), params);
    }
    async get(serviceId) {
        return extractData(await this.client.GET('/v1/{workspace_id}/services/{service_id}', {
            params: { path: { workspace_id: this.workspaceId, service_id: serviceId } },
        }));
    }
    async update(serviceId, body) {
        return extractData(await this.client.PUT('/v1/{workspace_id}/services/{service_id}', {
            params: { path: { workspace_id: this.workspaceId, service_id: serviceId } },
            body,
        }));
    }
    async delete(serviceId) {
        await this.client.DELETE('/v1/{workspace_id}/services/{service_id}', {
            params: { path: { workspace_id: this.workspaceId, service_id: serviceId } },
        });
    }
}
//# sourceMappingURL=services.js.map