import { WorkspaceScopedResource, extractData } from './base.js';
export class OperatorsResource extends WorkspaceScopedResource {
    async list(params) {
        return extractData(await this.client.GET('/v1/{workspace_id}/operators', {
            params: { path: { workspace_id: this.workspaceId }, query: params },
        }));
    }
    listAutoPaging(params) {
        return this.iterateOffsetPaginatedList((pageParams) => this.list(pageParams), (page) => page.items, params);
    }
    async create(body) {
        return extractData(await this.client.POST('/v1/{workspace_id}/operators', {
            params: { path: { workspace_id: this.workspaceId } },
            body,
        }));
    }
    async get(operatorId) {
        return extractData(await this.client.GET('/v1/{workspace_id}/operators/{operator_id}', {
            params: { path: { workspace_id: this.workspaceId, operator_id: operatorId } },
        }));
    }
    /** Update an operator (name, role, status, etc.) */
    async update(operatorId, body) {
        return extractData(await this.client.PATCH('/v1/{workspace_id}/operators/{operator_id}', {
            params: { path: { workspace_id: this.workspaceId, operator_id: operatorId } },
            body,
        }));
    }
    async getDashboard() {
        return extractData(await this.client.GET('/v1/{workspace_id}/operators/dashboard', {
            params: { path: { workspace_id: this.workspaceId } },
        }));
    }
    async getQueue() {
        return extractData(await this.client.GET('/v1/{workspace_id}/operators/queue', {
            params: { path: { workspace_id: this.workspaceId } },
        }));
    }
    async getEscalations(params) {
        return extractData(await this.client.GET('/v1/{workspace_id}/operators/escalations', {
            params: { path: { workspace_id: this.workspaceId }, query: params },
        }));
    }
    getEscalationsAutoPaging(params) {
        return this.iterateOffsetPaginatedList((pageParams) => this.getEscalations(pageParams), (page) => page.items, params);
    }
    async getActiveEscalations() {
        return extractData(await this.client.GET('/v1/{workspace_id}/operators/escalations/active', {
            params: { path: { workspace_id: this.workspaceId } },
        }));
    }
    async getEscalationStats(params) {
        return extractData(await this.client.GET('/v1/{workspace_id}/operators/escalations/stats', {
            params: { path: { workspace_id: this.workspaceId }, query: params },
        }));
    }
    async getPerformance(params) {
        return extractData(await this.client.GET('/v1/{workspace_id}/operators/performance', {
            params: { path: { workspace_id: this.workspaceId }, query: params },
        }));
    }
    async getAccessToken(operatorId, body) {
        return extractData(await this.client.POST('/v1/{workspace_id}/operators/{operator_id}/access-token', {
            params: { path: { workspace_id: this.workspaceId, operator_id: operatorId } },
            body,
        }));
    }
    async joinCall(operatorId, body) {
        return extractData(await this.client.POST('/v1/{workspace_id}/operators/{operator_id}/join-call', {
            params: { path: { workspace_id: this.workspaceId, operator_id: operatorId } },
            body,
        }));
    }
    async leaveCall(operatorId, body) {
        return extractData(await this.client.POST('/v1/{workspace_id}/operators/{operator_id}/leave-call', {
            params: { path: { workspace_id: this.workspaceId, operator_id: operatorId } },
            body,
        }));
    }
    async switchMode(operatorId, body) {
        return extractData(await this.client.POST('/v1/{workspace_id}/operators/{operator_id}/switch-mode', {
            params: { path: { workspace_id: this.workspaceId, operator_id: operatorId } },
            body,
        }));
    }
    async sendGuidance(operatorId, body) {
        return extractData(await this.client.POST('/v1/{workspace_id}/operators/{operator_id}/send-guidance', {
            params: { path: { workspace_id: this.workspaceId, operator_id: operatorId } },
            body,
        }));
    }
    async createBriefing(operatorId, body) {
        return extractData(await this.client.POST('/v1/{workspace_id}/operators/{operator_id}/briefing', {
            params: { path: { workspace_id: this.workspaceId, operator_id: operatorId } },
            body,
        }));
    }
    async wrapUp(operatorId, body) {
        return extractData(await this.client.POST('/v1/{workspace_id}/operators/{operator_id}/wrap-up', {
            params: { path: { workspace_id: this.workspaceId, operator_id: operatorId } },
            body,
        }));
    }
    async getCallTranscript(callSid) {
        return extractData(await this.client.GET('/v1/{workspace_id}/operators/calls/{call_sid}/transcript', {
            params: { path: { workspace_id: this.workspaceId, call_sid: callSid } },
        }));
    }
    async getAuditLog(params) {
        return extractData(await this.client.GET('/v1/{workspace_id}/operators/audit-log', {
            params: { path: { workspace_id: this.workspaceId }, query: params },
        }));
    }
    getAuditLogAutoPaging(params) {
        return this.iterateOffsetPaginatedList((pageParams) => this.getAuditLog(pageParams), (page) => page.items, params);
    }
}
//# sourceMappingURL=operators.js.map