var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import NotImplementedException from "../../../Types/Exception/NotImplementedException";
import logger from "../Logger";
import CaptureSpan from "../Telemetry/CaptureSpan";
export default class WorkspaceBase {
    static async isUserInDirectMessageChannel(_data) {
        throw new NotImplementedException();
    }
    static async doesChannelExist(_data) {
        throw new NotImplementedException();
    }
    static async archiveChannels(_data) {
        throw new NotImplementedException();
    }
    static async getUsernameFromUserId(_data) {
        throw new NotImplementedException();
    }
    static async showModalToUser(_data) {
        throw new NotImplementedException();
    }
    static getCheckboxBlock(_data) {
        throw new NotImplementedException();
    }
    static sendDirectMessageToUser(_data) {
        throw new NotImplementedException();
    }
    static async joinChannel(_data) {
        throw new NotImplementedException();
    }
    static async sendPayloadBlocksToChannel(_data) {
        throw new NotImplementedException();
    }
    static async inviteUsersToChannels(data) {
        for (const channelName of data.workspaceChannelInvitationPayload
            .channelNames) {
            await this.inviteUsersToChannel({
                authToken: data.authToken,
                channelName: channelName,
                workspaceUserIds: data.workspaceChannelInvitationPayload.workspaceUserIds,
                projectId: data.projectId,
            });
        }
    }
    static async inviteUsersToChannel(data) {
        for (const userId of data.workspaceUserIds) {
            await this.inviteUserToChannelByChannelName({
                authToken: data.authToken,
                channelName: data.channelName,
                workspaceUserId: userId,
                projectId: data.projectId,
            });
        }
    }
    static async inviteUserToChannelByChannelName(_data) {
        throw new NotImplementedException();
    }
    static getDateTimePickerBlock(_data) {
        throw new NotImplementedException();
    }
    static async inviteUserToChannelByChannelId(_data) { }
    static async createChannelsIfDoesNotExist(_data) {
        throw new NotImplementedException();
    }
    static async getWorkspaceChannelFromChannelId(_data) {
        throw new NotImplementedException();
    }
    static async sendMessage(_data) {
        throw new NotImplementedException();
    }
    static async getAllWorkspaceChannels(_data) {
        throw new NotImplementedException();
    }
    static async getWorkspaceChannelFromChannelName(_data) {
        throw new NotImplementedException();
    }
    static async createChannel(_data) {
        throw new NotImplementedException();
    }
    static getHeaderBlock(_data) {
        throw new NotImplementedException();
    }
    static getDividerBlock() {
        throw new NotImplementedException();
    }
    static getMarkdownBlock(_data) {
        throw new NotImplementedException();
    }
    static getButtonBlock(_data) {
        throw new NotImplementedException();
    }
    static getBlocksFromWorkspaceMessagePayload(data) {
        const { messageBlocks } = data;
        const blocks = [];
        for (const block of messageBlocks) {
            switch (block._type) {
                case "WorkspacePayloadHeader":
                    blocks.push(this.getHeaderBlock({
                        payloadHeaderBlock: block,
                    }));
                    break;
                case "WorkspacePayloadMarkdown":
                    blocks.push(this.getMarkdownBlock({
                        payloadMarkdownBlock: block,
                    }));
                    break;
                case "WorkspacePayloadDivider":
                    blocks.push(this.getDividerBlock());
                    break;
                case "WorkspacePayloadButtons":
                    blocks.push(this.getButtonsBlock({
                        payloadButtonsBlock: block,
                    }));
                    break;
                case "WorkspaceTextAreaBlock":
                    blocks.push(this.getTextAreaBlock({
                        payloadTextAreaBlock: block,
                    }));
                    break;
                case "WorkspaceTextBoxBlock":
                    blocks.push(this.getTextBoxBlock({
                        payloadTextBoxBlock: block,
                    }));
                    break;
                case "WorkspacePayloadImage":
                    blocks.push(this.getImageBlock({
                        payloadImageBlock: block,
                    }));
                    break;
                case "WorkspaceDropdownBlock":
                    blocks.push(this.getDropdownBlock({
                        payloadDropdownBlock: block,
                    }));
                    break;
                case "WorkspaceModalBlock":
                    blocks.push(this.getModalBlock({
                        payloadModalBlock: block,
                    }));
                    break;
                case "WorkspaceDateTimePickerBlock":
                    blocks.push(this.getDateTimePickerBlock({
                        payloadDateTimePickerBlock: block,
                    }));
                    break;
                default:
                    logger.error("Unknown block type: " + block._type, {
                        blockType: block._type,
                    });
                    break;
            }
        }
        return blocks;
    }
    static getTextAreaBlock(_data) {
        throw new NotImplementedException();
    }
    static getTextBoxBlock(_data) {
        throw new NotImplementedException();
    }
    static getImageBlock(_data) {
        throw new NotImplementedException();
    }
    static getDropdownBlock(_data) {
        throw new NotImplementedException();
    }
    static getModalBlock(_data) {
        throw new NotImplementedException();
    }
    static getButtonsBlock(_data) {
        throw new NotImplementedException();
    }
    static async sendMessageToChannelViaIncomingWebhook(_data) {
        throw new NotImplementedException();
    }
    static async isUserInChannel(_data) {
        throw new NotImplementedException();
    }
}
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], WorkspaceBase, "isUserInDirectMessageChannel", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], WorkspaceBase, "doesChannelExist", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], WorkspaceBase, "archiveChannels", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], WorkspaceBase, "getUsernameFromUserId", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], WorkspaceBase, "showModalToUser", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Object)
], WorkspaceBase, "getCheckboxBlock", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], WorkspaceBase, "sendDirectMessageToUser", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], WorkspaceBase, "joinChannel", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], WorkspaceBase, "sendPayloadBlocksToChannel", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], WorkspaceBase, "inviteUsersToChannels", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], WorkspaceBase, "inviteUsersToChannel", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], WorkspaceBase, "inviteUserToChannelByChannelName", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Object)
], WorkspaceBase, "getDateTimePickerBlock", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], WorkspaceBase, "inviteUserToChannelByChannelId", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], WorkspaceBase, "createChannelsIfDoesNotExist", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], WorkspaceBase, "getWorkspaceChannelFromChannelId", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], WorkspaceBase, "sendMessage", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], WorkspaceBase, "getAllWorkspaceChannels", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], WorkspaceBase, "getWorkspaceChannelFromChannelName", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], WorkspaceBase, "createChannel", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Object)
], WorkspaceBase, "getHeaderBlock", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", []),
    __metadata("design:returntype", Object)
], WorkspaceBase, "getDividerBlock", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Object)
], WorkspaceBase, "getMarkdownBlock", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Object)
], WorkspaceBase, "getButtonBlock", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Array)
], WorkspaceBase, "getBlocksFromWorkspaceMessagePayload", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Object)
], WorkspaceBase, "getTextAreaBlock", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Object)
], WorkspaceBase, "getTextBoxBlock", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Object)
], WorkspaceBase, "getImageBlock", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Object)
], WorkspaceBase, "getDropdownBlock", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Object)
], WorkspaceBase, "getModalBlock", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Object)
], WorkspaceBase, "getButtonsBlock", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], WorkspaceBase, "sendMessageToChannelViaIncomingWebhook", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], WorkspaceBase, "isUserInChannel", null);
//# sourceMappingURL=WorkspaceBase.js.map