"use strict";
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;
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.UpdateMessageResponse = exports.UpdateMessageResponseBody = exports.UpdateMessageRequest = exports.UpdateMessageHeaders = exports.UpdateMailFolderResponse = exports.UpdateMailFolderResponseBody = exports.UpdateMailFolderRequest = exports.UpdateMailFolderHeaders = exports.SendMessageResponse = exports.SendMessageResponseBody = exports.SendMessageRequest = exports.SendMessageHeaders = exports.MoveMailFolderResponse = exports.MoveMailFolderResponseBody = exports.MoveMailFolderRequest = exports.MoveMailFolderHeaders = exports.ListMessagesResponse = exports.ListMessagesResponseBody = exports.ListMessagesRequest = exports.ListMessagesHeaders = exports.ListMailFoldersResponse = exports.ListMailFoldersResponseBody = exports.ListMailFoldersRequest = exports.ListMailFoldersHeaders = exports.GetMessageResponse = exports.GetMessageResponseBody = exports.GetMessageRequest = exports.GetMessageHeaders = exports.DeleteMessagesResponse = exports.DeleteMessagesResponseBody = exports.DeleteMessagesRequest = exports.DeleteMessagesHeaders = exports.DeleteMailFolderResponse = exports.DeleteMailFolderResponseBody = exports.DeleteMailFolderHeaders = exports.CreateUserResponse = exports.CreateUserResponseBody = exports.CreateUserRequest = exports.CreateUserHeaders = exports.CreateMessageResponse = exports.CreateMessageResponseBody = exports.CreateMessageRequest = exports.CreateMessageHeaders = exports.CreateMailFolderResponse = exports.CreateMailFolderResponseBody = exports.CreateMailFolderRequest = exports.CreateMailFolderHeaders = exports.Recipient = exports.Message = exports.DraftMessage = void 0;
exports.ListMailFoldersResponseBodyFolders = exports.CreateMailFolderResponseBodyFolder = exports.DraftMessageBody = void 0;
// This file is auto-generated, don't edit it
/**
 */
const tea_util_1 = __importStar(require("@alicloud/tea-util")), $Util = tea_util_1;
const gateway_dingtalk_1 = __importDefault(require("@alicloud/gateway-dingtalk"));
const openapi_client_1 = __importStar(require("@alicloud/openapi-client")), $OpenApi = openapi_client_1;
const openapi_util_1 = __importDefault(require("@alicloud/openapi-util"));
const $tea = __importStar(require("@alicloud/tea-typescript"));
class DraftMessage extends $tea.Model {
    static names() {
        return {
            bccRecipients: 'bccRecipients',
            body: 'body',
            ccRecipients: 'ccRecipients',
            from: 'from',
            internetMessageHeaders: 'internetMessageHeaders',
            internetMessageId: 'internetMessageId',
            isReadReceiptRequested: 'isReadReceiptRequested',
            priority: 'priority',
            replyTo: 'replyTo',
            subject: 'subject',
            summary: 'summary',
            tags: 'tags',
            toRecipients: 'toRecipients',
        };
    }
    static types() {
        return {
            bccRecipients: { 'type': 'array', 'itemType': Recipient },
            body: DraftMessageBody,
            ccRecipients: { 'type': 'array', 'itemType': Recipient },
            from: Recipient,
            internetMessageHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'any' },
            internetMessageId: 'Readable',
            isReadReceiptRequested: 'boolean',
            priority: 'Readable',
            replyTo: Recipient,
            subject: 'Readable',
            summary: 'Readable',
            tags: { 'type': 'array', 'itemType': 'Readable' },
            toRecipients: { 'type': 'array', 'itemType': Recipient },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.DraftMessage = DraftMessage;
class Message extends $tea.Model {
    static names() {
        return {
            bccRecipients: 'bccRecipients',
            ccRecipients: 'ccRecipients',
            conversationId: 'conversationId',
            folderId: 'folderId',
            from: 'from',
            hasAttachments: 'hasAttachments',
            id: 'id',
            internetMessageHeaders: 'internetMessageHeaders',
            internetMessageId: 'internetMessageId',
            isForwarded: 'isForwarded',
            isRead: 'isRead',
            isReadReceiptRequested: 'isReadReceiptRequested',
            isReplied: 'isReplied',
            lastModifiedDateTime: 'lastModifiedDateTime',
            priority: 'priority',
            receivedDateTime: 'receivedDateTime',
            replyTo: 'replyTo',
            sentDateTime: 'sentDateTime',
            subject: 'subject',
            summary: 'summary',
            tags: 'tags',
            toRecipients: 'toRecipients',
        };
    }
    static types() {
        return {
            bccRecipients: { 'type': 'array', 'itemType': Recipient },
            ccRecipients: { 'type': 'array', 'itemType': Recipient },
            conversationId: 'Readable',
            folderId: 'Readable',
            from: Recipient,
            hasAttachments: 'boolean',
            id: 'Readable',
            internetMessageHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'any' },
            internetMessageId: 'Readable',
            isForwarded: 'boolean',
            isRead: 'boolean',
            isReadReceiptRequested: 'boolean',
            isReplied: 'boolean',
            lastModifiedDateTime: 'Readable',
            priority: 'Readable',
            receivedDateTime: 'Readable',
            replyTo: Recipient,
            sentDateTime: 'Readable',
            subject: 'Readable',
            summary: 'Readable',
            tags: { 'type': 'array', 'itemType': 'string' },
            toRecipients: { 'type': 'array', 'itemType': Recipient },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.Message = Message;
class Recipient extends $tea.Model {
    static names() {
        return {
            email: 'email',
            name: 'name',
        };
    }
    static types() {
        return {
            email: 'Readable',
            name: 'Readable',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.Recipient = Recipient;
class CreateMailFolderHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateMailFolderHeaders = CreateMailFolderHeaders;
class CreateMailFolderRequest extends $tea.Model {
    static names() {
        return {
            displayName: 'displayName',
            extensions: 'extensions',
            folerId: 'folerId',
        };
    }
    static types() {
        return {
            displayName: 'string',
            extensions: { 'type': 'map', 'keyType': 'string', 'valueType': 'any' },
            folerId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateMailFolderRequest = CreateMailFolderRequest;
class CreateMailFolderResponseBody extends $tea.Model {
    static names() {
        return {
            folder: 'folder',
            requestId: 'requestId',
        };
    }
    static types() {
        return {
            folder: CreateMailFolderResponseBodyFolder,
            requestId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateMailFolderResponseBody = CreateMailFolderResponseBody;
class CreateMailFolderResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: CreateMailFolderResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateMailFolderResponse = CreateMailFolderResponse;
class CreateMessageHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateMessageHeaders = CreateMessageHeaders;
class CreateMessageRequest extends $tea.Model {
    static names() {
        return {
            message: 'message',
        };
    }
    static types() {
        return {
            message: DraftMessage,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateMessageRequest = CreateMessageRequest;
class CreateMessageResponseBody extends $tea.Model {
    static names() {
        return {
            message: 'message',
            requestId: 'requestId',
        };
    }
    static types() {
        return {
            message: Message,
            requestId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateMessageResponseBody = CreateMessageResponseBody;
class CreateMessageResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: CreateMessageResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateMessageResponse = CreateMessageResponse;
class CreateUserHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateUserHeaders = CreateUserHeaders;
class CreateUserRequest extends $tea.Model {
    static names() {
        return {
            email: 'email',
            employeeType: 'employeeType',
            name: 'name',
            password: 'password',
        };
    }
    static types() {
        return {
            email: 'string',
            employeeType: 'string',
            name: 'string',
            password: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateUserRequest = CreateUserRequest;
class CreateUserResponseBody extends $tea.Model {
    static names() {
        return {
            email: 'email',
        };
    }
    static types() {
        return {
            email: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateUserResponseBody = CreateUserResponseBody;
class CreateUserResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: CreateUserResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateUserResponse = CreateUserResponse;
class DeleteMailFolderHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.DeleteMailFolderHeaders = DeleteMailFolderHeaders;
class DeleteMailFolderResponseBody extends $tea.Model {
    static names() {
        return {
            requestId: 'requestId',
        };
    }
    static types() {
        return {
            requestId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.DeleteMailFolderResponseBody = DeleteMailFolderResponseBody;
class DeleteMailFolderResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: DeleteMailFolderResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.DeleteMailFolderResponse = DeleteMailFolderResponse;
class DeleteMessagesHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.DeleteMessagesHeaders = DeleteMessagesHeaders;
class DeleteMessagesRequest extends $tea.Model {
    static names() {
        return {
            deleteType: 'deleteType',
            ids: 'ids',
        };
    }
    static types() {
        return {
            deleteType: 'string',
            ids: { 'type': 'array', 'itemType': 'string' },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.DeleteMessagesRequest = DeleteMessagesRequest;
class DeleteMessagesResponseBody extends $tea.Model {
    static names() {
        return {
            requestId: 'requestId',
        };
    }
    static types() {
        return {
            requestId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.DeleteMessagesResponseBody = DeleteMessagesResponseBody;
class DeleteMessagesResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: DeleteMessagesResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.DeleteMessagesResponse = DeleteMessagesResponse;
class GetMessageHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetMessageHeaders = GetMessageHeaders;
class GetMessageRequest extends $tea.Model {
    static names() {
        return {
            selectFields: 'selectFields',
        };
    }
    static types() {
        return {
            selectFields: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetMessageRequest = GetMessageRequest;
class GetMessageResponseBody extends $tea.Model {
    static names() {
        return {
            message: 'message',
            requestId: 'requestId',
        };
    }
    static types() {
        return {
            message: Message,
            requestId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetMessageResponseBody = GetMessageResponseBody;
class GetMessageResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: GetMessageResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetMessageResponse = GetMessageResponse;
class ListMailFoldersHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.ListMailFoldersHeaders = ListMailFoldersHeaders;
class ListMailFoldersRequest extends $tea.Model {
    static names() {
        return {
            folderId: 'folderId',
        };
    }
    static types() {
        return {
            folderId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.ListMailFoldersRequest = ListMailFoldersRequest;
class ListMailFoldersResponseBody extends $tea.Model {
    static names() {
        return {
            folders: 'folders',
        };
    }
    static types() {
        return {
            folders: { 'type': 'array', 'itemType': ListMailFoldersResponseBodyFolders },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.ListMailFoldersResponseBody = ListMailFoldersResponseBody;
class ListMailFoldersResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: ListMailFoldersResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.ListMailFoldersResponse = ListMailFoldersResponse;
class ListMessagesHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.ListMessagesHeaders = ListMessagesHeaders;
class ListMessagesRequest extends $tea.Model {
    static names() {
        return {
            maxResults: 'maxResults',
            nextToken: 'nextToken',
            selectFields: 'selectFields',
        };
    }
    static types() {
        return {
            maxResults: 'number',
            nextToken: 'string',
            selectFields: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.ListMessagesRequest = ListMessagesRequest;
class ListMessagesResponseBody extends $tea.Model {
    static names() {
        return {
            hasMore: 'hasMore',
            messages: 'messages',
            nextToken: 'nextToken',
            requestId: 'requestId',
        };
    }
    static types() {
        return {
            hasMore: 'boolean',
            messages: { 'type': 'array', 'itemType': Message },
            nextToken: 'string',
            requestId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.ListMessagesResponseBody = ListMessagesResponseBody;
class ListMessagesResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: ListMessagesResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.ListMessagesResponse = ListMessagesResponse;
class MoveMailFolderHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.MoveMailFolderHeaders = MoveMailFolderHeaders;
class MoveMailFolderRequest extends $tea.Model {
    static names() {
        return {
            destinationFolderId: 'destinationFolderId',
        };
    }
    static types() {
        return {
            destinationFolderId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.MoveMailFolderRequest = MoveMailFolderRequest;
class MoveMailFolderResponseBody extends $tea.Model {
    static names() {
        return {
            requestId: 'requestId',
        };
    }
    static types() {
        return {
            requestId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.MoveMailFolderResponseBody = MoveMailFolderResponseBody;
class MoveMailFolderResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: MoveMailFolderResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.MoveMailFolderResponse = MoveMailFolderResponse;
class SendMessageHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.SendMessageHeaders = SendMessageHeaders;
class SendMessageRequest extends $tea.Model {
    static names() {
        return {
            saveToSentItems: 'saveToSentItems',
        };
    }
    static types() {
        return {
            saveToSentItems: 'boolean',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.SendMessageRequest = SendMessageRequest;
class SendMessageResponseBody extends $tea.Model {
    static names() {
        return {
            requestId: 'requestId',
        };
    }
    static types() {
        return {
            requestId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.SendMessageResponseBody = SendMessageResponseBody;
class SendMessageResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: SendMessageResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.SendMessageResponse = SendMessageResponse;
class UpdateMailFolderHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateMailFolderHeaders = UpdateMailFolderHeaders;
class UpdateMailFolderRequest extends $tea.Model {
    static names() {
        return {
            displayName: 'displayName',
        };
    }
    static types() {
        return {
            displayName: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateMailFolderRequest = UpdateMailFolderRequest;
class UpdateMailFolderResponseBody extends $tea.Model {
    static names() {
        return {
            requestId: 'requestId',
        };
    }
    static types() {
        return {
            requestId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateMailFolderResponseBody = UpdateMailFolderResponseBody;
class UpdateMailFolderResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: UpdateMailFolderResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateMailFolderResponse = UpdateMailFolderResponse;
class UpdateMessageHeaders extends $tea.Model {
    static names() {
        return {
            commonHeaders: 'commonHeaders',
            xAcsDingtalkAccessToken: 'x-acs-dingtalk-access-token',
        };
    }
    static types() {
        return {
            commonHeaders: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            xAcsDingtalkAccessToken: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateMessageHeaders = UpdateMessageHeaders;
class UpdateMessageRequest extends $tea.Model {
    static names() {
        return {
            message: 'message',
        };
    }
    static types() {
        return {
            message: DraftMessage,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateMessageRequest = UpdateMessageRequest;
class UpdateMessageResponseBody extends $tea.Model {
    static names() {
        return {
            message: 'message',
            requestId: 'requestId',
        };
    }
    static types() {
        return {
            message: Message,
            requestId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateMessageResponseBody = UpdateMessageResponseBody;
class UpdateMessageResponse extends $tea.Model {
    static names() {
        return {
            headers: 'headers',
            statusCode: 'statusCode',
            body: 'body',
        };
    }
    static types() {
        return {
            headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            statusCode: 'number',
            body: UpdateMessageResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateMessageResponse = UpdateMessageResponse;
class DraftMessageBody extends $tea.Model {
    static names() {
        return {
            bodyHtml: 'bodyHtml',
            bodyText: 'bodyText',
        };
    }
    static types() {
        return {
            bodyHtml: 'Readable',
            bodyText: 'Readable',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.DraftMessageBody = DraftMessageBody;
class CreateMailFolderResponseBodyFolder extends $tea.Model {
    static names() {
        return {
            childFolderCount: 'childFolderCount',
            displayName: 'displayName',
            extensions: 'extensions',
            id: 'id',
            parentFolderId: 'parentFolderId',
            totalItemCount: 'totalItemCount',
            unreadItemCount: 'unreadItemCount',
        };
    }
    static types() {
        return {
            childFolderCount: 'number',
            displayName: 'string',
            extensions: { 'type': 'map', 'keyType': 'string', 'valueType': 'any' },
            id: 'string',
            parentFolderId: 'string',
            totalItemCount: 'number',
            unreadItemCount: 'number',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateMailFolderResponseBodyFolder = CreateMailFolderResponseBodyFolder;
class ListMailFoldersResponseBodyFolders extends $tea.Model {
    static names() {
        return {
            childFolderCount: 'childFolderCount',
            displayName: 'displayName',
            extensions: 'extensions',
            id: 'id',
            parentFolderId: 'parentFolderId',
            totalItemCount: 'totalItemCount',
            unreadItemCount: 'unreadItemCount',
        };
    }
    static types() {
        return {
            childFolderCount: 'number',
            displayName: 'string',
            extensions: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
            id: 'string',
            parentFolderId: 'string',
            totalItemCount: 'number',
            unreadItemCount: 'number',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.ListMailFoldersResponseBodyFolders = ListMailFoldersResponseBodyFolders;
class Client extends openapi_client_1.default {
    constructor(config) {
        super(config);
        let gatewayClient = new gateway_dingtalk_1.default();
        this._spi = gatewayClient;
        this._endpointRule = "";
        if (tea_util_1.default.empty(this._endpoint)) {
            this._endpoint = "api.dingtalk.com";
        }
    }
    /**
     * 创建邮件文件夹
     *
     * @param request - CreateMailFolderRequest
     * @param headers - CreateMailFolderHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns CreateMailFolderResponse
     */
    async createMailFolderWithOptions(email, request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.displayName)) {
            body["displayName"] = request.displayName;
        }
        if (!tea_util_1.default.isUnset(request.extensions)) {
            body["extensions"] = request.extensions;
        }
        if (!tea_util_1.default.isUnset(request.folerId)) {
            body["folerId"] = request.folerId;
        }
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
            body: openapi_util_1.default.parseToMap(body),
        });
        let params = new $OpenApi.Params({
            action: "CreateMailFolder",
            version: "mail_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/mail/users/${email}/mailFolders`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new CreateMailFolderResponse({}));
    }
    /**
     * 创建邮件文件夹
     *
     * @param request - CreateMailFolderRequest
     * @returns CreateMailFolderResponse
     */
    async createMailFolder(email, request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new CreateMailFolderHeaders({});
        return await this.createMailFolderWithOptions(email, request, headers, runtime);
    }
    /**
     * 创建草稿
     *
     * @param request - CreateMessageRequest
     * @param headers - CreateMessageHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns CreateMessageResponse
     */
    async createMessageWithOptions(email, request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.message)) {
            body["message"] = request.message;
        }
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
            body: openapi_util_1.default.parseToMap(body),
        });
        let params = new $OpenApi.Params({
            action: "CreateMessage",
            version: "mail_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/mail/users/${email}/messages`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new CreateMessageResponse({}));
    }
    /**
     * 创建草稿
     *
     * @param request - CreateMessageRequest
     * @returns CreateMessageResponse
     */
    async createMessage(email, request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new CreateMessageHeaders({});
        return await this.createMessageWithOptions(email, request, headers, runtime);
    }
    /**
     * 创建企业邮箱用户
     *
     * @param request - CreateUserRequest
     * @param headers - CreateUserHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns CreateUserResponse
     */
    async createUserWithOptions(request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.email)) {
            body["email"] = request.email;
        }
        if (!tea_util_1.default.isUnset(request.employeeType)) {
            body["employeeType"] = request.employeeType;
        }
        if (!tea_util_1.default.isUnset(request.name)) {
            body["name"] = request.name;
        }
        if (!tea_util_1.default.isUnset(request.password)) {
            body["password"] = request.password;
        }
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
            body: openapi_util_1.default.parseToMap(body),
        });
        let params = new $OpenApi.Params({
            action: "CreateUser",
            version: "mail_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/mail/users`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new CreateUserResponse({}));
    }
    /**
     * 创建企业邮箱用户
     *
     * @param request - CreateUserRequest
     * @returns CreateUserResponse
     */
    async createUser(request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new CreateUserHeaders({});
        return await this.createUserWithOptions(request, headers, runtime);
    }
    /**
     * 删除文件夹
     *
     * @param headers - DeleteMailFolderHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns DeleteMailFolderResponse
     */
    async deleteMailFolderWithOptions(email, id, headers, runtime) {
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
        });
        let params = new $OpenApi.Params({
            action: "DeleteMailFolder",
            version: "mail_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/mail/users/${email}/mailFolders/${id}`,
            method: "DELETE",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new DeleteMailFolderResponse({}));
    }
    /**
     * 删除文件夹
     * @returns DeleteMailFolderResponse
     */
    async deleteMailFolder(email, id) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new DeleteMailFolderHeaders({});
        return await this.deleteMailFolderWithOptions(email, id, headers, runtime);
    }
    /**
     * 批量删除邮件
     *
     * @param request - DeleteMessagesRequest
     * @param headers - DeleteMessagesHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns DeleteMessagesResponse
     */
    async deleteMessagesWithOptions(email, request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.deleteType)) {
            body["deleteType"] = request.deleteType;
        }
        if (!tea_util_1.default.isUnset(request.ids)) {
            body["ids"] = request.ids;
        }
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
            body: openapi_util_1.default.parseToMap(body),
        });
        let params = new $OpenApi.Params({
            action: "DeleteMessages",
            version: "mail_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/mail/users/${email}/messages/batchDelete`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new DeleteMessagesResponse({}));
    }
    /**
     * 批量删除邮件
     *
     * @param request - DeleteMessagesRequest
     * @returns DeleteMessagesResponse
     */
    async deleteMessages(email, request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new DeleteMessagesHeaders({});
        return await this.deleteMessagesWithOptions(email, request, headers, runtime);
    }
    /**
     * 获取邮件元数据
     *
     * @param request - GetMessageRequest
     * @param headers - GetMessageHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns GetMessageResponse
     */
    async getMessageWithOptions(email, id, request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let query = {};
        if (!tea_util_1.default.isUnset(request.selectFields)) {
            query["selectFields"] = request.selectFields;
        }
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
            query: openapi_util_1.default.query(query),
        });
        let params = new $OpenApi.Params({
            action: "GetMessage",
            version: "mail_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/mail/users/${email}/messages/${id}`,
            method: "GET",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new GetMessageResponse({}));
    }
    /**
     * 获取邮件元数据
     *
     * @param request - GetMessageRequest
     * @returns GetMessageResponse
     */
    async getMessage(email, id, request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new GetMessageHeaders({});
        return await this.getMessageWithOptions(email, id, request, headers, runtime);
    }
    /**
     * 获取指定文件夹的子文件夹列表
     *
     * @param request - ListMailFoldersRequest
     * @param headers - ListMailFoldersHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns ListMailFoldersResponse
     */
    async listMailFoldersWithOptions(email, request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let query = {};
        if (!tea_util_1.default.isUnset(request.folderId)) {
            query["folderId"] = request.folderId;
        }
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
            query: openapi_util_1.default.query(query),
        });
        let params = new $OpenApi.Params({
            action: "ListMailFolders",
            version: "mail_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/mail/users/${email}/mailFolders`,
            method: "GET",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new ListMailFoldersResponse({}));
    }
    /**
     * 获取指定文件夹的子文件夹列表
     *
     * @param request - ListMailFoldersRequest
     * @returns ListMailFoldersResponse
     */
    async listMailFolders(email, request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new ListMailFoldersHeaders({});
        return await this.listMailFoldersWithOptions(email, request, headers, runtime);
    }
    /**
     * 获取邮件列表
     *
     * @param request - ListMessagesRequest
     * @param headers - ListMessagesHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns ListMessagesResponse
     */
    async listMessagesWithOptions(email, folderId, request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let query = {};
        if (!tea_util_1.default.isUnset(request.maxResults)) {
            query["maxResults"] = request.maxResults;
        }
        if (!tea_util_1.default.isUnset(request.nextToken)) {
            query["nextToken"] = request.nextToken;
        }
        if (!tea_util_1.default.isUnset(request.selectFields)) {
            query["selectFields"] = request.selectFields;
        }
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
            query: openapi_util_1.default.query(query),
        });
        let params = new $OpenApi.Params({
            action: "ListMessages",
            version: "mail_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/mail/users/${email}/mailFolders/${folderId}/messages`,
            method: "GET",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new ListMessagesResponse({}));
    }
    /**
     * 获取邮件列表
     *
     * @param request - ListMessagesRequest
     * @returns ListMessagesResponse
     */
    async listMessages(email, folderId, request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new ListMessagesHeaders({});
        return await this.listMessagesWithOptions(email, folderId, request, headers, runtime);
    }
    /**
     * 移动文件夹
     *
     * @param request - MoveMailFolderRequest
     * @param headers - MoveMailFolderHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns MoveMailFolderResponse
     */
    async moveMailFolderWithOptions(email, id, request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.destinationFolderId)) {
            body["destinationFolderId"] = request.destinationFolderId;
        }
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
            body: openapi_util_1.default.parseToMap(body),
        });
        let params = new $OpenApi.Params({
            action: "MoveMailFolder",
            version: "mail_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/mail/users/${email}/mailFolders/${id}/move`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new MoveMailFolderResponse({}));
    }
    /**
     * 移动文件夹
     *
     * @param request - MoveMailFolderRequest
     * @returns MoveMailFolderResponse
     */
    async moveMailFolder(email, id, request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new MoveMailFolderHeaders({});
        return await this.moveMailFolderWithOptions(email, id, request, headers, runtime);
    }
    /**
     * 发送邮件
     *
     * @param request - SendMessageRequest
     * @param headers - SendMessageHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns SendMessageResponse
     */
    async sendMessageWithOptions(email, id, request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.saveToSentItems)) {
            body["saveToSentItems"] = request.saveToSentItems;
        }
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
            body: openapi_util_1.default.parseToMap(body),
        });
        let params = new $OpenApi.Params({
            action: "SendMessage",
            version: "mail_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/mail/users/${email}/messages/${id}/send`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new SendMessageResponse({}));
    }
    /**
     * 发送邮件
     *
     * @param request - SendMessageRequest
     * @returns SendMessageResponse
     */
    async sendMessage(email, id, request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new SendMessageHeaders({});
        return await this.sendMessageWithOptions(email, id, request, headers, runtime);
    }
    /**
     * 修改文件夹信息
     *
     * @param request - UpdateMailFolderRequest
     * @param headers - UpdateMailFolderHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns UpdateMailFolderResponse
     */
    async updateMailFolderWithOptions(email, id, request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.displayName)) {
            body["displayName"] = request.displayName;
        }
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
            body: openapi_util_1.default.parseToMap(body),
        });
        let params = new $OpenApi.Params({
            action: "UpdateMailFolder",
            version: "mail_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/mail/users/${email}/mailFolders/${id}/update`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new UpdateMailFolderResponse({}));
    }
    /**
     * 修改文件夹信息
     *
     * @param request - UpdateMailFolderRequest
     * @returns UpdateMailFolderResponse
     */
    async updateMailFolder(email, id, request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new UpdateMailFolderHeaders({});
        return await this.updateMailFolderWithOptions(email, id, request, headers, runtime);
    }
    /**
     * 修改草稿
     *
     * @param request - UpdateMessageRequest
     * @param headers - UpdateMessageHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns UpdateMessageResponse
     */
    async updateMessageWithOptions(email, id, request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.message)) {
            body["message"] = request.message;
        }
        let realHeaders = {};
        if (!tea_util_1.default.isUnset(headers.commonHeaders)) {
            realHeaders = headers.commonHeaders;
        }
        if (!tea_util_1.default.isUnset(headers.xAcsDingtalkAccessToken)) {
            realHeaders["x-acs-dingtalk-access-token"] = tea_util_1.default.toJSONString(headers.xAcsDingtalkAccessToken);
        }
        let req = new $OpenApi.OpenApiRequest({
            headers: realHeaders,
            body: openapi_util_1.default.parseToMap(body),
        });
        let params = new $OpenApi.Params({
            action: "UpdateMessage",
            version: "mail_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/mail/users/${email}/messages/${id}/update`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new UpdateMessageResponse({}));
    }
    /**
     * 修改草稿
     *
     * @param request - UpdateMessageRequest
     * @returns UpdateMessageResponse
     */
    async updateMessage(email, id, request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new UpdateMessageHeaders({});
        return await this.updateMessageWithOptions(email, id, request, headers, runtime);
    }
}
exports.default = Client;
//# sourceMappingURL=client.js.map