UNPKG

tencentcloud-sdk-nodejs-intl-en

Version:
1,731 lines (1,471 loc) 300 kB
/* * 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"); /** * Recognition information of a single invoice/ticket among multiple types of invoices/tickets * @class */ class InvoiceItem extends AbstractModel { constructor(){ super(); /** * The recognition result. `OK`: Recognition is successful. `FailedOperation.UnsupportedInvoice`: Recognition is not supported. `FailedOperation.UnKnowError`: Recognition failed. For the information about other error codes, see the OCR API description for each invoice/ticket. * @type {string || null} */ this.Code = null; /** * The type of invoice/ticket to which the recognized image belongs. -1: Unknown 0: Taxi receipt 1: Quota invoice 2: Train ticket 3: VAT invoice 5: Itinerary/Receipt of e-ticket for air transportation 8: General machine-printed invoice 9: Bus ticket 10: Ship ticket 11: VAT invoice (roll) 12: Car sales invoice 13: Toll receipt 15: Non-tax revenue invoice 16: Fully digitalized electronic invoice * @type {number || null} */ this.Type = null; /** * The coordinates of the four vertices of the rotated image. * @type {Polygon || null} */ this.Polygon = null; /** * The rotation angle of the recognized image in the image with multiple types of invoices/tickets. * @type {number || null} */ this.Angle = null; /** * The recognized content. * @type {SingleInvoiceItem || null} */ this.SingleInvoiceInfos = null; /** * The number of the page on which the recognized invoice is in the image or PDF file, starting from 1 by default. * @type {number || null} */ this.Page = null; /** * The detailed invoice type. See the description of `SubType`. * @type {string || null} */ this.SubType = null; /** * The invoice description. See the description of `TypeDescription`. * @type {string || null} */ this.TypeDescription = null; /** * The image file after cropping, encoded in Base64. This is returned if `EnableCutImage` is set to `true`. * @type {string || null} */ this.CutImage = null; /** * The description of the detailed invoice type. See the description of `SubType`. * @type {string || null} */ this.SubTypeDescription = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.Code = 'Code' in params ? params.Code : null; this.Type = 'Type' in params ? params.Type : null; if (params.Polygon) { let obj = new Polygon(); obj.deserialize(params.Polygon) this.Polygon = obj; } this.Angle = 'Angle' in params ? params.Angle : null; if (params.SingleInvoiceInfos) { let obj = new SingleInvoiceItem(); obj.deserialize(params.SingleInvoiceInfos) this.SingleInvoiceInfos = obj; } this.Page = 'Page' in params ? params.Page : null; this.SubType = 'SubType' in params ? params.SubType : null; this.TypeDescription = 'TypeDescription' in params ? params.TypeDescription : null; this.CutImage = 'CutImage' in params ? params.CutImage : null; this.SubTypeDescription = 'SubTypeDescription' in params ? params.SubTypeDescription : 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; } } /** * 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; } /** * @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; } } } /** * MLIDPassportOCR request structure. * @class */ class MLIDPassportOCRRequest extends AbstractModel { constructor(){ super(); /** * Base64-encoded value of image. The image cannot exceed 7 MB in size after being Base64-encoded. A resolution above 500x800 is recommended. PNG, JPG, JPEG, BMP, and PDF formats are supported. It is recommended that the card part occupies more than 2/3 area of the image. * @type {string || null} */ this.ImageBase64 = null; /** * Whether to return an image. Default value: false. * @type {boolean || null} */ this.RetImage = null; /** * URL address of image. (This field is not supported outside Chinese mainland) Supported image formats: PNG, JPG, JPEG, BMP, PDF. Supported image size: the downloaded image cannot exceed 7 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.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; } } /** * Table of other invoices * @class */ class OtherInvoiceList extends AbstractModel { constructor(){ super(); /** * List * @type {Array.<OtherInvoiceItem> || null} */ this.OtherInvoiceItemList = null; } /** * @private */ deserialize(params) { if (!params) { return; } if (params.OtherInvoiceItemList) { this.OtherInvoiceItemList = new Array(); for (let z in params.OtherInvoiceItemList) { let obj = new OtherInvoiceItem(); obj.deserialize(params.OtherInvoiceItemList[z]); this.OtherInvoiceItemList.push(obj); } } } } /** * RecognizeMacaoIDCardOCR response structure. * @class */ class RecognizeMacaoIDCardOCRResponse extends AbstractModel { constructor(){ super(); /** * Chinese last name * @type {string || null} */ this.CnLastName = null; /** * English last name * @type {string || null} */ this.EnLastName = null; /** * Last name code * @type {string || null} */ this.LastNameCode = null; /** * Chinese first name * @type {string || null} */ this.CnFirstName = null; /** * English first name * @type {string || null} */ this.EnFirstName = null; /** * First name code * @type {string || null} */ this.FirstNameCode = null; /** * ID Number * @type {string || null} */ this.ID = null; /** * Birthday(DD-MM-YYYY) * @type {string || null} */ this.Birthday = null; /** * gender * @type {string || null} */ this.Sex = null; /** * First issue Date (DD-MM-YYYY) * @type {string || null} */ this.FirstIssueDate = null; /** * Issue date (DD-MM-YYYY) * @type {string || null} */ this.CurrentIssueDate = null; /** * Validity period (DD-MM-YYYY) * @type {string || null} */ this.ValidityPeriod = null; /** * ID 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; /** * Image rotation angle, the horizontal direction of the text is 0, clockwise is positive, counterclockwise is negative * @type {string || null} */ this.Angle = null; /** * Resident type. * @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 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; /** * 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; } } /** * PermitOCR response structure. * @class */ class PermitOCRResponse extends AbstractModel { constructor(){ super(); /** * Name * @type {string || null} */ this.Name = null; /** * Name in English * @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; /** * The unique request ID, which is returned for each request. 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.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; } /** * @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; } } /** * Coordinates * @class */ class Rect extends AbstractModel { constructor(){ super(); /** * X-coordinate of top-left point * @type {number || null} */ this.X = null; /** * Y-coordinate of top-left point * @type {number || null} */ this.Y = null; /** * Width * @type {number || null} */ this.Width = null; /** * Height * @type {number || null} */ this.Height = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.X = 'X' in params ? params.X : null; this.Y = 'Y' in params ? params.Y : null; this.Width = 'Width' in params ? params.Width : null; this.Height = 'Height' in params ? params.Height : null; } } /** * Vehicle license plate information * @class */ class LicensePlateInfo extends AbstractModel { constructor(){ super(); /** * The recognized license plate number. * @type {string || null} */ this.Number = null; /** * The confidence score (0–100). * @type {number || null} */ this.Confidence = null; /** * The bounding box coordinates of the text line in the original image. * @type {Rect || null} */ this.Rect = null; /** * The recognized license plate color, which currently includes "white", "black", "blue", "green", "yellow", "yellow-green", and "temporary plate". * @type {string || null} */ this.Color = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.Number = 'Number' in params ? params.Number : null; this.Confidence = 'Confidence' in params ? params.Confidence : null; if (params.Rect) { let obj = new Rect(); obj.deserialize(params.Rect) this.Rect = obj; } this.Color = 'Color' in params ? params.Color : null; } } /** * Items of a general VAT invoice (roll) * @class */ class VatRollItem extends AbstractModel { constructor(){ super(); /** * Item name * @type {string || null} */ this.Name = null; /** * Quantity * @type {string || null} */ this.Quantity = null; /** * Unit price * @type {string || null} */ this.Price = null; /** * Amount * @type {string || null} */ this.Total = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.Name = 'Name' in params ? params.Name : null; this.Quantity = 'Quantity' in params ? params.Quantity : null; this.Price = 'Price' in params ? params.Price : null; this.Total = 'Total' in params ? params.Total : null; } } /** * HmtResidentPermitOCR response structure. * @class */ class HmtResidentPermitOCRResponse extends AbstractModel { constructor(){ super(); /** * Name * @type {string || null} */ this.Name = null; /** * Gender * @type {string || null} */ this.Sex = null; /** * Date of birth * @type {string || null} */ this.Birth = null; /** * Address * @type {string || null} */ this.Address = null; /** * ID card number * @type {string || null} */ this.IdCardNo = null; /** * 0: Front side. 1: Back side. * @type {number || null} */ this.CardType = null; /** * Validity period * @type {string || null} */ this.ValidDate = null; /** * Issuing authority * @type {string || null} */ this.Authority = null; /** * Number of issues * @type {string || null} */ this.VisaNum = null; /** * Permit number * @type {string || null} */ this.PassNo = null; /** * The unique request ID, which is returned for each request. 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.Birth = 'Birth' in params ? params.Birth : null; this.Address = 'Address' in params ? params.Address : null; this.IdCardNo = 'IdCardNo' in params ? params.IdCardNo : null; this.CardType = 'CardType' in params ? params.CardType : null; this.ValidDate = 'ValidDate' in params ? params.ValidDate : null; this.Authority = 'Authority' in params ? params.Authority : null; this.VisaNum = 'VisaNum' in params ? params.VisaNum : null; this.PassNo = 'PassNo' in params ? params.PassNo : null; this.RequestId = 'RequestId' in params ? params.RequestId : null; } } /** * Flight items * @class */ class FlightItem extends AbstractModel { constructor(){ super(); /** * Departure terminal * @type {string || null} */ this.TerminalGetOn = null; /** * Arrival terminal * @type {string || null} */ this.TerminalGetOff = null; /** * Carrier * @type {string || null} */ this.Carrier = null; /** * Flight number * @type {string || null} */ this.FlightNumber = null; /** * Class * @type {string || null} */ this.Seat = null; /** * Departure date * @type {string || null} */ this.DateGetOn = null; /** * Departure time * @type {string || null} */ this.TimeGetOn = null; /** * Departure city * @type {string || null} */ this.StationGetOn = null; /** * Arrival city * @type {string || null} */ this.StationGetOff = null; /** * Baggage allowance * @type {string || null} */ this.Allow = null; /** * Fare category * @type {string || null} */ this.FareBasis = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.TerminalGetOn = 'TerminalGetOn' in params ? params.TerminalGetOn : null; this.TerminalGetOff = 'TerminalGetOff' in params ? params.TerminalGetOff : null; this.Carrier = 'Carrier' in params ? params.Carrier : null; this.FlightNumber = 'FlightNumber' in params ? params.FlightNumber : null; this.Seat = 'Seat' in params ? params.Seat : null; this.DateGetOn = 'DateGetOn' in params ? params.DateGetOn : null; this.TimeGetOn = 'TimeGetOn' in params ? params.TimeGetOn : null; this.StationGetOn = 'StationGetOn' in params ? params.StationGetOn : null; this.StationGetOff = 'StationGetOff' in params ? params.StationGetOff : null; this.Allow = 'Allow' in params ? params.Allow : null; this.FareBasis = 'FareBasis' in params ? params.FareBasis : null; } } /** * 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; } } } /** * Seal information * @class */ class SealInfo extends AbstractModel { constructor(){ super(); /** * Seal body information * @type {string || null} */ this.SealBody = null; /** * Seal coordinates * @type {Rect || null} */ this.Location = null; /** * Other text content * @type {Array.<string> || null} */ this.OtherTexts = null; /** * Seal shape. Valid values: 0: Round 1: Oval 2: Rectangle 3: Diamond 4: Triangle * @type {string || null} */ this.SealShape = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.SealBody = 'SealBody' in params ? params.SealBody : null; if (params.Location) { let obj = new Rect(); obj.deserialize(params.Location) this.Location = obj; } this.OtherTexts = 'OtherTexts' in params ? params.OtherTexts : null; this.SealShape = 'SealShape' in params ? params.SealShape : null; } } /** * RecognizePhilippinesVoteIDOCR request structure. * @class */ class RecognizePhilippinesVoteIDOCRRequest extends AbstractModel { constructor(){ super(); /** * Whether to return the identity photo. * @type {boolean || null} */ this.ReturnHeadImage = null; /** * 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; } /** * @private */ deserialize(params) { if (!params) { return; } this.ReturnHeadImage = 'ReturnHeadImage' in params ? params.ReturnHeadImage : null; this.ImageBase64 = 'ImageBase64' in params ? params.ImageBase64 : null; this.ImageUrl = 'ImageUrl' in params ? params.ImageUrl : null; } } /** * RecognizeKoreanDrivingLicenseOCR request structure. * @class */ class RecognizeKoreanDrivingLicenseOCRRequest extends AbstractModel { constructor(){ super(); /** * 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; /** * 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; /** * 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; } } /** * Items of other invoices * @class */ class OtherInvoiceItem extends AbstractModel { constructor(){ super(); /** * Field name * @type {string || null} */ this.Name = null; /** * Field value * @type {string || null} */ this.Value = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.Name = 'Name' in params ? params.Name : null; this.Value = 'Value' in params ? params.Value : null; } } /** * SmartStructuralPro request structure. * @class */ class SmartStructuralProRequest 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; /** * 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 `. 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; /** * Configuration ID support: General -- General scenarios; InvoiceEng -- Ocean bill of lading, international invoice template; -- Ocean shipment order template; WayBillEng -- CustomsDeclaration -- WeightNote -- MedicalMeter * @type {string || null} */ this.ConfigId = null; /** * Enable recognition of coordinate values in full-text fields * @type {boolean || null} */ this.EnableCoord = 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.ReturnFullText = 'ReturnFullText' in params ? params.ReturnFullText : null; this.ConfigId = 'ConfigId' in params ? params.ConfigId : null; this.EnableCoord = 'EnableCoord' in params ? params.EnableCoord : null; } } /** * Information about VAT invoice items * @class */ class VatInvoiceItemInfo extends AbstractModel { constructor(){ super(); /** * Item name * @type {string || null} */ this.Name = null; /** * Specification * @type {string || null} */ this.Specification = null; /** * Unit * @type {string || null} */ this.Unit = null; /** * Quantity * @type {string || null} */ this.Quantity = null; /** * Unit price * @type {string || null} */ this.Price = null; /** * Amount * @type {string || null} */ this.Total = null; /** * Tax rate * @type {string || null} */ this.TaxRate = null; /** * Tax amount * @type {string || null} */ this.Tax = null; /** * Start date * @type {string || null} */ this.DateStart = null; /** * End date * @type {string || null} */ this.DateEnd = null; /** * License plate number * @type {string || null} */ this.LicensePlate = null; /** * Vehicle type * @type {string || null} */ this.VehicleType = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.Name = 'Name' in params ? params.Name : null; this.Specification = 'Specification' in params ? params.Specification : null; this.Unit = 'Unit' in params ? params.Unit : null; this.Quantity = 'Quantity' in params ? params.Quantity : null; this.Price = 'Price' in params ? params.Price : null; this.Total = 'Total' in params ? params.Total : null; this.TaxRate = 'TaxRate' in params ? params.TaxRate : null; this.Tax = 'Tax' in params ? params.Tax : null; this.DateStart = 'DateStart' in params ? params.DateStart : null; this.DateEnd = 'DateEnd' in params ? params.DateEnd : null; this.LicensePlate = 'LicensePlate' in params ? params.LicensePlate : null; this.VehicleType = 'VehicleType' in params ? params.VehicleType : null; } } /** * MainlandPermitOCR request structure. * @class */ class MainlandPermitOCRRequest extends AbstractModel { constructor(){ super(); /** * 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; /** * 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; /** * Whether to return the ID photo. By default, the ID photo is not returned. * @type {boolean || null} */ this.RetProfile = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.ImageBase64 = 'ImageBase64' in params ? params.ImageBase64 : null; this.ImageUrl = 'ImageUrl' in params ? params.ImageUrl : null; this.RetProfile = 'RetProfile' in params ? params.RetProfile : null; } } /** * OCR result. * @class */ class TextDetection extends AbstractModel { constructor(){ super(); /** * Recognized text line content. * @type {string || null} */ this.DetectedText = null; /** * Confidence. Value range: 0–100. * @type {number || null} */ this.Confidence = null; /** * Text line coordinates, which are represented as 4 vertex coordinates. Note: this field may return null, indicating that no valid values can be obtained. * @type {Array.<Coord> || null} */ this.Polygon = null; /** * Extended field. The paragraph information `Parag` returned by the `GeneralBasicOcr` API contains `ParagNo`. * @type {string || null} */ this.AdvancedInfo = null; /** * Pixel coordinates of the text line in the image after rotation correction, which is in the format of `(X-coordinate of top-left point, Y-coordinate of top-left point, width, height)`. * @type {ItemCoord || null} */ this.ItemPolygon = null; /** * Information about a character, including the character itself and its confidence. Supported APIs: `GeneralBasicOCR`, `GeneralAccurateOCR` * @type {Array.<DetectedWords> || null} */ this.Words = null; /** * Coordinates of a word’s four corners on the input image. Supported APIs: `GeneralBasicOCR`, `GeneralAccurateOCR` * @type {Array.<DetectedWordCoordPoint> || null} */ this.WordCoordPoint = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.DetectedText = 'DetectedText' in params ? params.DetectedText : null; this.Confidence = 'Confidence' in params ? params.Confidence : null; if (params.Polygon) { this.Polygon = new Array(); for (let z in params.Polygon) { let obj = new Coord(); ob