"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.UpdateIsvOppStatusRequestIsvOpportunityStatusList = exports.BatchQueryOpportunityTagResponseBodyResult = exports.BatchQueryOpportunityTagResponseBodyResultOpportunityList = exports.UpdateIsvOppStatusResponse = exports.UpdateIsvOppStatusResponseBody = exports.UpdateIsvOppStatusRequest = exports.UpdateIsvOppStatusHeaders = exports.BatchQueryOpportunityTagResponse = exports.BatchQueryOpportunityTagResponseBody = exports.BatchQueryOpportunityTagRequest = exports.BatchQueryOpportunityTagHeaders = 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 BatchQueryOpportunityTagHeaders 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.BatchQueryOpportunityTagHeaders = BatchQueryOpportunityTagHeaders;
class BatchQueryOpportunityTagRequest extends $tea.Model {
    static names() {
        return {
            corpIdList: 'corpIdList',
        };
    }
    static types() {
        return {
            corpIdList: { 'type': 'array', 'itemType': 'string' },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.BatchQueryOpportunityTagRequest = BatchQueryOpportunityTagRequest;
class BatchQueryOpportunityTagResponseBody extends $tea.Model {
    static names() {
        return {
            result: 'result',
        };
    }
    static types() {
        return {
            result: BatchQueryOpportunityTagResponseBodyResult,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.BatchQueryOpportunityTagResponseBody = BatchQueryOpportunityTagResponseBody;
class BatchQueryOpportunityTagResponse 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: BatchQueryOpportunityTagResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.BatchQueryOpportunityTagResponse = BatchQueryOpportunityTagResponse;
class UpdateIsvOppStatusHeaders 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.UpdateIsvOppStatusHeaders = UpdateIsvOppStatusHeaders;
class UpdateIsvOppStatusRequest extends $tea.Model {
    static names() {
        return {
            isvOpportunityStatusList: 'isvOpportunityStatusList',
        };
    }
    static types() {
        return {
            isvOpportunityStatusList: { 'type': 'array', 'itemType': UpdateIsvOppStatusRequestIsvOpportunityStatusList },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateIsvOppStatusRequest = UpdateIsvOppStatusRequest;
class UpdateIsvOppStatusResponseBody extends $tea.Model {
    static names() {
        return {
            result: 'result',
        };
    }
    static types() {
        return {
            result: 'boolean',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateIsvOppStatusResponseBody = UpdateIsvOppStatusResponseBody;
class UpdateIsvOppStatusResponse 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: UpdateIsvOppStatusResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateIsvOppStatusResponse = UpdateIsvOppStatusResponse;
class BatchQueryOpportunityTagResponseBodyResultOpportunityList extends $tea.Model {
    static names() {
        return {
            activeUserCnt7d: 'activeUserCnt7d',
            appActiveState: 'appActiveState',
            corpId: 'corpId',
            fstFunnelsourceNameLv1: 'fstFunnelsourceNameLv1',
            funnelsourceNameLv1: 'funnelsourceNameLv1',
        };
    }
    static types() {
        return {
            activeUserCnt7d: 'number',
            appActiveState: 'string',
            corpId: 'string',
            fstFunnelsourceNameLv1: 'string',
            funnelsourceNameLv1: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.BatchQueryOpportunityTagResponseBodyResultOpportunityList = BatchQueryOpportunityTagResponseBodyResultOpportunityList;
class BatchQueryOpportunityTagResponseBodyResult extends $tea.Model {
    static names() {
        return {
            opportunityList: 'opportunityList',
        };
    }
    static types() {
        return {
            opportunityList: { 'type': 'array', 'itemType': BatchQueryOpportunityTagResponseBodyResultOpportunityList },
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.BatchQueryOpportunityTagResponseBodyResult = BatchQueryOpportunityTagResponseBodyResult;
class UpdateIsvOppStatusRequestIsvOpportunityStatusList extends $tea.Model {
    static names() {
        return {
            isvCorpId: 'isvCorpId',
            microAppId: 'microAppId',
            name: 'name',
            note: 'note',
            operCorpId: 'operCorpId',
            operName: 'operName',
            operTime: 'operTime',
            operUserId: 'operUserId',
            oppSourceCorpId: 'oppSourceCorpId',
            opportunityStatus: 'opportunityStatus',
            userId: 'userId',
        };
    }
    static types() {
        return {
            isvCorpId: 'string',
            microAppId: 'string',
            name: 'string',
            note: 'string',
            operCorpId: 'string',
            operName: 'string',
            operTime: 'string',
            operUserId: 'string',
            oppSourceCorpId: 'string',
            opportunityStatus: 'string',
            userId: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.UpdateIsvOppStatusRequestIsvOpportunityStatusList = UpdateIsvOppStatusRequestIsvOpportunityStatusList;
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";
        }
    }
    /**
     * ISV批量查询商机标签
     *
     * @param request - BatchQueryOpportunityTagRequest
     * @param headers - BatchQueryOpportunityTagHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns BatchQueryOpportunityTagResponse
     */
    async batchQueryOpportunityTagWithOptions(request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.corpIdList)) {
            body["corpIdList"] = request.corpIdList;
        }
        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: "BatchQueryOpportunityTag",
            version: "coolOps_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/coolOps/isvOpportunities/opportunityTags/batchQuery`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new BatchQueryOpportunityTagResponse({}));
    }
    /**
     * ISV批量查询商机标签
     *
     * @param request - BatchQueryOpportunityTagRequest
     * @returns BatchQueryOpportunityTagResponse
     */
    async batchQueryOpportunityTag(request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new BatchQueryOpportunityTagHeaders({});
        return await this.batchQueryOpportunityTagWithOptions(request, headers, runtime);
    }
    /**
     * ISV商机状态同步
     *
     * @param request - UpdateIsvOppStatusRequest
     * @param headers - UpdateIsvOppStatusHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns UpdateIsvOppStatusResponse
     */
    async updateIsvOppStatusWithOptions(request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.isvOpportunityStatusList)) {
            body["isvOpportunityStatusList"] = request.isvOpportunityStatusList;
        }
        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: "UpdateIsvOppStatus",
            version: "coolOps_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/coolOps/isvOpportunities/statuses`,
            method: "PUT",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new UpdateIsvOppStatusResponse({}));
    }
    /**
     * ISV商机状态同步
     *
     * @param request - UpdateIsvOppStatusRequest
     * @returns UpdateIsvOppStatusResponse
     */
    async updateIsvOppStatus(request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new UpdateIsvOppStatusHeaders({});
        return await this.updateIsvOppStatusWithOptions(request, headers, runtime);
    }
}
exports.default = Client;
//# sourceMappingURL=client.js.map