"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.WikiWordsParseResponseBodyData = exports.WikiWordsDetailResponseBodyData = exports.WikiWordsDetailResponseBodyDataRelatedLink = exports.WikiWordsDetailResponseBodyDataRelatedDoc = exports.WikiWordsDetailResponseBodyDataAppLink = exports.WikiWordsParseResponse = exports.WikiWordsParseResponseBody = exports.WikiWordsParseRequest = exports.WikiWordsParseHeaders = exports.WikiWordsDetailResponse = exports.WikiWordsDetailResponseBody = exports.WikiWordsDetailRequest = exports.WikiWordsDetailHeaders = 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 WikiWordsDetailHeaders 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.WikiWordsDetailHeaders = WikiWordsDetailHeaders;
class WikiWordsDetailRequest extends $tea.Model {
    static names() {
        return {
            wordName: 'wordName',
        };
    }
    static types() {
        return {
            wordName: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WikiWordsDetailRequest = WikiWordsDetailRequest;
class WikiWordsDetailResponseBody extends $tea.Model {
    static names() {
        return {
            data: 'data',
            errMsg: 'errMsg',
            success: 'success',
        };
    }
    static types() {
        return {
            data: { 'type': 'array', 'itemType': WikiWordsDetailResponseBodyData },
            errMsg: 'string',
            success: 'boolean',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WikiWordsDetailResponseBody = WikiWordsDetailResponseBody;
class WikiWordsDetailResponse 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: WikiWordsDetailResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WikiWordsDetailResponse = WikiWordsDetailResponse;
class WikiWordsParseHeaders 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.WikiWordsParseHeaders = WikiWordsParseHeaders;
class WikiWordsParseRequest extends $tea.Model {
    static names() {
        return {
            content: 'content',
        };
    }
    static types() {
        return {
            content: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WikiWordsParseRequest = WikiWordsParseRequest;
class WikiWordsParseResponseBody extends $tea.Model {
    static names() {
        return {
            data: 'data',
            errMsg: 'errMsg',
            success: 'success',
        };
    }
    static types() {
        return {
            data: { 'type': 'array', 'itemType': WikiWordsParseResponseBodyData },
            errMsg: 'string',
            success: 'boolean',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WikiWordsParseResponseBody = WikiWordsParseResponseBody;
class WikiWordsParseResponse 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: WikiWordsParseResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WikiWordsParseResponse = WikiWordsParseResponse;
class WikiWordsDetailResponseBodyDataAppLink extends $tea.Model {
    static names() {
        return {
            appId: 'appId',
            appName: 'appName',
            iconLink: 'iconLink',
            pcLink: 'pcLink',
            phoneLink: 'phoneLink',
        };
    }
    static types() {
        return {
            appId: 'number',
            appName: 'string',
            iconLink: 'string',
            pcLink: 'string',
            phoneLink: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WikiWordsDetailResponseBodyDataAppLink = WikiWordsDetailResponseBodyDataAppLink;
class WikiWordsDetailResponseBodyDataRelatedDoc extends $tea.Model {
    static names() {
        return {
            link: 'link',
            name: 'name',
            type: 'type',
        };
    }
    static types() {
        return {
            link: 'string',
            name: 'string',
            type: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WikiWordsDetailResponseBodyDataRelatedDoc = WikiWordsDetailResponseBodyDataRelatedDoc;
class WikiWordsDetailResponseBodyDataRelatedLink extends $tea.Model {
    static names() {
        return {
            link: 'link',
            name: 'name',
            type: 'type',
        };
    }
    static types() {
        return {
            link: 'string',
            name: 'string',
            type: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WikiWordsDetailResponseBodyDataRelatedLink = WikiWordsDetailResponseBodyDataRelatedLink;
class WikiWordsDetailResponseBodyData extends $tea.Model {
    static names() {
        return {
            appLink: 'appLink',
            approveName: 'approveName',
            contacts: 'contacts',
            creatorName: 'creatorName',
            gmtCreate: 'gmtCreate',
            gmtModify: 'gmtModify',
            highLightWordAlias: 'highLightWordAlias',
            imHighLight: 'imHighLight',
            orgName: 'orgName',
            relatedDoc: 'relatedDoc',
            relatedLink: 'relatedLink',
            simHighLight: 'simHighLight',
            simpleWordParaphrase: 'simpleWordParaphrase',
            tagsList: 'tagsList',
            updaterName: 'updaterName',
            uuid: 'uuid',
            wordAlias: 'wordAlias',
            wordFullName: 'wordFullName',
            wordName: 'wordName',
            wordParaphrase: 'wordParaphrase',
        };
    }
    static types() {
        return {
            appLink: { 'type': 'array', 'itemType': WikiWordsDetailResponseBodyDataAppLink },
            approveName: 'string',
            contacts: { 'type': 'array', 'itemType': 'string' },
            creatorName: 'string',
            gmtCreate: 'number',
            gmtModify: 'number',
            highLightWordAlias: { 'type': 'array', 'itemType': 'string' },
            imHighLight: 'boolean',
            orgName: 'string',
            relatedDoc: { 'type': 'array', 'itemType': WikiWordsDetailResponseBodyDataRelatedDoc },
            relatedLink: { 'type': 'array', 'itemType': WikiWordsDetailResponseBodyDataRelatedLink },
            simHighLight: 'boolean',
            simpleWordParaphrase: 'string',
            tagsList: { 'type': 'array', 'itemType': 'string' },
            updaterName: 'string',
            uuid: 'number',
            wordAlias: { 'type': 'array', 'itemType': 'string' },
            wordFullName: 'string',
            wordName: 'string',
            wordParaphrase: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WikiWordsDetailResponseBodyData = WikiWordsDetailResponseBodyData;
class WikiWordsParseResponseBodyData extends $tea.Model {
    static names() {
        return {
            endIndex: 'endIndex',
            startIndex: 'startIndex',
            wordName: 'wordName',
        };
    }
    static types() {
        return {
            endIndex: 'number',
            startIndex: 'number',
            wordName: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.WikiWordsParseResponseBodyData = WikiWordsParseResponseBodyData;
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 - WikiWordsDetailRequest
     * @param headers - WikiWordsDetailHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns WikiWordsDetailResponse
     */
    async wikiWordsDetailWithOptions(request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let query = {};
        if (!tea_util_1.default.isUnset(request.wordName)) {
            query["wordName"] = request.wordName;
        }
        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: "WikiWordsDetail",
            version: "wiki_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/wiki/words/details`,
            method: "GET",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new WikiWordsDetailResponse({}));
    }
    /**
     * 根据词条名称获取该词条释义
     *
     * @param request - WikiWordsDetailRequest
     * @returns WikiWordsDetailResponse
     */
    async wikiWordsDetail(request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new WikiWordsDetailHeaders({});
        return await this.wikiWordsDetailWithOptions(request, headers, runtime);
    }
    /**
     * 外部传递过来的消息根据百科词库分词
     *
     * @param request - WikiWordsParseRequest
     * @param headers - WikiWordsParseHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns WikiWordsParseResponse
     */
    async wikiWordsParseWithOptions(request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let body = {};
        if (!tea_util_1.default.isUnset(request.content)) {
            body["content"] = request.content;
        }
        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: "WikiWordsParse",
            version: "wiki_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/wiki/words/parse`,
            method: "POST",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new WikiWordsParseResponse({}));
    }
    /**
     * 外部传递过来的消息根据百科词库分词
     *
     * @param request - WikiWordsParseRequest
     * @returns WikiWordsParseResponse
     */
    async wikiWordsParse(request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new WikiWordsParseHeaders({});
        return await this.wikiWordsParseWithOptions(request, headers, runtime);
    }
}
exports.default = Client;
//# sourceMappingURL=client.js.map