tencentcloud-sdk-nodejs-intl-en
Version:
212 lines (182 loc) • 8.24 kB
JavaScript
/*
* Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
const AbstractModel = require("../../common/abstract_model");
/**
* DescribeCaptchaResult response structure.
* @class
*/
class DescribeCaptchaResultResponse extends AbstractModel {
constructor(){
super();
/**
* `1 OK`: Verification passed
`7 captcha no match`: The passed in `Randstr` is invalid. Make sure it is the same as the `Randstr` returned from the frontend.
`8 ticket expired`: The `Ticket` has expired. A ticket is valid for five minutes. Please generate a new `Ticket` and `Randstr`.
`9 ticket reused`: The specified `Ticket` has been used. Please generate a new `Ticket` and `Randstr`.
`15 decrypt fail`: The specified `Ticket` is invalid. Make sure it's the same as the Ticket returned from the frontend.
`16 appid-ticket mismatch`: The specified `CaptchaAppId` is invalid. Make sure it's the same as the `CaptchaAppId` returned from the frontend. You can obtain it from the CAPTCHA console in **Verification management** > **Basic configuration**.
`21 diff`. Ticket verification error. Possible reasons: 1) If the ticket contains the `terror` prefix, it's usually the case that a disaster recovery ticket is generated due to the network connection problems of the user. You can choose to ignore it or verify again. 2) If the ticket does not include the `terror` prefix, Captcha detects security risk on this request . You can choose to block it or not.
`100 appid-secretkey-ticket mismatch`: Parameter error. 1) Make sure `CaptchaAppId` and `AppSecretKey` are correct. `CaptchaAppId` and `AppSecretKey` in the CAPTACHA console under **Verification management** > **Basic configuration**. 2) Make sure the passed-in `Ticket` is generated by using the passed-in `CaptchaAppId`.
* @type {number || null}
*/
this.CaptchaCode = null;
/**
* Status description and verification error message
Note: This field may return `null`, indicating that no valid value was found.
* @type {string || null}
*/
this.CaptchaMsg = null;
/**
* This parameter returns the result of imperceptible verification. This parameter is not available for Tencent Cloud International yet.
`0`: The request is trusted.
`100`: The request is malicious.
Note: This field may return `null`, indicating that no valid value was found.
* @type {number || null}
*/
this.EvilLevel = null;
/**
* The timestamp when the frontend obtains the CAPTCHA.
Note: This field may return `null`, indicating that no valid value was found.
* @type {number || null}
*/
this.GetCaptchaTime = null;
/**
* Blocking type
Note: This field may return null, indicating that no valid values can be obtained.
* @type {number || null}
*/
this.EvilBitmap = null;
/**
* The time when the CAPTCHA is submitted.
* @type {number || null}
*/
this.SubmitCaptchaTime = null;
/**
* Device Risk Category
* @type {string || null}
*/
this.DeviceRiskCategory = null;
/**
* The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.CaptchaCode = 'CaptchaCode' in params ? params.CaptchaCode : null;
this.CaptchaMsg = 'CaptchaMsg' in params ? params.CaptchaMsg : null;
this.EvilLevel = 'EvilLevel' in params ? params.EvilLevel : null;
this.GetCaptchaTime = 'GetCaptchaTime' in params ? params.GetCaptchaTime : null;
this.EvilBitmap = 'EvilBitmap' in params ? params.EvilBitmap : null;
this.SubmitCaptchaTime = 'SubmitCaptchaTime' in params ? params.SubmitCaptchaTime : null;
this.DeviceRiskCategory = 'DeviceRiskCategory' in params ? params.DeviceRiskCategory : null;
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* DescribeCaptchaResult request structure.
* @class
*/
class DescribeCaptchaResultRequest extends AbstractModel {
constructor(){
super();
/**
* It must be `9` here.
* @type {number || null}
*/
this.CaptchaType = null;
/**
* The user verification ticket returned by the frontend callback function
* @type {string || null}
*/
this.Ticket = null;
/**
* The user public IP obtained from the customer backend server
* @type {string || null}
*/
this.UserIp = null;
/**
* A random string returned by the frontend callback function
* @type {string || null}
*/
this.Randstr = null;
/**
* CAPTCHA's app ID. Log in to the [Captcha console](https://console.cloud.tencent.com/captcha/graphical) and you can view the CaptchaAppId in the "Key" column of the CAPTCHA list.
* @type {number || null}
*/
this.CaptchaAppId = null;
/**
* CAPTCHA's app key. Log in to the [Captcha console](https://console.cloud.tencent.com/captcha/graphical) and you can view the AppSecretKey in the "Key" column of the CAPTCHA list. AppSecretKey is the key for CAPTCHA ticket verification performed by the server. Please keep it confidential and do not disclose it to any third parties.
* @type {string || null}
*/
this.AppSecretKey = null;
/**
* Reserved field.
* @type {number || null}
*/
this.BusinessId = null;
/**
* Reserved field.
* @type {number || null}
*/
this.SceneId = null;
/**
* MAC address or unique identifier of a device
* @type {string || null}
*/
this.MacAddress = null;
/**
* Mobile equipment identity number
* @type {string || null}
*/
this.Imei = null;
/**
* Indicates whether to return the time when the frontend obtains the CAPTCHA. Valid values: 1 (return the time) and others.
* @type {number || null}
*/
this.NeedGetCaptchaTime = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.CaptchaType = 'CaptchaType' in params ? params.CaptchaType : null;
this.Ticket = 'Ticket' in params ? params.Ticket : null;
this.UserIp = 'UserIp' in params ? params.UserIp : null;
this.Randstr = 'Randstr' in params ? params.Randstr : null;
this.CaptchaAppId = 'CaptchaAppId' in params ? params.CaptchaAppId : null;
this.AppSecretKey = 'AppSecretKey' in params ? params.AppSecretKey : null;
this.BusinessId = 'BusinessId' in params ? params.BusinessId : null;
this.SceneId = 'SceneId' in params ? params.SceneId : null;
this.MacAddress = 'MacAddress' in params ? params.MacAddress : null;
this.Imei = 'Imei' in params ? params.Imei : null;
this.NeedGetCaptchaTime = 'NeedGetCaptchaTime' in params ? params.NeedGetCaptchaTime : null;
}
}
module.exports = {
DescribeCaptchaResultResponse: DescribeCaptchaResultResponse,
DescribeCaptchaResultRequest: DescribeCaptchaResultRequest,
}