tencentcloud-sdk-nodejs-intl-en
Version:
1,533 lines (1,306 loc) • 232 kB
JavaScript
/*
* Copyright (c) 2018 Tencent. 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");
/**
* RecognizeMexicoVTID response structure.
* @class
*/
class RecognizeMexicoVTIDResponse extends AbstractModel {
constructor(){
super();
/**
* The full name.
* @type {string || null}
*/
this.Name = null;
/**
* Gender.
* @type {string || null}
*/
this.Sex = null;
/**
* Address
* @type {string || null}
*/
this.Address = null;
/**
* Vote PIN Code
* @type {string || null}
*/
this.VotePIN = null;
/**
* Unique Population Registry Code
* @type {string || null}
*/
this.CURP = null;
/**
* Date of birth.
* @type {string || null}
*/
this.Birth = null;
/**
* Section Number
* @type {string || null}
*/
this.SECCION = null;
/**
* IssueDate
* @type {string || null}
*/
this.IssueDate = null;
/**
* The validity period (expiration date).
* @type {string || null}
*/
this.ValidDate = null;
/**
* State
* @type {string || null}
*/
this.State = null;
/**
* City
* @type {string || null}
*/
this.City = null;
/**
* Locality
* @type {string || null}
*/
this.Locality = null;
/**
* Edition
* @type {string || null}
*/
this.EMISION = null;
/**
* Portrait image base64
* @type {string || null}
*/
this.PortraitImage = 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.Name = 'Name' in params ? params.Name : null;
this.Sex = 'Sex' in params ? params.Sex : null;
this.Address = 'Address' in params ? params.Address : null;
this.VotePIN = 'VotePIN' in params ? params.VotePIN : null;
this.CURP = 'CURP' in params ? params.CURP : null;
this.Birth = 'Birth' in params ? params.Birth : null;
this.SECCION = 'SECCION' in params ? params.SECCION : null;
this.IssueDate = 'IssueDate' in params ? params.IssueDate : null;
this.ValidDate = 'ValidDate' in params ? params.ValidDate : null;
this.State = 'State' in params ? params.State : null;
this.City = 'City' in params ? params.City : null;
this.Locality = 'Locality' in params ? params.Locality : null;
this.EMISION = 'EMISION' in params ? params.EMISION : null;
this.PortraitImage = 'PortraitImage' in params ? params.PortraitImage : null;
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* HKIDCardOCR request structure.
* @class
*/
class HKIDCardOCRRequest extends AbstractModel {
constructor(){
super();
/**
* Whether to return identity photo.
* @type {boolean || null}
*/
this.ReturnHeadImage = null;
/**
* Whether to check for authenticity.
* @type {boolean || null}
*/
this.DetectFake = null;
/**
* Base64 string of the image
Supported image formats: PNG, JPG, JPEG. GIF is not supported yet.
Supported image size: The downloaded image cannot exceed 7 MB after being Base64-encoded, and it cannot take longer than 3 seconds to download the image.
* @type {string || null}
*/
this.ImageBase64 = null;
/**
* URL address of image. (This field is not supported outside Chinese mainland)
Supported image formats: PNG, JPG, JPEG. GIF is currently not supported.
Supported image size: the downloaded image cannot exceed 3 MB after being Base64-encoded. The download time of the image cannot exceed 3 seconds.
We recommend you store the image in Tencent Cloud, as a Tencent Cloud URL can guarantee higher download speed and stability.
The download speed and stability of non-Tencent Cloud URLs may be low.
* @type {string || null}
*/
this.ImageUrl = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.ReturnHeadImage = 'ReturnHeadImage' in params ? params.ReturnHeadImage : null;
this.DetectFake = 'DetectFake' in params ? params.DetectFake : null;
this.ImageBase64 = 'ImageBase64' in params ? params.ImageBase64 : null;
this.ImageUrl = 'ImageUrl' in params ? params.ImageUrl : null;
}
}
/**
* ExtractDocMulti request structure.
* @class
*/
class ExtractDocMultiRequest extends AbstractModel {
constructor(){
super();
/**
* The Url address of the image. supported image formats: PNG, JPG, JPEG, WORD, EXCEL. GIF format is not currently supported. supported image size: no more than 10M after Base64 encoding. image download time should not exceed 3 seconds. supported image pixels: between 20-10000px. images stored in tencent cloud's Url ensure higher download speed and stability. it is recommended to store images in tencent cloud. the speed and stability of non-tencent cloud storage urls may be impacted.
* @type {string || null}
*/
this.ImageUrl = null;
/**
* The Base64 value of the image. supported image formats: PNG, JPG, JPEG, WORD, EXCEL. GIF format is not currently supported. supported image size: no more than 10M after encoding the downloaded image with Base64. image download time: no more than 3 seconds. supported image pixels: between 20-10000px. either ImageUrl or ImageBase64 must be provided. if both are provided, only use ImageUrl.
* @type {string || null}
*/
this.ImageBase64 = null;
/**
* Specifies the page number of the PDF to be recognized. only single page recognition is supported. valid when uploading a PDF file with the IsPdf parameter set to true. default value is the first 3 pages.
* @type {number || null}
*/
this.PdfPageNumber = null;
/**
* Specifies the field names to be returned by the customized structuring feature. for example, if the customer wants to add the recognition result of two fields, name and gender, manually input ItemNames=["name","gender"].
* @type {Array.<string> || null}
*/
this.ItemNames = null;
/**
* true: only custom field.
False: default value field + custom field.
Default true.
* @type {boolean || null}
*/
this.ItemNamesShowMode = null;
/**
* Whether the full-text field recognition is enabled.
* @type {boolean || null}
*/
this.ReturnFullText = null;
/**
* Configuration ID support:
-- General
-- InvoiceEng
-- WayBillEng
-- CustomsDeclaration
-- WeightNote
-- MedicalMeter
-- BillOfLading
-- EntrustmentBook
-- Statement
-- BookingConfirmation
-- AirWayBill
-- Table
-- SteelLabel
-- CarInsurance
-- MultiRealEstateCertificate
-- MultiRealEstateMaterial
-- HongKongUtilityBill
-- OverseasCheques
-- RegistrationCertificate
-- GridPhoto
-- SignaturePage
* @type {string || null}
*/
this.ConfigId = null;
/**
* Whether the full-text field coordinate value recognition is enabled.
* @type {boolean || null}
*/
this.EnableCoord = null;
/**
* Whether parent-child key recognition is enabled. the option is selected by default.
* @type {boolean || null}
*/
this.OutputParentKey = null;
/**
* Single attribute configuration of a template.
* @type {ConfigAdvanced || null}
*/
this.ConfigAdvanced = null;
/**
* When cn, the added key is chinese.
When set to en, the added key is english.
* @type {string || null}
*/
this.OutputLanguage = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.ImageUrl = 'ImageUrl' in params ? params.ImageUrl : null;
this.ImageBase64 = 'ImageBase64' in params ? params.ImageBase64 : null;
this.PdfPageNumber = 'PdfPageNumber' in params ? params.PdfPageNumber : null;
this.ItemNames = 'ItemNames' in params ? params.ItemNames : null;
this.ItemNamesShowMode = 'ItemNamesShowMode' in params ? params.ItemNamesShowMode : null;
this.ReturnFullText = 'ReturnFullText' in params ? params.ReturnFullText : null;
this.ConfigId = 'ConfigId' in params ? params.ConfigId : null;
this.EnableCoord = 'EnableCoord' in params ? params.EnableCoord : null;
this.OutputParentKey = 'OutputParentKey' in params ? params.OutputParentKey : null;
if (params.ConfigAdvanced) {
let obj = new ConfigAdvanced();
obj.deserialize(params.ConfigAdvanced)
this.ConfigAdvanced = obj;
}
this.OutputLanguage = 'OutputLanguage' in params ? params.OutputLanguage : null;
}
}
/**
* RecognizeBrazilIDCardOCR request structure.
* @class
*/
class RecognizeBrazilIDCardOCRRequest extends AbstractModel {
constructor(){
super();
/**
* Base64 value of the image. Supported image formats: PNG, JPG, JPEG, GIF format is not supported yet. Supported image size: The downloaded image does not exceed 7M after Base64 encoding. Image download time does not exceed 3 seconds.
* @type {string || null}
*/
this.ImageBase64 = null;
/**
* URL address of the image. Supported image formats: PNG, JPG, JPEG, GIF format is not supported yet. Supported image size: The downloaded image should not exceed 7M after Base64 encoding. Image download time should not exceed 3 seconds. URLs of images stored in Tencent Cloud can guarantee higher download speed and stability. It is recommended that images be stored in Tencent Cloud. The speed and stability of URLs not stored in Tencent Cloud may be affected to a certain extent.
* @type {string || null}
*/
this.ImageUrl = null;
/**
* Base64 value of the image on the back of the card. Supported image formats: PNG, JPG, JPEG, GIF format is not supported yet. Supported image size: The downloaded image should not exceed 7M after Base64 encoding. Image download time should not exceed 3 seconds. An ImageUrl and ImageBase64 must be provided. If both are provided, only ImageUrl will be used.
* @type {string || null}
*/
this.BackImageBase64 = null;
/**
* The URL address of the image on the back of the card. Supported image formats: PNG, JPG, JPEG, GIF format is not supported yet. Supported image size: The downloaded image does not exceed 7M after Base64 encoding. The image download time does not exceed 3 seconds. The URL of the image stored in Tencent Cloud can ensure higher download speed and stability. It is recommended to store the image in Tencent Cloud. The speed and stability of the URL stored outside Tencent Cloud may be affected to a certain extent.
* @type {string || null}
*/
this.BackImageUrl = null;
/**
* Whether to return portrait photos.
* @type {boolean || null}
*/
this.ReturnHeadImage = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.ImageBase64 = 'ImageBase64' in params ? params.ImageBase64 : null;
this.ImageUrl = 'ImageUrl' in params ? params.ImageUrl : null;
this.BackImageBase64 = 'BackImageBase64' in params ? params.BackImageBase64 : null;
this.BackImageUrl = 'BackImageUrl' in params ? params.BackImageUrl : null;
this.ReturnHeadImage = 'ReturnHeadImage' in params ? params.ReturnHeadImage : null;
}
}
/**
* RecognizePhilippinesDrivingLicenseOCR request structure.
* @class
*/
class RecognizePhilippinesDrivingLicenseOCRRequest extends AbstractModel {
constructor(){
super();
/**
* The Base64-encoded value of an image.
Supported image formats: PNG, JPG, and JPEG. GIF is currently not supported.
Supported image size: The downloaded image after Base64 encoding can be up to 7 MB. The download time of the image cannot exceed 3s.
Either the `ImageUrl` or `ImageBase64` of the image must be provided. If both are provided, only `ImageUrl` will be used.
* @type {string || null}
*/
this.ImageBase64 = null;
/**
* The URL of the image.
Supported image formats: PNG, JPG, and JPEG. GIF is currently not supported.
Supported image size: The downloaded image after Base64 encoding can be up to 7 MB. The download time of the image cannot exceed 3s.
We recommend that you store the image in Tencent Cloud for higher download speed and stability.
For a non-Tencent Cloud URL, the download speed and stability may be affected.
* @type {string || null}
*/
this.ImageUrl = null;
/**
* Whether to return the identity photo.
* @type {boolean || null}
*/
this.ReturnHeadImage = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.ImageBase64 = 'ImageBase64' in params ? params.ImageBase64 : null;
this.ImageUrl = 'ImageUrl' in params ? params.ImageUrl : null;
this.ReturnHeadImage = 'ReturnHeadImage' in params ? params.ReturnHeadImage : null;
}
}
/**
* The recognized text information.
* @class
*/
class WordItem extends AbstractModel {
constructor(){
super();
/**
* The text content.
* @type {string || null}
*/
this.DetectedText = null;
/**
* The coordinates of the four vertices.
* @type {Polygon || null}
*/
this.Coord = null;
/**
* Description.
* @type {string || null}
*/
this.AdvancedInfo = null;
/**
* Specifies the four-point coordinate of the word.
* @type {Array.<WordPolygon> || null}
*/
this.WordCoord = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.DetectedText = 'DetectedText' in params ? params.DetectedText : null;
if (params.Coord) {
let obj = new Polygon();
obj.deserialize(params.Coord)
this.Coord = obj;
}
this.AdvancedInfo = 'AdvancedInfo' in params ? params.AdvancedInfo : null;
if (params.WordCoord) {
this.WordCoord = new Array();
for (let z in params.WordCoord) {
let obj = new WordPolygon();
obj.deserialize(params.WordCoord[z]);
this.WordCoord.push(obj);
}
}
}
}
/**
* MLIDPassportOCR request structure.
* @class
*/
class MLIDPassportOCRRequest extends AbstractModel {
constructor(){
super();
/**
* Base64-encoded image data. The image must be no larger than 7 MB after Base64 encoding. A resolution of at least 500x800 is recommended. Supported image formats: PNG, JPG, JPEG, BMP, and PDF. The document should occupy more than 2/3 of the image area.
* @type {string || null}
*/
this.ImageBase64 = null;
/**
* Whether to return an image.
Default value: false.
* @type {boolean || null}
*/
this.RetImage = null;
/**
* URL of the image. The downloaded image must be no larger than 7 MB after Base64 encoding. A resolution of at least 500x800 is recommended. Supported image formats: PNG, JPG, JPEG, BMP, and PDF. The document should occupy more than 2/3 of the image area. Image download must complete within 3 seconds. We recommend storing images in Tencent Cloud for higher download speed and stability. The speed and stability of URLs from non-Tencent Cloud storage may be affected. Note: This field is not supported outside the Chinese mainland region.
* @type {string || null}
*/
this.ImageUrl = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.ImageBase64 = 'ImageBase64' in params ? params.ImageBase64 : null;
this.RetImage = 'RetImage' in params ? params.RetImage : null;
this.ImageUrl = 'ImageUrl' in params ? params.ImageUrl : null;
}
}
/**
* Structured element group
* @class
*/
class ItemInfo extends AbstractModel {
constructor(){
super();
/**
* The key information.
Note: This field may return null, indicating that no valid values can be obtained.
* @type {Key || null}
*/
this.Key = null;
/**
* The value information.
Note: This field may return null, indicating that no valid values can be obtained.
* @type {Value || null}
*/
this.Value = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
if (params.Key) {
let obj = new Key();
obj.deserialize(params.Key)
this.Key = obj;
}
if (params.Value) {
let obj = new Value();
obj.deserialize(params.Value)
this.Value = obj;
}
}
}
/**
* SmartStructuralOCRV2 request structure.
* @class
*/
class SmartStructuralOCRV2Request extends AbstractModel {
constructor(){
super();
/**
* The URL of the image.
Supported image formats: PNG, JPG, and JPEG. GIF is currently not supported.
Supported image size: The downloaded image after Base64 encoding can be up to 7 MB. The download time of the image cannot exceed 3s.
We recommend that you store the image in Tencent Cloud for higher download speed and stability.
The download speed and stability of non-Tencent Cloud URLs may be low.
* @type {string || null}
*/
this.ImageUrl = null;
/**
* The Base64-encoded value of the image.
Supported image formats: PNG, JPG, and JPEG. GIF is currently not supported.
Supported image size: The downloaded image after Base64 encoding can be up to 7 MB. The download time of the image cannot exceed 3s.
Either `ImageUrl` or `ImageBase64` of the image must be provided. If both are provided, only `ImageUrl` is used.
* @type {string || null}
*/
this.ImageBase64 = null;
/**
* Whether to enable PDF recognition. Default value: `false`. If you enable this feature, both images and PDF files can be recognized.
* @type {boolean || null}
*/
this.IsPdf = null;
/**
* The number of the PDF page that needs to be recognized. Only one single PDF page can be recognized. This parameter is valid if the uploaded file is a PDF and the value of `IsPdf` is `true`. Default value: `1`.
* @type {number || null}
*/
this.PdfPageNumber = null;
/**
* The names of the fields you want to return for the structured information recognition.
For example, if you want to return only the recognition result of the "Name" and "Gender" fields, set this parameter as follows:
ItemNames=["Name","Gender"]
* @type {Array.<string> || null}
*/
this.ItemNames = null;
/**
* Whether to enable recognition of all fields.
* @type {boolean || null}
*/
this.ReturnFullText = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.ImageUrl = 'ImageUrl' in params ? params.ImageUrl : null;
this.ImageBase64 = 'ImageBase64' in params ? params.ImageBase64 : null;
this.IsPdf = 'IsPdf' in params ? params.IsPdf : null;
this.PdfPageNumber = 'PdfPageNumber' in params ? params.PdfPageNumber : null;
this.ItemNames = 'ItemNames' in params ? params.ItemNames : null;
this.ReturnFullText = 'ReturnFullText' in params ? params.ReturnFullText : null;
}
}
/**
* RecognizeThaiIDCardOCR response structure.
* @class
*/
class RecognizeThaiIDCardOCRResponse extends AbstractModel {
constructor(){
super();
/**
* ID card number
* @type {string || null}
*/
this.ID = null;
/**
* Name in Thai
* @type {string || null}
*/
this.ThaiName = null;
/**
* First name in English
* @type {string || null}
*/
this.EnFirstName = null;
/**
* Last name in English
* @type {string || null}
*/
this.EnLastName = null;
/**
* Date of issue in Thai
* @type {string || null}
*/
this.IssueDate = null;
/**
* Expiration date in Thai
* @type {string || null}
*/
this.ExpirationDate = null;
/**
* Date of issue in English
* @type {string || null}
*/
this.EnIssueDate = null;
/**
* Expiration date in English
* @type {string || null}
*/
this.EnExpirationDate = null;
/**
* Date of birth in Thai
* @type {string || null}
*/
this.Birthday = null;
/**
* Date of birth in English
* @type {string || null}
*/
this.EnBirthday = null;
/**
* Religion
* @type {string || null}
*/
this.Religion = null;
/**
* Serial number
* @type {string || null}
*/
this.SerialNumber = null;
/**
* Address
* @type {string || null}
*/
this.Address = null;
/**
* Laser ID on the back of the card.
* @type {string || null}
*/
this.LaserID = null;
/**
* Identity photo
* @type {string || null}
*/
this.PortraitImage = null;
/**
* Card Warning Information
-9101 Alarm for covered certificate,
-9102 Alarm for photocopied certificate,
-9103 Alarm for photographed certificate,
-9104 Alarm for PS certificate,
-9107 Alarm for reflective certificate,
-9108 Alarm for blurry image,
-9109 This capability is not enabled.
* @type {Array.<number> || null}
*/
this.WarnCardInfos = null;
/**
* This field is deprecated and will always return "1". Usage is not recommended.
* @type {string || null}
*/
this.AdvancedInfo = null;
/**
* The number of cards detected in the input image provided via ImageBase64 parameter.(Currently supported only in ap-bangkok region)
* @type {number || null}
*/
this.CardCount = null;
/**
* The card information field complete or not
true: complete; false: incomplete
* @type {boolean || null}
*/
this.IsComplete = 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.ID = 'ID' in params ? params.ID : null;
this.ThaiName = 'ThaiName' in params ? params.ThaiName : null;
this.EnFirstName = 'EnFirstName' in params ? params.EnFirstName : null;
this.EnLastName = 'EnLastName' in params ? params.EnLastName : null;
this.IssueDate = 'IssueDate' in params ? params.IssueDate : null;
this.ExpirationDate = 'ExpirationDate' in params ? params.ExpirationDate : null;
this.EnIssueDate = 'EnIssueDate' in params ? params.EnIssueDate : null;
this.EnExpirationDate = 'EnExpirationDate' in params ? params.EnExpirationDate : null;
this.Birthday = 'Birthday' in params ? params.Birthday : null;
this.EnBirthday = 'EnBirthday' in params ? params.EnBirthday : null;
this.Religion = 'Religion' in params ? params.Religion : null;
this.SerialNumber = 'SerialNumber' in params ? params.SerialNumber : null;
this.Address = 'Address' in params ? params.Address : null;
this.LaserID = 'LaserID' in params ? params.LaserID : null;
this.PortraitImage = 'PortraitImage' in params ? params.PortraitImage : null;
this.WarnCardInfos = 'WarnCardInfos' in params ? params.WarnCardInfos : null;
this.AdvancedInfo = 'AdvancedInfo' in params ? params.AdvancedInfo : null;
this.CardCount = 'CardCount' in params ? params.CardCount : null;
this.IsComplete = 'IsComplete' in params ? params.IsComplete : null;
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* RecognizeBrazilCommonOCR response structure.
* @class
*/
class RecognizeBrazilCommonOCRResponse extends AbstractModel {
constructor(){
super();
/**
* Specifies the type of document in brazil. valid values:
1. RNE
2. RNM
3. IDCard
4. DrivingLicense.
* @type {number || null}
*/
this.Type = null;
/**
* The recognized content of the Brazilian document.
* @type {BrazilCardInfo || null}
*/
this.Result = 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.Type = 'Type' in params ? params.Type : null;
if (params.Result) {
let obj = new BrazilCardInfo();
obj.deserialize(params.Result)
this.Result = obj;
}
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* RecognizeMacaoIDCardOCR response structure.
* @class
*/
class RecognizeMacaoIDCardOCRResponse extends AbstractModel {
constructor(){
super();
/**
* Last name in Chinese
* @type {string || null}
*/
this.CnLastName = null;
/**
* Last name in English
* @type {string || null}
*/
this.EnLastName = null;
/**
* Telecode of the last name in Chinese
* @type {string || null}
*/
this.LastNameCode = null;
/**
* First name in Chinese
* @type {string || null}
*/
this.CnFirstName = null;
/**
* First name in English
* @type {string || null}
*/
this.EnFirstName = null;
/**
* Telecode of the first name in Chinese
* @type {string || null}
*/
this.FirstNameCode = null;
/**
* Identity card number
* @type {string || null}
*/
this.ID = null;
/**
* Date of birth (DD-MM-YYYY)
* @type {string || null}
*/
this.Birthday = null;
/**
* Gender
* @type {string || null}
*/
this.Sex = null;
/**
* Date of first issue (DD-MM-YYYY)
* @type {string || null}
*/
this.FirstIssueDate = null;
/**
* Date of issue (DD-MM-YYYY)
* @type {string || null}
*/
this.CurrentIssueDate = null;
/**
* Validity period (DD-MM-YYYY)
* @type {string || null}
*/
this.ValidityPeriod = null;
/**
* Document symbol
* @type {string || null}
*/
this.Symbol = null;
/**
* Height (unit: meters)
* @type {string || null}
*/
this.Height = null;
/**
* Processed image (Base64)
* @type {string || null}
*/
this.RetImage = null;
/**
* This field is deprecated and will always return null. Usage is not recommended.
* @type {string || null}
*/
this.Angle = null;
/**
* Resident type.
Valid values: Permanent Resident Identity Card, Non-permanent Resident Identity Card.
* @type {string || null}
*/
this.ResidentType = null;
/**
* Card Warning Information
-9101 Alarm for covered certificate
-9102 Alarm for photocopied certificate
-9103 Alarm for photographed certificate
-9104 Alarm for tamper certificate
-9107 Alarm for reflective certificate
-9108 Alarm for blurry certificate
-9109 This capability is not enabled. Please contact customer support to activate the alert service.
* @type {Array.<number> || null}
*/
this.WarnCardInfos = 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.CnLastName = 'CnLastName' in params ? params.CnLastName : null;
this.EnLastName = 'EnLastName' in params ? params.EnLastName : null;
this.LastNameCode = 'LastNameCode' in params ? params.LastNameCode : null;
this.CnFirstName = 'CnFirstName' in params ? params.CnFirstName : null;
this.EnFirstName = 'EnFirstName' in params ? params.EnFirstName : null;
this.FirstNameCode = 'FirstNameCode' in params ? params.FirstNameCode : null;
this.ID = 'ID' in params ? params.ID : null;
this.Birthday = 'Birthday' in params ? params.Birthday : null;
this.Sex = 'Sex' in params ? params.Sex : null;
this.FirstIssueDate = 'FirstIssueDate' in params ? params.FirstIssueDate : null;
this.CurrentIssueDate = 'CurrentIssueDate' in params ? params.CurrentIssueDate : null;
this.ValidityPeriod = 'ValidityPeriod' in params ? params.ValidityPeriod : null;
this.Symbol = 'Symbol' in params ? params.Symbol : null;
this.Height = 'Height' in params ? params.Height : null;
this.RetImage = 'RetImage' in params ? params.RetImage : null;
this.Angle = 'Angle' in params ? params.Angle : null;
this.ResidentType = 'ResidentType' in params ? params.ResidentType : null;
this.WarnCardInfos = 'WarnCardInfos' in params ? params.WarnCardInfos : null;
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* GetCardVerificationExternalResult response structure.
* @class
*/
class GetCardVerificationExternalResultResponse extends AbstractModel {
constructor(){
super();
/**
* Verification status. Valid values:
PROCESSING
ABNORMAL
COMPLETED
* @type {string || null}
*/
this.Status = null;
/**
* Anti-counterfeiting information.
- ScreenshotSuspected: The image is a screenshot.
- RetakeSuspected: The image is taken from another screen.
- PaperCopy: The image is a black and white, or color photocopy.
- FakeSuspected: The image of the card, or the information on the card has been edited or altered.
- PoorImageQuality: The image is bad quality.
- InformationVerificationFailed: Information verification failed based on OCR recognition results
- TooManyCards: Multiple cards present in the frame.
- IncompleteCard: Captured document is incomplete.
- OtherWarning: Document's authenticity is not verified for various reasons.
Note: This field may return null, indicating that no valid values can be obtained.
* @type {Array.<string> || null}
*/
this.WarnInfo = null;
/**
* Country or region of the document.
Note: This field may return null, indicating that no valid values can be obtained.
* @type {string || null}
*/
this.Nationality = null;
/**
* Front-side document recognition results.
Note: This field may return null, indicating that no valid values can be obtained.
* @type {GeneralCard || null}
*/
this.CardInfo = null;
/**
* Back-side document recognition results.
Note: This field may return null, indicating that no valid values can be obtained.
* @type {GeneralCard || null}
*/
this.BackCardInfo = null;
/**
* The token passed in the input parameters.
* @type {string || null}
*/
this.CardVerificationToken = null;
/**
* Base64-encoded head image from the document. If ReturnHeadImage was set to false or not provided in the request, this field returns an empty string. If ReturnHeadImage was set to true and this field returns an empty string, indicating a failure to extract the head image extraction failed. Please check the input document photo.
* @type {string || null}
*/
this.HeadImageBase64 = 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.Status = 'Status' in params ? params.Status : null;
this.WarnInfo = 'WarnInfo' in params ? params.WarnInfo : null;
this.Nationality = 'Nationality' in params ? params.Nationality : null;
if (params.CardInfo) {
let obj = new GeneralCard();
obj.deserialize(params.CardInfo)
this.CardInfo = obj;
}
if (params.BackCardInfo) {
let obj = new GeneralCard();
obj.deserialize(params.BackCardInfo)
this.BackCardInfo = obj;
}
this.CardVerificationToken = 'CardVerificationToken' in params ? params.CardVerificationToken : null;
this.HeadImageBase64 = 'HeadImageBase64' in params ? params.HeadImageBase64 : null;
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* PermitOCR response structure.
* @class
*/
class PermitOCRResponse extends AbstractModel {
constructor(){
super();
/**
* Name in Chinese
* @type {string || null}
*/
this.Name = null;
/**
* English name
* @type {string || null}
*/
this.EnglishName = null;
/**
* ID number
* @type {string || null}
*/
this.Number = null;
/**
* Gender
* @type {string || null}
*/
this.Sex = null;
/**
* Validity period
* @type {string || null}
*/
this.ValidDate = null;
/**
* Issuing authority
* @type {string || null}
*/
this.IssueAuthority = null;
/**
* Place of issue
* @type {string || null}
*/
this.IssueAddress = null;
/**
* Date of birth
* @type {string || null}
*/
this.Birthday = null;
/**
* Base64-encoded profile photo of the document holder.
* @type {string || null}
*/
this.PortraitImage = null;
/**
* Document type, such as: Exit-Entry Permit for Travelling to and from Hong Kong and Macao, or Exit-Entry Permit for Travelling to and from Taiwan.
* @type {string || null}
*/
this.Type = null;
/**
* Card Warning Information
-9101 Alarm for covered certificate
-9102 Alarm for photocopied certificate
-9103 Alarm for photographed certificate
-9104 Alarm for tamper certificate
-9107 Alarm for reflective certificate
-9108 Alarm for blurry certificate
-9109 This capability is not enabled. Please contact customer support to activate the alert service.
* @type {Array.<number> || null}
*/
this.WarnCardInfos = 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.Name = 'Name' in params ? params.Name : null;
this.EnglishName = 'EnglishName' in params ? params.EnglishName : null;
this.Number = 'Number' in params ? params.Number : null;
this.Sex = 'Sex' in params ? params.Sex : null;
this.ValidDate = 'ValidDate' in params ? params.ValidDate : null;
this.IssueAuthority = 'IssueAuthority' in params ? params.IssueAuthority : null;
this.IssueAddress = 'IssueAddress' in params ? params.IssueAddress : null;
this.Birthday = 'Birthday' in params ? params.Birthday : null;
this.PortraitImage = 'PortraitImage' in params ? params.PortraitImage : null;
this.Type = 'Type' in params ? params.Type : null;
this.WarnCardInfos = 'WarnCardInfos' in params ? params.WarnCardInfos : null;
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* RecognizeBrazilDriverLicenseOCR request structure.
* @class
*/
class RecognizeBrazilDriverLicenseOCRRequest extends AbstractModel {
constructor(){
super();
/**
* The Base64 value of the image. It is required that the image after Base64 encoding should not exceed 7M, the resolution is recommended to be 500*800 or above, and PNG, JPG, JPEG, and BMP formats are supported. It is recommended that the card part occupies at least 2/3 of the picture. One of ImageUrl and ImageBase64 of the image must be provided. If both are provided, only ImageUrl will be used.
* @type {string || null}
*/
this.ImageBase64 = null;
/**
* The Base64 value of the image. It is required that the image after Base64 encoding should not exceed 7M, the resolution is recommended to be 500*800 or above, and PNG, JPG, JPEG, and BMP formats are supported. It is recommended that the card part occupies at least 2/3 of the picture. One of ImageUrl and ImageBase64 of the image must be provided. If both are provided, only ImageUrl will be used.
* @type {string || null}
*/
this.BackImageBase64 = null;
/**
* The URL address of the image. It is required that the image after Base64 encoding should not exceed 7M, the resolution is recommended to be 500*800 or above, and PNG, JPG, JPEG, and BMP formats are supported. It is recommended that the card part occupies at least 2/3 of the picture. It is recommended that images be stored in Tencent Cloud to ensure higher download speed and stability.
* @type {string || null}
*/
this.ImageUrl = null;
/**
* The URL address of the image. It is required that the image after Base64 encoding should not exceed 7M, the resolution is recommended to be 500*800 or above, and PNG, JPG, JPEG, and BMP formats are supported. It is recommended that the card part occupies at least 2/3 of the picture. It is recommended that images be stored in Tencent Cloud to ensure higher download speed and stability.
* @type {string || null}
*/
this.BackImageUrl = null;
/**
* Picture switch. The default is false, and the base64 encoding of the avatar photo is not returned. When set to true, the base64 encoding of the portrait photo is returned.
* @type {boolean || null}
*/
this.CropPortrait = null;
/**
* Version of the driver's license image.
Valid values:
OLD (old version),
NEW (new version).
The default value is OLD.
* @type {string || null}
*/
this.LicenceVersion = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.ImageBase64 = 'ImageBase64' in params ? params.ImageBase64 : null;
this.BackImageBase64 = 'BackImageBase64' in params ? params.BackImageBase64 : null;
this.ImageUrl = 'ImageUrl' in params ? params.ImageUrl : null;
this.BackImageUrl = 'BackImageUrl' in params ? params.BackImageUrl : null;
this.CropPortrait = 'CropPortrait' in params ? params.CropPortrait : null;
this.LicenceVersion = 'LicenceVersion' in params ? params.LicenceVersion : null;
}
}
/**
* RecognizeMainlandIDCardOCR request structure.
* @class
*/
class RecognizeMainlandIDCardOCRRequest extends AbstractModel {
constructor(){
super();
/**
* The Base64 value of the image. The image is required to be no larger than 7M after Base64 encoding, and the resolution is recommended to be 500*800 or above. PNG, JPG, JPEG, and BMP formats are supported. It is recommended that the card part occupies at least 2/3 of the picture. One of ImageUrl and ImageBase64 of the image must be provided. If both are provided, only ImageUrl will be used.
* @type {string || null}
*/
this.ImageBase64 = null;
/**
* The URL address of the image. The image is required to be no larger than 7M after Base64 encoding, and the resolution is recommended to be 500*800 or above. PNG, JPG, JPEG, and BMP formats are supported. It is recommended that the card part occupies at least 2/3 of the picture. It is recommended that images be stored in Tencent Cloud to ensure higher download speed and stability.
* @type {string || null}
*/
this.ImageUrl = null;
/**
* FRONT: The side of the ID card with the photo (portrait side), BACK: The side of the ID card with the national emblem (national emblem side). If this parameter is not filled in, the front and back of the ID card will be automatically determined for you.
* @type {string || null}
*/
this.CardSide = null;
/**
* Whether to return the ID card portrait, the default is false
* @type {boolean || null}
*/
this.CropPortrait = null;
/**
* Whether to enable ID card photo cropping (removing excess edges outside the ID, automatically correcting the shooting angle), the default value is false
* @type {boolean || null}
*/
this.CropIdCard = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.ImageBase64 = 'ImageBase64' in params ? params.ImageBase64 : null;
this.ImageUrl = 'ImageUrl' in params ? params.ImageUrl : null;
this.CardSide = 'CardSide' in params ? params.CardSide : null;
this.CropPortrait = 'CropPortrait' in params ? params.CropPortrait : null;
this.CropIdCard = 'CropIdCard' in params ? params.CropIdCard : null;
}
}
/**
* MLIDCardOCR request structure.
* @class
*/
class MLIDCardOCRRequest extends AbstractModel {
constructor(){
super();
/**
* The Base64-encoded value of an image.
Supported image formats: PNG, JPG, and JPEG. GIF is currently not supported.
Supported image size: The downloaded image after Base64 encoding can be up to 7 MB. The download time of the image cannot exceed 3s.
* @type {string || null}
*/
this.ImageBase64 = null;
/**
* Base64 value of the image on the back of the card. Supported image formats: PNG, JPG, JPEG, GIF format is not supported yet. Supported image size: The downloaded image cannot exceed 7M after Base64 encoding. The image download takes no more than 3 seconds. One of ImageUrl and ImageBase64 of the image must be provided. If both are provided, only ImageUrl will be used.
* @type {string || null}
*/
this.BackImageBase64 = null;
/**
* The URL of an image. (This field is not available outside the Chinese mainland.)
Supported image formats: PNG, JPG, and JPEG. GIF is currently not supported.
Supported image size: The downloaded image after Base64 encoding can be up to 7 MB. The download time of the image cannot exceed 3s.
We recommend that you store the image in Tencent Cloud for higher download speed and stability.
For a non-Tencent Cloud URL, the download speed and stability may be low.
* @type {string || null}
*/
this.ImageUrl = null;
/**
* The URL address of the image on the back of the card. Supported image formats: PNG, JPG, JPEG, GIF format is not supported yet. Supported image size: The downloaded image does not exceed 7M after Base64 encoding. The image download takes no more than 3 seconds. Storing images in Tencent Cloud URLs can ensure higher download speed and stability. It is recommended that images be stored in Tencent Cloud. The URL speed and stability of non-Tencent cloud storage may be affected to a certain extent.
* @type {string || null}
*/
this.BackImageUrl = null;
/**
* Whether to return an image. Default value: `false`.
* @type {boolean || null}
*/
this.RetImage = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.ImageBase64 = 'ImageBase64' in params ? params.ImageBase64 : null;
this.BackImageBase64 = 'BackImageBase64' in params ? params.BackImageBase64 : null;
this.ImageUrl = 'ImageUrl' in params ? params.ImageUrl : null;
this.BackImageUrl = 'BackImageUrl' in params ? params.BackImageUrl : null;
this.RetImage = 'RetImage' in params ? params.RetImage : null;
}
}
/**
* Word coordinates info.
* @class
*/
class WordPolygon extends AbstractModel {
constructor(){
super();
/**
* The text content.
* @type {string || null}
*/
this.DetectedText = null;
/**
* The coordinates of the four vertices.
* @type {Polygon || null}
*/
this.Coord = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.DetectedText = 'DetectedText' in params ? params.DetectedText : null;
if (params.Coord) {
let obj = new Polygon();
obj.deserialize(params.Coord)
this.Coord = obj;
}
}
}
/**
* Value information
* @class
*/
class Value extends AbstractModel {
constructor(){
super();
/**
* The value of the recognized field.
* @type {string || null}
*/
this.AutoContent = null;
/**
* The coordinates of the four vertices.
Note: This field may return null, indicating that no valid values can be obtained.
* @type {Polygon || null}
*/
this.Coord = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.AutoContent = 'AutoContent' in params ? params.AutoContent : null;
if (params.Coord) {
let obj = new Polygon();
obj.deserialize(params.Coord)
this.Coord = obj;
}
}
}
/**
* RecognizeDetectCardCoords response structure.
* @class
*/
class RecognizeDetectCardCoordsResponse extends AbstractModel {
constructor(){
super();
/**
* Coordinate information of the detected four corners of the card.
* @type {Array.<CoordsItem> ||