"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.QueryScoreResponseBodyResult = exports.QueryScoreResponse = exports.QueryScoreResponseBody = exports.QueryScoreRequest = exports.QueryScoreHeaders = 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 QueryScoreHeaders 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.QueryScoreHeaders = QueryScoreHeaders;
class QueryScoreRequest extends $tea.Model {
    static names() {
        return {
            encryption: 'encryption',
            fullName: 'fullName',
            idCardCode: 'idCardCode',
            mobile: 'mobile',
            orgName: 'orgName',
            uniScCode: 'uniScCode',
        };
    }
    static types() {
        return {
            encryption: 'string',
            fullName: 'string',
            idCardCode: 'string',
            mobile: 'string',
            orgName: 'string',
            uniScCode: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.QueryScoreRequest = QueryScoreRequest;
class QueryScoreResponseBody extends $tea.Model {
    static names() {
        return {
            result: 'result',
            success: 'success',
        };
    }
    static types() {
        return {
            result: QueryScoreResponseBodyResult,
            success: 'boolean',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.QueryScoreResponseBody = QueryScoreResponseBody;
class QueryScoreResponse 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: QueryScoreResponseBody,
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.QueryScoreResponse = QueryScoreResponse;
class QueryScoreResponseBodyResult extends $tea.Model {
    static names() {
        return {
            ccocScore: 'ccocScore',
            cityChangeCnt3y: 'cityChangeCnt3y',
            cityChangeTrend2y: 'cityChangeTrend2y',
            classificationOfOrg: 'classificationOfOrg',
            growthRateLoginDays180d: 'growthRateLoginDays180d',
            indChangeCnt3y: 'indChangeCnt3y',
            indChangeTrend2y: 'indChangeTrend2y',
            jobChangeCnt3y: 'jobChangeCnt3y',
            jobTitle: 'jobTitle',
            joinDays: 'joinDays',
            loginDays14dPct: 'loginDays14dPct',
            loginDays365dPct: 'loginDays365dPct',
            orgCnt: 'orgCnt',
            orgIndustrySubNameNew: 'orgIndustrySubNameNew',
            orgIndustryUpNameNew: 'orgIndustryUpNameNew',
        };
    }
    static types() {
        return {
            ccocScore: 'number',
            cityChangeCnt3y: 'number',
            cityChangeTrend2y: 'number',
            classificationOfOrg: 'string',
            growthRateLoginDays180d: 'number',
            indChangeCnt3y: 'number',
            indChangeTrend2y: 'number',
            jobChangeCnt3y: 'number',
            jobTitle: 'string',
            joinDays: 'number',
            loginDays14dPct: 'number',
            loginDays365dPct: 'number',
            orgCnt: 'number',
            orgIndustrySubNameNew: 'string',
            orgIndustryUpNameNew: 'string',
        };
    }
    constructor(map) {
        super(map);
    }
}
exports.QueryScoreResponseBodyResult = QueryScoreResponseBodyResult;
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 - QueryScoreRequest
     * @param headers - QueryScoreHeaders
     * @param runtime - runtime options for this request RuntimeOptions
     * @returns QueryScoreResponse
     */
    async queryScoreWithOptions(request, headers, runtime) {
        tea_util_1.default.validateModel(request);
        let query = {};
        if (!tea_util_1.default.isUnset(request.encryption)) {
            query["encryption"] = request.encryption;
        }
        if (!tea_util_1.default.isUnset(request.fullName)) {
            query["fullName"] = request.fullName;
        }
        if (!tea_util_1.default.isUnset(request.idCardCode)) {
            query["idCardCode"] = request.idCardCode;
        }
        if (!tea_util_1.default.isUnset(request.mobile)) {
            query["mobile"] = request.mobile;
        }
        if (!tea_util_1.default.isUnset(request.orgName)) {
            query["orgName"] = request.orgName;
        }
        if (!tea_util_1.default.isUnset(request.uniScCode)) {
            query["uniScCode"] = request.uniScCode;
        }
        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: "QueryScore",
            version: "credit_1.0",
            protocol: "HTTP",
            pathname: `/v1.0/credit/scores`,
            method: "GET",
            authType: "AK",
            style: "ROA",
            reqBodyType: "none",
            bodyType: "json",
        });
        return $tea.cast(await this.execute(params, req, runtime), new QueryScoreResponse({}));
    }
    /**
     * 查询用户金融评分数据
     *
     * @param request - QueryScoreRequest
     * @returns QueryScoreResponse
     */
    async queryScore(request) {
        let runtime = new $Util.RuntimeOptions({});
        let headers = new QueryScoreHeaders({});
        return await this.queryScoreWithOptions(request, headers, runtime);
    }
}
exports.default = Client;
//# sourceMappingURL=client.js.map