"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.DeleteGroupBlackboardResponse = exports.DeleteGroupBlackboardResponseBody = exports.DeleteGroupBlackboardRequest = exports.DeleteGroupBlackboardHeaders = exports.CreateGroupBlackboardResponse = exports.CreateGroupBlackboardResponseBody = exports.CreateGroupBlackboardRequest = exports.CreateGroupBlackboardHeaders = 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 CreateGroupBlackboardHeaders 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.CreateGroupBlackboardHeaders = CreateGroupBlackboardHeaders;
class CreateGroupBlackboardRequest extends $tea.Model {
    static names() {
        return {
            content: 'content',
            openConversationId: 'openConversationId',
            sendDing: 'sendDing',
            sticky: 'sticky',
            uniqueId: 'uniqueId',
            userId: 'userId',
        };
    }
    static types() {
        return {
            content: 'string',
            openConversationId: 'string',
            sendDing: 'boolean',
            sticky: 'boolean',
            uniqueId: 'string',
            userId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateGroupBlackboardRequest = CreateGroupBlackboardRequest;
class CreateGroupBlackboardResponseBody extends $tea.Model {
    static names() {
        return {
            dataId: 'dataId',
            success: 'success',
        };
    }
    static types() {
        return {
            dataId: 'string',
            success: 'boolean',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateGroupBlackboardResponseBody = CreateGroupBlackboardResponseBody;
class CreateGroupBlackboardResponse 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: CreateGroupBlackboardResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateGroupBlackboardResponse = CreateGroupBlackboardResponse;
class DeleteGroupBlackboardHeaders 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.DeleteGroupBlackboardHeaders = DeleteGroupBlackboardHeaders;
class DeleteGroupBlackboardRequest extends $tea.Model {
    static names() {
        return {
            dataId: 'dataId',
            openConversationId: 'openConversationId',
            userId: 'userId',
        };
    }
    static types() {
        return {
            dataId: 'string',
            openConversationId: 'string',
            userId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.DeleteGroupBlackboardRequest = DeleteGroupBlackboardRequest;
class DeleteGroupBlackboardResponseBody extends $tea.Model {
    static names() {
        return {
            isDeleted: 'isDeleted',
            success: 'success',
        };
    }
    static types() {
        return {
            isDeleted: 'boolean',
            success: 'boolean',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.DeleteGroupBlackboardResponseBody = DeleteGroupBlackboardResponseBody;
class DeleteGroupBlackboardResponse 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: DeleteGroupBlackboardResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.DeleteGroupBlackboardResponse = DeleteGroupBlackboardResponse;
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 - CreateGroupBlackboardRequest
     * @param headers - CreateGroupBlackboardHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns CreateGroupBlackboardResponse
     */
    async createGroupBlackboardWithOptions(request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.content)) {
            body["content"] = request.content;
        }
        if (!tea_util_1.default.isUnset(request.openConversationId)) {
            body["openConversationId"] = request.openConversationId;
        }
        if (!tea_util_1.default.isUnset(request.sendDing)) {
            body["sendDing"] = request.sendDing;
        }
        if (!tea_util_1.default.isUnset(request.sticky)) {
            body["sticky"] = request.sticky;
        }
        if (!tea_util_1.default.isUnset(request.uniqueId)) {
            body["uniqueId"] = request.uniqueId;
        }
        if (!tea_util_1.default.isUnset(request.userId)) {
            body["userId"] = request.userId;
        }
        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: "CreateGroupBlackboard",
            version: "groupBlackboard_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/groupBlackboard/blackboards`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new CreateGroupBlackboardResponse({}));
    }
    /**
     * 创建群公告
     *
     * @param request - CreateGroupBlackboardRequest
     * @returns CreateGroupBlackboardResponse
     */
    async createGroupBlackboard(request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new CreateGroupBlackboardHeaders({});
        return await this.createGroupBlackboardWithOptions(request, headers, runtime);
    }
    /**
     * 删除群公告
     *
     * @param request - DeleteGroupBlackboardRequest
     * @param headers - DeleteGroupBlackboardHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns DeleteGroupBlackboardResponse
     */
    async deleteGroupBlackboardWithOptions(request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.dataId)) {
            body["dataId"] = request.dataId;
        }
        if (!tea_util_1.default.isUnset(request.openConversationId)) {
            body["openConversationId"] = request.openConversationId;
        }
        if (!tea_util_1.default.isUnset(request.userId)) {
            body["userId"] = request.userId;
        }
        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: "DeleteGroupBlackboard",
            version: "groupBlackboard_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/groupBlackboard/blackboards/remove`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new DeleteGroupBlackboardResponse({}));
    }
    /**
     * 删除群公告
     *
     * @param request - DeleteGroupBlackboardRequest
     * @returns DeleteGroupBlackboardResponse
     */
    async deleteGroupBlackboard(request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new DeleteGroupBlackboardHeaders({});
        return await this.deleteGroupBlackboardWithOptions(request, headers, runtime);
    }
}
exports.default = Client;
//# sourceMappingURL=client.js.map