"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.QueryBlackboardReadUnReadResponseBodyUsers = exports.GetBlackboardResponseBodyUserList = exports.GetBlackboardResponseBodyDeptList = exports.GetBlackboardResponseBodyAttachments = exports.QueryBlackboardSpaceResponse = exports.QueryBlackboardSpaceResponseBody = exports.QueryBlackboardSpaceRequest = exports.QueryBlackboardSpaceHeaders = exports.QueryBlackboardReadUnReadResponse = exports.QueryBlackboardReadUnReadResponseBody = exports.QueryBlackboardReadUnReadRequest = exports.QueryBlackboardReadUnReadHeaders = exports.GetBlackboardResponse = exports.GetBlackboardResponseBody = exports.GetBlackboardRequest = exports.GetBlackboardHeaders = 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 GetBlackboardHeaders 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.GetBlackboardHeaders = GetBlackboardHeaders;
class GetBlackboardRequest extends $tea.Model {
    static names() {
        return {
            blackboardId: 'blackboardId',
            operationUserId: 'operationUserId',
        };
    }
    static types() {
        return {
            blackboardId: 'string',
            operationUserId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetBlackboardRequest = GetBlackboardRequest;
class GetBlackboardResponseBody extends $tea.Model {
    static names() {
        return {
            attachments: 'attachments',
            categoryId: 'categoryId',
            categoryName: 'categoryName',
            content: 'content',
            coverPicUrl: 'coverPicUrl',
            depNameList: 'depNameList',
            deptList: 'deptList',
            gmtCreate: 'gmtCreate',
            gmtModified: 'gmtModified',
            id: 'id',
            isPushTop: 'isPushTop',
            privateLevel: 'privateLevel',
            readCount: 'readCount',
            senderStaffId: 'senderStaffId',
            title: 'title',
            unReadCount: 'unReadCount',
            userList: 'userList',
            userNameList: 'userNameList',
        };
    }
    static types() {
        return {
            attachments: { 'type': 'array', 'itemType': GetBlackboardResponseBodyAttachments },
            categoryId: 'string',
            categoryName: 'string',
            content: 'string',
            coverPicUrl: 'string',
            depNameList: { 'type': 'array', 'itemType': 'string' },
            deptList: { 'type': 'array', 'itemType': GetBlackboardResponseBodyDeptList },
            gmtCreate: 'string',
            gmtModified: 'string',
            id: 'string',
            isPushTop: 'number',
            privateLevel: 'number',
            readCount: 'number',
            senderStaffId: 'string',
            title: 'string',
            unReadCount: 'number',
            userList: { 'type': 'array', 'itemType': GetBlackboardResponseBodyUserList },
            userNameList: { 'type': 'array', 'itemType': 'string' },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetBlackboardResponseBody = GetBlackboardResponseBody;
class GetBlackboardResponse 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: GetBlackboardResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetBlackboardResponse = GetBlackboardResponse;
class QueryBlackboardReadUnReadHeaders 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.QueryBlackboardReadUnReadHeaders = QueryBlackboardReadUnReadHeaders;
class QueryBlackboardReadUnReadRequest extends $tea.Model {
    static names() {
        return {
            blackboardId: 'blackboardId',
            maxResults: 'maxResults',
            nextToken: 'nextToken',
            operationUserId: 'operationUserId',
        };
    }
    static types() {
        return {
            blackboardId: 'string',
            maxResults: 'number',
            nextToken: 'string',
            operationUserId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.QueryBlackboardReadUnReadRequest = QueryBlackboardReadUnReadRequest;
class QueryBlackboardReadUnReadResponseBody extends $tea.Model {
    static names() {
        return {
            nextToken: 'nextToken',
            users: 'users',
        };
    }
    static types() {
        return {
            nextToken: 'string',
            users: { 'type': 'array', 'itemType': QueryBlackboardReadUnReadResponseBodyUsers },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.QueryBlackboardReadUnReadResponseBody = QueryBlackboardReadUnReadResponseBody;
class QueryBlackboardReadUnReadResponse 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: QueryBlackboardReadUnReadResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.QueryBlackboardReadUnReadResponse = QueryBlackboardReadUnReadResponse;
class QueryBlackboardSpaceHeaders 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.QueryBlackboardSpaceHeaders = QueryBlackboardSpaceHeaders;
class QueryBlackboardSpaceRequest extends $tea.Model {
    static names() {
        return {
            operationUserId: 'operationUserId',
        };
    }
    static types() {
        return {
            operationUserId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.QueryBlackboardSpaceRequest = QueryBlackboardSpaceRequest;
class QueryBlackboardSpaceResponseBody extends $tea.Model {
    static names() {
        return {
            spaceId: 'spaceId',
        };
    }
    static types() {
        return {
            spaceId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.QueryBlackboardSpaceResponseBody = QueryBlackboardSpaceResponseBody;
class QueryBlackboardSpaceResponse 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: QueryBlackboardSpaceResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.QueryBlackboardSpaceResponse = QueryBlackboardSpaceResponse;
class GetBlackboardResponseBodyAttachments extends $tea.Model {
    static names() {
        return {
            dentryId: 'dentryId',
            fileName: 'fileName',
            fileType: 'fileType',
            spaceId: 'spaceId',
        };
    }
    static types() {
        return {
            dentryId: 'string',
            fileName: 'string',
            fileType: 'string',
            spaceId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetBlackboardResponseBodyAttachments = GetBlackboardResponseBodyAttachments;
class GetBlackboardResponseBodyDeptList extends $tea.Model {
    static names() {
        return {
            deptId: 'deptId',
            name: 'name',
        };
    }
    static types() {
        return {
            deptId: 'string',
            name: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetBlackboardResponseBodyDeptList = GetBlackboardResponseBodyDeptList;
class GetBlackboardResponseBodyUserList extends $tea.Model {
    static names() {
        return {
            corpId: 'corpId',
            name: 'name',
            staffId: 'staffId',
        };
    }
    static types() {
        return {
            corpId: 'string',
            name: 'string',
            staffId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GetBlackboardResponseBodyUserList = GetBlackboardResponseBodyUserList;
class QueryBlackboardReadUnReadResponseBodyUsers extends $tea.Model {
    static names() {
        return {
            read: 'read',
            readTimestamp: 'readTimestamp',
            userId: 'userId',
        };
    }
    static types() {
        return {
            read: 'string',
            readTimestamp: 'number',
            userId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.QueryBlackboardReadUnReadResponseBodyUsers = QueryBlackboardReadUnReadResponseBodyUsers;
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 - GetBlackboardRequest
     * @param headers - GetBlackboardHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns GetBlackboardResponse
     */
    async getBlackboardWithOptions(request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let query = {};
        if (!tea_util_1.default.isUnset(request.blackboardId)) {
            query["blackboardId"] = request.blackboardId;
        }
        if (!tea_util_1.default.isUnset(request.operationUserId)) {
            query["operationUserId"] = request.operationUserId;
        }
        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: "GetBlackboard",
            version: "blackboard_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/blackboard/get_blackboard`,
            method: "GET",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new GetBlackboardResponse({}));
    }
    /**
     * 获取公告详情
     *
     * @param request - GetBlackboardRequest
     * @returns GetBlackboardResponse
     */
    async getBlackboard(request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new GetBlackboardHeaders({});
        return await this.getBlackboardWithOptions(request, headers, runtime);
    }
    /**
     * 查询公告已读未读人员列表
     *
     * @param request - QueryBlackboardReadUnReadRequest
     * @param headers - QueryBlackboardReadUnReadHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns QueryBlackboardReadUnReadResponse
     */
    async queryBlackboardReadUnReadWithOptions(request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let query = {};
        if (!tea_util_1.default.isUnset(request.blackboardId)) {
            query["blackboardId"] = request.blackboardId;
        }
        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.operationUserId)) {
            query["operationUserId"] = request.operationUserId;
        }
        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: "QueryBlackboardReadUnRead",
            version: "blackboard_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/blackboard/readers`,
            method: "GET",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new QueryBlackboardReadUnReadResponse({}));
    }
    /**
     * 查询公告已读未读人员列表
     *
     * @param request - QueryBlackboardReadUnReadRequest
     * @returns QueryBlackboardReadUnReadResponse
     */
    async queryBlackboardReadUnRead(request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new QueryBlackboardReadUnReadHeaders({});
        return await this.queryBlackboardReadUnReadWithOptions(request, headers, runtime);
    }
    /**
     * 获取公告钉盘空间信息
     *
     * @param request - QueryBlackboardSpaceRequest
     * @param headers - QueryBlackboardSpaceHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns QueryBlackboardSpaceResponse
     */
    async queryBlackboardSpaceWithOptions(request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let query = {};
        if (!tea_util_1.default.isUnset(request.operationUserId)) {
            query["operationUserId"] = request.operationUserId;
        }
        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: "QueryBlackboardSpace",
            version: "blackboard_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/blackboard/spaces`,
            method: "GET",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new QueryBlackboardSpaceResponse({}));
    }
    /**
     * 获取公告钉盘空间信息
     *
     * @param request - QueryBlackboardSpaceRequest
     * @returns QueryBlackboardSpaceResponse
     */
    async queryBlackboardSpace(request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new QueryBlackboardSpaceHeaders({});
        return await this.queryBlackboardSpaceWithOptions(request, headers, runtime);
    }
}
exports.default = Client;
//# sourceMappingURL=client.js.map