"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.CreateTopboxRequestCardSettings = exports.CreateTopboxRequestCardData = exports.CreateGroupRequestUsers = exports.CreateCoupleGroupRequestUsers = exports.GroupManagerDeviceMarketResponse = exports.GroupManagerDeviceMarketResponseBody = exports.CreateTopboxResponse = exports.CreateTopboxResponseBody = exports.CreateTopboxRequest = exports.CreateTopboxHeaders = exports.CreateGroupResponse = exports.CreateGroupResponseBody = exports.CreateGroupRequest = exports.CreateGroupHeaders = exports.CreateCoupleGroupResponse = exports.CreateCoupleGroupResponseBody = exports.CreateCoupleGroupRequest = exports.CreateCoupleGroupHeaders = exports.CloseTopboxResponse = exports.CloseTopboxResponseBody = exports.CloseTopboxRequest = exports.CloseTopboxHeaders = exports.UserIdPrivateDataMapValue = exports.UnionIdPrivateDataMapValue = 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 UnionIdPrivateDataMapValue extends $tea.Model {
    static names() {
        return {
            cardParamMap: 'cardParamMap',
        };
    }
    static types() {
        return {
            cardParamMap: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UnionIdPrivateDataMapValue = UnionIdPrivateDataMapValue;
class UserIdPrivateDataMapValue extends $tea.Model {
    static names() {
        return {
            cardParamMap: 'cardParamMap',
        };
    }
    static types() {
        return {
            cardParamMap: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UserIdPrivateDataMapValue = UserIdPrivateDataMapValue;
class CloseTopboxHeaders 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.CloseTopboxHeaders = CloseTopboxHeaders;
class CloseTopboxRequest extends $tea.Model {
    static names() {
        return {
            conversationType: 'conversationType',
            coolAppCode: 'coolAppCode',
            groupTemplateId: 'groupTemplateId',
            openConversationId: 'openConversationId',
            outTrackId: 'outTrackId',
            robotCode: 'robotCode',
            unoinId: 'unoinId',
            userId: 'userId',
        };
    }
    static types() {
        return {
            conversationType: 'number',
            coolAppCode: 'string',
            groupTemplateId: 'string',
            openConversationId: 'string',
            outTrackId: 'string',
            robotCode: 'string',
            unoinId: 'string',
            userId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CloseTopboxRequest = CloseTopboxRequest;
class CloseTopboxResponseBody extends $tea.Model {
    static names() {
        return {
            success: 'success',
        };
    }
    static types() {
        return {
            success: 'boolean',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CloseTopboxResponseBody = CloseTopboxResponseBody;
class CloseTopboxResponse 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: CloseTopboxResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CloseTopboxResponse = CloseTopboxResponse;
class CreateCoupleGroupHeaders 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.CreateCoupleGroupHeaders = CreateCoupleGroupHeaders;
class CreateCoupleGroupRequest extends $tea.Model {
    static names() {
        return {
            groupTemplateId: 'groupTemplateId',
            operatorId: 'operatorId',
            users: 'users',
        };
    }
    static types() {
        return {
            groupTemplateId: 'string',
            operatorId: 'string',
            users: { 'type': 'array', 'itemType': CreateCoupleGroupRequestUsers },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateCoupleGroupRequest = CreateCoupleGroupRequest;
class CreateCoupleGroupResponseBody extends $tea.Model {
    static names() {
        return {
            appUserIds: 'appUserIds',
            conversationId: 'conversationId',
            openConversationId: 'openConversationId',
            userIds: 'userIds',
        };
    }
    static types() {
        return {
            appUserIds: { 'type': 'array', 'itemType': 'string' },
            conversationId: 'string',
            openConversationId: 'string',
            userIds: { 'type': 'array', 'itemType': 'string' },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateCoupleGroupResponseBody = CreateCoupleGroupResponseBody;
class CreateCoupleGroupResponse 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: CreateCoupleGroupResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateCoupleGroupResponse = CreateCoupleGroupResponse;
class CreateGroupHeaders 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.CreateGroupHeaders = CreateGroupHeaders;
class CreateGroupRequest extends $tea.Model {
    static names() {
        return {
            groupAvatar: 'groupAvatar',
            groupName: 'groupName',
            groupTemplateId: 'groupTemplateId',
            operatorId: 'operatorId',
            users: 'users',
        };
    }
    static types() {
        return {
            groupAvatar: 'string',
            groupName: 'string',
            groupTemplateId: 'string',
            operatorId: 'string',
            users: { 'type': 'array', 'itemType': CreateGroupRequestUsers },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateGroupRequest = CreateGroupRequest;
class CreateGroupResponseBody extends $tea.Model {
    static names() {
        return {
            appUserIds: 'appUserIds',
            conversationId: 'conversationId',
            openConversationId: 'openConversationId',
            userIds: 'userIds',
        };
    }
    static types() {
        return {
            appUserIds: { 'type': 'array', 'itemType': 'string' },
            conversationId: 'string',
            openConversationId: 'string',
            userIds: { 'type': 'array', 'itemType': 'string' },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateGroupResponseBody = CreateGroupResponseBody;
class CreateGroupResponse 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: CreateGroupResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateGroupResponse = CreateGroupResponse;
class CreateTopboxHeaders 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.CreateTopboxHeaders = CreateTopboxHeaders;
class CreateTopboxRequest extends $tea.Model {
    static names() {
        return {
            callbackRouteKey: 'callbackRouteKey',
            cardData: 'cardData',
            cardSettings: 'cardSettings',
            cardTemplateId: 'cardTemplateId',
            conversationType: 'conversationType',
            coolAppCode: 'coolAppCode',
            expiredTime: 'expiredTime',
            groupTemplateId: 'groupTemplateId',
            openConversationId: 'openConversationId',
            outTrackId: 'outTrackId',
            platforms: 'platforms',
            receiverUnionIdList: 'receiverUnionIdList',
            receiverUserIdList: 'receiverUserIdList',
            robotCode: 'robotCode',
            unionId: 'unionId',
            unionIdPrivateDataMap: 'unionIdPrivateDataMap',
            userId: 'userId',
            userIdPrivateDataMap: 'userIdPrivateDataMap',
        };
    }
    static types() {
        return {
            callbackRouteKey: 'string',
            cardData: CreateTopboxRequestCardData,
            cardSettings: CreateTopboxRequestCardSettings,
            cardTemplateId: 'string',
            conversationType: 'number',
            coolAppCode: 'string',
            expiredTime: 'number',
            groupTemplateId: 'string',
            openConversationId: 'string',
            outTrackId: 'string',
            platforms: 'string',
            receiverUnionIdList: { 'type': 'array', 'itemType': 'string' },
            receiverUserIdList: { 'type': 'array', 'itemType': 'string' },
            robotCode: 'string',
            unionId: 'string',
            unionIdPrivateDataMap: { 'type': 'map', 'keyType': 'string', 'valueType': UnionIdPrivateDataMapValue },
            userId: 'string',
            userIdPrivateDataMap: { 'type': 'map', 'keyType': 'string', 'valueType': UserIdPrivateDataMapValue },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateTopboxRequest = CreateTopboxRequest;
class CreateTopboxResponseBody extends $tea.Model {
    static names() {
        return {
            success: 'success',
        };
    }
    static types() {
        return {
            success: 'boolean',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateTopboxResponseBody = CreateTopboxResponseBody;
class CreateTopboxResponse 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: CreateTopboxResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateTopboxResponse = CreateTopboxResponse;
class GroupManagerDeviceMarketResponseBody extends $tea.Model {
    static names() {
        return {
            requestId: 'requestId',
        };
    }
    static types() {
        return {
            requestId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GroupManagerDeviceMarketResponseBody = GroupManagerDeviceMarketResponseBody;
class GroupManagerDeviceMarketResponse 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: GroupManagerDeviceMarketResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.GroupManagerDeviceMarketResponse = GroupManagerDeviceMarketResponse;
class CreateCoupleGroupRequestUsers extends $tea.Model {
    static names() {
        return {
            appUserId: 'appUserId',
            groupOwner: 'groupOwner',
            userId: 'userId',
        };
    }
    static types() {
        return {
            appUserId: 'string',
            groupOwner: 'boolean',
            userId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateCoupleGroupRequestUsers = CreateCoupleGroupRequestUsers;
class CreateGroupRequestUsers extends $tea.Model {
    static names() {
        return {
            appUserId: 'appUserId',
            groupOwner: 'groupOwner',
            userId: 'userId',
        };
    }
    static types() {
        return {
            appUserId: 'string',
            groupOwner: 'boolean',
            userId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateGroupRequestUsers = CreateGroupRequestUsers;
class CreateTopboxRequestCardData extends $tea.Model {
    static names() {
        return {
            cardParamMap: 'cardParamMap',
        };
    }
    static types() {
        return {
            cardParamMap: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateTopboxRequestCardData = CreateTopboxRequestCardData;
class CreateTopboxRequestCardSettings extends $tea.Model {
    static names() {
        return {
            pullStrategy: 'pullStrategy',
        };
    }
    static types() {
        return {
            pullStrategy: 'boolean',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.CreateTopboxRequestCardSettings = CreateTopboxRequestCardSettings;
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 - CloseTopboxRequest
     * @param headers - CloseTopboxHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns CloseTopboxResponse
     */
    async closeTopboxWithOptions(request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.conversationType)) {
            body["conversationType"] = request.conversationType;
        }
        if (!tea_util_1.default.isUnset(request.coolAppCode)) {
            body["coolAppCode"] = request.coolAppCode;
        }
        if (!tea_util_1.default.isUnset(request.groupTemplateId)) {
            body["groupTemplateId"] = request.groupTemplateId;
        }
        if (!tea_util_1.default.isUnset(request.openConversationId)) {
            body["openConversationId"] = request.openConversationId;
        }
        if (!tea_util_1.default.isUnset(request.outTrackId)) {
            body["outTrackId"] = request.outTrackId;
        }
        if (!tea_util_1.default.isUnset(request.robotCode)) {
            body["robotCode"] = request.robotCode;
        }
        if (!tea_util_1.default.isUnset(request.unoinId)) {
            body["unoinId"] = request.unoinId;
        }
        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: "CloseTopbox",
            version: "im_2.0",
            protocol: "HTTP",
            pathname: `/v2.0/im/topBoxes/close`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new CloseTopboxResponse({}));
    }
    /**
     * 关闭互动卡片吊顶
     *
     * @param request - CloseTopboxRequest
     * @returns CloseTopboxResponse
     */
    async closeTopbox(request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new CloseTopboxHeaders({});
        return await this.closeTopboxWithOptions(request, headers, runtime);
    }
    /**
     * 创建两人群
     *
     * @param request - CreateCoupleGroupRequest
     * @param headers - CreateCoupleGroupHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns CreateCoupleGroupResponse
     */
    async createCoupleGroupWithOptions(request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.groupTemplateId)) {
            body["groupTemplateId"] = request.groupTemplateId;
        }
        if (!tea_util_1.default.isUnset(request.operatorId)) {
            body["operatorId"] = request.operatorId;
        }
        if (!tea_util_1.default.isUnset(request.users)) {
            body["users"] = request.users;
        }
        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: "CreateCoupleGroup",
            version: "im_2.0",
            protocol: "HTTP",
            pathname: `/v2.0/im/interconnections/couples/groups`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new CreateCoupleGroupResponse({}));
    }
    /**
     * 创建两人群
     *
     * @param request - CreateCoupleGroupRequest
     * @returns CreateCoupleGroupResponse
     */
    async createCoupleGroup(request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new CreateCoupleGroupHeaders({});
        return await this.createCoupleGroupWithOptions(request, headers, runtime);
    }
    /**
     * 创建普通群
     *
     * @param request - CreateGroupRequest
     * @param headers - CreateGroupHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns CreateGroupResponse
     */
    async createGroupWithOptions(request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.groupAvatar)) {
            body["groupAvatar"] = request.groupAvatar;
        }
        if (!tea_util_1.default.isUnset(request.groupName)) {
            body["groupName"] = request.groupName;
        }
        if (!tea_util_1.default.isUnset(request.groupTemplateId)) {
            body["groupTemplateId"] = request.groupTemplateId;
        }
        if (!tea_util_1.default.isUnset(request.operatorId)) {
            body["operatorId"] = request.operatorId;
        }
        if (!tea_util_1.default.isUnset(request.users)) {
            body["users"] = request.users;
        }
        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: "CreateGroup",
            version: "im_2.0",
            protocol: "HTTP",
            pathname: `/v2.0/im/interconnections/groups`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new CreateGroupResponse({}));
    }
    /**
     * 创建普通群
     *
     * @param request - CreateGroupRequest
     * @returns CreateGroupResponse
     */
    async createGroup(request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new CreateGroupHeaders({});
        return await this.createGroupWithOptions(request, headers, runtime);
    }
    /**
     * 创建并开启互动卡片吊顶
     *
     * @param request - CreateTopboxRequest
     * @param headers - CreateTopboxHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns CreateTopboxResponse
     */
    async createTopboxWithOptions(request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.callbackRouteKey)) {
            body["callbackRouteKey"] = request.callbackRouteKey;
        }
        if (!tea_util_1.default.isUnset(request.cardData)) {
            body["cardData"] = request.cardData;
        }
        if (!tea_util_1.default.isUnset(request.cardSettings)) {
            body["cardSettings"] = request.cardSettings;
        }
        if (!tea_util_1.default.isUnset(request.cardTemplateId)) {
            body["cardTemplateId"] = request.cardTemplateId;
        }
        if (!tea_util_1.default.isUnset(request.conversationType)) {
            body["conversationType"] = request.conversationType;
        }
        if (!tea_util_1.default.isUnset(request.coolAppCode)) {
            body["coolAppCode"] = request.coolAppCode;
        }
        if (!tea_util_1.default.isUnset(request.expiredTime)) {
            body["expiredTime"] = request.expiredTime;
        }
        if (!tea_util_1.default.isUnset(request.groupTemplateId)) {
            body["groupTemplateId"] = request.groupTemplateId;
        }
        if (!tea_util_1.default.isUnset(request.openConversationId)) {
            body["openConversationId"] = request.openConversationId;
        }
        if (!tea_util_1.default.isUnset(request.outTrackId)) {
            body["outTrackId"] = request.outTrackId;
        }
        if (!tea_util_1.default.isUnset(request.platforms)) {
            body["platforms"] = request.platforms;
        }
        if (!tea_util_1.default.isUnset(request.receiverUnionIdList)) {
            body["receiverUnionIdList"] = request.receiverUnionIdList;
        }
        if (!tea_util_1.default.isUnset(request.receiverUserIdList)) {
            body["receiverUserIdList"] = request.receiverUserIdList;
        }
        if (!tea_util_1.default.isUnset(request.robotCode)) {
            body["robotCode"] = request.robotCode;
        }
        if (!tea_util_1.default.isUnset(request.unionId)) {
            body["unionId"] = request.unionId;
        }
        if (!tea_util_1.default.isUnset(request.unionIdPrivateDataMap)) {
            body["unionIdPrivateDataMap"] = request.unionIdPrivateDataMap;
        }
        if (!tea_util_1.default.isUnset(request.userId)) {
            body["userId"] = request.userId;
        }
        if (!tea_util_1.default.isUnset(request.userIdPrivateDataMap)) {
            body["userIdPrivateDataMap"] = request.userIdPrivateDataMap;
        }
        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: "CreateTopbox",
            version: "im_2.0",
            protocol: "HTTP",
            pathname: `/v2.0/im/topBoxes`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new CreateTopboxResponse({}));
    }
    /**
     * 创建并开启互动卡片吊顶
     *
     * @param request - CreateTopboxRequest
     * @returns CreateTopboxResponse
     */
    async createTopbox(request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new CreateTopboxHeaders({});
        return await this.createTopboxWithOptions(request, headers, runtime);
    }
    /**
     * 群设备市场管理
     *
     * @param headers - map
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns GroupManagerDeviceMarketResponse
     */
    async groupManagerDeviceMarketWithOptions(headers, runtime) {
        let req = new $OpenApi.OpenApiRequest({
            headers: headers,
        });
        let params = new $OpenApi.Params({
            action: "GroupManagerDeviceMarket",
            version: "im_2.0",
            protocol: "HTTP",
            pathname: `/v2.0/im/group/device/market/manager`,
            method: "GET",
            authType: "Anonymous",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new GroupManagerDeviceMarketResponse({}));
    }
    /**
     * 群设备市场管理
     * @returns GroupManagerDeviceMarketResponse
     */
    async groupManagerDeviceMarket() {
        let runtime = new $Util.RuntimeOptions({});
        let headers = {};
        return await this.groupManagerDeviceMarketWithOptions(headers, runtime);
    }
}
exports.default = Client;
//# sourceMappingURL=client.js.map