diff --git a/.github/workflows/php-versions.yml b/.github/workflows/php-versions.yml index 9860a79..65c4ead 100644 --- a/.github/workflows/php-versions.yml +++ b/.github/workflows/php-versions.yml @@ -61,4 +61,7 @@ jobs: - name: Run test suite env: TEST_CONFIGURATION_ACCESS_TOKEN: ${{ secrets.TEST_CONFIGURATION_ACCESS_TOKEN }} - run: composer run-script test + run: | + composer run-script test + chmod +x scripts/* + ./scripts/run_snippets.sh diff --git a/.gitignore b/.gitignore index 3f90af3..205248f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ Configuration*.json /.phpunit.cache /.phpunit.result.cache phpunit.log +/snippets_test diff --git a/Makefile b/Makefile index 2bdc0b0..eb52058 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ lint: .PHONY: test test: composer test + ./scripts/run_snippets.sh .PHONY: init init: diff --git a/Pdf417.png b/Pdf417.png new file mode 100644 index 0000000..a8d3e3d Binary files /dev/null and b/Pdf417.png differ diff --git a/README.md b/README.md index 9d6e4e4..51b2f2e 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,15 @@ [![Packagist Version](https://img.shields.io/packagist/v/aspose/barcode-cloud-php)](https://packagist.org/packages/aspose/barcode-cloud-php) [![Supported PHP Versions](https://img.shields.io/packagist/dependency-v/aspose/barcode-cloud-php/php)](https://packagist.org/packages/aspose/barcode-cloud-php) -- API version: 3.0 -- Package version: 24.12.0 +- API version: 4.0 +- Package version: 25.1.0 - Supported PHP versions: ">=7.4 || >=8.0" +## SDK and API Version Compatibility: + +- SDK Version 25.1 and Later: Starting from SDK version 25.1, all subsequent versions are compatible with API Version v4.0. +- SDK Version 24.12 and Earlier: These versions are compatible with API Version v3.0. + ## Demo applications [Scan QR](https://products.aspose.app/barcode/scanqr) | [Generate Barcode](https://products.aspose.app/barcode/generate) | [Recognize Barcode](https://products.aspose.app/barcode/recognize) @@ -54,9 +59,9 @@ declare(strict_types=1); require __DIR__ . '/vendor/autoload.php'; use Aspose\BarCode\Configuration; -use Aspose\BarCode\BarcodeApi; -use Aspose\BarCode\Requests\GetBarcodeGenerateRequest; -use Aspose\BarCode\Model\{EncodeBarcodeType, CodeLocation}; +use Aspose\BarCode\GenerateApi; +use Aspose\BarCode\Requests\GenerateRequestWrapper; +use Aspose\BarCode\Model\{EncodeBarcodeType, EncodeDataType, CodeLocation, BarcodeImageFormat}; $config = new Configuration(); $config->setClientId('ClientId from https://dashboard.aspose.cloud/applications'); @@ -65,12 +70,12 @@ if (getenv("TEST_CONFIGURATION_ACCESS_TOKEN")) { $config->setAccessToken(getenv("TEST_CONFIGURATION_ACCESS_TOKEN")); } -$request = new GetBarcodeGenerateRequest(EncodeBarcodeType::QR, 'PHP SDK Test'); -$request->format = 'png'; +$request = new GenerateRequestWrapper(EncodeBarcodeType::QR, 'PHP SDK Test'); +$request->image_format = BarcodeImageFormat::Png; $request->text_location = CodeLocation::None; -$api = new BarcodeApi(null, $config); -$response = $api->GetBarCodeGenerate($request); +$api = new GenerateApi(null, $config); +$response = $api->generate($request); $type = 'image/png'; $size = $response->getSize(); @@ -95,113 +100,39 @@ All Aspose.BarCode for Cloud SDKs, helper scripts and templates are licensed und ## Documentation for API Endpoints -All URIs are relative to ** +All URIs are relative to ** Class | Method | HTTP request | Description ----- | ------ | ------------ | ----------- -*BarcodeApi* | [**getBarcodeGenerate**](docs/Api/BarcodeApi.md#getbarcodegenerate) | **GET** /barcode/generate | Generate barcode. -*BarcodeApi* | [**getBarcodeRecognize**](docs/Api/BarcodeApi.md#getbarcoderecognize) | **GET** /barcode/{name}/recognize | Recognize barcode from a file on server. -*BarcodeApi* | [**postBarcodeRecognizeFromUrlOrContent**](docs/Api/BarcodeApi.md#postbarcoderecognizefromurlorcontent) | **POST** /barcode/recognize | Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image with content-type \"application/octet-stream\". An image can also be passed as a form field. -*BarcodeApi* | [**postGenerateMultiple**](docs/Api/BarcodeApi.md#postgeneratemultiple) | **POST** /barcode/generateMultiple | Generate multiple barcodes and return in response stream -*BarcodeApi* | [**putBarcodeGenerateFile**](docs/Api/BarcodeApi.md#putbarcodegeneratefile) | **PUT** /barcode/{name}/generate | Generate barcode and save on server (from query params or from file with json or xml content) -*BarcodeApi* | [**putBarcodeRecognizeFromBody**](docs/Api/BarcodeApi.md#putbarcoderecognizefrombody) | **PUT** /barcode/{name}/recognize | Recognition of a barcode from file on server with parameters in body. -*BarcodeApi* | [**putGenerateMultiple**](docs/Api/BarcodeApi.md#putgeneratemultiple) | **PUT** /barcode/{name}/generateMultiple | Generate image with multiple barcodes and put new file on server -*BarcodeApi* | [**scanBarcode**](docs/Api/BarcodeApi.md#scanbarcode) | **POST** /barcode/scan | Quickly scan a barcode from an image. -*FileApi* | [**copyFile**](docs/Api/FileApi.md#copyfile) | **PUT** /barcode/storage/file/copy/{srcPath} | Copy file -*FileApi* | [**deleteFile**](docs/Api/FileApi.md#deletefile) | **DELETE** /barcode/storage/file/{path} | Delete file -*FileApi* | [**downloadFile**](docs/Api/FileApi.md#downloadfile) | **GET** /barcode/storage/file/{path} | Download file -*FileApi* | [**moveFile**](docs/Api/FileApi.md#movefile) | **PUT** /barcode/storage/file/move/{srcPath} | Move file -*FileApi* | [**uploadFile**](docs/Api/FileApi.md#uploadfile) | **PUT** /barcode/storage/file/{path} | Upload file -*FolderApi* | [**copyFolder**](docs/Api/FolderApi.md#copyfolder) | **PUT** /barcode/storage/folder/copy/{srcPath} | Copy folder -*FolderApi* | [**createFolder**](docs/Api/FolderApi.md#createfolder) | **PUT** /barcode/storage/folder/{path} | Create the folder -*FolderApi* | [**deleteFolder**](docs/Api/FolderApi.md#deletefolder) | **DELETE** /barcode/storage/folder/{path} | Delete folder -*FolderApi* | [**getFilesList**](docs/Api/FolderApi.md#getfileslist) | **GET** /barcode/storage/folder/{path} | Get all files and folders within a folder -*FolderApi* | [**moveFolder**](docs/Api/FolderApi.md#movefolder) | **PUT** /barcode/storage/folder/move/{srcPath} | Move folder -*StorageApi* | [**getDiscUsage**](docs/Api/StorageApi.md#getdiscusage) | **GET** /barcode/storage/disc | Get disc usage -*StorageApi* | [**getFileVersions**](docs/Api/StorageApi.md#getfileversions) | **GET** /barcode/storage/version/{path} | Get file versions -*StorageApi* | [**objectExists**](docs/Api/StorageApi.md#objectexists) | **GET** /barcode/storage/exist/{path} | Check if file or folder exists -*StorageApi* | [**storageExists**](docs/Api/StorageApi.md#storageexists) | **GET** /barcode/storage/{storageName}/exist | Check if storage exists +*GenerateApi* | [**generate**](docs/Api/GenerateApi.md#generate) | **GET** /barcode/generate/{barcodeType} | Generate barcode using GET request with parameters in route and query string. +*GenerateApi* | [**generateBody**](docs/Api/GenerateApi.md#generatebody) | **POST** /barcode/generate-body | Generate barcode using POST request with parameters in body in json or xml format. +*GenerateApi* | [**generateMultipart**](docs/Api/GenerateApi.md#generatemultipart) | **POST** /barcode/generate-multipart | Generate barcode using POST request with parameters in multipart form. +*RecognizeApi* | [**recognize**](docs/Api/RecognizeApi.md#recognize) | **GET** /barcode/recognize | Recognize barcode from file on server using GET requests with parameters in route and query string. +*RecognizeApi* | [**recognizeBase64**](docs/Api/RecognizeApi.md#recognizebase64) | **POST** /barcode/recognize-body | Recognize barcode from file in request body using POST requests with parameters in body in json or xml format. +*RecognizeApi* | [**recognizeMultipart**](docs/Api/RecognizeApi.md#recognizemultipart) | **POST** /barcode/recognize-multipart | Recognize barcode from file in request body using POST requests with parameters in multipart form. +*ScanApi* | [**scan**](docs/Api/ScanApi.md#scan) | **GET** /barcode/scan | Scan barcode from file on server using GET requests with parameter in query string. +*ScanApi* | [**scanBase64**](docs/Api/ScanApi.md#scanbase64) | **POST** /barcode/scan-body | Scan barcode from file in request body using POST requests with parameter in body in json or xml format. +*ScanApi* | [**scanMultipart**](docs/Api/ScanApi.md#scanmultipart) | **POST** /barcode/scan-multipart | Scan barcode from file in request body using POST requests with parameter in multipart form. ## Documentation For Models - [ApiError](docs/Model/ApiError.md) - [ApiErrorResponse](docs/Model/ApiErrorResponse.md) -- [AustralianPostParams](docs/Model/AustralianPostParams.md) -- [AutoSizeMode](docs/Model/AutoSizeMode.md) -- [AvailableGraphicsUnit](docs/Model/AvailableGraphicsUnit.md) -- [AztecEncodeMode](docs/Model/AztecEncodeMode.md) -- [AztecParams](docs/Model/AztecParams.md) -- [AztecSymbolMode](docs/Model/AztecSymbolMode.md) +- [BarcodeImageFormat](docs/Model/BarcodeImageFormat.md) +- [BarcodeImageParams](docs/Model/BarcodeImageParams.md) - [BarcodeResponse](docs/Model/BarcodeResponse.md) - [BarcodeResponseList](docs/Model/BarcodeResponseList.md) -- [BorderDashStyle](docs/Model/BorderDashStyle.md) -- [CaptionParams](docs/Model/CaptionParams.md) -- [ChecksumValidation](docs/Model/ChecksumValidation.md) -- [CodabarChecksumMode](docs/Model/CodabarChecksumMode.md) -- [CodabarParams](docs/Model/CodabarParams.md) -- [CodabarSymbol](docs/Model/CodabarSymbol.md) -- [CodablockParams](docs/Model/CodablockParams.md) -- [Code128Emulation](docs/Model/Code128Emulation.md) -- [Code128EncodeMode](docs/Model/Code128EncodeMode.md) -- [Code128Params](docs/Model/Code128Params.md) -- [Code16KParams](docs/Model/Code16KParams.md) - [CodeLocation](docs/Model/CodeLocation.md) -- [CouponParams](docs/Model/CouponParams.md) -- [CustomerInformationInterpretingType](docs/Model/CustomerInformationInterpretingType.md) -- [DataBarParams](docs/Model/DataBarParams.md) -- [DataMatrixEccType](docs/Model/DataMatrixEccType.md) -- [DataMatrixEncodeMode](docs/Model/DataMatrixEncodeMode.md) -- [DataMatrixParams](docs/Model/DataMatrixParams.md) -- [DataMatrixVersion](docs/Model/DataMatrixVersion.md) - [DecodeBarcodeType](docs/Model/DecodeBarcodeType.md) -- [DiscUsage](docs/Model/DiscUsage.md) -- [DotCodeEncodeMode](docs/Model/DotCodeEncodeMode.md) -- [DotCodeParams](docs/Model/DotCodeParams.md) -- [ECIEncodings](docs/Model/ECIEncodings.md) -- [EnableChecksum](docs/Model/EnableChecksum.md) - [EncodeBarcodeType](docs/Model/EncodeBarcodeType.md) -- [Error](docs/Model/Error.md) -- [ErrorDetails](docs/Model/ErrorDetails.md) -- [FileVersions](docs/Model/FileVersions.md) -- [FilesList](docs/Model/FilesList.md) -- [FilesUploadResult](docs/Model/FilesUploadResult.md) -- [FontMode](docs/Model/FontMode.md) -- [FontParams](docs/Model/FontParams.md) -- [FontStyle](docs/Model/FontStyle.md) -- [GeneratorParams](docs/Model/GeneratorParams.md) -- [GeneratorParamsList](docs/Model/GeneratorParamsList.md) -- [HanXinEncodeMode](docs/Model/HanXinEncodeMode.md) -- [HanXinErrorLevel](docs/Model/HanXinErrorLevel.md) -- [HanXinParams](docs/Model/HanXinParams.md) -- [HanXinVersion](docs/Model/HanXinVersion.md) -- [ITF14BorderType](docs/Model/ITF14BorderType.md) -- [ITFParams](docs/Model/ITFParams.md) -- [MacroCharacter](docs/Model/MacroCharacter.md) -- [MaxiCodeEncodeMode](docs/Model/MaxiCodeEncodeMode.md) -- [MaxiCodeMode](docs/Model/MaxiCodeMode.md) -- [MaxiCodeParams](docs/Model/MaxiCodeParams.md) -- [ObjectExist](docs/Model/ObjectExist.md) -- [Padding](docs/Model/Padding.md) -- [PatchCodeParams](docs/Model/PatchCodeParams.md) -- [PatchFormat](docs/Model/PatchFormat.md) -- [Pdf417CompactionMode](docs/Model/Pdf417CompactionMode.md) -- [Pdf417ErrorLevel](docs/Model/Pdf417ErrorLevel.md) -- [Pdf417MacroTerminator](docs/Model/Pdf417MacroTerminator.md) -- [Pdf417Params](docs/Model/Pdf417Params.md) -- [PostalParams](docs/Model/PostalParams.md) -- [PresetType](docs/Model/PresetType.md) -- [QREncodeMode](docs/Model/QREncodeMode.md) -- [QREncodeType](docs/Model/QREncodeType.md) -- [QRErrorLevel](docs/Model/QRErrorLevel.md) -- [QRVersion](docs/Model/QRVersion.md) -- [QrParams](docs/Model/QrParams.md) -- [ReaderParams](docs/Model/ReaderParams.md) +- [EncodeData](docs/Model/EncodeData.md) +- [EncodeDataType](docs/Model/EncodeDataType.md) +- [GenerateParams](docs/Model/GenerateParams.md) +- [GraphicsUnit](docs/Model/GraphicsUnit.md) +- [RecognitionImageKind](docs/Model/RecognitionImageKind.md) +- [RecognitionMode](docs/Model/RecognitionMode.md) +- [RecognizeBase64Request](docs/Model/RecognizeBase64Request.md) - [RegionPoint](docs/Model/RegionPoint.md) -- [ResultImageInfo](docs/Model/ResultImageInfo.md) -- [StorageExist](docs/Model/StorageExist.md) -- [StorageFile](docs/Model/StorageFile.md) -- [StructuredAppend](docs/Model/StructuredAppend.md) -- [TextAlignment](docs/Model/TextAlignment.md) -- [FileVersion](docs/Model/FileVersion.md) +- [ScanBase64Request](docs/Model/ScanBase64Request.md) diff --git a/composer.json b/composer.json index c885511..42a144c 100644 --- a/composer.json +++ b/composer.json @@ -126,7 +126,7 @@ ], "require": { "php": ">=7.4 || >=8.0", - "guzzlehttp/guzzle": ">=6", + "guzzlehttp/guzzle": "^7.4", "ext-json": "*" }, "require-dev": { diff --git a/docs/Api/BarcodeApi.md b/docs/Api/BarcodeApi.md deleted file mode 100644 index 9a51c14..0000000 --- a/docs/Api/BarcodeApi.md +++ /dev/null @@ -1,740 +0,0 @@ -# Aspose\BarCode\BarcodeApi - -All URIs are relative to *https://api.aspose.cloud/v3.0* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**getBarcodeGenerate**](BarcodeApi.md#getBarcodeGenerate) | **GET** /barcode/generate | Generate barcode. -[**getBarcodeRecognize**](BarcodeApi.md#getBarcodeRecognize) | **GET** /barcode/{name}/recognize | Recognize barcode from a file on server. -[**postBarcodeRecognizeFromUrlOrContent**](BarcodeApi.md#postBarcodeRecognizeFromUrlOrContent) | **POST** /barcode/recognize | Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image with content-type \"application/octet-stream\". An image can also be passed as a form field. -[**postGenerateMultiple**](BarcodeApi.md#postGenerateMultiple) | **POST** /barcode/generateMultiple | Generate multiple barcodes and return in response stream -[**putBarcodeGenerateFile**](BarcodeApi.md#putBarcodeGenerateFile) | **PUT** /barcode/{name}/generate | Generate barcode and save on server (from query params or from file with json or xml content) -[**putBarcodeRecognizeFromBody**](BarcodeApi.md#putBarcodeRecognizeFromBody) | **PUT** /barcode/{name}/recognize | Recognition of a barcode from file on server with parameters in body. -[**putGenerateMultiple**](BarcodeApi.md#putGenerateMultiple) | **PUT** /barcode/{name}/generateMultiple | Generate image with multiple barcodes and put new file on server -[**scanBarcode**](BarcodeApi.md#scanBarcode) | **POST** /barcode/scan | Quickly scan a barcode from an image. - - -# **getBarcodeGenerate** -> \SplFileObject getBarcodeGenerate($type, $text, $two_d_display_text, $text_location, $text_alignment, $text_color, $no_wrap, $resolution, $resolution_x, $resolution_y, $dimension_x, $text_space, $units, $size_mode, $bar_height, $image_height, $image_width, $rotation_angle, $back_color, $bar_color, $border_color, $border_width, $border_dash_style, $border_visible, $enable_checksum, $enable_escape, $filled_bars, $always_show_checksum, $wide_narrow_ratio, $validate_text, $supplement_data, $supplement_space, $bar_width_reduction, $use_anti_alias, $format) - -Generate barcode. - -### Example -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Aspose\BarCode\Api\BarcodeApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$type = "type_example"; // string | Type of barcode to generate. -$text = "text_example"; // string | Text to encode. -$two_d_display_text = "two_d_display_text_example"; // string | Text that will be displayed instead of codetext in 2D barcodes. Used for: Aztec, Pdf417, DataMatrix, QR, MaxiCode, DotCode -$text_location = "text_location_example"; // string | Specify the displaying Text Location, set to CodeLocation.None to hide CodeText. Default value: CodeLocation.Below. -$text_alignment = "text_alignment_example"; // string | Text alignment. -$text_color = "text_color_example"; // string | Specify the displaying CodeText's Color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF -$no_wrap = true; // bool | Specify word wraps (line breaks) within text. Default value: false. -$resolution = 1.2; // double | Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. -$resolution_x = 1.2; // double | DEPRECATED: Use 'Resolution' instead. -$resolution_y = 1.2; // double | DEPRECATED: Use 'Resolution' instead. -$dimension_x = 1.2; // double | The smallest width of the unit of BarCode bars or spaces. Increase this will increase the whole barcode image width. Ignored if AutoSizeMode property is set to AutoSizeMode.Nearest or AutoSizeMode.Interpolation. -$text_space = 1.2; // double | Space between the CodeText and the BarCode in Unit value. Default value: 2pt. Ignored for EAN8, EAN13, UPCE, UPCA, ISBN, ISMN, ISSN, UpcaGs1DatabarCoupon. -$units = "units_example"; // string | Common Units for all measuring in query. Default units: pixel. -$size_mode = "size_mode_example"; // string | Specifies the different types of automatic sizing modes. Default value: AutoSizeMode.None. -$bar_height = 1.2; // double | Height of the barcode in given units. Default units: pixel. -$image_height = 1.2; // double | Height of the barcode image in given units. Default units: pixel. -$image_width = 1.2; // double | Width of the barcode image in given units. Default units: pixel. -$rotation_angle = 1.2; // double | BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0. -$back_color = "back_color_example"; // string | Background color of the barcode image. Default value: white. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF -$bar_color = "bar_color_example"; // string | Bars color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF -$border_color = "border_color_example"; // string | Border color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF -$border_width = 1.2; // double | Border width. Default value: 0. Ignored if Visible is set to false. -$border_dash_style = "border_dash_style_example"; // string | Border dash style. Default value: BorderDashStyle.Solid. -$border_visible = true; // bool | Border visibility. If false than parameter Width is always ignored (0). Default value: false. -$enable_checksum = "enable_checksum_example"; // string | Enable checksum during generation 1D barcodes. Default is treated as Yes for symbology which must contain checksum, as No where checksum only possible. Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN, Codabar Checksum always used: Rest symbology -$enable_escape = true; // bool | Indicates whether explains the character \"\\\" as an escape character in CodeText property. Used for Pdf417, DataMatrix, Code128 only If the EnableEscape is true, \"\\\" will be explained as a special escape character. Otherwise, \"\\\" acts as normal characters. Aspose.BarCode supports input decimal ascii code and mnemonic for ASCII control-code characters. For example, \\013 and \\\\CR stands for CR. -$filled_bars = true; // bool | Value indicating whether bars are filled. Only for 1D barcodes. Default value: true. -$always_show_checksum = true; // bool | Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes. -$wide_narrow_ratio = 1.2; // double | Wide bars to Narrow bars ratio. Default value: 3, that is, wide bars are 3 times as wide as narrow bars. Used for ITF, PZN, PharmaCode, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, IATA2of5, VIN, DeutschePost, OPC, Code32, DataLogic2of5, PatchCode, Code39Extended, Code39Standard -$validate_text = true; // bool | Only for 1D barcodes. If codetext is incorrect and value set to true - exception will be thrown. Otherwise codetext will be corrected to match barcode's specification. Exception always will be thrown for: Databar symbology if codetext is incorrect. Exception always will not be thrown for: AustraliaPost, SingaporePost, Code39Extended, Code93Extended, Code16K, Code128 symbology if codetext is incorrect. -$supplement_data = "supplement_data_example"; // string | Supplement parameters. Used for Interleaved2of5, Standard2of5, EAN13, EAN8, UPCA, UPCE, ISBN, ISSN, ISMN. -$supplement_space = 1.2; // double | Space between main the BarCode and supplement BarCode. -$bar_width_reduction = 1.2; // double | Bars reduction value that is used to compensate ink spread while printing. -$use_anti_alias = true; // bool | Indicates whether is used anti-aliasing mode to render image. Anti-aliasing mode is applied to barcode and text drawing. -$format = "format_example"; // string | Result image format. - -try { - $result = $apiInstance->getBarcodeGenerate($type, $text, $two_d_display_text, $text_location, $text_alignment, $text_color, $no_wrap, $resolution, $resolution_x, $resolution_y, $dimension_x, $text_space, $units, $size_mode, $bar_height, $image_height, $image_width, $rotation_angle, $back_color, $bar_color, $border_color, $border_width, $border_dash_style, $border_visible, $enable_checksum, $enable_escape, $filled_bars, $always_show_checksum, $wide_narrow_ratio, $validate_text, $supplement_data, $supplement_space, $bar_width_reduction, $use_anti_alias, $format); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling BarcodeApi->getBarcodeGenerate: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **type** | **string**| Type of barcode to generate. | - **text** | **string**| Text to encode. | - **two_d_display_text** | **string**| Text that will be displayed instead of codetext in 2D barcodes. Used for: Aztec, Pdf417, DataMatrix, QR, MaxiCode, DotCode | [optional] - **text_location** | **string**| Specify the displaying Text Location, set to CodeLocation.None to hide CodeText. Default value: CodeLocation.Below. | [optional] - **text_alignment** | **string**| Text alignment. | [optional] - **text_color** | **string**| Specify the displaying CodeText's Color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF | [optional] - **no_wrap** | **bool**| Specify word wraps (line breaks) within text. Default value: false. | [optional] - **resolution** | **double**| Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. | [optional] - **resolution_x** | **double**| DEPRECATED: Use 'Resolution' instead. | [optional] - **resolution_y** | **double**| DEPRECATED: Use 'Resolution' instead. | [optional] - **dimension_x** | **double**| The smallest width of the unit of BarCode bars or spaces. Increase this will increase the whole barcode image width. Ignored if AutoSizeMode property is set to AutoSizeMode.Nearest or AutoSizeMode.Interpolation. | [optional] - **text_space** | **double**| Space between the CodeText and the BarCode in Unit value. Default value: 2pt. Ignored for EAN8, EAN13, UPCE, UPCA, ISBN, ISMN, ISSN, UpcaGs1DatabarCoupon. | [optional] - **units** | **string**| Common Units for all measuring in query. Default units: pixel. | [optional] - **size_mode** | **string**| Specifies the different types of automatic sizing modes. Default value: AutoSizeMode.None. | [optional] - **bar_height** | **double**| Height of the barcode in given units. Default units: pixel. | [optional] - **image_height** | **double**| Height of the barcode image in given units. Default units: pixel. | [optional] - **image_width** | **double**| Width of the barcode image in given units. Default units: pixel. | [optional] - **rotation_angle** | **double**| BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0. | [optional] - **back_color** | **string**| Background color of the barcode image. Default value: white. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF | [optional] - **bar_color** | **string**| Bars color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF | [optional] - **border_color** | **string**| Border color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF | [optional] - **border_width** | **double**| Border width. Default value: 0. Ignored if Visible is set to false. | [optional] - **border_dash_style** | **string**| Border dash style. Default value: BorderDashStyle.Solid. | [optional] - **border_visible** | **bool**| Border visibility. If false than parameter Width is always ignored (0). Default value: false. | [optional] - **enable_checksum** | **string**| Enable checksum during generation 1D barcodes. Default is treated as Yes for symbology which must contain checksum, as No where checksum only possible. Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN, Codabar Checksum always used: Rest symbology | [optional] - **enable_escape** | **bool**| Indicates whether explains the character \"\\\" as an escape character in CodeText property. Used for Pdf417, DataMatrix, Code128 only If the EnableEscape is true, \"\\\" will be explained as a special escape character. Otherwise, \"\\\" acts as normal characters. Aspose.BarCode supports input decimal ascii code and mnemonic for ASCII control-code characters. For example, \\013 and \\\\CR stands for CR. | [optional] - **filled_bars** | **bool**| Value indicating whether bars are filled. Only for 1D barcodes. Default value: true. | [optional] - **always_show_checksum** | **bool**| Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes. | [optional] - **wide_narrow_ratio** | **double**| Wide bars to Narrow bars ratio. Default value: 3, that is, wide bars are 3 times as wide as narrow bars. Used for ITF, PZN, PharmaCode, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, IATA2of5, VIN, DeutschePost, OPC, Code32, DataLogic2of5, PatchCode, Code39Extended, Code39Standard | [optional] - **validate_text** | **bool**| Only for 1D barcodes. If codetext is incorrect and value set to true - exception will be thrown. Otherwise codetext will be corrected to match barcode's specification. Exception always will be thrown for: Databar symbology if codetext is incorrect. Exception always will not be thrown for: AustraliaPost, SingaporePost, Code39Extended, Code93Extended, Code16K, Code128 symbology if codetext is incorrect. | [optional] - **supplement_data** | **string**| Supplement parameters. Used for Interleaved2of5, Standard2of5, EAN13, EAN8, UPCA, UPCE, ISBN, ISSN, ISMN. | [optional] - **supplement_space** | **double**| Space between main the BarCode and supplement BarCode. | [optional] - **bar_width_reduction** | **double**| Bars reduction value that is used to compensate ink spread while printing. | [optional] - **use_anti_alias** | **bool**| Indicates whether is used anti-aliasing mode to render image. Anti-aliasing mode is applied to barcode and text drawing. | [optional] - **format** | **string**| Result image format. | [optional] - -### Return type - -[**\SplFileObject**](../Model/\SplFileObject.md) - -### Authorization - -[JWT](../../README.md#JWT) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: image/png, image/bmp, image/gif, image/jpeg, image/svg+xml, image/tiff - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) - -# **getBarcodeRecognize** -> \Aspose\BarCode\Model\BarcodeResponseList getBarcodeRecognize($name, $type, $types, $checksum_validation, $detect_encoding, $preset, $rect_x, $rect_y, $rect_width, $rect_height, $strip_fnc, $timeout, $median_smoothing_window_size, $allow_median_smoothing, $allow_complex_background, $allow_datamatrix_industrial_barcodes, $allow_decreased_image, $allow_detect_scan_gap, $allow_incorrect_barcodes, $allow_invert_image, $allow_micro_white_spots_removing, $allow_one_d_fast_barcodes_detector, $allow_one_d_wiped_bars_restoration, $allow_qr_micro_qr_restoration, $allow_regular_image, $allow_salt_and_pepper_filtering, $allow_white_spots_removing, $check_more1_d_variants, $fast_scan_only, $allow_additional_restorations, $region_likelihood_threshold_percent, $scan_window_sizes, $similarity, $skip_diagonal_search, $read_tiny_barcodes, $australian_post_encoding_table, $ignore_ending_filling_patterns_for_c_table, $storage, $folder) - -Recognize barcode from a file on server. - -### Example -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Aspose\BarCode\Api\BarcodeApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$name = "name_example"; // string | The image file name. -$type = "type_example"; // string | The type of barcode to read. -$types = array(new \Aspose\BarCode\Model\\Aspose\BarCode\Model\DecodeBarcodeType()); // \Aspose\BarCode\Model\DecodeBarcodeType[] | Multiple barcode types to read. -$checksum_validation = "checksum_validation_example"; // string | Enable checksum validation during recognition for 1D barcodes. Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible. Checksum never used: Codabar Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN Checksum always used: Rest symbologies -$detect_encoding = true; // bool | A flag which force engine to detect codetext encoding for Unicode. -$preset = "preset_example"; // string | Preset allows to configure recognition quality and speed manually. You can quickly set up Preset by embedded presets: HighPerformance, NormalQuality, HighQuality, MaxBarCodes or you can manually configure separate options. Default value of Preset is NormalQuality. -$rect_x = 56; // int | Set X of top left corner of area for recognition. -$rect_y = 56; // int | Set Y of top left corner of area for recognition. -$rect_width = 56; // int | Set Width of area for recognition. -$rect_height = 56; // int | Set Height of area for recognition. -$strip_fnc = true; // bool | Value indicating whether FNC symbol strip must be done. -$timeout = 56; // int | Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). Maximum value is 30_000 (1/2 minute). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout. -$median_smoothing_window_size = 56; // int | Window size for median smoothing. Typical values are 3 or 4. Default value is 3. AllowMedianSmoothing must be set. -$allow_median_smoothing = true; // bool | Allows engine to enable median smoothing as additional scan. Mode helps to recognize noised barcodes. -$allow_complex_background = true; // bool | Allows engine to recognize color barcodes on color background as additional scan. Extremely slow mode. -$allow_datamatrix_industrial_barcodes = true; // bool | Allows engine for Datamatrix to recognize dashed industrial Datamatrix barcodes. Slow mode which helps only for dashed barcodes which consist from spots. -$allow_decreased_image = true; // bool | Allows engine to recognize decreased image as additional scan. Size for decreasing is selected by internal engine algorithms. Mode helps to recognize barcodes which are noised and blurred but captured with high resolution. -$allow_detect_scan_gap = true; // bool | Allows engine to use gap between scans to increase recognition speed. Mode can make recognition problems with low height barcodes. -$allow_incorrect_barcodes = true; // bool | Allows engine to recognize barcodes which has incorrect checksum or incorrect values. Mode can be used to recognize damaged barcodes with incorrect text. -$allow_invert_image = true; // bool | Allows engine to recognize inverse color image as additional scan. Mode can be used when barcode is white on black background. -$allow_micro_white_spots_removing = true; // bool | Allows engine for Postal barcodes to recognize slightly noised images. Mode helps to recognize slightly damaged Postal barcodes. -$allow_one_d_fast_barcodes_detector = true; // bool | Allows engine for 1D barcodes to quickly recognize high quality barcodes which fill almost whole image. Mode helps to quickly recognize generated barcodes from Internet. -$allow_one_d_wiped_bars_restoration = true; // bool | Allows engine for 1D barcodes to recognize barcodes with single wiped/glued bars in pattern. -$allow_qr_micro_qr_restoration = true; // bool | Allows engine for QR/MicroQR to recognize damaged MicroQR barcodes. -$allow_regular_image = true; // bool | Allows engine to recognize regular image without any restorations as main scan. Mode to recognize image as is. -$allow_salt_and_pepper_filtering = true; // bool | Allows engine to recognize barcodes with salt and pepper noise type. Mode can remove small noise with white and black dots. -$allow_white_spots_removing = true; // bool | Allows engine to recognize image without small white spots as additional scan. Mode helps to recognize noised image as well as median smoothing filtering. -$check_more1_d_variants = true; // bool | Allows engine to recognize 1D barcodes with checksum by checking more recognition variants. Default value: False. -$fast_scan_only = true; // bool | Allows engine for 1D barcodes to quickly recognize middle slice of an image and return result without using any time-consuming algorithms. Default value: False. -$allow_additional_restorations = true; // bool | Allows engine using additional image restorations to recognize corrupted barcodes. At this time, it is used only in MicroPdf417 barcode type. Default value: False. -$region_likelihood_threshold_percent = 1.2; // double | Sets threshold for detected regions that may contain barcodes. Value 0.7 means that bottom 70% of possible regions are filtered out and not processed further. Region likelihood threshold must be between [0.05, 0.9] Use high values for clear images with few barcodes. Use low values for images with many barcodes or for noisy images. Low value may lead to a bigger recognition time. -$scan_window_sizes = array(56); // int[] | Scan window sizes in pixels. Allowed sizes are 10, 15, 20, 25, 30. Scanning with small window size takes more time and provides more accuracy but may fail in detecting very big barcodes. Combining of several window sizes can improve detection quality. -$similarity = 1.2; // double | Similarity coefficient depends on how homogeneous barcodes are. Use high value for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] -$skip_diagonal_search = true; // bool | Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time. -$read_tiny_barcodes = true; // bool | Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False. -$australian_post_encoding_table = "australian_post_encoding_table_example"; // string | Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. -$ignore_ending_filling_patterns_for_c_table = true; // bool | The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequence \"333\" of filling patterns is decoded as letter \"z\". -$storage = "storage_example"; // string | The image storage. -$folder = "folder_example"; // string | The image folder. - -try { - $result = $apiInstance->getBarcodeRecognize($name, $type, $types, $checksum_validation, $detect_encoding, $preset, $rect_x, $rect_y, $rect_width, $rect_height, $strip_fnc, $timeout, $median_smoothing_window_size, $allow_median_smoothing, $allow_complex_background, $allow_datamatrix_industrial_barcodes, $allow_decreased_image, $allow_detect_scan_gap, $allow_incorrect_barcodes, $allow_invert_image, $allow_micro_white_spots_removing, $allow_one_d_fast_barcodes_detector, $allow_one_d_wiped_bars_restoration, $allow_qr_micro_qr_restoration, $allow_regular_image, $allow_salt_and_pepper_filtering, $allow_white_spots_removing, $check_more1_d_variants, $fast_scan_only, $allow_additional_restorations, $region_likelihood_threshold_percent, $scan_window_sizes, $similarity, $skip_diagonal_search, $read_tiny_barcodes, $australian_post_encoding_table, $ignore_ending_filling_patterns_for_c_table, $storage, $folder); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling BarcodeApi->getBarcodeRecognize: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **string**| The image file name. | - **type** | **string**| The type of barcode to read. | [optional] - **types** | [**\Aspose\BarCode\Model\DecodeBarcodeType[]**](../Model/\Aspose\BarCode\Model\DecodeBarcodeType.md)| Multiple barcode types to read. | [optional] - **checksum_validation** | **string**| Enable checksum validation during recognition for 1D barcodes. Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible. Checksum never used: Codabar Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN Checksum always used: Rest symbologies | [optional] - **detect_encoding** | **bool**| A flag which force engine to detect codetext encoding for Unicode. | [optional] - **preset** | **string**| Preset allows to configure recognition quality and speed manually. You can quickly set up Preset by embedded presets: HighPerformance, NormalQuality, HighQuality, MaxBarCodes or you can manually configure separate options. Default value of Preset is NormalQuality. | [optional] - **rect_x** | **int**| Set X of top left corner of area for recognition. | [optional] - **rect_y** | **int**| Set Y of top left corner of area for recognition. | [optional] - **rect_width** | **int**| Set Width of area for recognition. | [optional] - **rect_height** | **int**| Set Height of area for recognition. | [optional] - **strip_fnc** | **bool**| Value indicating whether FNC symbol strip must be done. | [optional] - **timeout** | **int**| Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). Maximum value is 30_000 (1/2 minute). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout. | [optional] - **median_smoothing_window_size** | **int**| Window size for median smoothing. Typical values are 3 or 4. Default value is 3. AllowMedianSmoothing must be set. | [optional] - **allow_median_smoothing** | **bool**| Allows engine to enable median smoothing as additional scan. Mode helps to recognize noised barcodes. | [optional] - **allow_complex_background** | **bool**| Allows engine to recognize color barcodes on color background as additional scan. Extremely slow mode. | [optional] - **allow_datamatrix_industrial_barcodes** | **bool**| Allows engine for Datamatrix to recognize dashed industrial Datamatrix barcodes. Slow mode which helps only for dashed barcodes which consist from spots. | [optional] - **allow_decreased_image** | **bool**| Allows engine to recognize decreased image as additional scan. Size for decreasing is selected by internal engine algorithms. Mode helps to recognize barcodes which are noised and blurred but captured with high resolution. | [optional] - **allow_detect_scan_gap** | **bool**| Allows engine to use gap between scans to increase recognition speed. Mode can make recognition problems with low height barcodes. | [optional] - **allow_incorrect_barcodes** | **bool**| Allows engine to recognize barcodes which has incorrect checksum or incorrect values. Mode can be used to recognize damaged barcodes with incorrect text. | [optional] - **allow_invert_image** | **bool**| Allows engine to recognize inverse color image as additional scan. Mode can be used when barcode is white on black background. | [optional] - **allow_micro_white_spots_removing** | **bool**| Allows engine for Postal barcodes to recognize slightly noised images. Mode helps to recognize slightly damaged Postal barcodes. | [optional] - **allow_one_d_fast_barcodes_detector** | **bool**| Allows engine for 1D barcodes to quickly recognize high quality barcodes which fill almost whole image. Mode helps to quickly recognize generated barcodes from Internet. | [optional] - **allow_one_d_wiped_bars_restoration** | **bool**| Allows engine for 1D barcodes to recognize barcodes with single wiped/glued bars in pattern. | [optional] - **allow_qr_micro_qr_restoration** | **bool**| Allows engine for QR/MicroQR to recognize damaged MicroQR barcodes. | [optional] - **allow_regular_image** | **bool**| Allows engine to recognize regular image without any restorations as main scan. Mode to recognize image as is. | [optional] - **allow_salt_and_pepper_filtering** | **bool**| Allows engine to recognize barcodes with salt and pepper noise type. Mode can remove small noise with white and black dots. | [optional] - **allow_white_spots_removing** | **bool**| Allows engine to recognize image without small white spots as additional scan. Mode helps to recognize noised image as well as median smoothing filtering. | [optional] - **check_more1_d_variants** | **bool**| Allows engine to recognize 1D barcodes with checksum by checking more recognition variants. Default value: False. | [optional] - **fast_scan_only** | **bool**| Allows engine for 1D barcodes to quickly recognize middle slice of an image and return result without using any time-consuming algorithms. Default value: False. | [optional] - **allow_additional_restorations** | **bool**| Allows engine using additional image restorations to recognize corrupted barcodes. At this time, it is used only in MicroPdf417 barcode type. Default value: False. | [optional] - **region_likelihood_threshold_percent** | **double**| Sets threshold for detected regions that may contain barcodes. Value 0.7 means that bottom 70% of possible regions are filtered out and not processed further. Region likelihood threshold must be between [0.05, 0.9] Use high values for clear images with few barcodes. Use low values for images with many barcodes or for noisy images. Low value may lead to a bigger recognition time. | [optional] - **scan_window_sizes** | [**int[]**](../Model/int.md)| Scan window sizes in pixels. Allowed sizes are 10, 15, 20, 25, 30. Scanning with small window size takes more time and provides more accuracy but may fail in detecting very big barcodes. Combining of several window sizes can improve detection quality. | [optional] - **similarity** | **double**| Similarity coefficient depends on how homogeneous barcodes are. Use high value for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] | [optional] - **skip_diagonal_search** | **bool**| Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time. | [optional] - **read_tiny_barcodes** | **bool**| Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False. | [optional] - **australian_post_encoding_table** | **string**| Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. | [optional] - **ignore_ending_filling_patterns_for_c_table** | **bool**| The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequence \"333\" of filling patterns is decoded as letter \"z\". | [optional] - **storage** | **string**| The image storage. | [optional] - **folder** | **string**| The image folder. | [optional] - -### Return type - -[**\Aspose\BarCode\Model\BarcodeResponseList**](../Model/BarcodeResponseList.md) - -### Authorization - -[JWT](../../README.md#JWT) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) - -# **postBarcodeRecognizeFromUrlOrContent** -> \Aspose\BarCode\Model\BarcodeResponseList postBarcodeRecognizeFromUrlOrContent($type, $types, $checksum_validation, $detect_encoding, $preset, $rect_x, $rect_y, $rect_width, $rect_height, $strip_fnc, $timeout, $median_smoothing_window_size, $allow_median_smoothing, $allow_complex_background, $allow_datamatrix_industrial_barcodes, $allow_decreased_image, $allow_detect_scan_gap, $allow_incorrect_barcodes, $allow_invert_image, $allow_micro_white_spots_removing, $allow_one_d_fast_barcodes_detector, $allow_one_d_wiped_bars_restoration, $allow_qr_micro_qr_restoration, $allow_regular_image, $allow_salt_and_pepper_filtering, $allow_white_spots_removing, $check_more1_d_variants, $fast_scan_only, $allow_additional_restorations, $region_likelihood_threshold_percent, $scan_window_sizes, $similarity, $skip_diagonal_search, $read_tiny_barcodes, $australian_post_encoding_table, $ignore_ending_filling_patterns_for_c_table, $url, $image) - -Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image with content-type \"application/octet-stream\". An image can also be passed as a form field. - -### Example -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Aspose\BarCode\Api\BarcodeApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$type = "type_example"; // string | The type of barcode to read. -$types = array(new \Aspose\BarCode\Model\\Aspose\BarCode\Model\DecodeBarcodeType()); // \Aspose\BarCode\Model\DecodeBarcodeType[] | Multiple barcode types to read. -$checksum_validation = "checksum_validation_example"; // string | Enable checksum validation during recognition for 1D barcodes. Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible. Checksum never used: Codabar Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN Checksum always used: Rest symbologies -$detect_encoding = true; // bool | A flag which force engine to detect codetext encoding for Unicode. -$preset = "preset_example"; // string | Preset allows to configure recognition quality and speed manually. You can quickly set up Preset by embedded presets: HighPerformance, NormalQuality, HighQuality, MaxBarCodes or you can manually configure separate options. Default value of Preset is NormalQuality. -$rect_x = 56; // int | Set X of top left corner of area for recognition. -$rect_y = 56; // int | Set Y of top left corner of area for recognition. -$rect_width = 56; // int | Set Width of area for recognition. -$rect_height = 56; // int | Set Height of area for recognition. -$strip_fnc = true; // bool | Value indicating whether FNC symbol strip must be done. -$timeout = 56; // int | Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). Maximum value is 30_000 (1/2 minute). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout. -$median_smoothing_window_size = 56; // int | Window size for median smoothing. Typical values are 3 or 4. Default value is 3. AllowMedianSmoothing must be set. -$allow_median_smoothing = true; // bool | Allows engine to enable median smoothing as additional scan. Mode helps to recognize noised barcodes. -$allow_complex_background = true; // bool | Allows engine to recognize color barcodes on color background as additional scan. Extremely slow mode. -$allow_datamatrix_industrial_barcodes = true; // bool | Allows engine for Datamatrix to recognize dashed industrial Datamatrix barcodes. Slow mode which helps only for dashed barcodes which consist from spots. -$allow_decreased_image = true; // bool | Allows engine to recognize decreased image as additional scan. Size for decreasing is selected by internal engine algorithms. Mode helps to recognize barcodes which are noised and blurred but captured with high resolution. -$allow_detect_scan_gap = true; // bool | Allows engine to use gap between scans to increase recognition speed. Mode can make recognition problems with low height barcodes. -$allow_incorrect_barcodes = true; // bool | Allows engine to recognize barcodes which has incorrect checksum or incorrect values. Mode can be used to recognize damaged barcodes with incorrect text. -$allow_invert_image = true; // bool | Allows engine to recognize inverse color image as additional scan. Mode can be used when barcode is white on black background. -$allow_micro_white_spots_removing = true; // bool | Allows engine for Postal barcodes to recognize slightly noised images. Mode helps to recognize slightly damaged Postal barcodes. -$allow_one_d_fast_barcodes_detector = true; // bool | Allows engine for 1D barcodes to quickly recognize high quality barcodes which fill almost whole image. Mode helps to quickly recognize generated barcodes from Internet. -$allow_one_d_wiped_bars_restoration = true; // bool | Allows engine for 1D barcodes to recognize barcodes with single wiped/glued bars in pattern. -$allow_qr_micro_qr_restoration = true; // bool | Allows engine for QR/MicroQR to recognize damaged MicroQR barcodes. -$allow_regular_image = true; // bool | Allows engine to recognize regular image without any restorations as main scan. Mode to recognize image as is. -$allow_salt_and_pepper_filtering = true; // bool | Allows engine to recognize barcodes with salt and pepper noise type. Mode can remove small noise with white and black dots. -$allow_white_spots_removing = true; // bool | Allows engine to recognize image without small white spots as additional scan. Mode helps to recognize noised image as well as median smoothing filtering. -$check_more1_d_variants = true; // bool | Allows engine to recognize 1D barcodes with checksum by checking more recognition variants. Default value: False. -$fast_scan_only = true; // bool | Allows engine for 1D barcodes to quickly recognize middle slice of an image and return result without using any time-consuming algorithms. Default value: False. -$allow_additional_restorations = true; // bool | Allows engine using additional image restorations to recognize corrupted barcodes. At this time, it is used only in MicroPdf417 barcode type. Default value: False. -$region_likelihood_threshold_percent = 1.2; // double | Sets threshold for detected regions that may contain barcodes. Value 0.7 means that bottom 70% of possible regions are filtered out and not processed further. Region likelihood threshold must be between [0.05, 0.9] Use high values for clear images with few barcodes. Use low values for images with many barcodes or for noisy images. Low value may lead to a bigger recognition time. -$scan_window_sizes = array(56); // int[] | Scan window sizes in pixels. Allowed sizes are 10, 15, 20, 25, 30. Scanning with small window size takes more time and provides more accuracy but may fail in detecting very big barcodes. Combining of several window sizes can improve detection quality. -$similarity = 1.2; // double | Similarity coefficient depends on how homogeneous barcodes are. Use high value for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] -$skip_diagonal_search = true; // bool | Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time. -$read_tiny_barcodes = true; // bool | Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False. -$australian_post_encoding_table = "australian_post_encoding_table_example"; // string | Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. -$ignore_ending_filling_patterns_for_c_table = true; // bool | The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequence \"333\" of filling patterns is decoded as letter \"z\". -$url = "url_example"; // string | The image file url. -$image = "/path/to/file.txt"; // \SplFileObject | Image data - -try { - $result = $apiInstance->postBarcodeRecognizeFromUrlOrContent($type, $types, $checksum_validation, $detect_encoding, $preset, $rect_x, $rect_y, $rect_width, $rect_height, $strip_fnc, $timeout, $median_smoothing_window_size, $allow_median_smoothing, $allow_complex_background, $allow_datamatrix_industrial_barcodes, $allow_decreased_image, $allow_detect_scan_gap, $allow_incorrect_barcodes, $allow_invert_image, $allow_micro_white_spots_removing, $allow_one_d_fast_barcodes_detector, $allow_one_d_wiped_bars_restoration, $allow_qr_micro_qr_restoration, $allow_regular_image, $allow_salt_and_pepper_filtering, $allow_white_spots_removing, $check_more1_d_variants, $fast_scan_only, $allow_additional_restorations, $region_likelihood_threshold_percent, $scan_window_sizes, $similarity, $skip_diagonal_search, $read_tiny_barcodes, $australian_post_encoding_table, $ignore_ending_filling_patterns_for_c_table, $url, $image); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling BarcodeApi->postBarcodeRecognizeFromUrlOrContent: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **type** | **string**| The type of barcode to read. | [optional] - **types** | [**\Aspose\BarCode\Model\DecodeBarcodeType[]**](../Model/\Aspose\BarCode\Model\DecodeBarcodeType.md)| Multiple barcode types to read. | [optional] - **checksum_validation** | **string**| Enable checksum validation during recognition for 1D barcodes. Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible. Checksum never used: Codabar Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN Checksum always used: Rest symbologies | [optional] - **detect_encoding** | **bool**| A flag which force engine to detect codetext encoding for Unicode. | [optional] - **preset** | **string**| Preset allows to configure recognition quality and speed manually. You can quickly set up Preset by embedded presets: HighPerformance, NormalQuality, HighQuality, MaxBarCodes or you can manually configure separate options. Default value of Preset is NormalQuality. | [optional] - **rect_x** | **int**| Set X of top left corner of area for recognition. | [optional] - **rect_y** | **int**| Set Y of top left corner of area for recognition. | [optional] - **rect_width** | **int**| Set Width of area for recognition. | [optional] - **rect_height** | **int**| Set Height of area for recognition. | [optional] - **strip_fnc** | **bool**| Value indicating whether FNC symbol strip must be done. | [optional] - **timeout** | **int**| Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). Maximum value is 30_000 (1/2 minute). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout. | [optional] - **median_smoothing_window_size** | **int**| Window size for median smoothing. Typical values are 3 or 4. Default value is 3. AllowMedianSmoothing must be set. | [optional] - **allow_median_smoothing** | **bool**| Allows engine to enable median smoothing as additional scan. Mode helps to recognize noised barcodes. | [optional] - **allow_complex_background** | **bool**| Allows engine to recognize color barcodes on color background as additional scan. Extremely slow mode. | [optional] - **allow_datamatrix_industrial_barcodes** | **bool**| Allows engine for Datamatrix to recognize dashed industrial Datamatrix barcodes. Slow mode which helps only for dashed barcodes which consist from spots. | [optional] - **allow_decreased_image** | **bool**| Allows engine to recognize decreased image as additional scan. Size for decreasing is selected by internal engine algorithms. Mode helps to recognize barcodes which are noised and blurred but captured with high resolution. | [optional] - **allow_detect_scan_gap** | **bool**| Allows engine to use gap between scans to increase recognition speed. Mode can make recognition problems with low height barcodes. | [optional] - **allow_incorrect_barcodes** | **bool**| Allows engine to recognize barcodes which has incorrect checksum or incorrect values. Mode can be used to recognize damaged barcodes with incorrect text. | [optional] - **allow_invert_image** | **bool**| Allows engine to recognize inverse color image as additional scan. Mode can be used when barcode is white on black background. | [optional] - **allow_micro_white_spots_removing** | **bool**| Allows engine for Postal barcodes to recognize slightly noised images. Mode helps to recognize slightly damaged Postal barcodes. | [optional] - **allow_one_d_fast_barcodes_detector** | **bool**| Allows engine for 1D barcodes to quickly recognize high quality barcodes which fill almost whole image. Mode helps to quickly recognize generated barcodes from Internet. | [optional] - **allow_one_d_wiped_bars_restoration** | **bool**| Allows engine for 1D barcodes to recognize barcodes with single wiped/glued bars in pattern. | [optional] - **allow_qr_micro_qr_restoration** | **bool**| Allows engine for QR/MicroQR to recognize damaged MicroQR barcodes. | [optional] - **allow_regular_image** | **bool**| Allows engine to recognize regular image without any restorations as main scan. Mode to recognize image as is. | [optional] - **allow_salt_and_pepper_filtering** | **bool**| Allows engine to recognize barcodes with salt and pepper noise type. Mode can remove small noise with white and black dots. | [optional] - **allow_white_spots_removing** | **bool**| Allows engine to recognize image without small white spots as additional scan. Mode helps to recognize noised image as well as median smoothing filtering. | [optional] - **check_more1_d_variants** | **bool**| Allows engine to recognize 1D barcodes with checksum by checking more recognition variants. Default value: False. | [optional] - **fast_scan_only** | **bool**| Allows engine for 1D barcodes to quickly recognize middle slice of an image and return result without using any time-consuming algorithms. Default value: False. | [optional] - **allow_additional_restorations** | **bool**| Allows engine using additional image restorations to recognize corrupted barcodes. At this time, it is used only in MicroPdf417 barcode type. Default value: False. | [optional] - **region_likelihood_threshold_percent** | **double**| Sets threshold for detected regions that may contain barcodes. Value 0.7 means that bottom 70% of possible regions are filtered out and not processed further. Region likelihood threshold must be between [0.05, 0.9] Use high values for clear images with few barcodes. Use low values for images with many barcodes or for noisy images. Low value may lead to a bigger recognition time. | [optional] - **scan_window_sizes** | [**int[]**](../Model/int.md)| Scan window sizes in pixels. Allowed sizes are 10, 15, 20, 25, 30. Scanning with small window size takes more time and provides more accuracy but may fail in detecting very big barcodes. Combining of several window sizes can improve detection quality. | [optional] - **similarity** | **double**| Similarity coefficient depends on how homogeneous barcodes are. Use high value for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] | [optional] - **skip_diagonal_search** | **bool**| Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time. | [optional] - **read_tiny_barcodes** | **bool**| Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False. | [optional] - **australian_post_encoding_table** | **string**| Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. | [optional] - **ignore_ending_filling_patterns_for_c_table** | **bool**| The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequence \"333\" of filling patterns is decoded as letter \"z\". | [optional] - **url** | **string**| The image file url. | [optional] - **image** | **\SplFileObject**| Image data | [optional] - -### Return type - -[**\Aspose\BarCode\Model\BarcodeResponseList**](../Model/BarcodeResponseList.md) - -### Authorization - -[JWT](../../README.md#JWT) - -### HTTP request headers - - - **Content-Type**: multipart/form-data, application/x-www-form-urlencoded, application/octet-stream - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) - -# **postGenerateMultiple** -> \SplFileObject postGenerateMultiple($generator_params_list, $format) - -Generate multiple barcodes and return in response stream - -### Example -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Aspose\BarCode\Api\BarcodeApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$generator_params_list = new \Aspose\BarCode\Model\GeneratorParamsList(); // \Aspose\BarCode\Model\GeneratorParamsList | List of barcodes -$format = "png"; // string | Format to return stream in - -try { - $result = $apiInstance->postGenerateMultiple($generator_params_list, $format); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling BarcodeApi->postGenerateMultiple: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **generator_params_list** | [**\Aspose\BarCode\Model\GeneratorParamsList**](../Model/GeneratorParamsList.md)| List of barcodes | - **format** | **string**| Format to return stream in | [optional] [default to png] - -### Return type - -[**\SplFileObject**](../Model/\SplFileObject.md) - -### Authorization - -[JWT](../../README.md#JWT) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: image/png, image/bmp, image/gif, image/jpeg, image/svg+xml, image/tiff - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) - -# **putBarcodeGenerateFile** -> \Aspose\BarCode\Model\ResultImageInfo putBarcodeGenerateFile($name, $type, $text, $two_d_display_text, $text_location, $text_alignment, $text_color, $no_wrap, $resolution, $resolution_x, $resolution_y, $dimension_x, $text_space, $units, $size_mode, $bar_height, $image_height, $image_width, $rotation_angle, $back_color, $bar_color, $border_color, $border_width, $border_dash_style, $border_visible, $enable_checksum, $enable_escape, $filled_bars, $always_show_checksum, $wide_narrow_ratio, $validate_text, $supplement_data, $supplement_space, $bar_width_reduction, $use_anti_alias, $storage, $folder, $format) - -Generate barcode and save on server (from query params or from file with json or xml content) - -### Example -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Aspose\BarCode\Api\BarcodeApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$name = "name_example"; // string | The image file name. -$type = "type_example"; // string | Type of barcode to generate. -$text = "text_example"; // string | Text to encode. -$two_d_display_text = "two_d_display_text_example"; // string | Text that will be displayed instead of codetext in 2D barcodes. Used for: Aztec, Pdf417, DataMatrix, QR, MaxiCode, DotCode -$text_location = "text_location_example"; // string | Specify the displaying Text Location, set to CodeLocation.None to hide CodeText. Default value: CodeLocation.Below. -$text_alignment = "text_alignment_example"; // string | Text alignment. -$text_color = "text_color_example"; // string | Specify the displaying CodeText's Color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF -$no_wrap = true; // bool | Specify word wraps (line breaks) within text. Default value: false. -$resolution = 1.2; // double | Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. -$resolution_x = 1.2; // double | DEPRECATED: Use 'Resolution' instead. -$resolution_y = 1.2; // double | DEPRECATED: Use 'Resolution' instead. -$dimension_x = 1.2; // double | The smallest width of the unit of BarCode bars or spaces. Increase this will increase the whole barcode image width. Ignored if AutoSizeMode property is set to AutoSizeMode.Nearest or AutoSizeMode.Interpolation. -$text_space = 1.2; // double | Space between the CodeText and the BarCode in Unit value. Default value: 2pt. Ignored for EAN8, EAN13, UPCE, UPCA, ISBN, ISMN, ISSN, UpcaGs1DatabarCoupon. -$units = "units_example"; // string | Common Units for all measuring in query. Default units: pixel. -$size_mode = "size_mode_example"; // string | Specifies the different types of automatic sizing modes. Default value: AutoSizeMode.None. -$bar_height = 1.2; // double | Height of the barcode in given units. Default units: pixel. -$image_height = 1.2; // double | Height of the barcode image in given units. Default units: pixel. -$image_width = 1.2; // double | Width of the barcode image in given units. Default units: pixel. -$rotation_angle = 1.2; // double | BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0. -$back_color = "back_color_example"; // string | Background color of the barcode image. Default value: white. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF -$bar_color = "bar_color_example"; // string | Bars color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF -$border_color = "border_color_example"; // string | Border color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF -$border_width = 1.2; // double | Border width. Default value: 0. Ignored if Visible is set to false. -$border_dash_style = "border_dash_style_example"; // string | Border dash style. Default value: BorderDashStyle.Solid. -$border_visible = true; // bool | Border visibility. If false than parameter Width is always ignored (0). Default value: false. -$enable_checksum = "enable_checksum_example"; // string | Enable checksum during generation 1D barcodes. Default is treated as Yes for symbology which must contain checksum, as No where checksum only possible. Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN, Codabar Checksum always used: Rest symbology -$enable_escape = true; // bool | Indicates whether explains the character \"\\\" as an escape character in CodeText property. Used for Pdf417, DataMatrix, Code128 only If the EnableEscape is true, \"\\\" will be explained as a special escape character. Otherwise, \"\\\" acts as normal characters. Aspose.BarCode supports input decimal ascii code and mnemonic for ASCII control-code characters. For example, \\013 and \\\\CR stands for CR. -$filled_bars = true; // bool | Value indicating whether bars are filled. Only for 1D barcodes. Default value: true. -$always_show_checksum = true; // bool | Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes. -$wide_narrow_ratio = 1.2; // double | Wide bars to Narrow bars ratio. Default value: 3, that is, wide bars are 3 times as wide as narrow bars. Used for ITF, PZN, PharmaCode, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, IATA2of5, VIN, DeutschePost, OPC, Code32, DataLogic2of5, PatchCode, Code39Extended, Code39Standard -$validate_text = true; // bool | Only for 1D barcodes. If codetext is incorrect and value set to true - exception will be thrown. Otherwise codetext will be corrected to match barcode's specification. Exception always will be thrown for: Databar symbology if codetext is incorrect. Exception always will not be thrown for: AustraliaPost, SingaporePost, Code39Extended, Code93Extended, Code16K, Code128 symbology if codetext is incorrect. -$supplement_data = "supplement_data_example"; // string | Supplement parameters. Used for Interleaved2of5, Standard2of5, EAN13, EAN8, UPCA, UPCE, ISBN, ISSN, ISMN. -$supplement_space = 1.2; // double | Space between main the BarCode and supplement BarCode. -$bar_width_reduction = 1.2; // double | Bars reduction value that is used to compensate ink spread while printing. -$use_anti_alias = true; // bool | Indicates whether is used anti-aliasing mode to render image. Anti-aliasing mode is applied to barcode and text drawing. -$storage = "storage_example"; // string | Image's storage. -$folder = "folder_example"; // string | Image's folder. -$format = "format_example"; // string | The image format. - -try { - $result = $apiInstance->putBarcodeGenerateFile($name, $type, $text, $two_d_display_text, $text_location, $text_alignment, $text_color, $no_wrap, $resolution, $resolution_x, $resolution_y, $dimension_x, $text_space, $units, $size_mode, $bar_height, $image_height, $image_width, $rotation_angle, $back_color, $bar_color, $border_color, $border_width, $border_dash_style, $border_visible, $enable_checksum, $enable_escape, $filled_bars, $always_show_checksum, $wide_narrow_ratio, $validate_text, $supplement_data, $supplement_space, $bar_width_reduction, $use_anti_alias, $storage, $folder, $format); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling BarcodeApi->putBarcodeGenerateFile: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **string**| The image file name. | - **type** | **string**| Type of barcode to generate. | - **text** | **string**| Text to encode. | - **two_d_display_text** | **string**| Text that will be displayed instead of codetext in 2D barcodes. Used for: Aztec, Pdf417, DataMatrix, QR, MaxiCode, DotCode | [optional] - **text_location** | **string**| Specify the displaying Text Location, set to CodeLocation.None to hide CodeText. Default value: CodeLocation.Below. | [optional] - **text_alignment** | **string**| Text alignment. | [optional] - **text_color** | **string**| Specify the displaying CodeText's Color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF | [optional] - **no_wrap** | **bool**| Specify word wraps (line breaks) within text. Default value: false. | [optional] - **resolution** | **double**| Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. | [optional] - **resolution_x** | **double**| DEPRECATED: Use 'Resolution' instead. | [optional] - **resolution_y** | **double**| DEPRECATED: Use 'Resolution' instead. | [optional] - **dimension_x** | **double**| The smallest width of the unit of BarCode bars or spaces. Increase this will increase the whole barcode image width. Ignored if AutoSizeMode property is set to AutoSizeMode.Nearest or AutoSizeMode.Interpolation. | [optional] - **text_space** | **double**| Space between the CodeText and the BarCode in Unit value. Default value: 2pt. Ignored for EAN8, EAN13, UPCE, UPCA, ISBN, ISMN, ISSN, UpcaGs1DatabarCoupon. | [optional] - **units** | **string**| Common Units for all measuring in query. Default units: pixel. | [optional] - **size_mode** | **string**| Specifies the different types of automatic sizing modes. Default value: AutoSizeMode.None. | [optional] - **bar_height** | **double**| Height of the barcode in given units. Default units: pixel. | [optional] - **image_height** | **double**| Height of the barcode image in given units. Default units: pixel. | [optional] - **image_width** | **double**| Width of the barcode image in given units. Default units: pixel. | [optional] - **rotation_angle** | **double**| BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0. | [optional] - **back_color** | **string**| Background color of the barcode image. Default value: white. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF | [optional] - **bar_color** | **string**| Bars color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF | [optional] - **border_color** | **string**| Border color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF | [optional] - **border_width** | **double**| Border width. Default value: 0. Ignored if Visible is set to false. | [optional] - **border_dash_style** | **string**| Border dash style. Default value: BorderDashStyle.Solid. | [optional] - **border_visible** | **bool**| Border visibility. If false than parameter Width is always ignored (0). Default value: false. | [optional] - **enable_checksum** | **string**| Enable checksum during generation 1D barcodes. Default is treated as Yes for symbology which must contain checksum, as No where checksum only possible. Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN, Codabar Checksum always used: Rest symbology | [optional] - **enable_escape** | **bool**| Indicates whether explains the character \"\\\" as an escape character in CodeText property. Used for Pdf417, DataMatrix, Code128 only If the EnableEscape is true, \"\\\" will be explained as a special escape character. Otherwise, \"\\\" acts as normal characters. Aspose.BarCode supports input decimal ascii code and mnemonic for ASCII control-code characters. For example, \\013 and \\\\CR stands for CR. | [optional] - **filled_bars** | **bool**| Value indicating whether bars are filled. Only for 1D barcodes. Default value: true. | [optional] - **always_show_checksum** | **bool**| Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes. | [optional] - **wide_narrow_ratio** | **double**| Wide bars to Narrow bars ratio. Default value: 3, that is, wide bars are 3 times as wide as narrow bars. Used for ITF, PZN, PharmaCode, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, IATA2of5, VIN, DeutschePost, OPC, Code32, DataLogic2of5, PatchCode, Code39Extended, Code39Standard | [optional] - **validate_text** | **bool**| Only for 1D barcodes. If codetext is incorrect and value set to true - exception will be thrown. Otherwise codetext will be corrected to match barcode's specification. Exception always will be thrown for: Databar symbology if codetext is incorrect. Exception always will not be thrown for: AustraliaPost, SingaporePost, Code39Extended, Code93Extended, Code16K, Code128 symbology if codetext is incorrect. | [optional] - **supplement_data** | **string**| Supplement parameters. Used for Interleaved2of5, Standard2of5, EAN13, EAN8, UPCA, UPCE, ISBN, ISSN, ISMN. | [optional] - **supplement_space** | **double**| Space between main the BarCode and supplement BarCode. | [optional] - **bar_width_reduction** | **double**| Bars reduction value that is used to compensate ink spread while printing. | [optional] - **use_anti_alias** | **bool**| Indicates whether is used anti-aliasing mode to render image. Anti-aliasing mode is applied to barcode and text drawing. | [optional] - **storage** | **string**| Image's storage. | [optional] - **folder** | **string**| Image's folder. | [optional] - **format** | **string**| The image format. | [optional] - -### Return type - -[**\Aspose\BarCode\Model\ResultImageInfo**](../Model/ResultImageInfo.md) - -### Authorization - -[JWT](../../README.md#JWT) - -### HTTP request headers - - - **Content-Type**: multipart/form-data, application/x-www-form-urlencoded, application/json, application/xml - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) - -# **putBarcodeRecognizeFromBody** -> \Aspose\BarCode\Model\BarcodeResponseList putBarcodeRecognizeFromBody($name, $reader_params, $type, $storage, $folder) - -Recognition of a barcode from file on server with parameters in body. - -### Example -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Aspose\BarCode\Api\BarcodeApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$name = "name_example"; // string | The image file name. -$reader_params = new \Aspose\BarCode\Model\ReaderParams(); // \Aspose\BarCode\Model\ReaderParams | BarcodeReader object with parameters. -$type = "type_example"; // string | -$storage = "storage_example"; // string | The storage name -$folder = "folder_example"; // string | The image folder. - -try { - $result = $apiInstance->putBarcodeRecognizeFromBody($name, $reader_params, $type, $storage, $folder); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling BarcodeApi->putBarcodeRecognizeFromBody: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **string**| The image file name. | - **reader_params** | [**\Aspose\BarCode\Model\ReaderParams**](../Model/ReaderParams.md)| BarcodeReader object with parameters. | - **type** | **string**| | [optional] - **storage** | **string**| The storage name | [optional] - **folder** | **string**| The image folder. | [optional] - -### Return type - -[**\Aspose\BarCode\Model\BarcodeResponseList**](../Model/BarcodeResponseList.md) - -### Authorization - -[JWT](../../README.md#JWT) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) - -# **putGenerateMultiple** -> \Aspose\BarCode\Model\ResultImageInfo putGenerateMultiple($name, $generator_params_list, $format, $folder, $storage) - -Generate image with multiple barcodes and put new file on server - -### Example -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Aspose\BarCode\Api\BarcodeApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$name = "name_example"; // string | New filename -$generator_params_list = new \Aspose\BarCode\Model\GeneratorParamsList(); // \Aspose\BarCode\Model\GeneratorParamsList | List of barcodes -$format = "png"; // string | Format of file -$folder = "folder_example"; // string | Folder to place file to -$storage = "storage_example"; // string | The storage name - -try { - $result = $apiInstance->putGenerateMultiple($name, $generator_params_list, $format, $folder, $storage); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling BarcodeApi->putGenerateMultiple: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **string**| New filename | - **generator_params_list** | [**\Aspose\BarCode\Model\GeneratorParamsList**](../Model/GeneratorParamsList.md)| List of barcodes | - **format** | **string**| Format of file | [optional] [default to png] - **folder** | **string**| Folder to place file to | [optional] - **storage** | **string**| The storage name | [optional] - -### Return type - -[**\Aspose\BarCode\Model\ResultImageInfo**](../Model/ResultImageInfo.md) - -### Authorization - -[JWT](../../README.md#JWT) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) - -# **scanBarcode** -> \Aspose\BarCode\Model\BarcodeResponseList scanBarcode($image_file, $decode_types, $timeout, $checksum_validation) - -Quickly scan a barcode from an image. - -### Example -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Aspose\BarCode\Api\BarcodeApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$image_file = "/path/to/file.txt"; // \SplFileObject | Image as file -$decode_types = array(new \Aspose\BarCode\Model\\Aspose\BarCode\Model\DecodeBarcodeType()); // \Aspose\BarCode\Model\DecodeBarcodeType[] | Types of barcode to recognize -$timeout = 56; // int | Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). Maximum value is 30_000 (1/2 minute). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout. -$checksum_validation = "checksum_validation_example"; // string | Checksum validation setting. Default is ON. - -try { - $result = $apiInstance->scanBarcode($image_file, $decode_types, $timeout, $checksum_validation); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling BarcodeApi->scanBarcode: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **image_file** | **\SplFileObject**| Image as file | - **decode_types** | [**\Aspose\BarCode\Model\DecodeBarcodeType[]**](../Model/\Aspose\BarCode\Model\DecodeBarcodeType.md)| Types of barcode to recognize | [optional] - **timeout** | **int**| Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). Maximum value is 30_000 (1/2 minute). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout. | [optional] - **checksum_validation** | **string**| Checksum validation setting. Default is ON. | [optional] - -### Return type - -[**\Aspose\BarCode\Model\BarcodeResponseList**](../Model/BarcodeResponseList.md) - -### Authorization - -[JWT](../../README.md#JWT) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) - diff --git a/docs/Api/FileApi.md b/docs/Api/FileApi.md deleted file mode 100644 index 7f0ecd3..0000000 --- a/docs/Api/FileApi.md +++ /dev/null @@ -1,293 +0,0 @@ -# Aspose\BarCode\FileApi - -All URIs are relative to *https://api.aspose.cloud/v3.0* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**copyFile**](FileApi.md#copyFile) | **PUT** /barcode/storage/file/copy/{srcPath} | Copy file -[**deleteFile**](FileApi.md#deleteFile) | **DELETE** /barcode/storage/file/{path} | Delete file -[**downloadFile**](FileApi.md#downloadFile) | **GET** /barcode/storage/file/{path} | Download file -[**moveFile**](FileApi.md#moveFile) | **PUT** /barcode/storage/file/move/{srcPath} | Move file -[**uploadFile**](FileApi.md#uploadFile) | **PUT** /barcode/storage/file/{path} | Upload file - - -# **copyFile** -> copyFile($src_path, $dest_path, $src_storage_name, $dest_storage_name, $version_id) - -Copy file - -### Example -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Aspose\BarCode\Api\FileApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$src_path = "src_path_example"; // string | Source file path e.g. '/folder/file.ext' -$dest_path = "dest_path_example"; // string | Destination file path -$src_storage_name = "src_storage_name_example"; // string | Source storage name -$dest_storage_name = "dest_storage_name_example"; // string | Destination storage name -$version_id = "version_id_example"; // string | File version ID to copy - -try { - $apiInstance->copyFile($src_path, $dest_path, $src_storage_name, $dest_storage_name, $version_id); -} catch (Exception $e) { - echo 'Exception when calling FileApi->copyFile: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **src_path** | **string**| Source file path e.g. '/folder/file.ext' | - **dest_path** | **string**| Destination file path | - **src_storage_name** | **string**| Source storage name | [optional] - **dest_storage_name** | **string**| Destination storage name | [optional] - **version_id** | **string**| File version ID to copy | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[JWT](../../README.md#JWT) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) - -# **deleteFile** -> deleteFile($path, $storage_name, $version_id) - -Delete file - -### Example -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Aspose\BarCode\Api\FileApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$path = "path_example"; // string | File path e.g. '/folder/file.ext' -$storage_name = "storage_name_example"; // string | Storage name -$version_id = "version_id_example"; // string | File version ID to delete - -try { - $apiInstance->deleteFile($path, $storage_name, $version_id); -} catch (Exception $e) { - echo 'Exception when calling FileApi->deleteFile: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **path** | **string**| File path e.g. '/folder/file.ext' | - **storage_name** | **string**| Storage name | [optional] - **version_id** | **string**| File version ID to delete | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[JWT](../../README.md#JWT) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) - -# **downloadFile** -> \SplFileObject downloadFile($path, $storage_name, $version_id) - -Download file - -### Example -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Aspose\BarCode\Api\FileApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$path = "path_example"; // string | File path e.g. '/folder/file.ext' -$storage_name = "storage_name_example"; // string | Storage name -$version_id = "version_id_example"; // string | File version ID to download - -try { - $result = $apiInstance->downloadFile($path, $storage_name, $version_id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling FileApi->downloadFile: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **path** | **string**| File path e.g. '/folder/file.ext' | - **storage_name** | **string**| Storage name | [optional] - **version_id** | **string**| File version ID to download | [optional] - -### Return type - -[**\SplFileObject**](../Model/\SplFileObject.md) - -### Authorization - -[JWT](../../README.md#JWT) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: multipart/form-data - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) - -# **moveFile** -> moveFile($src_path, $dest_path, $src_storage_name, $dest_storage_name, $version_id) - -Move file - -### Example -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Aspose\BarCode\Api\FileApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$src_path = "src_path_example"; // string | Source file path e.g. '/src.ext' -$dest_path = "dest_path_example"; // string | Destination file path e.g. '/dest.ext' -$src_storage_name = "src_storage_name_example"; // string | Source storage name -$dest_storage_name = "dest_storage_name_example"; // string | Destination storage name -$version_id = "version_id_example"; // string | File version ID to move - -try { - $apiInstance->moveFile($src_path, $dest_path, $src_storage_name, $dest_storage_name, $version_id); -} catch (Exception $e) { - echo 'Exception when calling FileApi->moveFile: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **src_path** | **string**| Source file path e.g. '/src.ext' | - **dest_path** | **string**| Destination file path e.g. '/dest.ext' | - **src_storage_name** | **string**| Source storage name | [optional] - **dest_storage_name** | **string**| Destination storage name | [optional] - **version_id** | **string**| File version ID to move | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[JWT](../../README.md#JWT) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) - -# **uploadFile** -> \Aspose\BarCode\Model\FilesUploadResult uploadFile($path, $file, $storage_name) - -Upload file - -### Example -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Aspose\BarCode\Api\FileApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$path = "path_example"; // string | Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext If the content is multipart and path does not contains the file name it tries to get them from filename parameter from Content-Disposition header. -$file = "/path/to/file.txt"; // \SplFileObject | File to upload -$storage_name = "storage_name_example"; // string | Storage name - -try { - $result = $apiInstance->uploadFile($path, $file, $storage_name); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling FileApi->uploadFile: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **path** | **string**| Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext If the content is multipart and path does not contains the file name it tries to get them from filename parameter from Content-Disposition header. | - **file** | **\SplFileObject**| File to upload | - **storage_name** | **string**| Storage name | [optional] - -### Return type - -[**\Aspose\BarCode\Model\FilesUploadResult**](../Model/FilesUploadResult.md) - -### Authorization - -[JWT](../../README.md#JWT) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) - diff --git a/docs/Api/FolderApi.md b/docs/Api/FolderApi.md deleted file mode 100644 index 506619a..0000000 --- a/docs/Api/FolderApi.md +++ /dev/null @@ -1,284 +0,0 @@ -# Aspose\BarCode\FolderApi - -All URIs are relative to *https://api.aspose.cloud/v3.0* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**copyFolder**](FolderApi.md#copyFolder) | **PUT** /barcode/storage/folder/copy/{srcPath} | Copy folder -[**createFolder**](FolderApi.md#createFolder) | **PUT** /barcode/storage/folder/{path} | Create the folder -[**deleteFolder**](FolderApi.md#deleteFolder) | **DELETE** /barcode/storage/folder/{path} | Delete folder -[**getFilesList**](FolderApi.md#getFilesList) | **GET** /barcode/storage/folder/{path} | Get all files and folders within a folder -[**moveFolder**](FolderApi.md#moveFolder) | **PUT** /barcode/storage/folder/move/{srcPath} | Move folder - - -# **copyFolder** -> copyFolder($src_path, $dest_path, $src_storage_name, $dest_storage_name) - -Copy folder - -### Example -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Aspose\BarCode\Api\FolderApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$src_path = "src_path_example"; // string | Source folder path e.g. '/src' -$dest_path = "dest_path_example"; // string | Destination folder path e.g. '/dst' -$src_storage_name = "src_storage_name_example"; // string | Source storage name -$dest_storage_name = "dest_storage_name_example"; // string | Destination storage name - -try { - $apiInstance->copyFolder($src_path, $dest_path, $src_storage_name, $dest_storage_name); -} catch (Exception $e) { - echo 'Exception when calling FolderApi->copyFolder: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **src_path** | **string**| Source folder path e.g. '/src' | - **dest_path** | **string**| Destination folder path e.g. '/dst' | - **src_storage_name** | **string**| Source storage name | [optional] - **dest_storage_name** | **string**| Destination storage name | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[JWT](../../README.md#JWT) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) - -# **createFolder** -> createFolder($path, $storage_name) - -Create the folder - -### Example -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Aspose\BarCode\Api\FolderApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$path = "path_example"; // string | Folder path to create e.g. 'folder_1/folder_2/' -$storage_name = "storage_name_example"; // string | Storage name - -try { - $apiInstance->createFolder($path, $storage_name); -} catch (Exception $e) { - echo 'Exception when calling FolderApi->createFolder: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **path** | **string**| Folder path to create e.g. 'folder_1/folder_2/' | - **storage_name** | **string**| Storage name | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[JWT](../../README.md#JWT) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) - -# **deleteFolder** -> deleteFolder($path, $storage_name, $recursive) - -Delete folder - -### Example -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Aspose\BarCode\Api\FolderApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$path = "path_example"; // string | Folder path e.g. '/folder' -$storage_name = "storage_name_example"; // string | Storage name -$recursive = false; // bool | Enable to delete folders, subfolders and files - -try { - $apiInstance->deleteFolder($path, $storage_name, $recursive); -} catch (Exception $e) { - echo 'Exception when calling FolderApi->deleteFolder: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **path** | **string**| Folder path e.g. '/folder' | - **storage_name** | **string**| Storage name | [optional] - **recursive** | **bool**| Enable to delete folders, subfolders and files | [optional] [default to false] - -### Return type - -void (empty response body) - -### Authorization - -[JWT](../../README.md#JWT) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) - -# **getFilesList** -> \Aspose\BarCode\Model\FilesList getFilesList($path, $storage_name) - -Get all files and folders within a folder - -### Example -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Aspose\BarCode\Api\FolderApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$path = "path_example"; // string | Folder path e.g. '/folder' -$storage_name = "storage_name_example"; // string | Storage name - -try { - $result = $apiInstance->getFilesList($path, $storage_name); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling FolderApi->getFilesList: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **path** | **string**| Folder path e.g. '/folder' | - **storage_name** | **string**| Storage name | [optional] - -### Return type - -[**\Aspose\BarCode\Model\FilesList**](../Model/FilesList.md) - -### Authorization - -[JWT](../../README.md#JWT) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) - -# **moveFolder** -> moveFolder($src_path, $dest_path, $src_storage_name, $dest_storage_name) - -Move folder - -### Example -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Aspose\BarCode\Api\FolderApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$src_path = "src_path_example"; // string | Folder path to move e.g. '/folder' -$dest_path = "dest_path_example"; // string | Destination folder path to move to e.g '/dst' -$src_storage_name = "src_storage_name_example"; // string | Source storage name -$dest_storage_name = "dest_storage_name_example"; // string | Destination storage name - -try { - $apiInstance->moveFolder($src_path, $dest_path, $src_storage_name, $dest_storage_name); -} catch (Exception $e) { - echo 'Exception when calling FolderApi->moveFolder: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **src_path** | **string**| Folder path to move e.g. '/folder' | - **dest_path** | **string**| Destination folder path to move to e.g '/dst' | - **src_storage_name** | **string**| Source storage name | [optional] - **dest_storage_name** | **string**| Destination storage name | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[JWT](../../README.md#JWT) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) - diff --git a/docs/Api/GenerateApi.md b/docs/Api/GenerateApi.md new file mode 100644 index 0000000..4e9356e --- /dev/null +++ b/docs/Api/GenerateApi.md @@ -0,0 +1,228 @@ +# Aspose\BarCode\GenerateApi + +All URIs are relative to https://api.aspose.cloud/v4.0, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**generate()**](GenerateApi.md#generate) | **GET** /barcode/generate/{barcodeType} | Generate barcode using GET request with parameters in route and query string. | +| [**generateBody()**](GenerateApi.md#generateBody) | **POST** /barcode/generate-body | Generate barcode using POST request with parameters in body in json or xml format. | +| [**generateMultipart()**](GenerateApi.md#generateMultipart) | **POST** /barcode/generate-multipart | Generate barcode using POST request with parameters in multipart form. | + + +## `generate()` + +```php +generate($barcode_type, $data, $data_type, $image_format, $text_location, $foreground_color, $background_color, $units, $resolution, $image_height, $image_width, $rotation_angle): \SplFileObject +``` + +Generate barcode using GET request with parameters in route and query string. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Aspose\BarCode\Api\GenerateApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$barcode_type = new \Aspose\BarCode\Model\EncodeBarcodeType(); // EncodeBarcodeType | Type of barcode to generate. +$data = 'data_example'; // string | String represents data to encode +$data_type = new \Aspose\BarCode\Model\EncodeDataType(); // EncodeDataType | Type of data to encode. Default value: StringData. +$image_format = new \Aspose\BarCode\Model\BarcodeImageFormat(); // BarcodeImageFormat | Barcode output image format. Default value: png +$text_location = new \Aspose\BarCode\Model\CodeLocation(); // CodeLocation | Specify the displaying Text Location, set to CodeLocation.None to hide CodeText. Default value: CodeLocation.Below. +$foreground_color = 'Black'; // string | Specify the displaying bars and content Color. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: Black. +$background_color = 'White'; // string | Background color of the barcode image. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: White. +$units = new \Aspose\BarCode\Model\GraphicsUnit(); // GraphicsUnit | Common Units for all measuring in query. Default units: pixel. +$resolution = 3.4; // float | Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. Decimal separator is dot. +$image_height = 3.4; // float | Height of the barcode image in given units. Default units: pixel. Decimal separator is dot. +$image_width = 3.4; // float | Width of the barcode image in given units. Default units: pixel. Decimal separator is dot. +$rotation_angle = 56; // int | BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0. + +try { + $result = $apiInstance->generate($barcode_type, $data, $data_type, $image_format, $text_location, $foreground_color, $background_color, $units, $resolution, $image_height, $image_width, $rotation_angle); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling GenerateApi->generate: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **barcode_type** | [**EncodeBarcodeType**](../Model/.md)| Type of barcode to generate. | | +| **data** | **string**| String represents data to encode | | +| **data_type** | [**EncodeDataType**](../Model/.md)| Type of data to encode. Default value: StringData. | [optional] | +| **image_format** | [**BarcodeImageFormat**](../Model/.md)| Barcode output image format. Default value: png | [optional] | +| **text_location** | [**CodeLocation**](../Model/.md)| Specify the displaying Text Location, set to CodeLocation.None to hide CodeText. Default value: CodeLocation.Below. | [optional] | +| **foreground_color** | **string**| Specify the displaying bars and content Color. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: Black. | [optional] [default to 'Black'] | +| **background_color** | **string**| Background color of the barcode image. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: White. | [optional] [default to 'White'] | +| **units** | [**GraphicsUnit**](../Model/.md)| Common Units for all measuring in query. Default units: pixel. | [optional] | +| **resolution** | **float**| Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. Decimal separator is dot. | [optional] | +| **image_height** | **float**| Height of the barcode image in given units. Default units: pixel. Decimal separator is dot. | [optional] | +| **image_width** | **float**| Width of the barcode image in given units. Default units: pixel. Decimal separator is dot. | [optional] | +| **rotation_angle** | **int**| BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0. | [optional] | + +### Return type + +**\SplFileObject** + +### Authorization + +[JWT](../../README.md#JWT) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `image/png`, `image/bmp`, `image/gif`, `image/jpeg`, `image/svg+xml`, `image/tiff`, `application/json`, `application/xml` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `generateBody()` + +```php +generateBody($generate_params): \SplFileObject +``` + +Generate barcode using POST request with parameters in body in json or xml format. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Aspose\BarCode\Api\GenerateApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$generate_params = new \Aspose\BarCode\Model\GenerateParams(); // \Aspose\BarCode\Model\GenerateParams | Parameters of generation + +try { + $result = $apiInstance->generateBody($generate_params); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling GenerateApi->generateBody: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **generate_params** | [**\Aspose\BarCode\Model\GenerateParams**](../Model/GenerateParams.md)| Parameters of generation | | + +### Return type + +**\SplFileObject** + +### Authorization + +[JWT](../../README.md#JWT) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: `image/png`, `image/bmp`, `image/gif`, `image/jpeg`, `image/svg+xml`, `image/tiff`, `application/json`, `application/xml` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `generateMultipart()` + +```php +generateMultipart($barcode_type, $data, $data_type, $image_format, $text_location, $foreground_color, $background_color, $units, $resolution, $image_height, $image_width, $rotation_angle): \SplFileObject +``` + +Generate barcode using POST request with parameters in multipart form. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Aspose\BarCode\Api\GenerateApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$barcode_type = new \Aspose\BarCode\Model\EncodeBarcodeType(); // \Aspose\BarCode\Model\EncodeBarcodeType +$data = 'data_example'; // string | String represents data to encode +$data_type = new \Aspose\BarCode\Model\EncodeDataType(); // \Aspose\BarCode\Model\EncodeDataType +$image_format = new \Aspose\BarCode\Model\BarcodeImageFormat(); // \Aspose\BarCode\Model\BarcodeImageFormat +$text_location = new \Aspose\BarCode\Model\CodeLocation(); // \Aspose\BarCode\Model\CodeLocation +$foreground_color = 'Black'; // string | Specify the displaying bars and content Color. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: Black. +$background_color = 'White'; // string | Background color of the barcode image. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: White. +$units = new \Aspose\BarCode\Model\GraphicsUnit(); // \Aspose\BarCode\Model\GraphicsUnit +$resolution = 3.4; // float | Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. Decimal separator is dot. +$image_height = 3.4; // float | Height of the barcode image in given units. Default units: pixel. Decimal separator is dot. +$image_width = 3.4; // float | Width of the barcode image in given units. Default units: pixel. Decimal separator is dot. +$rotation_angle = 56; // int | BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0. + +try { + $result = $apiInstance->generateMultipart($barcode_type, $data, $data_type, $image_format, $text_location, $foreground_color, $background_color, $units, $resolution, $image_height, $image_width, $rotation_angle); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling GenerateApi->generateMultipart: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **barcode_type** | [**\Aspose\BarCode\Model\EncodeBarcodeType**](../Model/EncodeBarcodeType.md)| | | +| **data** | **string**| String represents data to encode | | +| **data_type** | [**\Aspose\BarCode\Model\EncodeDataType**](../Model/EncodeDataType.md)| | [optional] | +| **image_format** | [**\Aspose\BarCode\Model\BarcodeImageFormat**](../Model/BarcodeImageFormat.md)| | [optional] | +| **text_location** | [**\Aspose\BarCode\Model\CodeLocation**](../Model/CodeLocation.md)| | [optional] | +| **foreground_color** | **string**| Specify the displaying bars and content Color. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: Black. | [optional] [default to 'Black'] | +| **background_color** | **string**| Background color of the barcode image. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: White. | [optional] [default to 'White'] | +| **units** | [**\Aspose\BarCode\Model\GraphicsUnit**](../Model/GraphicsUnit.md)| | [optional] | +| **resolution** | **float**| Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. Decimal separator is dot. | [optional] | +| **image_height** | **float**| Height of the barcode image in given units. Default units: pixel. Decimal separator is dot. | [optional] | +| **image_width** | **float**| Width of the barcode image in given units. Default units: pixel. Decimal separator is dot. | [optional] | +| **rotation_angle** | **int**| BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0. | [optional] | + +### Return type + +**\SplFileObject** + +### Authorization + +[JWT](../../README.md#JWT) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `image/png`, `image/bmp`, `image/gif`, `image/jpeg`, `image/svg+xml`, `image/tiff`, `application/json`, `application/xml` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/RecognizeApi.md b/docs/Api/RecognizeApi.md new file mode 100644 index 0000000..501ce1b --- /dev/null +++ b/docs/Api/RecognizeApi.md @@ -0,0 +1,196 @@ +# Aspose\BarCode\RecognizeApi + +All URIs are relative to https://api.aspose.cloud/v4.0, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**recognize()**](RecognizeApi.md#recognize) | **GET** /barcode/recognize | Recognize barcode from file on server using GET requests with parameters in route and query string. | +| [**recognizeBase64()**](RecognizeApi.md#recognizeBase64) | **POST** /barcode/recognize-body | Recognize barcode from file in request body using POST requests with parameters in body in json or xml format. | +| [**recognizeMultipart()**](RecognizeApi.md#recognizeMultipart) | **POST** /barcode/recognize-multipart | Recognize barcode from file in request body using POST requests with parameters in multipart form. | + + +## `recognize()` + +```php +recognize($barcode_type, $file_url, $recognition_mode, $recognition_image_kind): \Aspose\BarCode\Model\BarcodeResponseList +``` + +Recognize barcode from file on server using GET requests with parameters in route and query string. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Aspose\BarCode\Api\RecognizeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$barcode_type = new \Aspose\BarCode\Model\DecodeBarcodeType(); // DecodeBarcodeType | Type of barcode to recognize +$file_url = 'file_url_example'; // string | Url to barcode image +$recognition_mode = new \Aspose\BarCode\Model\RecognitionMode(); // RecognitionMode | Recognition mode +$recognition_image_kind = new \Aspose\BarCode\Model\RecognitionImageKind(); // RecognitionImageKind | Image kind for recognition + +try { + $result = $apiInstance->recognize($barcode_type, $file_url, $recognition_mode, $recognition_image_kind); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RecognizeApi->recognize: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **barcode_type** | [**DecodeBarcodeType**](../Model/.md)| Type of barcode to recognize | | +| **file_url** | **string**| Url to barcode image | | +| **recognition_mode** | [**RecognitionMode**](../Model/.md)| Recognition mode | [optional] | +| **recognition_image_kind** | [**RecognitionImageKind**](../Model/.md)| Image kind for recognition | [optional] | + +### Return type + +[**\Aspose\BarCode\Model\BarcodeResponseList**](../Model/BarcodeResponseList.md) + +### Authorization + +[JWT](../../README.md#JWT) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `application/xml` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `recognizeBase64()` + +```php +recognizeBase64($recognize_base64_request): \Aspose\BarCode\Model\BarcodeResponseList +``` + +Recognize barcode from file in request body using POST requests with parameters in body in json or xml format. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Aspose\BarCode\Api\RecognizeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$recognize_base64_request = new \Aspose\BarCode\Model\RecognizeBase64Request(); // \Aspose\BarCode\Model\RecognizeBase64Request | Barcode recognition request + +try { + $result = $apiInstance->recognizeBase64($recognize_base64_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RecognizeApi->recognizeBase64: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **recognize_base64_request** | [**\Aspose\BarCode\Model\RecognizeBase64Request**](../Model/RecognizeBase64Request.md)| Barcode recognition request | | + +### Return type + +[**\Aspose\BarCode\Model\BarcodeResponseList**](../Model/BarcodeResponseList.md) + +### Authorization + +[JWT](../../README.md#JWT) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: `application/json`, `application/xml` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `recognizeMultipart()` + +```php +recognizeMultipart($barcode_type, $file, $recognition_mode, $recognition_image_kind): \Aspose\BarCode\Model\BarcodeResponseList +``` + +Recognize barcode from file in request body using POST requests with parameters in multipart form. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Aspose\BarCode\Api\RecognizeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$barcode_type = new \Aspose\BarCode\Model\DecodeBarcodeType(); // \Aspose\BarCode\Model\DecodeBarcodeType +$file = "/path/to/file.txt"; // \SplFileObject | Barcode image file +$recognition_mode = new \Aspose\BarCode\Model\RecognitionMode(); // \Aspose\BarCode\Model\RecognitionMode +$recognition_image_kind = new \Aspose\BarCode\Model\RecognitionImageKind(); // \Aspose\BarCode\Model\RecognitionImageKind + +try { + $result = $apiInstance->recognizeMultipart($barcode_type, $file, $recognition_mode, $recognition_image_kind); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RecognizeApi->recognizeMultipart: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **barcode_type** | [**\Aspose\BarCode\Model\DecodeBarcodeType**](../Model/DecodeBarcodeType.md)| | | +| **file** | **\SplFileObject****\SplFileObject**| Barcode image file | | +| **recognition_mode** | [**\Aspose\BarCode\Model\RecognitionMode**](../Model/RecognitionMode.md)| | [optional] | +| **recognition_image_kind** | [**\Aspose\BarCode\Model\RecognitionImageKind**](../Model/RecognitionImageKind.md)| | [optional] | + +### Return type + +[**\Aspose\BarCode\Model\BarcodeResponseList**](../Model/BarcodeResponseList.md) + +### Authorization + +[JWT](../../README.md#JWT) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json`, `application/xml` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/ScanApi.md b/docs/Api/ScanApi.md new file mode 100644 index 0000000..2271e1e --- /dev/null +++ b/docs/Api/ScanApi.md @@ -0,0 +1,184 @@ +# Aspose\BarCode\ScanApi + +All URIs are relative to https://api.aspose.cloud/v4.0, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**scan()**](ScanApi.md#scan) | **GET** /barcode/scan | Scan barcode from file on server using GET requests with parameter in query string. | +| [**scanBase64()**](ScanApi.md#scanBase64) | **POST** /barcode/scan-body | Scan barcode from file in request body using POST requests with parameter in body in json or xml format. | +| [**scanMultipart()**](ScanApi.md#scanMultipart) | **POST** /barcode/scan-multipart | Scan barcode from file in request body using POST requests with parameter in multipart form. | + + +## `scan()` + +```php +scan($file_url): \Aspose\BarCode\Model\BarcodeResponseList +``` + +Scan barcode from file on server using GET requests with parameter in query string. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Aspose\BarCode\Api\ScanApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$file_url = 'file_url_example'; // string | Url to barcode image + +try { + $result = $apiInstance->scan($file_url); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ScanApi->scan: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file_url** | **string**| Url to barcode image | | + +### Return type + +[**\Aspose\BarCode\Model\BarcodeResponseList**](../Model/BarcodeResponseList.md) + +### Authorization + +[JWT](../../README.md#JWT) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `application/xml` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `scanBase64()` + +```php +scanBase64($scan_base64_request): \Aspose\BarCode\Model\BarcodeResponseList +``` + +Scan barcode from file in request body using POST requests with parameter in body in json or xml format. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Aspose\BarCode\Api\ScanApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$scan_base64_request = new \Aspose\BarCode\Model\ScanBase64Request(); // \Aspose\BarCode\Model\ScanBase64Request | Barcode scan request + +try { + $result = $apiInstance->scanBase64($scan_base64_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ScanApi->scanBase64: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **scan_base64_request** | [**\Aspose\BarCode\Model\ScanBase64Request**](../Model/ScanBase64Request.md)| Barcode scan request | | + +### Return type + +[**\Aspose\BarCode\Model\BarcodeResponseList**](../Model/BarcodeResponseList.md) + +### Authorization + +[JWT](../../README.md#JWT) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: `application/json`, `application/xml` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `scanMultipart()` + +```php +scanMultipart($file): \Aspose\BarCode\Model\BarcodeResponseList +``` + +Scan barcode from file in request body using POST requests with parameter in multipart form. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Aspose\BarCode\Api\ScanApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$file = "/path/to/file.txt"; // \SplFileObject | Barcode image file + +try { + $result = $apiInstance->scanMultipart($file); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ScanApi->scanMultipart: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **\SplFileObject****\SplFileObject**| Barcode image file | | + +### Return type + +[**\Aspose\BarCode\Model\BarcodeResponseList**](../Model/BarcodeResponseList.md) + +### Authorization + +[JWT](../../README.md#JWT) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json`, `application/xml` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/StorageApi.md b/docs/Api/StorageApi.md deleted file mode 100644 index 73d1458..0000000 --- a/docs/Api/StorageApi.md +++ /dev/null @@ -1,222 +0,0 @@ -# Aspose\BarCode\StorageApi - -All URIs are relative to *https://api.aspose.cloud/v3.0* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**getDiscUsage**](StorageApi.md#getDiscUsage) | **GET** /barcode/storage/disc | Get disc usage -[**getFileVersions**](StorageApi.md#getFileVersions) | **GET** /barcode/storage/version/{path} | Get file versions -[**objectExists**](StorageApi.md#objectExists) | **GET** /barcode/storage/exist/{path} | Check if file or folder exists -[**storageExists**](StorageApi.md#storageExists) | **GET** /barcode/storage/{storageName}/exist | Check if storage exists - - -# **getDiscUsage** -> \Aspose\BarCode\Model\DiscUsage getDiscUsage($storage_name) - -Get disc usage - -### Example -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Aspose\BarCode\Api\StorageApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$storage_name = "storage_name_example"; // string | Storage name - -try { - $result = $apiInstance->getDiscUsage($storage_name); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling StorageApi->getDiscUsage: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **storage_name** | **string**| Storage name | [optional] - -### Return type - -[**\Aspose\BarCode\Model\DiscUsage**](../Model/DiscUsage.md) - -### Authorization - -[JWT](../../README.md#JWT) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) - -# **getFileVersions** -> \Aspose\BarCode\Model\FileVersions getFileVersions($path, $storage_name) - -Get file versions - -### Example -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Aspose\BarCode\Api\StorageApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$path = "path_example"; // string | File path e.g. '/file.ext' -$storage_name = "storage_name_example"; // string | Storage name - -try { - $result = $apiInstance->getFileVersions($path, $storage_name); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling StorageApi->getFileVersions: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **path** | **string**| File path e.g. '/file.ext' | - **storage_name** | **string**| Storage name | [optional] - -### Return type - -[**\Aspose\BarCode\Model\FileVersions**](../Model/FileVersions.md) - -### Authorization - -[JWT](../../README.md#JWT) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) - -# **objectExists** -> \Aspose\BarCode\Model\ObjectExist objectExists($path, $storage_name, $version_id) - -Check if file or folder exists - -### Example -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Aspose\BarCode\Api\StorageApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$path = "path_example"; // string | File or folder path e.g. '/file.ext' or '/folder' -$storage_name = "storage_name_example"; // string | Storage name -$version_id = "version_id_example"; // string | File version ID - -try { - $result = $apiInstance->objectExists($path, $storage_name, $version_id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling StorageApi->objectExists: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **path** | **string**| File or folder path e.g. '/file.ext' or '/folder' | - **storage_name** | **string**| Storage name | [optional] - **version_id** | **string**| File version ID | [optional] - -### Return type - -[**\Aspose\BarCode\Model\ObjectExist**](../Model/ObjectExist.md) - -### Authorization - -[JWT](../../README.md#JWT) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) - -# **storageExists** -> \Aspose\BarCode\Model\StorageExist storageExists($storage_name) - -Check if storage exists - -### Example -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Aspose\BarCode\Api\StorageApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$storage_name = "storage_name_example"; // string | Storage name - -try { - $result = $apiInstance->storageExists($storage_name); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling StorageApi->storageExists: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **storage_name** | **string**| Storage name | - -### Return type - -[**\Aspose\BarCode\Model\StorageExist**](../Model/StorageExist.md) - -### Authorization - -[JWT](../../README.md#JWT) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) - diff --git a/docs/Model/ApiError.md b/docs/Model/ApiError.md index 8f8d1e5..2086c2d 100644 --- a/docs/Model/ApiError.md +++ b/docs/Model/ApiError.md @@ -1,12 +1,14 @@ # ApiError +Api Error. + ## Properties Name | Type | Description | Notes ---- | ---- | ----------- | ----- -**code** | **string** | | [optional] -**message** | **string** | | [optional] -**description** | **string** | | [optional] -**date_time** | [**\DateTime**](\DateTime.md) | | [optional] +**code** | **string** | Gets or sets api error code. | +**message** | **string** | Gets or sets error message. | +**description** | **string** | Gets or sets error description. | [optional] +**date_time** | **\DateTime** | Gets or sets server datetime. | [optional] **inner_error** | [**\Aspose\BarCode\Model\ApiError**](ApiError.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ApiErrorResponse.md b/docs/Model/ApiErrorResponse.md index 8f72cb8..4b08513 100644 --- a/docs/Model/ApiErrorResponse.md +++ b/docs/Model/ApiErrorResponse.md @@ -1,10 +1,12 @@ # ApiErrorResponse +ApiError Response + ## Properties Name | Type | Description | Notes ---- | ---- | ----------- | ----- -**request_id** | **string** | | [optional] -**error** | [**\Aspose\BarCode\Model\ApiError**](ApiError.md) | | [optional] +**request_id** | **string** | Gets or sets request Id. | +**error** | [**\Aspose\BarCode\Model\ApiError**](ApiError.md) | | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AustralianPostParams.md b/docs/Model/AustralianPostParams.md deleted file mode 100644 index 384d0aa..0000000 --- a/docs/Model/AustralianPostParams.md +++ /dev/null @@ -1,13 +0,0 @@ -# AustralianPostParams - -AustralianPost barcode parameters. - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**encoding_table** | [**\Aspose\BarCode\Model\CustomerInformationInterpretingType**](CustomerInformationInterpretingType.md) | Interpreting type for the Customer Information of AustralianPost, default to CustomerInformationInterpretingType.Other | [optional] -**short_bar_height** | **double** | Short bar's height of AustralianPost barcode. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/AztecParams.md b/docs/Model/AztecParams.md deleted file mode 100644 index b4c76eb..0000000 --- a/docs/Model/AztecParams.md +++ /dev/null @@ -1,19 +0,0 @@ -# AztecParams - -Aztec parameters. - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**aspect_ratio** | **double** | Height/Width ratio of 2D BarCode module. | [optional] -**error_level** | **int** | Level of error correction of Aztec types of barcode. Value should between 10 to 95. | [optional] -**symbol_mode** | [**\Aspose\BarCode\Model\AztecSymbolMode**](AztecSymbolMode.md) | Aztec Symbol mode. Default value: AztecSymbolMode.Auto. | [optional] -**text_encoding** | **string** | DEPRECATED: This property is obsolete and will be removed in future releases. Unicode symbols detection and encoding will be processed in Auto mode with Extended Channel Interpretation charset designator. Using of own encodings requires manual CodeText encoding into byte[] array. Sets the encoding of codetext. | [optional] -**encode_mode** | [**\Aspose\BarCode\Model\AztecEncodeMode**](AztecEncodeMode.md) | Encoding mode for Aztec barcodes. Default value: Auto | [optional] -**eci_encoding** | [**\Aspose\BarCode\Model\ECIEncodings**](ECIEncodings.md) | Identifies ECI encoding. Used when AztecEncodeMode is Auto. Default value: ISO-8859-1. | [optional] -**is_reader_initialization** | **bool** | Used to instruct the reader to interpret the data contained within the symbol as programming for reader initialization. | [optional] -**layers_count** | **int** | Gets or sets layers count of Aztec symbol. Layers count should be in range from 1 to 3 for Compact mode and in range from 1 to 32 for Full Range mode. Default value: 0 (auto). | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/AztecSymbolMode.md b/docs/Model/BarcodeImageFormat.md similarity index 66% rename from docs/Model/AztecSymbolMode.md rename to docs/Model/BarcodeImageFormat.md index 9953c92..08eecb6 100644 --- a/docs/Model/AztecSymbolMode.md +++ b/docs/Model/BarcodeImageFormat.md @@ -1,12 +1,13 @@ -# AztecSymbolMode - +# BarcodeImageFormat +Specifies the file format of the image. ## Allowable values -* **AUTO** -* COMPACT -* FULL_RANGE -* RUNE +* **PNG** +* JPEG +* SVG +* TIFF +* GIF [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BarcodeImageParams.md b/docs/Model/BarcodeImageParams.md new file mode 100644 index 0000000..8cb8518 --- /dev/null +++ b/docs/Model/BarcodeImageParams.md @@ -0,0 +1,20 @@ +# BarcodeImageParams + +Barcode image optional parameters + +## Properties +Name | Type | Description | Notes +---- | ---- | ----------- | ----- +**image_format** | [**\Aspose\BarCode\Model\BarcodeImageFormat**](BarcodeImageFormat.md) | | [optional] +**text_location** | [**\Aspose\BarCode\Model\CodeLocation**](CodeLocation.md) | | [optional] +**foreground_color** | **string** | Specify the displaying bars and content Color. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: Black. | [optional] [default to 'Black'] +**background_color** | **string** | Background color of the barcode image. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: White. | [optional] [default to 'White'] +**units** | [**\Aspose\BarCode\Model\GraphicsUnit**](GraphicsUnit.md) | | [optional] +**resolution** | **float** | Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. Decimal separator is dot. | [optional] +**image_height** | **float** | Height of the barcode image in given units. Default units: pixel. Decimal separator is dot. | [optional] +**image_width** | **float** | Width of the barcode image in given units. Default units: pixel. Decimal separator is dot. | [optional] +**rotation_angle** | **int** | BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/BarcodeResponseList.md b/docs/Model/BarcodeResponseList.md index e97b441..39e3ae9 100644 --- a/docs/Model/BarcodeResponseList.md +++ b/docs/Model/BarcodeResponseList.md @@ -5,7 +5,7 @@ Represents information about barcode list. ## Properties Name | Type | Description | Notes ---- | ---- | ----------- | ----- -**barcodes** | [**\Aspose\BarCode\Model\BarcodeResponse[]**](BarcodeResponse.md) | List of barcodes which are present in image. | [optional] +**barcodes** | [**\Aspose\BarCode\Model\BarcodeResponse[]**](BarcodeResponse.md) | List of barcodes which are present in image. | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BorderDashStyle.md b/docs/Model/BorderDashStyle.md deleted file mode 100644 index eb62873..0000000 --- a/docs/Model/BorderDashStyle.md +++ /dev/null @@ -1,14 +0,0 @@ -# BorderDashStyle - - -## Allowable values - -* **SOLID** -* DASH -* DOT -* DASH_DOT -* DASH_DOT_DOT - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/CaptionParams.md b/docs/Model/CaptionParams.md deleted file mode 100644 index 7567169..0000000 --- a/docs/Model/CaptionParams.md +++ /dev/null @@ -1,18 +0,0 @@ -# CaptionParams - -Caption - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**text** | **string** | Caption text. | [optional] -**alignment** | [**\Aspose\BarCode\Model\TextAlignment**](TextAlignment.md) | Text alignment. | [optional] -**color** | **string** | Text color. Default value: black Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF | [optional] -**visible** | **bool** | Is caption visible. | [optional] -**font** | [**\Aspose\BarCode\Model\FontParams**](FontParams.md) | Font. | [optional] -**padding** | [**\Aspose\BarCode\Model\Padding**](Padding.md) | Padding. | [optional] -**no_wrap** | **bool** | Specify word wraps (line breaks) within text. Default value: false. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/ChecksumValidation.md b/docs/Model/ChecksumValidation.md deleted file mode 100644 index 5793bad..0000000 --- a/docs/Model/ChecksumValidation.md +++ /dev/null @@ -1,12 +0,0 @@ -# ChecksumValidation - - -## Allowable values - -* **_DEFAULT** -* ON -* OFF - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/CodabarChecksumMode.md b/docs/Model/CodabarChecksumMode.md deleted file mode 100644 index 6a78633..0000000 --- a/docs/Model/CodabarChecksumMode.md +++ /dev/null @@ -1,11 +0,0 @@ -# CodabarChecksumMode - - -## Allowable values - -* **MOD10** -* MOD16 - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/CodabarParams.md b/docs/Model/CodabarParams.md deleted file mode 100644 index 8b8f449..0000000 --- a/docs/Model/CodabarParams.md +++ /dev/null @@ -1,14 +0,0 @@ -# CodabarParams - -Codabar parameters. - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**checksum_mode** | [**\Aspose\BarCode\Model\CodabarChecksumMode**](CodabarChecksumMode.md) | Checksum algorithm for Codabar barcodes. Default value: CodabarChecksumMode.Mod16. To enable checksum calculation set value EnableChecksum.Yes to property EnableChecksum. | [optional] -**start_symbol** | [**\Aspose\BarCode\Model\CodabarSymbol**](CodabarSymbol.md) | Start symbol (character) of Codabar symbology. Default value: CodabarSymbol.A | [optional] -**stop_symbol** | [**\Aspose\BarCode\Model\CodabarSymbol**](CodabarSymbol.md) | Stop symbol (character) of Codabar symbology. Default value: CodabarSymbol.A | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/CodabarSymbol.md b/docs/Model/CodabarSymbol.md deleted file mode 100644 index b01d0b2..0000000 --- a/docs/Model/CodabarSymbol.md +++ /dev/null @@ -1,13 +0,0 @@ -# CodabarSymbol - - -## Allowable values - -* **A** -* B -* C -* D - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/CodablockParams.md b/docs/Model/CodablockParams.md deleted file mode 100644 index 618056d..0000000 --- a/docs/Model/CodablockParams.md +++ /dev/null @@ -1,14 +0,0 @@ -# CodablockParams - -Codablock parameters. - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**aspect_ratio** | **double** | Height/Width ratio of 2D BarCode module. | [optional] -**columns** | **int** | Columns count. | [optional] -**rows** | **int** | Rows count. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/Code128Emulation.md b/docs/Model/Code128Emulation.md deleted file mode 100644 index 9d60af1..0000000 --- a/docs/Model/Code128Emulation.md +++ /dev/null @@ -1,13 +0,0 @@ -# Code128Emulation - -DEPRECATED. This enum will be removed in future releases Function codewords for Code 128 emulation. Applied for MicroPDF417 only. Ignored for PDF417 and MacroPDF417 barcodes. -## Allowable values - -* **NONE** -* CODE903 -* CODE904 -* CODE905 - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/Code128EncodeMode.md b/docs/Model/Code128EncodeMode.md deleted file mode 100644 index b1a864f..0000000 --- a/docs/Model/Code128EncodeMode.md +++ /dev/null @@ -1,16 +0,0 @@ -# Code128EncodeMode - - -## Allowable values - -* **AUTO** -* CODE_A -* CODE_B -* CODE_AB -* CODE_C -* CODE_AC -* CODE_BC - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/Code128Params.md b/docs/Model/Code128Params.md deleted file mode 100644 index 090c0e0..0000000 --- a/docs/Model/Code128Params.md +++ /dev/null @@ -1,12 +0,0 @@ -# Code128Params - -Code128 params. - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**encode_mode** | [**\Aspose\BarCode\Model\Code128EncodeMode**](Code128EncodeMode.md) | Encoding mode for Code128 barcodes. Code 128 specification Default value: Code128EncodeMode.Auto. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/Code16KParams.md b/docs/Model/Code16KParams.md deleted file mode 100644 index 3b5545e..0000000 --- a/docs/Model/Code16KParams.md +++ /dev/null @@ -1,14 +0,0 @@ -# Code16KParams - -Code16K parameters. - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**aspect_ratio** | **double** | Height/Width ratio of 2D BarCode module. | [optional] -**quiet_zone_left_coef** | **int** | Size of the left quiet zone in xDimension. Default value: 10, meaning if xDimension = 2px than left quiet zone will be 20px. | [optional] -**quiet_zone_right_coef** | **int** | Size of the right quiet zone in xDimension. Default value: 1, meaning if xDimension = 2px than right quiet zone will be 2px. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/CodeLocation.md b/docs/Model/CodeLocation.md index 51e7ab7..0707384 100644 --- a/docs/Model/CodeLocation.md +++ b/docs/Model/CodeLocation.md @@ -1,6 +1,4 @@ # CodeLocation - - ## Allowable values * **BELOW** diff --git a/docs/Model/CouponParams.md b/docs/Model/CouponParams.md deleted file mode 100644 index b8f4060..0000000 --- a/docs/Model/CouponParams.md +++ /dev/null @@ -1,12 +0,0 @@ -# CouponParams - -Coupon parameters. Used for UpcaGs1DatabarCoupon, UpcaGs1Code128Coupon. - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**supplement_space** | **double** | Space between main the BarCode and supplement BarCode in Unit value. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/CustomerInformationInterpretingType.md b/docs/Model/CustomerInformationInterpretingType.md deleted file mode 100644 index 80cda05..0000000 --- a/docs/Model/CustomerInformationInterpretingType.md +++ /dev/null @@ -1,12 +0,0 @@ -# CustomerInformationInterpretingType - - -## Allowable values - -* **C_TABLE** -* N_TABLE -* OTHER - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/DataBarParams.md b/docs/Model/DataBarParams.md deleted file mode 100644 index 8f2e1ea..0000000 --- a/docs/Model/DataBarParams.md +++ /dev/null @@ -1,16 +0,0 @@ -# DataBarParams - -Databar parameters. - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**aspect_ratio** | **double** | Height/Width ratio of 2D BarCode module. Used for DataBar stacked. | [optional] -**columns** | **int** | Columns count. | [optional] -**rows** | **int** | Rows count. | [optional] -**is2_d_composite_component** | **bool** | Enables flag of 2D composite component with DataBar barcode | [optional] -**is_allow_only_gs1_encoding** | **bool** | If this flag is set, it allows only GS1 encoding standard for Databar barcode types | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/DataMatrixEccType.md b/docs/Model/DataMatrixEccType.md deleted file mode 100644 index 1f095a1..0000000 --- a/docs/Model/DataMatrixEccType.md +++ /dev/null @@ -1,16 +0,0 @@ -# DataMatrixEccType - - -## Allowable values - -* **ECC_AUTO** -* ECC000 -* ECC050 -* ECC080 -* ECC100 -* ECC140 -* ECC200 - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/DataMatrixEncodeMode.md b/docs/Model/DataMatrixEncodeMode.md deleted file mode 100644 index c1109c5..0000000 --- a/docs/Model/DataMatrixEncodeMode.md +++ /dev/null @@ -1,18 +0,0 @@ -# DataMatrixEncodeMode - -DataMatrix encoder's encoding mode, default to Auto -## Allowable values - -* **AUTO** -* ASCII -* FULL -* CUSTOM -* C40 -* TEXT -* EDIFACT -* ANSIX12 -* EXTENDED_CODETEXT - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/DataMatrixParams.md b/docs/Model/DataMatrixParams.md deleted file mode 100644 index 3d9c49e..0000000 --- a/docs/Model/DataMatrixParams.md +++ /dev/null @@ -1,19 +0,0 @@ -# DataMatrixParams - -DataMatrix parameters. - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**aspect_ratio** | **double** | Height/Width ratio of 2D BarCode module | [optional] -**text_encoding** | **string** | DEPRECATED: This property is obsolete and will be removed in future releases. Unicode symbols detection and encoding will be processed in Auto mode with Extended Channel Interpretation charset designator. Using of own encodings requires manual CodeText encoding into byte[] array. Sets the encoding of codetext. | [optional] -**columns** | **int** | DEPRECATED: Will be replaced with 'DataMatrix.Version' in the next release Columns count. | [optional] -**data_matrix_ecc** | [**\Aspose\BarCode\Model\DataMatrixEccType**](DataMatrixEccType.md) | Datamatrix ECC type. Default value: DataMatrixEccType.Ecc200. | [optional] -**data_matrix_encode_mode** | [**\Aspose\BarCode\Model\DataMatrixEncodeMode**](DataMatrixEncodeMode.md) | Encode mode of Datamatrix barcode. Default value: DataMatrixEncodeMode.Auto. | [optional] -**rows** | **int** | DEPRECATED: Will be replaced with 'DataMatrix.Version' in the next release Rows count. | [optional] -**macro_characters** | [**\Aspose\BarCode\Model\MacroCharacter**](MacroCharacter.md) | Macro Characters 05 and 06 values are used to obtain more compact encoding in special modes. Can be used only with DataMatrixEccType.Ecc200 or DataMatrixEccType.EccAuto. Cannot be used with EncodeTypes.GS1DataMatrix Default value: MacroCharacters.None. | [optional] -**version** | [**\Aspose\BarCode\Model\DataMatrixVersion**](DataMatrixVersion.md) | Sets a Datamatrix symbol size. Default value: DataMatrixVersion.Auto. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/DataMatrixVersion.md b/docs/Model/DataMatrixVersion.md deleted file mode 100644 index 26b3719..0000000 --- a/docs/Model/DataMatrixVersion.md +++ /dev/null @@ -1,80 +0,0 @@ -# DataMatrixVersion - - -## Allowable values - -* **AUTO** -* ROWS_COLUMNS -* ECC000_9X9 -* ECC000_050_11X11 -* ECC000_100_13X13 -* ECC000_100_15X15 -* ECC000_140_17X17 -* ECC000_140_19X19 -* ECC000_140_21X21 -* ECC000_140_23X23 -* ECC000_140_25X25 -* ECC000_140_27X27 -* ECC000_140_29X29 -* ECC000_140_31X31 -* ECC000_140_33X33 -* ECC000_140_35X35 -* ECC000_140_37X37 -* ECC000_140_39X39 -* ECC000_140_41X41 -* ECC000_140_43X43 -* ECC000_140_45X45 -* ECC000_140_47X47 -* ECC000_140_49X49 -* ECC200_10X10 -* ECC200_12X12 -* ECC200_14X14 -* ECC200_16X16 -* ECC200_18X18 -* ECC200_20X20 -* ECC200_22X22 -* ECC200_24X24 -* ECC200_26X26 -* ECC200_32X32 -* ECC200_36X36 -* ECC200_40X40 -* ECC200_44X44 -* ECC200_48X48 -* ECC200_52X52 -* ECC200_64X64 -* ECC200_72X72 -* ECC200_80X80 -* ECC200_88X88 -* ECC200_96X96 -* ECC200_104X104 -* ECC200_120X120 -* ECC200_132X132 -* ECC200_144X144 -* ECC200_8X18 -* ECC200_8X32 -* ECC200_12X26 -* ECC200_12X36 -* ECC200_16X36 -* ECC200_16X48 -* DMRE_8X48 -* DMRE_8X64 -* DMRE_8X80 -* DMRE_8X96 -* DMRE_8X120 -* DMRE_8X144 -* DMRE_12X64 -* DMRE_12X88 -* DMRE_16X64 -* DMRE_20X36 -* DMRE_20X44 -* DMRE_20X64 -* DMRE_22X48 -* DMRE_24X48 -* DMRE_24X64 -* DMRE_26X40 -* DMRE_26X48 -* DMRE_26X64 - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/DecodeBarcodeType.md b/docs/Model/DecodeBarcodeType.md index d8baf07..117aeb5 100644 --- a/docs/Model/DecodeBarcodeType.md +++ b/docs/Model/DecodeBarcodeType.md @@ -1,93 +1,92 @@ # DecodeBarcodeType -See DecodeType +See Aspose.BarCode.Aspose.BarCode.BarCodeRecognition.DecodeType ## Allowable values -* **ALL** +* **MOST_COMMONLY_USED** +* QR * AUSTRALIA_POST +* AUSTRALIAN_POSTE_PARCEL * AZTEC -* ISBN * CODABAR +* CODABLOCK_F * CODE11 * CODE128 -* GS1_CODE128 -* CODE39_EXTENDED -* CODE39_STANDARD -* CODE93_EXTENDED -* CODE93_STANDARD +* CODE16_K +* CODE32 +* CODE39 +* CODE39_FULL_ASCII +* CODE93 +* COMPACT_PDF417 +* DATA_LOGIC2OF5 * DATA_MATRIX +* DATABAR_EXPANDED +* DATABAR_EXPANDED_STACKED +* DATABAR_LIMITED +* DATABAR_OMNI_DIRECTIONAL +* DATABAR_STACKED +* DATABAR_STACKED_OMNI_DIRECTIONAL +* DATABAR_TRUNCATED * DEUTSCHE_POST_IDENTCODE * DEUTSCHE_POST_LEITCODE +* DOT_CODE +* DUTCH_KIX * EAN13 * EAN14 * EAN8 +* GS1_AZTEC +* GS1_CODE128 +* GS1_COMPOSITE_BAR +* GS1_DATA_MATRIX +* GS1_DOT_CODE +* GS1_HAN_XIN +* GS1_MICRO_PDF417 +* GS1_QR +* HAN_XIN +* HIBC_AZTEC_LIC +* HIBC_AZTEC_PAS +* HIBC_CODE128_LIC +* HIBC_CODE128_PAS +* HIBC_CODE39_LIC +* HIBC_CODE39_PAS +* HIBC_DATA_MATRIX_LIC +* HIBC_DATA_MATRIX_PAS +* HIBCQRLIC +* HIBCQRPAS * IATA2OF5 -* INTERLEAVED2OF5 -* ISSN +* ISBN * ISMN -* ITALIAN_POST25 +* ISSN * ITF14 * ITF6 +* INTERLEAVED2OF5 +* ITALIAN_POST25 * MACRO_PDF417 +* MAILMARK * MATRIX2OF5 +* MAXI_CODE +* MICR_E13_B +* MICRO_PDF417 +* MICRO_QR * MSI * ONE_CODE * OPC * PATCH_CODE * PDF417 -* MICRO_PDF417 +* PHARMACODE * PLANET * POSTNET * PZN -* QR -* MICRO_QR +* RECT_MICRO_QR * RM4_SCC * SCC14 * SSCC18 * STANDARD2OF5 * SUPPLEMENT +* SWISS_POST_PARCEL * UPCA * UPCE * VIN -* PHARMACODE -* GS1_DATA_MATRIX -* DATABAR_OMNI_DIRECTIONAL -* DATABAR_TRUNCATED -* DATABAR_LIMITED -* DATABAR_EXPANDED -* SWISS_POST_PARCEL -* AUSTRALIAN_POSTE_PARCEL -* CODE16_K -* DATABAR_STACKED_OMNI_DIRECTIONAL -* DATABAR_STACKED -* DATABAR_EXPANDED_STACKED -* COMPACT_PDF417 -* GS1_QR -* MAXI_CODE -* MICR_E13_B -* CODE32 -* DATA_LOGIC2OF5 -* DOT_CODE -* DUTCH_KIX -* CODABLOCK_F -* MAILMARK -* GS1_DOT_CODE -* HIBC_CODE39_LIC -* HIBC_CODE128_LIC -* HIBC_AZTEC_LIC -* HIBC_DATA_MATRIX_LIC -* HIBCQRLIC -* HIBC_CODE39_PAS -* HIBC_CODE128_PAS -* HIBC_AZTEC_PAS -* HIBC_DATA_MATRIX_PAS -* HIBCQRPAS -* HAN_XIN -* GS1_HAN_XIN -* GS1_AZTEC -* GS1_COMPOSITE_BAR -* GS1_MICRO_PDF417 -* MOST_COMMONLY_USED [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DiscUsage.md b/docs/Model/DiscUsage.md deleted file mode 100644 index 353d6ef..0000000 --- a/docs/Model/DiscUsage.md +++ /dev/null @@ -1,13 +0,0 @@ -# DiscUsage - -Class for disc space information. - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**used_size** | **int** | Application used disc space. | -**total_size** | **int** | Total disc space. | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/DotCodeEncodeMode.md b/docs/Model/DotCodeEncodeMode.md deleted file mode 100644 index 404bc6f..0000000 --- a/docs/Model/DotCodeEncodeMode.md +++ /dev/null @@ -1,12 +0,0 @@ -# DotCodeEncodeMode - - -## Allowable values - -* **AUTO** -* BYTES -* EXTENDED_CODETEXT - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/DotCodeParams.md b/docs/Model/DotCodeParams.md deleted file mode 100644 index 9594864..0000000 --- a/docs/Model/DotCodeParams.md +++ /dev/null @@ -1,17 +0,0 @@ -# DotCodeParams - -DotCode parameters. - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**aspect_ratio** | **double** | Height/Width ratio of 2D BarCode module. | [optional] -**columns** | **int** | Identifies columns count. Sum of the number of rows plus the number of columns of a DotCode symbol must be odd. Number of columns must be at least 5. | [optional] -**encode_mode** | [**\Aspose\BarCode\Model\DotCodeEncodeMode**](DotCodeEncodeMode.md) | Identifies DotCode encode mode. Default value: Auto. | [optional] -**eci_encoding** | [**\Aspose\BarCode\Model\ECIEncodings**](ECIEncodings.md) | Identifies ECI encoding. Used when DotCodeEncodeMode is Auto. Default value: ISO-8859-1. | [optional] -**is_reader_initialization** | **bool** | Indicates whether code is used for instruct reader to interpret the following data as instructions for initialization or reprogramming of the bar code reader. Default value is false. | [optional] -**rows** | **int** | Identifies rows count. Sum of the number of rows plus the number of columns of a DotCode symbol must be odd. Number of rows must be at least 5. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/ECIEncodings.md b/docs/Model/ECIEncodings.md deleted file mode 100644 index 9dcf30a..0000000 --- a/docs/Model/ECIEncodings.md +++ /dev/null @@ -1,36 +0,0 @@ -# ECIEncodings - - -## Allowable values - -* **NONE** -* ISO_8859_1 -* ISO_8859_2 -* ISO_8859_3 -* ISO_8859_4 -* ISO_8859_5 -* ISO_8859_6 -* ISO_8859_7 -* ISO_8859_8 -* ISO_8859_9 -* ISO_8859_10 -* ISO_8859_11 -* ISO_8859_13 -* ISO_8859_14 -* ISO_8859_15 -* ISO_8859_16 -* SHIFT_JIS -* WIN1250 -* WIN1251 -* WIN1252 -* WIN1256 -* UTF16_BE -* UTF8 -* US_ASCII -* BIG5 -* GB18030 -* EUC_KR - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/EnableChecksum.md b/docs/Model/EnableChecksum.md deleted file mode 100644 index 9c34908..0000000 --- a/docs/Model/EnableChecksum.md +++ /dev/null @@ -1,12 +0,0 @@ -# EnableChecksum - - -## Allowable values - -* **_DEFAULT** -* YES -* NO - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/EncodeBarcodeType.md b/docs/Model/EncodeBarcodeType.md index 8c6bcda..99bd0c2 100644 --- a/docs/Model/EncodeBarcodeType.md +++ b/docs/Model/EncodeBarcodeType.md @@ -1,80 +1,81 @@ # EncodeBarcodeType -See EncodeTypes +See Aspose.BarCode.Generation.EncodeTypes ## Allowable values -* **CODABAR** +* **QR** +* AUSTRALIA_POST +* AUSTRALIAN_POSTE_PARCEL +* AZTEC +* CODABAR +* CODABLOCK_F * CODE11 -* CODE39_STANDARD -* CODE39_EXTENDED -* CODE93_STANDARD -* CODE93_EXTENDED * CODE128 -* GS1_CODE128 -* EAN8 +* CODE16_K +* CODE32 +* CODE39 +* CODE39_FULL_ASCII +* CODE93 +* DATA_LOGIC2OF5 +* DATA_MATRIX +* DATABAR_EXPANDED +* DATABAR_EXPANDED_STACKED +* DATABAR_LIMITED +* DATABAR_OMNI_DIRECTIONAL +* DATABAR_STACKED +* DATABAR_STACKED_OMNI_DIRECTIONAL +* DATABAR_TRUNCATED +* DEUTSCHE_POST_IDENTCODE +* DEUTSCHE_POST_LEITCODE +* DOT_CODE +* DUTCH_KIX * EAN13 * EAN14 -* SCC14 -* SSCC18 -* UPCA -* UPCE +* EAN8 +* GS1_AZTEC +* GS1_CODABLOCK_F +* GS1_CODE128 +* GS1_DATA_MATRIX +* GS1_DOT_CODE +* GS1_HAN_XIN +* GS1_MICRO_PDF417 +* GS1_QR +* HAN_XIN +* IATA2OF5 * ISBN -* ISSN * ISMN -* STANDARD2OF5 -* INTERLEAVED2OF5 -* MATRIX2OF5 -* ITALIAN_POST25 -* IATA2OF5 +* ISSN * ITF14 * ITF6 +* INTERLEAVED2OF5 +* ITALIAN_POST25 * MSI -* VIN -* DEUTSCHE_POST_IDENTCODE -* DEUTSCHE_POST_LEITCODE +* MACRO_PDF417 +* MAILMARK +* MATRIX2OF5 +* MAXI_CODE +* MICRO_PDF417 +* MICRO_QR * OPC +* ONE_CODE * PZN -* CODE16_K -* PHARMACODE -* DATA_MATRIX -* QR -* AZTEC +* PATCH_CODE * PDF417 -* MACRO_PDF417 -* AUSTRALIA_POST -* POSTNET +* PHARMACODE * PLANET -* ONE_CODE +* POSTNET * RM4_SCC -* DATABAR_OMNI_DIRECTIONAL -* DATABAR_TRUNCATED -* DATABAR_LIMITED -* DATABAR_EXPANDED +* RECT_MICRO_QR +* SCC14 +* SSCC18 * SINGAPORE_POST -* GS1_DATA_MATRIX -* AUSTRALIAN_POSTE_PARCEL +* STANDARD2OF5 * SWISS_POST_PARCEL -* PATCH_CODE -* DATABAR_EXPANDED_STACKED -* DATABAR_STACKED -* DATABAR_STACKED_OMNI_DIRECTIONAL -* MICRO_PDF417 -* GS1_QR -* MAXI_CODE -* CODE32 -* DATA_LOGIC2OF5 -* DOT_CODE -* DUTCH_KIX +* UPCA +* UPCE * UPCA_GS1_CODE128_COUPON * UPCA_GS1_DATABAR_COUPON -* CODABLOCK_F -* GS1_CODABLOCK_F -* MAILMARK -* GS1_DOT_CODE -* HAN_XIN -* GS1_HAN_XIN -* GS1_AZTEC -* GS1_MICRO_PDF417 +* VIN [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FileVersions.md b/docs/Model/EncodeData.md similarity index 57% rename from docs/Model/FileVersions.md rename to docs/Model/EncodeData.md index e274f0d..2375040 100644 --- a/docs/Model/FileVersions.md +++ b/docs/Model/EncodeData.md @@ -1,11 +1,12 @@ -# FileVersions +# EncodeData -File versions FileVersion. +Data to encode in barcode ## Properties Name | Type | Description | Notes ---- | ---- | ----------- | ----- -**value** | [**\Aspose\BarCode\Model\FileVersion[]**](FileVersion.md) | File versions FileVersion. | [optional] +**data_type** | [**\Aspose\BarCode\Model\EncodeDataType**](EncodeDataType.md) | | [optional] +**data** | **string** | String represents data to encode | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EncodeDataType.md b/docs/Model/EncodeDataType.md new file mode 100644 index 0000000..e59b0b9 --- /dev/null +++ b/docs/Model/EncodeDataType.md @@ -0,0 +1,12 @@ +# EncodeDataType + +Types of data can be encoded to barcode +## Allowable values + +* **STRING_DATA** +* BASE64_BYTES +* HEX_BYTES + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/Error.md b/docs/Model/Error.md deleted file mode 100644 index 54a4de6..0000000 --- a/docs/Model/Error.md +++ /dev/null @@ -1,15 +0,0 @@ -# Error - -Error - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**code** | **string** | Code | [optional] -**message** | **string** | Message | [optional] -**description** | **string** | Description | [optional] -**inner_error** | [**\Aspose\BarCode\Model\ErrorDetails**](ErrorDetails.md) | Inner Error | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/ErrorDetails.md b/docs/Model/ErrorDetails.md deleted file mode 100644 index 91b03a6..0000000 --- a/docs/Model/ErrorDetails.md +++ /dev/null @@ -1,13 +0,0 @@ -# ErrorDetails - -The error details - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**request_id** | **string** | The request id | [optional] -**date** | [**\DateTime**](\DateTime.md) | Date | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/FileVersion.md b/docs/Model/FileVersion.md deleted file mode 100644 index 60aa767..0000000 --- a/docs/Model/FileVersion.md +++ /dev/null @@ -1,16 +0,0 @@ -# FileVersion - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**name** | **string** | File or folder name. | [optional] -**is_folder** | **bool** | True if it is a folder. | -**modified_date** | [**\DateTime**](\DateTime.md) | File or folder last modified DateTime. | [optional] -**size** | **int** | File or folder size. | -**path** | **string** | File or folder path. | [optional] -**version_id** | **string** | File Version ID. | [optional] -**is_latest** | **bool** | Specifies whether the file is (true) or is not (false) the latest version of an file. | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/FilesList.md b/docs/Model/FilesList.md deleted file mode 100644 index 1f0a013..0000000 --- a/docs/Model/FilesList.md +++ /dev/null @@ -1,12 +0,0 @@ -# FilesList - -Files list - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**value** | [**\Aspose\BarCode\Model\StorageFile[]**](StorageFile.md) | Files and folders contained by folder StorageFile. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/FilesUploadResult.md b/docs/Model/FilesUploadResult.md deleted file mode 100644 index 9d0fd4b..0000000 --- a/docs/Model/FilesUploadResult.md +++ /dev/null @@ -1,13 +0,0 @@ -# FilesUploadResult - -File upload result - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**uploaded** | **string[]** | List of uploaded file names | [optional] -**errors** | [**\Aspose\BarCode\Model\Error[]**](Error.md) | List of errors. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/FontMode.md b/docs/Model/FontMode.md deleted file mode 100644 index ad1713c..0000000 --- a/docs/Model/FontMode.md +++ /dev/null @@ -1,11 +0,0 @@ -# FontMode - - -## Allowable values - -* **AUTO** -* MANUAL - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/FontParams.md b/docs/Model/FontParams.md deleted file mode 100644 index 94a9276..0000000 --- a/docs/Model/FontParams.md +++ /dev/null @@ -1,14 +0,0 @@ -# FontParams - -Font. - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**family** | **string** | Font family. | [optional] -**size** | **double** | Font size in units. | [optional] -**style** | [**\Aspose\BarCode\Model\FontStyle**](FontStyle.md) | Font style. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/FontStyle.md b/docs/Model/FontStyle.md deleted file mode 100644 index 6b8dd5f..0000000 --- a/docs/Model/FontStyle.md +++ /dev/null @@ -1,14 +0,0 @@ -# FontStyle - - -## Allowable values - -* **REGULAR** -* BOLD -* ITALIC -* UNDERLINE -* STRIKEOUT - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/GenerateParams.md b/docs/Model/GenerateParams.md new file mode 100644 index 0000000..522e2b4 --- /dev/null +++ b/docs/Model/GenerateParams.md @@ -0,0 +1,14 @@ +# GenerateParams + +Barcode generation parameters + +## Properties +Name | Type | Description | Notes +---- | ---- | ----------- | ----- +**barcode_type** | [**\Aspose\BarCode\Model\EncodeBarcodeType**](EncodeBarcodeType.md) | | +**encode_data** | [**\Aspose\BarCode\Model\EncodeData**](EncodeData.md) | | +**barcode_image_params** | [**\Aspose\BarCode\Model\BarcodeImageParams**](BarcodeImageParams.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/GeneratorParams.md b/docs/Model/GeneratorParams.md deleted file mode 100644 index 2674f3b..0000000 --- a/docs/Model/GeneratorParams.md +++ /dev/null @@ -1,67 +0,0 @@ -# GeneratorParams - -Represents extended BarcodeGenerator params. - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**type_of_barcode** | [**\Aspose\BarCode\Model\EncodeBarcodeType**](EncodeBarcodeType.md) | Type of barcode to generate. | -**text** | **string** | Text to encode. | -**two_d_display_text** | **string** | Text that will be displayed instead of codetext in 2D barcodes. Used for: Aztec, Pdf417, DataMatrix, QR, MaxiCode, DotCode | [optional] -**text_location** | [**\Aspose\BarCode\Model\CodeLocation**](CodeLocation.md) | Specify the displaying Text Location, set to CodeLocation.None to hide CodeText. Default value: CodeLocation.Below. | [optional] -**text_alignment** | [**\Aspose\BarCode\Model\TextAlignment**](TextAlignment.md) | Text alignment. | [optional] -**text_color** | **string** | Specify the displaying CodeText's Color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF | [optional] -**font** | [**\Aspose\BarCode\Model\FontParams**](FontParams.md) | Specify the displaying Text's font. Default value: Arial 5pt regular. Ignored if FontSizeMode is set to FontSizeMode.Auto. | [optional] -**font_size_mode** | [**\Aspose\BarCode\Model\FontMode**](FontMode.md) | Specify FontSizeMode. If FontSizeMode is set to Auto, font size will be calculated automatically based on xDimension value. It is recommended to use FontSizeMode.Auto especially in AutoSizeMode.Nearest or AutoSizeMode.Interpolation. Default value: FontSizeMode.Auto. | [optional] -**no_wrap** | **bool** | Specify word wraps (line breaks) within text. Default value: false. | [optional] -**resolution** | **double** | Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. | [optional] -**resolution_x** | **double** | DEPRECATED: Use 'Resolution' instead. | [optional] -**resolution_y** | **double** | DEPRECATED: Use 'Resolution' instead. | [optional] -**dimension_x** | **double** | The smallest width of the unit of BarCode bars or spaces. Increase this will increase the whole barcode image width. Ignored if AutoSizeMode property is set to AutoSizeMode.Nearest or AutoSizeMode.Interpolation. | [optional] -**text_space** | **double** | Space between the CodeText and the BarCode in Unit value. Default value: 2pt. Ignored for EAN8, EAN13, UPCE, UPCA, ISBN, ISMN, ISSN, UpcaGs1DatabarCoupon. | [optional] -**units** | [**\Aspose\BarCode\Model\AvailableGraphicsUnit**](AvailableGraphicsUnit.md) | Common Units for all measuring in query. Default units: pixel. | [optional] -**size_mode** | [**\Aspose\BarCode\Model\AutoSizeMode**](AutoSizeMode.md) | Specifies the different types of automatic sizing modes. Default value: AutoSizeMode.None. | [optional] -**bar_height** | **double** | Height of the barcode in given units. Default units: pixel. | [optional] -**image_height** | **double** | Height of the barcode image in given units. Default units: pixel. | [optional] -**image_width** | **double** | Width of the barcode image in given units. Default units: pixel. | [optional] -**rotation_angle** | **double** | BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0. | [optional] -**padding** | [**\Aspose\BarCode\Model\Padding**](Padding.md) | Barcode paddings. Default value: 5pt 5pt 5pt 5pt. | [optional] -**caption_above** | [**\Aspose\BarCode\Model\CaptionParams**](CaptionParams.md) | Additional caption above barcode. | [optional] -**caption_below** | [**\Aspose\BarCode\Model\CaptionParams**](CaptionParams.md) | Additional caption below barcode. | [optional] -**back_color** | **string** | Background color of the barcode image. Default value: white. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF | [optional] -**bar_color** | **string** | Bars color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF | [optional] -**border_color** | **string** | Border color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF | [optional] -**border_width** | **double** | Border width. Default value: 0. Ignored if Visible is set to false. | [optional] -**border_dash_style** | [**\Aspose\BarCode\Model\BorderDashStyle**](BorderDashStyle.md) | Border dash style. Default value: BorderDashStyle.Solid. | [optional] -**border_visible** | **bool** | Border visibility. If false than parameter Width is always ignored (0). Default value: false. | [optional] -**enable_checksum** | [**\Aspose\BarCode\Model\EnableChecksum**](EnableChecksum.md) | Enable checksum during generation 1D barcodes. Default is treated as Yes for symbology which must contain checksum, as No where checksum only possible. Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN, Codabar Checksum always used: Rest symbology | [optional] -**enable_escape** | **bool** | Indicates whether explains the character \"\\\" as an escape character in CodeText property. Used for Pdf417, DataMatrix, Code128 only If the EnableEscape is true, \"\\\" will be explained as a special escape character. Otherwise, \"\\\" acts as normal characters. Aspose.BarCode supports input decimal ascii code and mnemonic for ASCII control-code characters. For example, \\013 and \\\\CR stands for CR. | [optional] -**filled_bars** | **bool** | Value indicating whether bars are filled. Only for 1D barcodes. Default value: true. | [optional] -**always_show_checksum** | **bool** | Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes. | [optional] -**wide_narrow_ratio** | **double** | Wide bars to Narrow bars ratio. Default value: 3, that is, wide bars are 3 times as wide as narrow bars. Used for ITF, PZN, PharmaCode, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, IATA2of5, VIN, DeutschePost, OPC, Code32, DataLogic2of5, PatchCode, Code39Extended, Code39Standard | [optional] -**validate_text** | **bool** | Only for 1D barcodes. If codetext is incorrect and value set to true - exception will be thrown. Otherwise codetext will be corrected to match barcode's specification. Exception always will be thrown for: Databar symbology if codetext is incorrect. Exception always will not be thrown for: AustraliaPost, SingaporePost, Code39Extended, Code93Extended, Code16K, Code128 symbology if codetext is incorrect. | [optional] -**supplement_data** | **string** | Supplement parameters. Used for Interleaved2of5, Standard2of5, EAN13, EAN8, UPCA, UPCE, ISBN, ISSN, ISMN. | [optional] -**supplement_space** | **double** | Space between main the BarCode and supplement BarCode. | [optional] -**bar_width_reduction** | **double** | Bars reduction value that is used to compensate ink spread while printing. | [optional] -**use_anti_alias** | **bool** | Indicates whether is used anti-aliasing mode to render image. Anti-aliasing mode is applied to barcode and text drawing. | [optional] -**australian_post** | [**\Aspose\BarCode\Model\AustralianPostParams**](AustralianPostParams.md) | AustralianPost params. | [optional] -**aztec** | [**\Aspose\BarCode\Model\AztecParams**](AztecParams.md) | Aztec params. | [optional] -**codabar** | [**\Aspose\BarCode\Model\CodabarParams**](CodabarParams.md) | Codabar params. | [optional] -**codablock** | [**\Aspose\BarCode\Model\CodablockParams**](CodablockParams.md) | Codablock params. | [optional] -**code16_k** | [**\Aspose\BarCode\Model\Code16KParams**](Code16KParams.md) | Code16K params. | [optional] -**coupon** | [**\Aspose\BarCode\Model\CouponParams**](CouponParams.md) | Coupon params. | [optional] -**data_bar** | [**\Aspose\BarCode\Model\DataBarParams**](DataBarParams.md) | DataBar params. | [optional] -**data_matrix** | [**\Aspose\BarCode\Model\DataMatrixParams**](DataMatrixParams.md) | DataMatrix params. | [optional] -**dot_code** | [**\Aspose\BarCode\Model\DotCodeParams**](DotCodeParams.md) | DotCode params. | [optional] -**itf** | [**\Aspose\BarCode\Model\ITFParams**](ITFParams.md) | ITF params. | [optional] -**maxi_code** | [**\Aspose\BarCode\Model\MaxiCodeParams**](MaxiCodeParams.md) | MaxiCode params. | [optional] -**pdf417** | [**\Aspose\BarCode\Model\Pdf417Params**](Pdf417Params.md) | Pdf417 params. | [optional] -**postal** | [**\Aspose\BarCode\Model\PostalParams**](PostalParams.md) | Postal params. | [optional] -**qr** | [**\Aspose\BarCode\Model\QrParams**](QrParams.md) | QR params. | [optional] -**patch_code** | [**\Aspose\BarCode\Model\PatchCodeParams**](PatchCodeParams.md) | PatchCode params. | [optional] -**code128** | [**\Aspose\BarCode\Model\Code128Params**](Code128Params.md) | Code128 parameters | [optional] -**han_xin** | [**\Aspose\BarCode\Model\HanXinParams**](HanXinParams.md) | HanXin params. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/GeneratorParamsList.md b/docs/Model/GeneratorParamsList.md deleted file mode 100644 index 30623df..0000000 --- a/docs/Model/GeneratorParamsList.md +++ /dev/null @@ -1,14 +0,0 @@ -# GeneratorParamsList - -Represents list of barcode generators - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**barcode_builders** | [**\Aspose\BarCode\Model\GeneratorParams[]**](GeneratorParams.md) | List of barcode generators | [optional] -**x_step** | **int** | Shift step according to X axis | -**y_step** | **int** | Shift step according to Y axis | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/AvailableGraphicsUnit.md b/docs/Model/GraphicsUnit.md similarity index 81% rename from docs/Model/AvailableGraphicsUnit.md rename to docs/Model/GraphicsUnit.md index b500a3f..2d4f530 100644 --- a/docs/Model/AvailableGraphicsUnit.md +++ b/docs/Model/GraphicsUnit.md @@ -1,6 +1,6 @@ -# AvailableGraphicsUnit +# GraphicsUnit -Subset of GraphicsUnit. +Subset of Aspose.Drawing.GraphicsUnit. ## Allowable values * **PIXEL** diff --git a/docs/Model/HanXinEncodeMode.md b/docs/Model/HanXinEncodeMode.md deleted file mode 100644 index b075574..0000000 --- a/docs/Model/HanXinEncodeMode.md +++ /dev/null @@ -1,15 +0,0 @@ -# HanXinEncodeMode - - -## Allowable values - -* **AUTO** -* BINARY -* ECI -* UNICODE -* URI -* EXTENDED - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/HanXinErrorLevel.md b/docs/Model/HanXinErrorLevel.md deleted file mode 100644 index 247e49c..0000000 --- a/docs/Model/HanXinErrorLevel.md +++ /dev/null @@ -1,13 +0,0 @@ -# HanXinErrorLevel - - -## Allowable values - -* **L1** -* L2 -* L3 -* L4 - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/HanXinParams.md b/docs/Model/HanXinParams.md deleted file mode 100644 index 6cb7e76..0000000 --- a/docs/Model/HanXinParams.md +++ /dev/null @@ -1,15 +0,0 @@ -# HanXinParams - -HanXin params. - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**encode_mode** | [**\Aspose\BarCode\Model\HanXinEncodeMode**](HanXinEncodeMode.md) | Encoding mode for XanXin barcodes. Default value: HanXinEncodeMode.Auto. | [optional] -**error_level** | [**\Aspose\BarCode\Model\HanXinErrorLevel**](HanXinErrorLevel.md) | Allowed Han Xin error correction levels from L1 to L4. Default value: HanXinErrorLevel.L1. | [optional] -**version** | [**\Aspose\BarCode\Model\HanXinVersion**](HanXinVersion.md) | Allowed Han Xin versions, Auto and Version01 - Version84. Default value: HanXinVersion.Auto. | [optional] -**eci_encoding** | [**\Aspose\BarCode\Model\ECIEncodings**](ECIEncodings.md) | Extended Channel Interpretation Identifiers. It is used to tell the barcode reader details about the used references for encoding the data in the symbol. Current implementation consists all well known charset encodings. Default value: ECIEncodings.ISO_8859_1 | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/HanXinVersion.md b/docs/Model/HanXinVersion.md deleted file mode 100644 index bd627da..0000000 --- a/docs/Model/HanXinVersion.md +++ /dev/null @@ -1,94 +0,0 @@ -# HanXinVersion - - -## Allowable values - -* **AUTO** -* VERSION01 -* VERSION02 -* VERSION03 -* VERSION04 -* VERSION05 -* VERSION06 -* VERSION07 -* VERSION08 -* VERSION09 -* VERSION10 -* VERSION11 -* VERSION12 -* VERSION13 -* VERSION14 -* VERSION15 -* VERSION16 -* VERSION17 -* VERSION18 -* VERSION19 -* VERSION20 -* VERSION21 -* VERSION22 -* VERSION23 -* VERSION24 -* VERSION25 -* VERSION26 -* VERSION27 -* VERSION28 -* VERSION29 -* VERSION30 -* VERSION31 -* VERSION32 -* VERSION33 -* VERSION34 -* VERSION35 -* VERSION36 -* VERSION37 -* VERSION38 -* VERSION39 -* VERSION40 -* VERSION41 -* VERSION42 -* VERSION43 -* VERSION44 -* VERSION45 -* VERSION46 -* VERSION47 -* VERSION48 -* VERSION49 -* VERSION50 -* VERSION51 -* VERSION52 -* VERSION53 -* VERSION54 -* VERSION55 -* VERSION56 -* VERSION57 -* VERSION58 -* VERSION59 -* VERSION60 -* VERSION61 -* VERSION62 -* VERSION63 -* VERSION64 -* VERSION65 -* VERSION66 -* VERSION67 -* VERSION68 -* VERSION69 -* VERSION70 -* VERSION71 -* VERSION72 -* VERSION73 -* VERSION74 -* VERSION75 -* VERSION76 -* VERSION77 -* VERSION78 -* VERSION79 -* VERSION80 -* VERSION81 -* VERSION82 -* VERSION83 -* VERSION84 - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/ITF14BorderType.md b/docs/Model/ITF14BorderType.md deleted file mode 100644 index 6bd3476..0000000 --- a/docs/Model/ITF14BorderType.md +++ /dev/null @@ -1,14 +0,0 @@ -# ITF14BorderType - - -## Allowable values - -* **NONE** -* FRAME -* BAR -* FRAME_OUT -* BAR_OUT - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/ITFParams.md b/docs/Model/ITFParams.md deleted file mode 100644 index d1ea806..0000000 --- a/docs/Model/ITFParams.md +++ /dev/null @@ -1,14 +0,0 @@ -# ITFParams - -ITF parameters. - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**border_thickness** | **double** | ITF border (bearer bar) thickness in Unit value. Default value: 12pt. | [optional] -**border_type** | [**\Aspose\BarCode\Model\ITF14BorderType**](ITF14BorderType.md) | Border type of ITF barcode. Default value: ITF14BorderType.Bar. | [optional] -**quiet_zone_coef** | **int** | Size of the quiet zones in xDimension. Default value: 10, meaning if xDimension = 2px than quiet zones will be 20px. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/MacroCharacter.md b/docs/Model/MacroCharacter.md deleted file mode 100644 index 9924552..0000000 --- a/docs/Model/MacroCharacter.md +++ /dev/null @@ -1,12 +0,0 @@ -# MacroCharacter - - -## Allowable values - -* **NONE** -* MACRO05 -* MACRO06 - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/MaxiCodeEncodeMode.md b/docs/Model/MaxiCodeEncodeMode.md deleted file mode 100644 index b81b974..0000000 --- a/docs/Model/MaxiCodeEncodeMode.md +++ /dev/null @@ -1,12 +0,0 @@ -# MaxiCodeEncodeMode - - -## Allowable values - -* **AUTO** -* BYTES -* EXTENDED_CODETEXT - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/MaxiCodeMode.md b/docs/Model/MaxiCodeMode.md deleted file mode 100644 index 6cf2f2a..0000000 --- a/docs/Model/MaxiCodeMode.md +++ /dev/null @@ -1,14 +0,0 @@ -# MaxiCodeMode - - -## Allowable values - -* **MODE2** -* MODE3 -* MODE4 -* MODE5 -* MODE6 - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/MaxiCodeParams.md b/docs/Model/MaxiCodeParams.md deleted file mode 100644 index 0ea0e02..0000000 --- a/docs/Model/MaxiCodeParams.md +++ /dev/null @@ -1,14 +0,0 @@ -# MaxiCodeParams - -MaxiCode parameters. - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**aspect_ratio** | **double** | Height/Width ratio of 2D BarCode module. | [optional] -**mode** | [**\Aspose\BarCode\Model\MaxiCodeMode**](MaxiCodeMode.md) | Mode for MaxiCode barcodes. | [optional] -**encode_mode** | [**\Aspose\BarCode\Model\MaxiCodeEncodeMode**](MaxiCodeEncodeMode.md) | Encoding mode for MaxiCode barcodes. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/ObjectExist.md b/docs/Model/ObjectExist.md deleted file mode 100644 index f589dee..0000000 --- a/docs/Model/ObjectExist.md +++ /dev/null @@ -1,13 +0,0 @@ -# ObjectExist - -Object exists - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**exists** | **bool** | Indicates that the file or folder exists. | -**is_folder** | **bool** | True if it is a folder, false if it is a file. | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/Padding.md b/docs/Model/Padding.md deleted file mode 100644 index e68cb61..0000000 --- a/docs/Model/Padding.md +++ /dev/null @@ -1,15 +0,0 @@ -# Padding - -Padding around barcode. - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**left** | **double** | Left padding. | [optional] -**right** | **double** | Right padding. | [optional] -**top** | **double** | Top padding. | [optional] -**bottom** | **double** | Bottom padding. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/PatchCodeParams.md b/docs/Model/PatchCodeParams.md deleted file mode 100644 index 2af1894..0000000 --- a/docs/Model/PatchCodeParams.md +++ /dev/null @@ -1,13 +0,0 @@ -# PatchCodeParams - -PatchCode parameters. - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**extra_barcode_text** | **string** | Specifies codetext for an extra QR barcode, when PatchCode is generated in page mode. | [optional] -**patch_format** | [**\Aspose\BarCode\Model\PatchFormat**](PatchFormat.md) | PatchCode format. Choose PatchOnly to generate single PatchCode. Use page format to generate Patch page with PatchCodes as borders. Default value: PatchFormat.PatchOnly | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/PatchFormat.md b/docs/Model/PatchFormat.md deleted file mode 100644 index a5d74ad..0000000 --- a/docs/Model/PatchFormat.md +++ /dev/null @@ -1,14 +0,0 @@ -# PatchFormat - - -## Allowable values - -* **PATCH_ONLY** -* A4 -* A4_LANDSCAPE -* US_LETTER -* US_LETTER_LANDSCAPE - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/Pdf417CompactionMode.md b/docs/Model/Pdf417CompactionMode.md deleted file mode 100644 index a69a5ed..0000000 --- a/docs/Model/Pdf417CompactionMode.md +++ /dev/null @@ -1,13 +0,0 @@ -# Pdf417CompactionMode - - -## Allowable values - -* **AUTO** -* TEXT -* NUMERIC -* BINARY - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/Pdf417ErrorLevel.md b/docs/Model/Pdf417ErrorLevel.md deleted file mode 100644 index d890424..0000000 --- a/docs/Model/Pdf417ErrorLevel.md +++ /dev/null @@ -1,18 +0,0 @@ -# Pdf417ErrorLevel - - -## Allowable values - -* **LEVEL0** -* LEVEL1 -* LEVEL2 -* LEVEL3 -* LEVEL4 -* LEVEL5 -* LEVEL6 -* LEVEL7 -* LEVEL8 - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/Pdf417MacroTerminator.md b/docs/Model/Pdf417MacroTerminator.md deleted file mode 100644 index 7d83371..0000000 --- a/docs/Model/Pdf417MacroTerminator.md +++ /dev/null @@ -1,12 +0,0 @@ -# Pdf417MacroTerminator - - -## Allowable values - -* **AUTO** -* NONE -* SET - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/Pdf417Params.md b/docs/Model/Pdf417Params.md deleted file mode 100644 index eb465bb..0000000 --- a/docs/Model/Pdf417Params.md +++ /dev/null @@ -1,35 +0,0 @@ -# Pdf417Params - -PDF417 parameters. - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**aspect_ratio** | **double** | Height/Width ratio of 2D BarCode module. | [optional] -**text_encoding** | **string** | DEPRECATED: This property is obsolete and will be removed in future releases. Unicode symbols detection and encoding will be processed in Auto mode with Extended Channel Interpretation charset designator. Using of own encodings requires manual CodeText encoding into byte[] array. Sets the encoding of codetext. | [optional] -**columns** | **int** | Columns count. | [optional] -**compaction_mode** | [**\Aspose\BarCode\Model\Pdf417CompactionMode**](Pdf417CompactionMode.md) | Pdf417 symbology type of BarCode's compaction mode. Default value: Pdf417CompactionMode.Auto. | [optional] -**error_level** | [**\Aspose\BarCode\Model\Pdf417ErrorLevel**](Pdf417ErrorLevel.md) | Pdf417 symbology type of BarCode's error correction level ranging from level0 to level8, level0 means no error correction info, level8 means best error correction which means a larger picture. | [optional] -**macro_file_id** | **int** | Macro Pdf417 barcode's file ID. Used for MacroPdf417. | [optional] -**macro_segment_id** | **int** | Macro Pdf417 barcode's segment ID, which starts from 0, to MacroSegmentsCount - 1. | [optional] -**macro_segments_count** | **int** | Macro Pdf417 barcode segments count. | [optional] -**rows** | **int** | Rows count. | [optional] -**truncate** | **bool** | Whether Pdf417 symbology type of BarCode is truncated (to reduce space). | [optional] -**pdf417_eci_encoding** | [**\Aspose\BarCode\Model\ECIEncodings**](ECIEncodings.md) | Extended Channel Interpretation Identifiers. It is used to tell the barcode reader details about the used references for encoding the data in the symbol. Current implementation consists all well known charset encodings. | [optional] -**is_reader_initialization** | **bool** | Used to instruct the reader to interpret the data contained within the symbol as programming for reader initialization | [optional] -**macro_time_stamp** | [**\DateTime**](\DateTime.md) | Macro Pdf417 barcode time stamp | [optional] -**macro_sender** | **string** | Macro Pdf417 barcode sender name | [optional] -**macro_file_size** | **int** | Macro Pdf417 file size. The file size field contains the size in bytes of the entire source file | [optional] -**macro_checksum** | **int** | Macro Pdf417 barcode checksum. The checksum field contains the value of the 16-bit (2 bytes) CRC checksum using the CCITT-16 polynomial | [optional] -**macro_file_name** | **string** | Macro Pdf417 barcode file name | [optional] -**macro_addressee** | **string** | Macro Pdf417 barcode addressee name | [optional] -**macro_eci_encoding** | [**\Aspose\BarCode\Model\ECIEncodings**](ECIEncodings.md) | Extended Channel Interpretation Identifiers. Applies for Macro PDF417 text fields. | [optional] -**code128_emulation** | [**\Aspose\BarCode\Model\Code128Emulation**](Code128Emulation.md) | DEPRECATED: This property is obsolete and will be removed in future releases. See samples of using new parameters on https://releases.aspose.com/barcode/net/release-notes/2023/aspose-barcode-for-net-23-10-release-notes/ Function codeword for Code 128 emulation. Applied for MicroPDF417 only. Ignored for PDF417 and MacroPDF417 barcodes. | [optional] -**is_code128_emulation** | **bool** | Can be used only with MicroPdf417 and encodes Code 128 emulation modes. Can encode FNC1 in second position modes 908 and 909, also can encode 910 and 911 which just indicate that recognized MicroPdf417 can be interpret as Code 128. | [optional] -**pdf417_macro_terminator** | [**\Aspose\BarCode\Model\Pdf417MacroTerminator**](Pdf417MacroTerminator.md) | Used to tell the encoder whether to add Macro PDF417 Terminator (codeword 922) to the segment. Applied only for Macro PDF417. | [optional] -**is_linked** | **bool** | Defines linked modes with GS1MicroPdf417, MicroPdf417 and Pdf417 barcodes. With GS1MicroPdf417 symbology encodes 906, 907, 912, 913, 914, 915 “Linked” UCC/EAN-128 modes. With MicroPdf417 and Pdf417 symbologies encodes 918 linkage flag to associated linear component other than an EAN.UCC. | [optional] -**macro_characters** | [**\Aspose\BarCode\Model\MacroCharacter**](MacroCharacter.md) | Macro Characters 05 and 06 values are used to obtain more compact encoding in special modes. Can be used only with MicroPdf417 and encodes 916 and 917 MicroPdf417 modes. Default value: MacroCharacters.None. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/PostalParams.md b/docs/Model/PostalParams.md deleted file mode 100644 index a65c487..0000000 --- a/docs/Model/PostalParams.md +++ /dev/null @@ -1,12 +0,0 @@ -# PostalParams - -Postal parameters. Used for Postnet, Planet. - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**short_bar_height** | **double** | Short bar's height of Postal barcodes. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/PresetType.md b/docs/Model/PresetType.md deleted file mode 100644 index b33b2ce..0000000 --- a/docs/Model/PresetType.md +++ /dev/null @@ -1,15 +0,0 @@ -# PresetType - -See QualitySettings allows to configure recognition quality and speed manually. -## Allowable values - -* **HIGH_PERFORMANCE** -* NORMAL_QUALITY -* HIGH_QUALITY_DETECTION -* MAX_QUALITY_DETECTION -* HIGH_QUALITY -* MAX_BAR_CODES - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/QREncodeMode.md b/docs/Model/QREncodeMode.md deleted file mode 100644 index 2c992fd..0000000 --- a/docs/Model/QREncodeMode.md +++ /dev/null @@ -1,15 +0,0 @@ -# QREncodeMode - - -## Allowable values - -* **AUTO** -* BYTES -* UTF8_BOM -* UTF16_BEBOM -* ECI_ENCODING -* EXTENDED_CODETEXT - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/QREncodeType.md b/docs/Model/QREncodeType.md deleted file mode 100644 index 9a90a1e..0000000 --- a/docs/Model/QREncodeType.md +++ /dev/null @@ -1,12 +0,0 @@ -# QREncodeType - - -## Allowable values - -* **AUTO** -* FORCE_QR -* FORCE_MICRO_QR - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/QRErrorLevel.md b/docs/Model/QRErrorLevel.md deleted file mode 100644 index f61c506..0000000 --- a/docs/Model/QRErrorLevel.md +++ /dev/null @@ -1,13 +0,0 @@ -# QRErrorLevel - - -## Allowable values - -* **LEVEL_L** -* LEVEL_M -* LEVEL_Q -* LEVEL_H - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/QRVersion.md b/docs/Model/QRVersion.md deleted file mode 100644 index 6669452..0000000 --- a/docs/Model/QRVersion.md +++ /dev/null @@ -1,54 +0,0 @@ -# QRVersion - - -## Allowable values - -* **AUTO** -* VERSION01 -* VERSION02 -* VERSION03 -* VERSION04 -* VERSION05 -* VERSION06 -* VERSION07 -* VERSION08 -* VERSION09 -* VERSION10 -* VERSION11 -* VERSION12 -* VERSION13 -* VERSION14 -* VERSION15 -* VERSION16 -* VERSION17 -* VERSION18 -* VERSION19 -* VERSION20 -* VERSION21 -* VERSION22 -* VERSION23 -* VERSION24 -* VERSION25 -* VERSION26 -* VERSION27 -* VERSION28 -* VERSION29 -* VERSION30 -* VERSION31 -* VERSION32 -* VERSION33 -* VERSION34 -* VERSION35 -* VERSION36 -* VERSION37 -* VERSION38 -* VERSION39 -* VERSION40 -* VERSION_M1 -* VERSION_M2 -* VERSION_M3 -* VERSION_M4 - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/QrParams.md b/docs/Model/QrParams.md deleted file mode 100644 index 4c9a69f..0000000 --- a/docs/Model/QrParams.md +++ /dev/null @@ -1,19 +0,0 @@ -# QrParams - -QR parameters. - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**aspect_ratio** | **double** | Height/Width ratio of 2D BarCode module. | [optional] -**text_encoding** | **string** | DEPRECATED: This property is obsolete and will be removed in future releases. Unicode symbols detection and encoding will be processed in Auto mode with Extended Channel Interpretation charset designator. Using of own encodings requires manual CodeText encoding into byte[] array. Sets the encoding of codetext. | [optional] -**encode_type** | [**\Aspose\BarCode\Model\QREncodeType**](QREncodeType.md) | QR / MicroQR selector mode. Select ForceQR for standard QR symbols, Auto for MicroQR. | [optional] -**eci_encoding** | [**\Aspose\BarCode\Model\ECIEncodings**](ECIEncodings.md) | Extended Channel Interpretation Identifiers. It is used to tell the barcode reader details about the used references for encoding the data in the symbol. Current implementation consists all well known charset encodings. | [optional] -**encode_mode** | [**\Aspose\BarCode\Model\QREncodeMode**](QREncodeMode.md) | QR symbology type of BarCode's encoding mode. Default value: QREncodeMode.Auto. | [optional] -**error_level** | [**\Aspose\BarCode\Model\QRErrorLevel**](QRErrorLevel.md) | Level of Reed-Solomon error correction for QR barcode. From low to high: LevelL, LevelM, LevelQ, LevelH. see QRErrorLevel. | [optional] -**version** | [**\Aspose\BarCode\Model\QRVersion**](QRVersion.md) | Version of QR Code. From Version1 to Version40 for QR code and from M1 to M4 for MicroQr. Default value is QRVersion.Auto. | [optional] -**structured_append** | [**\Aspose\BarCode\Model\StructuredAppend**](StructuredAppend.md) | QR structured append parameters. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/ReaderParams.md b/docs/Model/ReaderParams.md deleted file mode 100644 index e1de99f..0000000 --- a/docs/Model/ReaderParams.md +++ /dev/null @@ -1,47 +0,0 @@ -# ReaderParams - -Represents BarcodeReader object. - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**type** | [**\Aspose\BarCode\Model\DecodeBarcodeType**](DecodeBarcodeType.md) | The type of barcode to read. | [optional] -**types** | [**\Aspose\BarCode\Model\DecodeBarcodeType[]**](DecodeBarcodeType.md) | Multiple barcode types to read. | [optional] -**checksum_validation** | [**\Aspose\BarCode\Model\ChecksumValidation**](ChecksumValidation.md) | Enable checksum validation during recognition for 1D barcodes. Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible. Checksum never used: Codabar Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN Checksum always used: Rest symbologies | [optional] -**detect_encoding** | **bool** | A flag which force engine to detect codetext encoding for Unicode. | [optional] -**preset** | [**\Aspose\BarCode\Model\PresetType**](PresetType.md) | Preset allows to configure recognition quality and speed manually. You can quickly set up Preset by embedded presets: HighPerformance, NormalQuality, HighQuality, MaxBarCodes or you can manually configure separate options. Default value of Preset is NormalQuality. | [optional] -**rect_x** | **int** | Set X of top left corner of area for recognition. | [optional] -**rect_y** | **int** | Set Y of top left corner of area for recognition. | [optional] -**rect_width** | **int** | Set Width of area for recognition. | [optional] -**rect_height** | **int** | Set Height of area for recognition. | [optional] -**strip_fnc** | **bool** | Value indicating whether FNC symbol strip must be done. | [optional] -**timeout** | **int** | Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). Maximum value is 30_000 (1/2 minute). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout. | [optional] -**median_smoothing_window_size** | **int** | Window size for median smoothing. Typical values are 3 or 4. Default value is 3. AllowMedianSmoothing must be set. | [optional] -**allow_median_smoothing** | **bool** | Allows engine to enable median smoothing as additional scan. Mode helps to recognize noised barcodes. | [optional] -**allow_complex_background** | **bool** | Allows engine to recognize color barcodes on color background as additional scan. Extremely slow mode. | [optional] -**allow_datamatrix_industrial_barcodes** | **bool** | Allows engine for Datamatrix to recognize dashed industrial Datamatrix barcodes. Slow mode which helps only for dashed barcodes which consist from spots. | [optional] -**allow_decreased_image** | **bool** | Allows engine to recognize decreased image as additional scan. Size for decreasing is selected by internal engine algorithms. Mode helps to recognize barcodes which are noised and blurred but captured with high resolution. | [optional] -**allow_detect_scan_gap** | **bool** | Allows engine to use gap between scans to increase recognition speed. Mode can make recognition problems with low height barcodes. | [optional] -**allow_incorrect_barcodes** | **bool** | Allows engine to recognize barcodes which has incorrect checksum or incorrect values. Mode can be used to recognize damaged barcodes with incorrect text. | [optional] -**allow_invert_image** | **bool** | Allows engine to recognize inverse color image as additional scan. Mode can be used when barcode is white on black background. | [optional] -**allow_micro_white_spots_removing** | **bool** | Allows engine for Postal barcodes to recognize slightly noised images. Mode helps to recognize slightly damaged Postal barcodes. | [optional] -**allow_one_d_fast_barcodes_detector** | **bool** | Allows engine for 1D barcodes to quickly recognize high quality barcodes which fill almost whole image. Mode helps to quickly recognize generated barcodes from Internet. | [optional] -**allow_one_d_wiped_bars_restoration** | **bool** | Allows engine for 1D barcodes to recognize barcodes with single wiped/glued bars in pattern. | [optional] -**allow_qr_micro_qr_restoration** | **bool** | Allows engine for QR/MicroQR to recognize damaged MicroQR barcodes. | [optional] -**allow_regular_image** | **bool** | Allows engine to recognize regular image without any restorations as main scan. Mode to recognize image as is. | [optional] -**allow_salt_and_pepper_filtering** | **bool** | Allows engine to recognize barcodes with salt and pepper noise type. Mode can remove small noise with white and black dots. | [optional] -**allow_white_spots_removing** | **bool** | Allows engine to recognize image without small white spots as additional scan. Mode helps to recognize noised image as well as median smoothing filtering. | [optional] -**check_more1_d_variants** | **bool** | Allows engine to recognize 1D barcodes with checksum by checking more recognition variants. Default value: False. | [optional] -**fast_scan_only** | **bool** | Allows engine for 1D barcodes to quickly recognize middle slice of an image and return result without using any time-consuming algorithms. Default value: False. | [optional] -**allow_additional_restorations** | **bool** | Allows engine using additional image restorations to recognize corrupted barcodes. At this time, it is used only in MicroPdf417 barcode type. Default value: False. | [optional] -**region_likelihood_threshold_percent** | **double** | Sets threshold for detected regions that may contain barcodes. Value 0.7 means that bottom 70% of possible regions are filtered out and not processed further. Region likelihood threshold must be between [0.05, 0.9] Use high values for clear images with few barcodes. Use low values for images with many barcodes or for noisy images. Low value may lead to a bigger recognition time. | [optional] -**scan_window_sizes** | **int[]** | Scan window sizes in pixels. Allowed sizes are 10, 15, 20, 25, 30. Scanning with small window size takes more time and provides more accuracy but may fail in detecting very big barcodes. Combining of several window sizes can improve detection quality. | [optional] -**similarity** | **double** | Similarity coefficient depends on how homogeneous barcodes are. Use high value for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] | [optional] -**skip_diagonal_search** | **bool** | Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time. | [optional] -**read_tiny_barcodes** | **bool** | Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False. | [optional] -**australian_post_encoding_table** | [**\Aspose\BarCode\Model\CustomerInformationInterpretingType**](CustomerInformationInterpretingType.md) | Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. | [optional] -**ignore_ending_filling_patterns_for_c_table** | **bool** | The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequence \"333\" of filling patterns is decoded as letter \"z\". | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/AztecEncodeMode.md b/docs/Model/RecognitionImageKind.md similarity index 67% rename from docs/Model/AztecEncodeMode.md rename to docs/Model/RecognitionImageKind.md index 4dcadb9..a740ff5 100644 --- a/docs/Model/AztecEncodeMode.md +++ b/docs/Model/RecognitionImageKind.md @@ -1,11 +1,11 @@ -# AztecEncodeMode - +# RecognitionImageKind +Kind of image to recognize ## Allowable values -* **AUTO** -* BYTES -* EXTENDED_CODETEXT +* **PHOTO** +* SCANNED_DOCUMENT +* CLEAR_IMAGE [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AutoSizeMode.md b/docs/Model/RecognitionMode.md similarity index 74% rename from docs/Model/AutoSizeMode.md rename to docs/Model/RecognitionMode.md index 3ee9ec5..57cd499 100644 --- a/docs/Model/AutoSizeMode.md +++ b/docs/Model/RecognitionMode.md @@ -1,11 +1,11 @@ -# AutoSizeMode - +# RecognitionMode +Recognition mode. ## Allowable values -* **NONE** -* NEAREST -* INTERPOLATION +* **FAST** +* NORMAL +* EXCELLENT [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RecognizeBase64Request.md b/docs/Model/RecognizeBase64Request.md new file mode 100644 index 0000000..08b4784 --- /dev/null +++ b/docs/Model/RecognizeBase64Request.md @@ -0,0 +1,15 @@ +# RecognizeBase64Request + +Barcode recognize request + +## Properties +Name | Type | Description | Notes +---- | ---- | ----------- | ----- +**barcode_types** | [**\Aspose\BarCode\Model\DecodeBarcodeType[]**](DecodeBarcodeType.md) | Array of decode types to find on barcode | +**file_base64** | **string** | Barcode image bytes encoded as base-64. | +**recognition_mode** | [**\Aspose\BarCode\Model\RecognitionMode**](RecognitionMode.md) | | [optional] +**recognition_image_kind** | [**\Aspose\BarCode\Model\RecognitionImageKind**](RecognitionImageKind.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/RegionPoint.md b/docs/Model/RegionPoint.md index 2b74c36..1424bf6 100644 --- a/docs/Model/RegionPoint.md +++ b/docs/Model/RegionPoint.md @@ -5,8 +5,8 @@ Wrapper around Drawing.Point for proper specification. ## Properties Name | Type | Description | Notes ---- | ---- | ----------- | ----- -**x** | **int** | X-coordinate | -**y** | **int** | Y-coordinate | +**x** | **int** | X-coordinate | [optional] +**y** | **int** | Y-coordinate | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ResultImageInfo.md b/docs/Model/ResultImageInfo.md deleted file mode 100644 index 647f6d4..0000000 --- a/docs/Model/ResultImageInfo.md +++ /dev/null @@ -1,14 +0,0 @@ -# ResultImageInfo - -Created image info. - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**file_size** | **int** | Result file size. | -**image_width** | **int** | Result image width. | [optional] -**image_height** | **int** | Result image height. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/StorageExist.md b/docs/Model/ScanBase64Request.md similarity index 68% rename from docs/Model/StorageExist.md rename to docs/Model/ScanBase64Request.md index 802d6aa..595422b 100644 --- a/docs/Model/StorageExist.md +++ b/docs/Model/ScanBase64Request.md @@ -1,11 +1,11 @@ -# StorageExist +# ScanBase64Request -Storage exists +Scan barcode request. ## Properties Name | Type | Description | Notes ---- | ---- | ----------- | ----- -**exists** | **bool** | Shows that the storage exists. | +**file_base64** | **string** | Barcode image bytes encoded as base-64. | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StorageFile.md b/docs/Model/StorageFile.md deleted file mode 100644 index 3368b98..0000000 --- a/docs/Model/StorageFile.md +++ /dev/null @@ -1,16 +0,0 @@ -# StorageFile - -File or folder information - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**name** | **string** | File or folder name. | [optional] -**is_folder** | **bool** | True if it is a folder. | -**modified_date** | [**\DateTime**](\DateTime.md) | File or folder last modified DateTime. | [optional] -**size** | **int** | File or folder size. | -**path** | **string** | File or folder path. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/StructuredAppend.md b/docs/Model/StructuredAppend.md deleted file mode 100644 index 359a10b..0000000 --- a/docs/Model/StructuredAppend.md +++ /dev/null @@ -1,14 +0,0 @@ -# StructuredAppend - -QR structured append parameters. - -## Properties -Name | Type | Description | Notes ----- | ---- | ----------- | ----- -**sequence_indicator** | **int** | The index of the QR structured append mode barcode. Index starts from 0. | [optional] -**total_count** | **int** | QR structured append mode barcodes quantity. Max value is 16. | [optional] -**parity_byte** | **int** | QR structured append mode parity data. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/TextAlignment.md b/docs/Model/TextAlignment.md deleted file mode 100644 index e0a1778..0000000 --- a/docs/Model/TextAlignment.md +++ /dev/null @@ -1,12 +0,0 @@ -# TextAlignment - - -## Allowable values - -* **LEFT** -* CENTER -* RIGHT - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/index.php b/index.php index 3964b28..4bf8aa0 100644 --- a/index.php +++ b/index.php @@ -5,9 +5,9 @@ require __DIR__ . '/vendor/autoload.php'; use Aspose\BarCode\Configuration; -use Aspose\BarCode\BarcodeApi; -use Aspose\BarCode\Requests\GetBarcodeGenerateRequest; -use Aspose\BarCode\Model\{EncodeBarcodeType, CodeLocation}; +use Aspose\BarCode\GenerateApi; +use Aspose\BarCode\Requests\GenerateRequestWrapper; +use Aspose\BarCode\Model\{EncodeBarcodeType, EncodeDataType, CodeLocation, BarcodeImageFormat}; $config = new Configuration(); $config->setClientId('ClientId from https://dashboard.aspose.cloud/applications'); @@ -16,12 +16,12 @@ $config->setAccessToken(getenv("TEST_CONFIGURATION_ACCESS_TOKEN")); } -$request = new GetBarcodeGenerateRequest(EncodeBarcodeType::QR, 'PHP SDK Test'); -$request->format = 'png'; +$request = new GenerateRequestWrapper(EncodeBarcodeType::QR, 'PHP SDK Test'); +$request->image_format = BarcodeImageFormat::Png; $request->text_location = CodeLocation::None; -$api = new BarcodeApi(null, $config); -$response = $api->GetBarCodeGenerate($request); +$api = new GenerateApi(null, $config); +$response = $api->generate($request); $type = 'image/png'; $size = $response->getSize(); diff --git a/scripts/insert-credentials.py b/scripts/insert-credentials.py new file mode 100644 index 0000000..809e67b --- /dev/null +++ b/scripts/insert-credentials.py @@ -0,0 +1,54 @@ +import sys +import json +import os + +def replace_values_in_file(text_file_path, json_file_path, output_folder_path): + # Check if the JSON file exists + if not os.path.exists(json_file_path): + print(f"JSON file '{json_file_path}' does not exist. Writing input file as is.") + # Ensure the output folder exists + os.makedirs(output_folder_path, exist_ok=True) + + # Generate the output file path + output_file_path = os.path.join(output_folder_path, os.path.basename(text_file_path)) + + # Write the original content to the output file + with open(text_file_path, 'r') as text_file, open(output_file_path, 'w') as output_file: + output_file.write(text_file.read()) + return + + # Read the JSON file + with open(json_file_path, 'r') as json_file: + replacement_values = json.load(json_file) + + + # Read the text file + with open(text_file_path, 'r') as text_file: + content = text_file.read() + + values_dict = { + "ClientId": "Client Id from https://dashboard.aspose.cloud/applications", + "ClientSecret": "Client Secret from https://dashboard.aspose.cloud/applications", + } + # Replace the old values with the new values + for new_value_key, old_value in values_dict.items(): + content = content.replace(old_value, replacement_values[new_value_key]) + + # Ensure the output folder exists + os.makedirs(output_folder_path, exist_ok=True) + + # Generate the output file path + output_file_path = os.path.join(output_folder_path, os.path.basename(text_file_path)) + + # Write the updated content to the output file + with open(output_file_path, 'w') as output_file: + output_file.write(content) + +if __name__ == "__main__": + if len(sys.argv) != 4: + print("Usage: python replace_values.py ") + else: + text_file_path = sys.argv[1] + json_file_path = sys.argv[2] + output_folder_path = sys.argv[3] + replace_values_in_file(text_file_path, json_file_path, output_folder_path) diff --git a/scripts/run_snippet.sh b/scripts/run_snippet.sh new file mode 100644 index 0000000..337b410 --- /dev/null +++ b/scripts/run_snippet.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -euo pipefail + +FILE_PATH=$1; +RUN_DIR=$2 +SCRIPT_DIR=$3 +CONFIG_FILE_PATH=$4 +echo "Run snippet file: $FILE_PATH" + +python ${SCRIPT_DIR}/insert-credentials.py $FILE_PATH $CONFIG_FILE_PATH $RUN_DIR + +php ./$RUN_DIR/"${FILE_PATH##*/}" || exit 1 \ No newline at end of file diff --git a/scripts/run_snippets.sh b/scripts/run_snippets.sh new file mode 100644 index 0000000..6ad7d92 --- /dev/null +++ b/scripts/run_snippets.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -euo pipefail + +RUN_DIR="snippets_test" +SNIPPETS_DIR="snippets" +SCRIPT_DIR="scripts" +CONFIG_FILE_PATH="tests/Configuration.json" + +rm -rf "${RUN_DIR}" || true +mkdir -p "${RUN_DIR}" + +pushd ${RUN_DIR} +ln -sv -F ../src/ . +popd + +for file in $(find "${SNIPPETS_DIR}" -name "*.php"); do + ${SCRIPT_DIR}/run_snippet.sh "$file" $RUN_DIR $SCRIPT_DIR $CONFIG_FILE_PATH || { echo "Error processing $file"; exit 1; } +done + +rm -rf "${RUN_DIR}" || true \ No newline at end of file diff --git a/snippets/ManualFetchToken.php b/snippets/ManualFetchToken.php new file mode 100644 index 0000000..abb508d --- /dev/null +++ b/snippets/ManualFetchToken.php @@ -0,0 +1,45 @@ + 'client_credentials', + 'client_id' => $clientId, + 'client_secret' => $clientSecret + ]; + + $client = new Client(); + + $response = $client->post($url, [ + 'form_params' => $data, + 'headers' => [ + 'Content-Type' => 'application/x-www-form-urlencoded' + ] + ]); + + $body = $response->getBody()->getContents(); + $statusCode = $response->getStatusCode(); + + if ($statusCode >= 200 && $statusCode < 300) { + $bodyArray=json_decode($body, true); + $token=$bodyArray["access_token"]; + echo "Token recieved successfully\n"; + // To veiw token uncomment next line + // echo "$token"; + + } else { + throw new Exception("Unexpected HTTP code: $statusCode\nResponse: $body\n"); + } diff --git a/snippets/generate/appearance/GenerateBody.php b/snippets/generate/appearance/GenerateBody.php new file mode 100644 index 0000000..c7c11ed --- /dev/null +++ b/snippets/generate/appearance/GenerateBody.php @@ -0,0 +1,55 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main(): void +{ + $fileName = __DIR__ . "/../testdata/Code39.jpeg"; + + $generateApi = new GenerateApi(null, makeConfiguration()); + + $generateParams = new GenerateParams([ + 'barcode_type' => EncodeBarcodeType::Code39, + 'encode_data' => new EncodeData([ + 'data' => 'Aspose', + 'data_type' => EncodeDataType::StringData + ]), + 'barcode_image_params' => new BarcodeImageParams([ + 'foreground_color' => '#FF0000', + 'background_color' => '#FFFF00', + 'image_format' => BarcodeImageFormat::Jpeg, + 'rotation_angle' => 90 + ]) + ]); + + $request = new GenerateBodyRequestWrapper($generateParams); + $generated = $generateApi->generateBody($request); + + file_put_contents($fileName, $generated->fread($generated->getSize())); + + echo "File '{$fileName}' generated.\n"; +} + +main(); diff --git a/snippets/generate/appearance/GenerateGet.php b/snippets/generate/appearance/GenerateGet.php new file mode 100644 index 0000000..f13d342 --- /dev/null +++ b/snippets/generate/appearance/GenerateGet.php @@ -0,0 +1,51 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main(): void +{ + $fileName = __DIR__ . "/../testdata/Qr.png"; + + $generateApi = new GenerateApi(null, makeConfiguration()); + + $request = new GenerateRequestWrapper( + EncodeBarcodeType::QR, + 'Aspose.BarCode.Cloud'); + $request->image_format = BarcodeImageFormat::Png; + $request->foreground_color = 'Black'; + $request->background_color = 'White'; + $request->text_location = CodeLocation::Below; + $request->resolution = 300; + $request->image_height = 200; + $request->image_width = 200; + + $generated = $generateApi->generate($request); + + file_put_contents($fileName, $generated->fread($generated->getSize())); + + echo "File '{$fileName}' generated.\n"; +} + +main(); \ No newline at end of file diff --git a/snippets/generate/appearance/GenerateMultipart.php b/snippets/generate/appearance/GenerateMultipart.php new file mode 100644 index 0000000..6963c3f --- /dev/null +++ b/snippets/generate/appearance/GenerateMultipart.php @@ -0,0 +1,48 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main(): void +{ + $fileName = __DIR__ . '/../testdata/Pdf417.svg'; + + $generateApi = new GenerateApi(null, makeConfiguration()); + + $request = new GenerateMultipartRequestWrapper( + EncodeBarcodeType::Pdf417, + "Aspose.BarCode.Cloud" + ); + $request->text_location = "Above"; + $request->image_format = BarcodeImageFormat::Svg; + + $barcodeStream = $generateApi->generateMultipart($request); + + file_put_contents($fileName, $barcodeStream->fread($barcodeStream->getSize())); + + echo "File '{$fileName}' generated.\n"; +} + +main(); \ No newline at end of file diff --git a/snippets/generate/save/GenerateBody.php b/snippets/generate/save/GenerateBody.php new file mode 100644 index 0000000..76356b1 --- /dev/null +++ b/snippets/generate/save/GenerateBody.php @@ -0,0 +1,54 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main(): void +{ + $fileName = __DIR__ . '/../testdata/Pdf417.png'; + + $generateApi = new GenerateApi(null, makeConfiguration()); + + $generateParams = new GenerateParams([ + 'barcode_type' => EncodeBarcodeType::Pdf417, + 'encode_data' => new EncodeData([ + 'data' => 'Aspose.BarCode.Cloud', + 'data_type' => EncodeDataType::StringData + ]), + 'barcode_image_params' => new BarcodeImageParams([ + 'foreground_color' => '#FF5733', + 'background_color' => '#FFFFFF', + 'image_format' => BarcodeImageFormat::Jpeg + ]) + ]); + + $request = new GenerateBodyRequestWrapper($generateParams); + $generated = $generateApi->generateBody($request); + + file_put_contents($fileName, $generated->fread($generated->getSize())); + + echo "File '{$fileName}' generated.\n"; +} + +main(); \ No newline at end of file diff --git a/snippets/generate/save/GenerateGet.php b/snippets/generate/save/GenerateGet.php new file mode 100644 index 0000000..4eaaf3e --- /dev/null +++ b/snippets/generate/save/GenerateGet.php @@ -0,0 +1,43 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main(): void +{ + $fileName = __DIR__ . '/../testdata/Code128.jpeg'; + + $generateApi = new GenerateApi(null, makeConfiguration()); + + $request = new GenerateRequestWrapper(EncodeBarcodeType::Code128, "Aspose.BarCode.Cloud"); + $request->image_format = BarcodeImageFormat::Png; + + $generated = $generateApi->generate($request); + + file_put_contents($fileName, $generated->fread($generated->getSize())); + + echo "File '{$fileName}' generated.\n"; +} + +main(); \ No newline at end of file diff --git a/snippets/generate/save/GenerateMultipart.php b/snippets/generate/save/GenerateMultipart.php new file mode 100644 index 0000000..298668c --- /dev/null +++ b/snippets/generate/save/GenerateMultipart.php @@ -0,0 +1,42 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main(): void +{ + $fileName = __DIR__ . '/../testdata/Pdf417.png'; + + $generateApi = new GenerateApi(null, makeConfiguration()); + + $request = new GenerateMultipartRequestWrapper(EncodeBarcodeType::Pdf417, "Aspose.BarCode.Cloud"); + + $generated = $generateApi->generateMultipart($request); + + file_put_contents($fileName, $generated->fread($generated->getSize())); + + echo "File '{$fileName}' generated.\n"; +} + +main(); \ No newline at end of file diff --git a/snippets/generate/set-colorscheme/GenerateBody.php b/snippets/generate/set-colorscheme/GenerateBody.php new file mode 100644 index 0000000..3316cd3 --- /dev/null +++ b/snippets/generate/set-colorscheme/GenerateBody.php @@ -0,0 +1,54 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main(): void +{ + $fileName = __DIR__ . '/../testdata/../Pdf417.png'; + + $generateApi = new GenerateApi(null, makeConfiguration()); + + $generateParams = new GenerateParams([ + 'barcode_type' => EncodeBarcodeType::Pdf417, + 'encode_data' => new EncodeData([ + 'data' => 'Aspose.BarCode.Cloud', + 'data_type' => EncodeDataType::StringData + ]), + 'barcode_image_params' => new BarcodeImageParams([ + 'foreground_color' => '#FF5733', + 'background_color' => '#FFFFFF', + 'image_format' => BarcodeImageFormat::Jpeg + ]) + ]); + + $request = new GenerateBodyRequestWrapper($generateParams); + $generated = $generateApi->generateBody($request); + + file_put_contents($fileName, $generated->fread($generated->getSize())); + + echo "File '{$fileName}' generated.\n"; +} + +main(); \ No newline at end of file diff --git a/snippets/generate/set-colorscheme/GenerateGet.php b/snippets/generate/set-colorscheme/GenerateGet.php new file mode 100644 index 0000000..7bd0a8a --- /dev/null +++ b/snippets/generate/set-colorscheme/GenerateGet.php @@ -0,0 +1,53 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main(): void +{ + $fileName = __DIR__ . '/../testdata/Qr.png'; + + $generateApi = new GenerateApi(null, makeConfiguration()); + + $request = new GenerateRequestWrapper( + EncodeBarcodeType::QR, + "https://products.aspose.cloud/barcode/family/" + ); + $request->foreground_color = "DarkBlue"; + $request->background_color = "LightGray"; + $request->image_format = BarcodeImageFormat::Png; + + $generated = $generateApi->generate($request); + + file_put_contents($fileName, $generated->fread($generated->getSize())); + + echo "File '{$fileName}' generated.\n"; +} + +main(); \ No newline at end of file diff --git a/snippets/generate/set-colorscheme/GenerateMultipart.php b/snippets/generate/set-colorscheme/GenerateMultipart.php new file mode 100644 index 0000000..0b678f4 --- /dev/null +++ b/snippets/generate/set-colorscheme/GenerateMultipart.php @@ -0,0 +1,45 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main(): void +{ + $fileName = __DIR__ . '/../testdata/Code39.png'; + + $generateApi = new GenerateApi(null, makeConfiguration()); + + $request = new GenerateMultipartRequestWrapper(EncodeBarcodeType::Code39, "Aspose"); + $request->foreground_color = "Green"; + $request->background_color = "Yellow"; + $request->image_format = BarcodeImageFormat::Gif; + + $generated = $generateApi->generateMultipart($request); + + file_put_contents($fileName, $generated->fread($generated->getSize())); + + echo "File '{$fileName}' generated.\n"; +} + +main(); \ No newline at end of file diff --git a/snippets/generate/set-size/GenerateBody.php b/snippets/generate/set-size/GenerateBody.php new file mode 100644 index 0000000..e823696 --- /dev/null +++ b/snippets/generate/set-size/GenerateBody.php @@ -0,0 +1,55 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main(): void +{ + $fileName = __DIR__ . '/../testdata/../Pdf417.png'; + + $generateApi = new GenerateApi(null, makeConfiguration()); + + $generateParams = new GenerateParams([ + 'barcode_type' => EncodeBarcodeType::Pdf417, + 'encode_data' => new EncodeData([ + 'data' => 'Aspose.BarCode.Cloud', + 'data_type' => EncodeDataType::StringData + ]), + 'barcode_image_params' => new BarcodeImageParams([ + 'image_height' => 2, + 'image_width' => 3, + 'resolution' => 96, + 'units' => 'Inch' + ]) + ]); + + $request = new GenerateBodyRequestWrapper($generateParams); + $generated = $generateApi->generateBody($request); + + file_put_contents($fileName, $generated->fread($generated->getSize())); + + echo "File '{$fileName}' generated.\n"; +} + +main(); \ No newline at end of file diff --git a/snippets/generate/set-size/GenerateGet.php b/snippets/generate/set-size/GenerateGet.php new file mode 100644 index 0000000..c2ca75a --- /dev/null +++ b/snippets/generate/set-size/GenerateGet.php @@ -0,0 +1,47 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main(): void +{ + $fileName = __DIR__ . '/../testdata/Qr.png'; + + $generateApi = new GenerateApi(null, makeConfiguration()); + + $request = new GenerateRequestWrapper(EncodeBarcodeType::QR, "Aspose.BarCode.Cloud"); + $request->image_height = 200; + $request->image_width = 200; + $request->resolution = 300; + $request->units = 'Pixel'; + + + $generated = $generateApi->generate($request); + + file_put_contents($fileName, $generated->fread($generated->getSize())); + + echo "File '{$fileName}' generated.\n"; +} + +main(); \ No newline at end of file diff --git a/snippets/generate/set-size/GenerateMultipart.php b/snippets/generate/set-size/GenerateMultipart.php new file mode 100644 index 0000000..3e429f5 --- /dev/null +++ b/snippets/generate/set-size/GenerateMultipart.php @@ -0,0 +1,47 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main(): void +{ + $fileName = __DIR__ . '/../testdata/Aztec.png'; + + $generateApi = new GenerateApi(null, makeConfiguration()); + + $request = new GenerateMultipartRequestWrapper(EncodeBarcodeType::Aztec, "Aspose.BarCode.Cloud"); + $request->image_height = 200; + $request->image_width = 200; + $request->resolution = 150; + $request->units = 'Point'; + + $generated = $generateApi->generateMultipart($request); + + file_put_contents($fileName, $generated->fread($generated->getSize())); + + echo "File '{$fileName}' generated.\n"; +} + +main(); \ No newline at end of file diff --git a/snippets/generate/set-text/GenerateBody.php b/snippets/generate/set-text/GenerateBody.php new file mode 100644 index 0000000..b8352b5 --- /dev/null +++ b/snippets/generate/set-text/GenerateBody.php @@ -0,0 +1,49 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main(): void +{ + $fileName = __DIR__ . '/../testdata/Pdf417.png'; + + $generateApi = new GenerateApi(null, makeConfiguration()); + + $generateParams = new GenerateParams([ + 'barcode_type' => EncodeBarcodeType::Pdf417, + 'encode_data' => new EncodeData([ + 'data' => 'QXNwb3NlLkJhckNvZGUuQ2xvdWQ=', + 'data_type' => EncodeDataType::Base64Bytes + ]) + ]); + + $request = new GenerateBodyRequestWrapper($generateParams); + $generated = $generateApi->generateBody($request); + + file_put_contents($fileName, $generated->fread($generated->getSize())); + + echo "File '{$fileName}' generated.\n"; +} + +main(); \ No newline at end of file diff --git a/snippets/generate/set-text/GenerateGet.php b/snippets/generate/set-text/GenerateGet.php new file mode 100644 index 0000000..fb01917 --- /dev/null +++ b/snippets/generate/set-text/GenerateGet.php @@ -0,0 +1,43 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main(): void +{ + $fileName = __DIR__ . '/../testdata/Qr.png'; + + $generateApi = new GenerateApi(null, makeConfiguration()); + + $getRequest = new GenerateRequestWrapper(EncodeBarcodeType::QR, "Aspose.BarCode.Cloud"); + $getRequest->data_type = EncodeDataType::StringData; + + $generated = $generateApi->generate($getRequest); + + file_put_contents($fileName, $generated->fread($generated->getSize())); + + echo "File '{$fileName}' generated.\n"; +} + +main(); \ No newline at end of file diff --git a/snippets/generate/set-text/GenerateMultipart.php b/snippets/generate/set-text/GenerateMultipart.php new file mode 100644 index 0000000..7ec8a70 --- /dev/null +++ b/snippets/generate/set-text/GenerateMultipart.php @@ -0,0 +1,43 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main(): void +{ + $fileName = __DIR__ . '/../testdata/Code128.png'; + + $generateApi = new GenerateApi(null, makeConfiguration()); + + $formRequest = new GenerateMultipartRequestWrapper(EncodeBarcodeType::Code128, "4173706F73652E426172436F64652E436C6F7564"); + $formRequest->data_type = EncodeDataType::HexBytes; + + $generated = $generateApi->generateMultipart($formRequest); + + file_put_contents($fileName, $generated->fread($generated->getSize())); + + echo "File '{$fileName}' generated.\n"; +} + +main(); \ No newline at end of file diff --git a/snippets/read/set-image-kind/RecognizeBody.php b/snippets/read/set-image-kind/RecognizeBody.php new file mode 100644 index 0000000..f3d2500 --- /dev/null +++ b/snippets/read/set-image-kind/RecognizeBody.php @@ -0,0 +1,51 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main() +{ + $recognizeApi = new RecognizeApi(null, makeConfiguration()); + + $fileName = __DIR__ . '/../testdata/QR_and_Code128.png'; + $imageBytes = file_get_contents($fileName); + $imageBase64 = base64_encode($imageBytes); + + $base64Request = new RecognizeBase64Request([ + 'barcode_types' => [DecodeBarcodeType::Aztec, DecodeBarcodeType::QR], + 'file_base64' => $imageBase64, + 'image_kind' => RecognitionImageKind::ScannedDocument + ]); + + $request = new RecognizeBase64RequestWrapper($base64Request); + + $result = $recognizeApi->recognizeBase64($request); + + echo sprintf( + "File '%s' recognized, results: value: '%s', type: %s\n", + $fileName, + $result->getBarcodes()[0]->getBarcodeValue(), + $result->getBarcodes()[0]->getType() + ); +} + +main(); diff --git a/snippets/read/set-image-kind/RecognizeGet.php b/snippets/read/set-image-kind/RecognizeGet.php new file mode 100644 index 0000000..563b755 --- /dev/null +++ b/snippets/read/set-image-kind/RecognizeGet.php @@ -0,0 +1,37 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main() +{ + $recognizeApi = new RecognizeApi(null, makeConfiguration()); + + $request = new RecognizeRequestWrapper(DecodeBarcodeType::QR, "https://products.aspose.app/barcode/scan/img/how-to/scan/step2.png"); + $request->image_kind = RecognitionImageKind::Photo; + + $result = $recognizeApi->recognize($request); + + echo sprintf("File '%s' recognized, result: '%s'\n", "https://products.aspose.app/barcode/scan/img/how-to/scan/step2.png", $result->getBarcodes()[0]->getBarcodeValue()); +} + +main(); \ No newline at end of file diff --git a/snippets/read/set-image-kind/RecognizeMultipart.php b/snippets/read/set-image-kind/RecognizeMultipart.php new file mode 100644 index 0000000..8707c68 --- /dev/null +++ b/snippets/read/set-image-kind/RecognizeMultipart.php @@ -0,0 +1,39 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main() +{ + $recognizeApi = new RecognizeApi(null, makeConfiguration()); + + $fileName = __DIR__ . '/../testdata/Pdf417.png'; + $file = new SplFileObject($fileName, 'rb'); + $request = new RecognizeMultipartRequestWrapper(DecodeBarcodeType::MostCommonlyUsed, $file); + $request->image_kind = RecognitionImageKind::ClearImage; + + $result = $recognizeApi->recognizeMultipart($request); + + echo sprintf("File '%s' recognized, result: '%s'\n", $fileName, $result->getBarcodes()[0]->getBarcodeValue()); +} + +main(); \ No newline at end of file diff --git a/snippets/read/set-quality/RecognizeBody.php b/snippets/read/set-quality/RecognizeBody.php new file mode 100644 index 0000000..1706245 --- /dev/null +++ b/snippets/read/set-quality/RecognizeBody.php @@ -0,0 +1,50 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main() +{ + $recognizeApi = new RecognizeApi(null, makeConfiguration()); + + $fileName = __DIR__ . '/../testdata/QR_and_Code128.png'; + $imageBytes = file_get_contents($fileName); + $imageBase64 = base64_encode($imageBytes); + + $base64Request = new RecognizeBase64Request([ + 'file_base64' => $imageBase64, + 'recognition_mode' => RecognitionMode::Excellent, + 'barcode_types' => [DecodeBarcodeType::Code128] + ]); + + $request = new RecognizeBase64RequestWrapper($base64Request); + + $result = $recognizeApi->recognizeBase64($request); + + echo sprintf( + "File '%s' recognized, result: '%s'\n", + $fileName, + $result->getBarcodes()[0]->getBarcodeValue() + ); +} + +main(); \ No newline at end of file diff --git a/snippets/read/set-quality/RecognizeGet.php b/snippets/read/set-quality/RecognizeGet.php new file mode 100644 index 0000000..68afb2d --- /dev/null +++ b/snippets/read/set-quality/RecognizeGet.php @@ -0,0 +1,42 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main() +{ + $recognizeApi = new RecognizeApi(null, makeConfiguration()); + + $request = new RecognizeRequestWrapper(DecodeBarcodeType::QR, "https://products.aspose.app/barcode/scan/img/how-to/scan/step2.png"); + $request->recognition_mode = RecognitionMode::Fast; + $request->image_kind = RecognitionImageKind::Photo; + + $result = $recognizeApi->recognize($request); + + echo sprintf( + "File '%s' recognized, result: '%s'\n", + "https://products.aspose.app/barcode/scan/img/how-to/scan/step2.png", + $result->getBarcodes()[0]->getBarcodeValue() + ); +} + +main(); \ No newline at end of file diff --git a/snippets/read/set-quality/RecognizeMultipart.php b/snippets/read/set-quality/RecognizeMultipart.php new file mode 100644 index 0000000..e9c40fd --- /dev/null +++ b/snippets/read/set-quality/RecognizeMultipart.php @@ -0,0 +1,45 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main() +{ + $recognizeApi = new RecognizeApi(null, makeConfiguration()); + + $fileName = __DIR__ . '/../testdata/Aztec.png'; + $file = new SplFileObject($fileName, 'rb'); + + $request = new RecognizeMultipartRequestWrapper(DecodeBarcodeType::Aztec, $file); + $request->recognition_mode = RecognitionMode::Normal; + $request->image_kind = RecognitionImageKind::ScannedDocument; + + $result = $recognizeApi->recognizeMultipart($request); + + echo sprintf( + "File '%s' recognized, result: '%s'\n", + $fileName, + $result->getBarcodes()[0]->getBarcodeValue() + ); +} + +main(); \ No newline at end of file diff --git a/snippets/read/set-source/RecognizeBody.php b/snippets/read/set-source/RecognizeBody.php new file mode 100644 index 0000000..a95c0be --- /dev/null +++ b/snippets/read/set-source/RecognizeBody.php @@ -0,0 +1,49 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main() +{ + $recognizeApi = new RecognizeApi(null, makeConfiguration()); + + $fileName = __DIR__ . '/../testdata/pdf417Sample.png'; + $imageBytes = file_get_contents($fileName); + $imageBase64 = base64_encode($imageBytes); + + $base64Request = new RecognizeBase64Request([ + 'barcode_types' => [DecodeBarcodeType::Pdf417], + 'file_base64' => $imageBase64 + ]); + + $request = new RecognizeBase64RequestWrapper($base64Request); + + $result = $recognizeApi->recognizeBase64($request); + + echo sprintf( + "File '%s' recognized, result: '%s'\n", + $fileName, + $result->getBarcodes()[0]->getBarcodeValue() + ); +} + +main(); \ No newline at end of file diff --git a/snippets/read/set-source/RecognizeGet.php b/snippets/read/set-source/RecognizeGet.php new file mode 100644 index 0000000..e30c6e5 --- /dev/null +++ b/snippets/read/set-source/RecognizeGet.php @@ -0,0 +1,43 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main() +{ + $recognizeApi = new RecognizeApi(null, makeConfiguration()); + + $request = new RecognizeRequestWrapper( + DecodeBarcodeType::QR, + "https://products.aspose.app/barcode/scan/img/how-to/scan/step2.png" + ); + + $result = $recognizeApi->recognize($request); + + echo sprintf( + "File '%s' recognized, result: '%s'\n", + "step2.png", + $result->getBarcodes()[0]->getBarcodeValue() + ); +} + +main(); \ No newline at end of file diff --git a/snippets/read/set-source/RecognizeMultipart.php b/snippets/read/set-source/RecognizeMultipart.php new file mode 100644 index 0000000..7619f6f --- /dev/null +++ b/snippets/read/set-source/RecognizeMultipart.php @@ -0,0 +1,48 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main() +{ + $recognizeApi = new RecognizeApi(null, makeConfiguration()); + + $fileName = __DIR__ . '/../testdata/Qr.png'; + $file = new SplFileObject($fileName, 'rb'); + + $request = new RecognizeMultipartRequestWrapper( + DecodeBarcodeType::QR, + $file + ); + + $result = $recognizeApi->recognizeMultipart($request); + + echo sprintf( + "File '%s' recognized, result: '%s'\n", + $fileName, + $result->getBarcodes()[0]->getBarcodeValue() + ); + + $file = null; +} + +main(); \ No newline at end of file diff --git a/snippets/read/set-source/ScanBody.php b/snippets/read/set-source/ScanBody.php new file mode 100644 index 0000000..f2a5d6b --- /dev/null +++ b/snippets/read/set-source/ScanBody.php @@ -0,0 +1,48 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main() +{ + $scanApi = new ScanApi(null, makeConfiguration()); + + $fileName = __DIR__ . '/../testdata/Qr.png'; + $imageBytes = file_get_contents($fileName); + $imageBase64 = base64_encode($imageBytes); + + $base64Request = new ScanBase64Request([ + 'file_base64' => $imageBase64 + ]); + + $request = new ScanBase64RequestWrapper($base64Request); + + $result = $scanApi->scanBase64($request); + + echo sprintf( + "File '%s' recognized, result: '%s'\n", + $fileName, + $result->getBarcodes()[0]->getBarcodeValue() + ); +} + +main(); \ No newline at end of file diff --git a/snippets/read/set-source/ScanGet.php b/snippets/read/set-source/ScanGet.php new file mode 100644 index 0000000..8bce4ca --- /dev/null +++ b/snippets/read/set-source/ScanGet.php @@ -0,0 +1,38 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main() +{ + $scanApi = new ScanApi(null, makeConfiguration()); + + $request = new ScanRequestWrapper("https://products.aspose.app/barcode/scan/img/how-to/scan/step2.png"); + $result = $scanApi->scan($request); + + echo sprintf( + "File '%s' recognized, result: '%s'\n", + "https://products.aspose.app/barcode/scan/img/how-to/scan/step2.png", + $result->getBarcodes()[0]->getBarcodeValue() + ); +} + +main(); \ No newline at end of file diff --git a/snippets/read/set-source/ScanMultipart.php b/snippets/read/set-source/ScanMultipart.php new file mode 100644 index 0000000..ca84bc8 --- /dev/null +++ b/snippets/read/set-source/ScanMultipart.php @@ -0,0 +1,38 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main() +{ + $scanApi = new ScanApi(null, makeConfiguration()); + + $fileName = __DIR__ . '/../testdata/Qr.png'; + $file = new SplFileObject($fileName, 'rb'); + $request = new ScanMultipartRequestWrapper($file); + + $result = $scanApi->scanMultipart($request); + $file = null; + + echo sprintf("File '%s' recognized, result: '%s'\n", $fileName, $result->getBarcodes()[0]->getBarcodeValue()); +} + +main(); \ No newline at end of file diff --git a/snippets/read/set-target-types/RecognizeBody.php b/snippets/read/set-target-types/RecognizeBody.php new file mode 100644 index 0000000..f2ff425 --- /dev/null +++ b/snippets/read/set-target-types/RecognizeBody.php @@ -0,0 +1,47 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main() +{ + $recognizeApi = new RecognizeApi(null, makeConfiguration()); + + $fileName = __DIR__ . '/../testdata/QR_and_Code128.png'; + $imageBytes = file_get_contents($fileName); + $imageBase64 = base64_encode($imageBytes); + + $base64Request = new RecognizeBase64Request([ + 'barcode_types' => [DecodeBarcodeType::QR, DecodeBarcodeType::Code128], + 'file_base64' => $imageBase64 + ]); + + $request = new RecognizeBase64RequestWrapper($base64Request); + $response = $recognizeApi->recognizeBase64($request); + + echo sprintf("File '%s' recognized, results: \n", $fileName); + foreach ($response->getBarcodes() as $result) { + echo sprintf("Value: '%s', type: %s\n", $result->getBarcodeValue(), $result->getType()); + } +} + +main(); \ No newline at end of file diff --git a/snippets/read/set-target-types/RecognizeGet.php b/snippets/read/set-target-types/RecognizeGet.php new file mode 100644 index 0000000..815b7eb --- /dev/null +++ b/snippets/read/set-target-types/RecognizeGet.php @@ -0,0 +1,42 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main() +{ + $recognizeApi = new RecognizeApi(null, makeConfiguration()); + + $request = new RecognizeRequestWrapper( + DecodeBarcodeType::MostCommonlyUsed, + "https://products.aspose.app/barcode/scan/img/how-to/scan/step2.png" + ); + + $result = $recognizeApi->recognize($request); + + echo sprintf( + "File recognized, result: '%s'\n", + $result->getBarcodes()[0]->getBarcodeValue() + ); +} + +main(); \ No newline at end of file diff --git a/snippets/read/set-target-types/RecognizeMultipart.php b/snippets/read/set-target-types/RecognizeMultipart.php new file mode 100644 index 0000000..5cda3ac --- /dev/null +++ b/snippets/read/set-target-types/RecognizeMultipart.php @@ -0,0 +1,47 @@ +setClientId("Client Id from https://dashboard.aspose.cloud/applications"); + $config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications"); + } else { + $config->setAccessToken($envToken); + } + + return $config; +} + +function main() +{ + $recognizeApi = new RecognizeApi(null, makeConfiguration()); + + $fileName = __DIR__ . '/../testdata/Pdf417.png'; + $file = new SplFileObject($fileName, 'rb'); + + $request = new RecognizeMultipartRequestWrapper( + DecodeBarcodeType::Pdf417, + $file + ); + + $result = $recognizeApi->recognizeMultipart($request); + $file = null; + + echo sprintf( + "File '%s' recognized, result: '%s'\n", + $fileName, + $result->getBarcodes()[0]->getBarcodeValue() + ); +} + +main(); \ No newline at end of file diff --git a/src/Aspose/BarCode/BarcodeApi.php b/src/Aspose/BarCode/BarcodeApi.php deleted file mode 100644 index f53390e..0000000 --- a/src/Aspose/BarCode/BarcodeApi.php +++ /dev/null @@ -1,3609 +0,0 @@ - - * Copyright (c) 2025 Aspose Pty Ltd - * - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * -------------------------------------------------------------------------------------------------------------------- - */ - -namespace Aspose\BarCode; - -use GuzzleHttp\Client; -use GuzzleHttp\ClientInterface; -use GuzzleHttp\Exception\GuzzleException; -use GuzzleHttp\Exception\RequestException; -use GuzzleHttp\Psr7\MultipartStream; -use GuzzleHttp\Psr7\Request; -use GuzzleHttp\RequestOptions; -use Aspose\BarCode\Requests; -use InvalidArgumentException; -use RuntimeException; - -/** - * Aspose.BarCode for Cloud API. - */ - -class BarcodeApi -{ - /** - * Stores client instance - * @var ClientInterface client for calling api - */ - protected $client; - - /** - * Stores configuration - * @var Configuration configuration info - */ - protected $config; - - /** - * Stores header selector - * HeaderSelector class for header selection - */ - protected $headerSelector; - - /** - * Initialize a new instance of Api - * @param ClientInterface|null $client client for calling api - * @param Configuration|null $config configuration info - * @param HeaderSelector|null $selector class for header selection - */ - public function __construct(ClientInterface $client = null, Configuration $config = null, HeaderSelector $selector = null) - { - $this->client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * Gets the config - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation getBarcodeGenerate - * - * Generate barcode. - * - * @param Requests\GetBarcodeGenerateRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return \SplFileObject - */ - public function getBarcodeGenerate(Requests\GetBarcodeGenerateRequest $request) - { - try { - list($response) = $this->getBarcodeGenerateWithHttpInfo($request); - return $response; - } catch (RepeatRequestException $e) { - list($response) = $this->getBarcodeGenerateWithHttpInfo($request); - return $response; - } - } - - /** - * Operation getBarcodeGenerateWithHttpInfo - * - * Generate barcode. - * - * @param Requests\GetBarcodeGenerateRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) - */ - public function getBarcodeGenerateWithHttpInfo(Requests\GetBarcodeGenerateRequest $request) - { - $returnType = '\SplFileObject'; - $request = $this->GetBarcodeGenerateRequest($request); - - try { - $options = $this->_createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - if ($statusCode === 401) { - $this->_requestToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody()); - } - - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - if ($this->config->getDebug()) { - $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\SplFileObject', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ApiErrorResponse', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation getBarcodeGenerateAsync - * - * Generate barcode. - * - * @param Requests\GetBarcodeGenerateRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getBarcodeGenerateAsync(Requests\GetBarcodeGenerateRequest $request) - { - return $this->getBarcodeGenerateAsyncWithHttpInfo($request) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation getBarcodeGenerateAsyncWithHttpInfo - * - * Generate barcode. - * - * @param Requests\GetBarcodeGenerateRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getBarcodeGenerateAsyncWithHttpInfo(Requests\GetBarcodeGenerateRequest $request) - { - $returnType = '\SplFileObject'; - $request = $this->GetBarcodeGenerateRequest($request); - - return $this->client - ->sendAsync($request, $this->_createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - if ($this->config->getDebug()) { - $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - - if ($exception instanceof RepeatRequestException) { - //$this->_refreshToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException( - sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'getBarcodeGenerate' - * - * @param Requests\GetBarcodeGenerateRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function GetBarcodeGenerateRequest(Requests\GetBarcodeGenerateRequest $request) - { - // verify the required parameter 'type' is set - if (!isset($request->type)) { - throw new InvalidArgumentException('Missing the required parameter $type when calling getBarcodeGenerate'); - } - // verify the required parameter 'text' is set - if (!isset($request->text)) { - throw new InvalidArgumentException('Missing the required parameter $text when calling getBarcodeGenerate'); - } - - $resourcePath = '/barcode/generate'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - if (isset($request->type)) { - $queryParamName = lcfirst('Type'); - $queryParamValue = is_bool($request->type) ? ($request->type ? 'true' : 'false') : $request->type; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->text)) { - $queryParamName = lcfirst('Text'); - $queryParamValue = is_bool($request->text) ? ($request->text ? 'true' : 'false') : $request->text; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->two_d_display_text)) { - $queryParamName = lcfirst('TwoDDisplayText'); - $queryParamValue = is_bool($request->two_d_display_text) ? ($request->two_d_display_text ? 'true' : 'false') : $request->two_d_display_text; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->text_location)) { - $queryParamName = lcfirst('TextLocation'); - $queryParamValue = is_bool($request->text_location) ? ($request->text_location ? 'true' : 'false') : $request->text_location; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->text_alignment)) { - $queryParamName = lcfirst('TextAlignment'); - $queryParamValue = is_bool($request->text_alignment) ? ($request->text_alignment ? 'true' : 'false') : $request->text_alignment; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->text_color)) { - $queryParamName = lcfirst('TextColor'); - $queryParamValue = is_bool($request->text_color) ? ($request->text_color ? 'true' : 'false') : $request->text_color; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->no_wrap)) { - $queryParamName = lcfirst('NoWrap'); - $queryParamValue = is_bool($request->no_wrap) ? ($request->no_wrap ? 'true' : 'false') : $request->no_wrap; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->resolution)) { - $queryParamName = lcfirst('Resolution'); - $queryParamValue = is_bool($request->resolution) ? ($request->resolution ? 'true' : 'false') : $request->resolution; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->resolution_x)) { - $queryParamName = lcfirst('ResolutionX'); - $queryParamValue = is_bool($request->resolution_x) ? ($request->resolution_x ? 'true' : 'false') : $request->resolution_x; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->resolution_y)) { - $queryParamName = lcfirst('ResolutionY'); - $queryParamValue = is_bool($request->resolution_y) ? ($request->resolution_y ? 'true' : 'false') : $request->resolution_y; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->dimension_x)) { - $queryParamName = lcfirst('DimensionX'); - $queryParamValue = is_bool($request->dimension_x) ? ($request->dimension_x ? 'true' : 'false') : $request->dimension_x; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->text_space)) { - $queryParamName = lcfirst('TextSpace'); - $queryParamValue = is_bool($request->text_space) ? ($request->text_space ? 'true' : 'false') : $request->text_space; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->units)) { - $queryParamName = lcfirst('Units'); - $queryParamValue = is_bool($request->units) ? ($request->units ? 'true' : 'false') : $request->units; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->size_mode)) { - $queryParamName = lcfirst('SizeMode'); - $queryParamValue = is_bool($request->size_mode) ? ($request->size_mode ? 'true' : 'false') : $request->size_mode; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->bar_height)) { - $queryParamName = lcfirst('BarHeight'); - $queryParamValue = is_bool($request->bar_height) ? ($request->bar_height ? 'true' : 'false') : $request->bar_height; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->image_height)) { - $queryParamName = lcfirst('ImageHeight'); - $queryParamValue = is_bool($request->image_height) ? ($request->image_height ? 'true' : 'false') : $request->image_height; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->image_width)) { - $queryParamName = lcfirst('ImageWidth'); - $queryParamValue = is_bool($request->image_width) ? ($request->image_width ? 'true' : 'false') : $request->image_width; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->rotation_angle)) { - $queryParamName = lcfirst('RotationAngle'); - $queryParamValue = is_bool($request->rotation_angle) ? ($request->rotation_angle ? 'true' : 'false') : $request->rotation_angle; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->back_color)) { - $queryParamName = lcfirst('BackColor'); - $queryParamValue = is_bool($request->back_color) ? ($request->back_color ? 'true' : 'false') : $request->back_color; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->bar_color)) { - $queryParamName = lcfirst('BarColor'); - $queryParamValue = is_bool($request->bar_color) ? ($request->bar_color ? 'true' : 'false') : $request->bar_color; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->border_color)) { - $queryParamName = lcfirst('BorderColor'); - $queryParamValue = is_bool($request->border_color) ? ($request->border_color ? 'true' : 'false') : $request->border_color; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->border_width)) { - $queryParamName = lcfirst('BorderWidth'); - $queryParamValue = is_bool($request->border_width) ? ($request->border_width ? 'true' : 'false') : $request->border_width; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->border_dash_style)) { - $queryParamName = lcfirst('BorderDashStyle'); - $queryParamValue = is_bool($request->border_dash_style) ? ($request->border_dash_style ? 'true' : 'false') : $request->border_dash_style; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->border_visible)) { - $queryParamName = lcfirst('BorderVisible'); - $queryParamValue = is_bool($request->border_visible) ? ($request->border_visible ? 'true' : 'false') : $request->border_visible; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->enable_checksum)) { - $queryParamName = lcfirst('EnableChecksum'); - $queryParamValue = is_bool($request->enable_checksum) ? ($request->enable_checksum ? 'true' : 'false') : $request->enable_checksum; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->enable_escape)) { - $queryParamName = lcfirst('EnableEscape'); - $queryParamValue = is_bool($request->enable_escape) ? ($request->enable_escape ? 'true' : 'false') : $request->enable_escape; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->filled_bars)) { - $queryParamName = lcfirst('FilledBars'); - $queryParamValue = is_bool($request->filled_bars) ? ($request->filled_bars ? 'true' : 'false') : $request->filled_bars; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->always_show_checksum)) { - $queryParamName = lcfirst('AlwaysShowChecksum'); - $queryParamValue = is_bool($request->always_show_checksum) ? ($request->always_show_checksum ? 'true' : 'false') : $request->always_show_checksum; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->wide_narrow_ratio)) { - $queryParamName = lcfirst('WideNarrowRatio'); - $queryParamValue = is_bool($request->wide_narrow_ratio) ? ($request->wide_narrow_ratio ? 'true' : 'false') : $request->wide_narrow_ratio; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->validate_text)) { - $queryParamName = lcfirst('ValidateText'); - $queryParamValue = is_bool($request->validate_text) ? ($request->validate_text ? 'true' : 'false') : $request->validate_text; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->supplement_data)) { - $queryParamName = lcfirst('SupplementData'); - $queryParamValue = is_bool($request->supplement_data) ? ($request->supplement_data ? 'true' : 'false') : $request->supplement_data; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->supplement_space)) { - $queryParamName = lcfirst('SupplementSpace'); - $queryParamValue = is_bool($request->supplement_space) ? ($request->supplement_space ? 'true' : 'false') : $request->supplement_space; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->bar_width_reduction)) { - $queryParamName = lcfirst('BarWidthReduction'); - $queryParamValue = is_bool($request->bar_width_reduction) ? ($request->bar_width_reduction ? 'true' : 'false') : $request->bar_width_reduction; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->use_anti_alias)) { - $queryParamName = lcfirst('UseAntiAlias'); - $queryParamValue = is_bool($request->use_anti_alias) ? ($request->use_anti_alias ? 'true' : 'false') : $request->use_anti_alias; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->format)) { - $queryParamName = lcfirst('format'); - $queryParamValue = is_bool($request->format) ? ($request->format ? 'true' : 'false') : $request->format; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - - $resourcePath = $this->_parseURL($resourcePath, $queryParams); - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['image/png', 'image/bmp', 'image/gif', 'image/jpeg', 'image/svg+xml', 'image/tiff'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['image/png', 'image/bmp', 'image/gif', 'image/jpeg', 'image/svg+xml', 'image/tiff'], - ['application/json'] - ); - } - - // for model (json/xml) - - if (!$this->config->getAccessToken()) { - $this->_requestToken(); - } - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['x-aspose-client'] = $this->config->getUserAgent(); - } - - $defaultHeaders['x-aspose-client-version'] = $this->config->getClientVersion(); - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $req = new Request( - 'GET', - $this->config->getHost() . $resourcePath, - $headers, - $httpBody - ); - if ($this->config->getDebug()) { - $this->_writeRequestLog('GET', $this->config->getHost() . $resourcePath, $headers, $httpBody); - } - - return $req; - } - - /** - * Operation getBarcodeRecognize - * - * Recognize barcode from a file on server. - * - * @param Requests\GetBarcodeRecognizeRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return \Aspose\BarCode\Model\BarcodeResponseList - */ - public function getBarcodeRecognize(Requests\GetBarcodeRecognizeRequest $request) - { - try { - list($response) = $this->getBarcodeRecognizeWithHttpInfo($request); - return $response; - } catch (RepeatRequestException $e) { - list($response) = $this->getBarcodeRecognizeWithHttpInfo($request); - return $response; - } - } - - /** - * Operation getBarcodeRecognizeWithHttpInfo - * - * Recognize barcode from a file on server. - * - * @param Requests\GetBarcodeRecognizeRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return array of \Aspose\BarCode\Model\BarcodeResponseList, HTTP status code, HTTP response headers (array of strings) - */ - public function getBarcodeRecognizeWithHttpInfo(Requests\GetBarcodeRecognizeRequest $request) - { - $returnType = '\Aspose\BarCode\Model\BarcodeResponseList'; - $request = $this->GetBarcodeRecognizeRequest($request); - - try { - $options = $this->_createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - if ($statusCode === 401) { - $this->_requestToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody()); - } - - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - if ($this->config->getDebug()) { - $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\BarcodeResponseList', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation getBarcodeRecognizeAsync - * - * Recognize barcode from a file on server. - * - * @param Requests\GetBarcodeRecognizeRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getBarcodeRecognizeAsync(Requests\GetBarcodeRecognizeRequest $request) - { - return $this->getBarcodeRecognizeAsyncWithHttpInfo($request) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation getBarcodeRecognizeAsyncWithHttpInfo - * - * Recognize barcode from a file on server. - * - * @param Requests\GetBarcodeRecognizeRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getBarcodeRecognizeAsyncWithHttpInfo(Requests\GetBarcodeRecognizeRequest $request) - { - $returnType = '\Aspose\BarCode\Model\BarcodeResponseList'; - $request = $this->GetBarcodeRecognizeRequest($request); - - return $this->client - ->sendAsync($request, $this->_createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - if ($this->config->getDebug()) { - $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - - if ($exception instanceof RepeatRequestException) { - //$this->_refreshToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException( - sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'getBarcodeRecognize' - * - * @param Requests\GetBarcodeRecognizeRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function GetBarcodeRecognizeRequest(Requests\GetBarcodeRecognizeRequest $request) - { - // verify the required parameter 'name' is set - if (!isset($request->name)) { - throw new InvalidArgumentException('Missing the required parameter $name when calling getBarcodeRecognize'); - } - - $resourcePath = '/barcode/{name}/recognize'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - if (isset($request->name)) { - $localName = lcfirst('name'); - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->name), $resourcePath); - } - if (isset($request->type)) { - $queryParamName = lcfirst('Type'); - $queryParamValue = is_bool($request->type) ? ($request->type ? 'true' : 'false') : $request->type; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (is_array($request->types)) { - $queryParamName = lcfirst('Types'); - $queryParams[$queryParamName] = $request->types; - } - if (isset($request->checksum_validation)) { - $queryParamName = lcfirst('ChecksumValidation'); - $queryParamValue = is_bool($request->checksum_validation) ? ($request->checksum_validation ? 'true' : 'false') : $request->checksum_validation; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->detect_encoding)) { - $queryParamName = lcfirst('DetectEncoding'); - $queryParamValue = is_bool($request->detect_encoding) ? ($request->detect_encoding ? 'true' : 'false') : $request->detect_encoding; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->preset)) { - $queryParamName = lcfirst('Preset'); - $queryParamValue = is_bool($request->preset) ? ($request->preset ? 'true' : 'false') : $request->preset; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->rect_x)) { - $queryParamName = lcfirst('RectX'); - $queryParamValue = is_bool($request->rect_x) ? ($request->rect_x ? 'true' : 'false') : $request->rect_x; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->rect_y)) { - $queryParamName = lcfirst('RectY'); - $queryParamValue = is_bool($request->rect_y) ? ($request->rect_y ? 'true' : 'false') : $request->rect_y; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->rect_width)) { - $queryParamName = lcfirst('RectWidth'); - $queryParamValue = is_bool($request->rect_width) ? ($request->rect_width ? 'true' : 'false') : $request->rect_width; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->rect_height)) { - $queryParamName = lcfirst('RectHeight'); - $queryParamValue = is_bool($request->rect_height) ? ($request->rect_height ? 'true' : 'false') : $request->rect_height; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->strip_fnc)) { - $queryParamName = lcfirst('StripFNC'); - $queryParamValue = is_bool($request->strip_fnc) ? ($request->strip_fnc ? 'true' : 'false') : $request->strip_fnc; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->timeout)) { - $queryParamName = lcfirst('Timeout'); - $queryParamValue = is_bool($request->timeout) ? ($request->timeout ? 'true' : 'false') : $request->timeout; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->median_smoothing_window_size)) { - $queryParamName = lcfirst('MedianSmoothingWindowSize'); - $queryParamValue = is_bool($request->median_smoothing_window_size) ? ($request->median_smoothing_window_size ? 'true' : 'false') : $request->median_smoothing_window_size; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_median_smoothing)) { - $queryParamName = lcfirst('AllowMedianSmoothing'); - $queryParamValue = is_bool($request->allow_median_smoothing) ? ($request->allow_median_smoothing ? 'true' : 'false') : $request->allow_median_smoothing; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_complex_background)) { - $queryParamName = lcfirst('AllowComplexBackground'); - $queryParamValue = is_bool($request->allow_complex_background) ? ($request->allow_complex_background ? 'true' : 'false') : $request->allow_complex_background; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_datamatrix_industrial_barcodes)) { - $queryParamName = lcfirst('AllowDatamatrixIndustrialBarcodes'); - $queryParamValue = is_bool($request->allow_datamatrix_industrial_barcodes) ? ($request->allow_datamatrix_industrial_barcodes ? 'true' : 'false') : $request->allow_datamatrix_industrial_barcodes; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_decreased_image)) { - $queryParamName = lcfirst('AllowDecreasedImage'); - $queryParamValue = is_bool($request->allow_decreased_image) ? ($request->allow_decreased_image ? 'true' : 'false') : $request->allow_decreased_image; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_detect_scan_gap)) { - $queryParamName = lcfirst('AllowDetectScanGap'); - $queryParamValue = is_bool($request->allow_detect_scan_gap) ? ($request->allow_detect_scan_gap ? 'true' : 'false') : $request->allow_detect_scan_gap; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_incorrect_barcodes)) { - $queryParamName = lcfirst('AllowIncorrectBarcodes'); - $queryParamValue = is_bool($request->allow_incorrect_barcodes) ? ($request->allow_incorrect_barcodes ? 'true' : 'false') : $request->allow_incorrect_barcodes; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_invert_image)) { - $queryParamName = lcfirst('AllowInvertImage'); - $queryParamValue = is_bool($request->allow_invert_image) ? ($request->allow_invert_image ? 'true' : 'false') : $request->allow_invert_image; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_micro_white_spots_removing)) { - $queryParamName = lcfirst('AllowMicroWhiteSpotsRemoving'); - $queryParamValue = is_bool($request->allow_micro_white_spots_removing) ? ($request->allow_micro_white_spots_removing ? 'true' : 'false') : $request->allow_micro_white_spots_removing; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_one_d_fast_barcodes_detector)) { - $queryParamName = lcfirst('AllowOneDFastBarcodesDetector'); - $queryParamValue = is_bool($request->allow_one_d_fast_barcodes_detector) ? ($request->allow_one_d_fast_barcodes_detector ? 'true' : 'false') : $request->allow_one_d_fast_barcodes_detector; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_one_d_wiped_bars_restoration)) { - $queryParamName = lcfirst('AllowOneDWipedBarsRestoration'); - $queryParamValue = is_bool($request->allow_one_d_wiped_bars_restoration) ? ($request->allow_one_d_wiped_bars_restoration ? 'true' : 'false') : $request->allow_one_d_wiped_bars_restoration; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_qr_micro_qr_restoration)) { - $queryParamName = lcfirst('AllowQRMicroQrRestoration'); - $queryParamValue = is_bool($request->allow_qr_micro_qr_restoration) ? ($request->allow_qr_micro_qr_restoration ? 'true' : 'false') : $request->allow_qr_micro_qr_restoration; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_regular_image)) { - $queryParamName = lcfirst('AllowRegularImage'); - $queryParamValue = is_bool($request->allow_regular_image) ? ($request->allow_regular_image ? 'true' : 'false') : $request->allow_regular_image; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_salt_and_pepper_filtering)) { - $queryParamName = lcfirst('AllowSaltAndPepperFiltering'); - $queryParamValue = is_bool($request->allow_salt_and_pepper_filtering) ? ($request->allow_salt_and_pepper_filtering ? 'true' : 'false') : $request->allow_salt_and_pepper_filtering; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_white_spots_removing)) { - $queryParamName = lcfirst('AllowWhiteSpotsRemoving'); - $queryParamValue = is_bool($request->allow_white_spots_removing) ? ($request->allow_white_spots_removing ? 'true' : 'false') : $request->allow_white_spots_removing; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->check_more1_d_variants)) { - $queryParamName = lcfirst('CheckMore1DVariants'); - $queryParamValue = is_bool($request->check_more1_d_variants) ? ($request->check_more1_d_variants ? 'true' : 'false') : $request->check_more1_d_variants; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->fast_scan_only)) { - $queryParamName = lcfirst('FastScanOnly'); - $queryParamValue = is_bool($request->fast_scan_only) ? ($request->fast_scan_only ? 'true' : 'false') : $request->fast_scan_only; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_additional_restorations)) { - $queryParamName = lcfirst('AllowAdditionalRestorations'); - $queryParamValue = is_bool($request->allow_additional_restorations) ? ($request->allow_additional_restorations ? 'true' : 'false') : $request->allow_additional_restorations; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->region_likelihood_threshold_percent)) { - $queryParamName = lcfirst('RegionLikelihoodThresholdPercent'); - $queryParamValue = is_bool($request->region_likelihood_threshold_percent) ? ($request->region_likelihood_threshold_percent ? 'true' : 'false') : $request->region_likelihood_threshold_percent; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (is_array($request->scan_window_sizes)) { - $queryParamName = lcfirst('ScanWindowSizes'); - $queryParams[$queryParamName] = $request->scan_window_sizes; - } - if (isset($request->similarity)) { - $queryParamName = lcfirst('Similarity'); - $queryParamValue = is_bool($request->similarity) ? ($request->similarity ? 'true' : 'false') : $request->similarity; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->skip_diagonal_search)) { - $queryParamName = lcfirst('SkipDiagonalSearch'); - $queryParamValue = is_bool($request->skip_diagonal_search) ? ($request->skip_diagonal_search ? 'true' : 'false') : $request->skip_diagonal_search; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->read_tiny_barcodes)) { - $queryParamName = lcfirst('ReadTinyBarcodes'); - $queryParamValue = is_bool($request->read_tiny_barcodes) ? ($request->read_tiny_barcodes ? 'true' : 'false') : $request->read_tiny_barcodes; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->australian_post_encoding_table)) { - $queryParamName = lcfirst('AustralianPostEncodingTable'); - $queryParamValue = is_bool($request->australian_post_encoding_table) ? ($request->australian_post_encoding_table ? 'true' : 'false') : $request->australian_post_encoding_table; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->ignore_ending_filling_patterns_for_c_table)) { - $queryParamName = lcfirst('IgnoreEndingFillingPatternsForCTable'); - $queryParamValue = is_bool($request->ignore_ending_filling_patterns_for_c_table) ? ($request->ignore_ending_filling_patterns_for_c_table ? 'true' : 'false') : $request->ignore_ending_filling_patterns_for_c_table; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->storage)) { - $queryParamName = lcfirst('storage'); - $queryParamValue = is_bool($request->storage) ? ($request->storage ? 'true' : 'false') : $request->storage; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->folder)) { - $queryParamName = lcfirst('folder'); - $queryParamValue = is_bool($request->folder) ? ($request->folder ? 'true' : 'false') : $request->folder; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - - $resourcePath = $this->_parseURL($resourcePath, $queryParams); - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } - - // for model (json/xml) - - if (!$this->config->getAccessToken()) { - $this->_requestToken(); - } - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['x-aspose-client'] = $this->config->getUserAgent(); - } - - $defaultHeaders['x-aspose-client-version'] = $this->config->getClientVersion(); - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $req = new Request( - 'GET', - $this->config->getHost() . $resourcePath, - $headers, - $httpBody - ); - if ($this->config->getDebug()) { - $this->_writeRequestLog('GET', $this->config->getHost() . $resourcePath, $headers, $httpBody); - } - - return $req; - } - - /** - * Operation postBarcodeRecognizeFromUrlOrContent - * - * Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image with content-type \"application/octet-stream\". An image can also be passed as a form field. - * - * @param Requests\PostBarcodeRecognizeFromUrlOrContentRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return \Aspose\BarCode\Model\BarcodeResponseList - */ - public function postBarcodeRecognizeFromUrlOrContent(Requests\PostBarcodeRecognizeFromUrlOrContentRequest $request) - { - try { - list($response) = $this->postBarcodeRecognizeFromUrlOrContentWithHttpInfo($request); - return $response; - } catch (RepeatRequestException $e) { - list($response) = $this->postBarcodeRecognizeFromUrlOrContentWithHttpInfo($request); - return $response; - } - } - - /** - * Operation postBarcodeRecognizeFromUrlOrContentWithHttpInfo - * - * Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image with content-type \"application/octet-stream\". An image can also be passed as a form field. - * - * @param Requests\PostBarcodeRecognizeFromUrlOrContentRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return array of \Aspose\BarCode\Model\BarcodeResponseList, HTTP status code, HTTP response headers (array of strings) - */ - public function postBarcodeRecognizeFromUrlOrContentWithHttpInfo(Requests\PostBarcodeRecognizeFromUrlOrContentRequest $request) - { - $returnType = '\Aspose\BarCode\Model\BarcodeResponseList'; - $request = $this->PostBarcodeRecognizeFromUrlOrContentRequest($request); - - try { - $options = $this->_createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - if ($statusCode === 401) { - $this->_requestToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody()); - } - - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - if ($this->config->getDebug()) { - $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\BarcodeResponseList', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation postBarcodeRecognizeFromUrlOrContentAsync - * - * Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image with content-type \"application/octet-stream\". An image can also be passed as a form field. - * - * @param Requests\PostBarcodeRecognizeFromUrlOrContentRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function postBarcodeRecognizeFromUrlOrContentAsync(Requests\PostBarcodeRecognizeFromUrlOrContentRequest $request) - { - return $this->postBarcodeRecognizeFromUrlOrContentAsyncWithHttpInfo($request) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation postBarcodeRecognizeFromUrlOrContentAsyncWithHttpInfo - * - * Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image with content-type \"application/octet-stream\". An image can also be passed as a form field. - * - * @param Requests\PostBarcodeRecognizeFromUrlOrContentRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function postBarcodeRecognizeFromUrlOrContentAsyncWithHttpInfo(Requests\PostBarcodeRecognizeFromUrlOrContentRequest $request) - { - $returnType = '\Aspose\BarCode\Model\BarcodeResponseList'; - $request = $this->PostBarcodeRecognizeFromUrlOrContentRequest($request); - - return $this->client - ->sendAsync($request, $this->_createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - if ($this->config->getDebug()) { - $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - - if ($exception instanceof RepeatRequestException) { - //$this->_refreshToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException( - sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'postBarcodeRecognizeFromUrlOrContent' - * - * @param Requests\PostBarcodeRecognizeFromUrlOrContentRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function PostBarcodeRecognizeFromUrlOrContentRequest(Requests\PostBarcodeRecognizeFromUrlOrContentRequest $request) - { - - $resourcePath = '/barcode/recognize'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - if (isset($request->type)) { - $queryParamName = lcfirst('Type'); - $queryParamValue = is_bool($request->type) ? ($request->type ? 'true' : 'false') : $request->type; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (is_array($request->types)) { - $queryParamName = lcfirst('Types'); - $queryParams[$queryParamName] = $request->types; - } - if (isset($request->checksum_validation)) { - $queryParamName = lcfirst('ChecksumValidation'); - $queryParamValue = is_bool($request->checksum_validation) ? ($request->checksum_validation ? 'true' : 'false') : $request->checksum_validation; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->detect_encoding)) { - $queryParamName = lcfirst('DetectEncoding'); - $queryParamValue = is_bool($request->detect_encoding) ? ($request->detect_encoding ? 'true' : 'false') : $request->detect_encoding; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->preset)) { - $queryParamName = lcfirst('Preset'); - $queryParamValue = is_bool($request->preset) ? ($request->preset ? 'true' : 'false') : $request->preset; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->rect_x)) { - $queryParamName = lcfirst('RectX'); - $queryParamValue = is_bool($request->rect_x) ? ($request->rect_x ? 'true' : 'false') : $request->rect_x; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->rect_y)) { - $queryParamName = lcfirst('RectY'); - $queryParamValue = is_bool($request->rect_y) ? ($request->rect_y ? 'true' : 'false') : $request->rect_y; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->rect_width)) { - $queryParamName = lcfirst('RectWidth'); - $queryParamValue = is_bool($request->rect_width) ? ($request->rect_width ? 'true' : 'false') : $request->rect_width; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->rect_height)) { - $queryParamName = lcfirst('RectHeight'); - $queryParamValue = is_bool($request->rect_height) ? ($request->rect_height ? 'true' : 'false') : $request->rect_height; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->strip_fnc)) { - $queryParamName = lcfirst('StripFNC'); - $queryParamValue = is_bool($request->strip_fnc) ? ($request->strip_fnc ? 'true' : 'false') : $request->strip_fnc; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->timeout)) { - $queryParamName = lcfirst('Timeout'); - $queryParamValue = is_bool($request->timeout) ? ($request->timeout ? 'true' : 'false') : $request->timeout; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->median_smoothing_window_size)) { - $queryParamName = lcfirst('MedianSmoothingWindowSize'); - $queryParamValue = is_bool($request->median_smoothing_window_size) ? ($request->median_smoothing_window_size ? 'true' : 'false') : $request->median_smoothing_window_size; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_median_smoothing)) { - $queryParamName = lcfirst('AllowMedianSmoothing'); - $queryParamValue = is_bool($request->allow_median_smoothing) ? ($request->allow_median_smoothing ? 'true' : 'false') : $request->allow_median_smoothing; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_complex_background)) { - $queryParamName = lcfirst('AllowComplexBackground'); - $queryParamValue = is_bool($request->allow_complex_background) ? ($request->allow_complex_background ? 'true' : 'false') : $request->allow_complex_background; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_datamatrix_industrial_barcodes)) { - $queryParamName = lcfirst('AllowDatamatrixIndustrialBarcodes'); - $queryParamValue = is_bool($request->allow_datamatrix_industrial_barcodes) ? ($request->allow_datamatrix_industrial_barcodes ? 'true' : 'false') : $request->allow_datamatrix_industrial_barcodes; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_decreased_image)) { - $queryParamName = lcfirst('AllowDecreasedImage'); - $queryParamValue = is_bool($request->allow_decreased_image) ? ($request->allow_decreased_image ? 'true' : 'false') : $request->allow_decreased_image; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_detect_scan_gap)) { - $queryParamName = lcfirst('AllowDetectScanGap'); - $queryParamValue = is_bool($request->allow_detect_scan_gap) ? ($request->allow_detect_scan_gap ? 'true' : 'false') : $request->allow_detect_scan_gap; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_incorrect_barcodes)) { - $queryParamName = lcfirst('AllowIncorrectBarcodes'); - $queryParamValue = is_bool($request->allow_incorrect_barcodes) ? ($request->allow_incorrect_barcodes ? 'true' : 'false') : $request->allow_incorrect_barcodes; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_invert_image)) { - $queryParamName = lcfirst('AllowInvertImage'); - $queryParamValue = is_bool($request->allow_invert_image) ? ($request->allow_invert_image ? 'true' : 'false') : $request->allow_invert_image; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_micro_white_spots_removing)) { - $queryParamName = lcfirst('AllowMicroWhiteSpotsRemoving'); - $queryParamValue = is_bool($request->allow_micro_white_spots_removing) ? ($request->allow_micro_white_spots_removing ? 'true' : 'false') : $request->allow_micro_white_spots_removing; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_one_d_fast_barcodes_detector)) { - $queryParamName = lcfirst('AllowOneDFastBarcodesDetector'); - $queryParamValue = is_bool($request->allow_one_d_fast_barcodes_detector) ? ($request->allow_one_d_fast_barcodes_detector ? 'true' : 'false') : $request->allow_one_d_fast_barcodes_detector; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_one_d_wiped_bars_restoration)) { - $queryParamName = lcfirst('AllowOneDWipedBarsRestoration'); - $queryParamValue = is_bool($request->allow_one_d_wiped_bars_restoration) ? ($request->allow_one_d_wiped_bars_restoration ? 'true' : 'false') : $request->allow_one_d_wiped_bars_restoration; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_qr_micro_qr_restoration)) { - $queryParamName = lcfirst('AllowQRMicroQrRestoration'); - $queryParamValue = is_bool($request->allow_qr_micro_qr_restoration) ? ($request->allow_qr_micro_qr_restoration ? 'true' : 'false') : $request->allow_qr_micro_qr_restoration; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_regular_image)) { - $queryParamName = lcfirst('AllowRegularImage'); - $queryParamValue = is_bool($request->allow_regular_image) ? ($request->allow_regular_image ? 'true' : 'false') : $request->allow_regular_image; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_salt_and_pepper_filtering)) { - $queryParamName = lcfirst('AllowSaltAndPepperFiltering'); - $queryParamValue = is_bool($request->allow_salt_and_pepper_filtering) ? ($request->allow_salt_and_pepper_filtering ? 'true' : 'false') : $request->allow_salt_and_pepper_filtering; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_white_spots_removing)) { - $queryParamName = lcfirst('AllowWhiteSpotsRemoving'); - $queryParamValue = is_bool($request->allow_white_spots_removing) ? ($request->allow_white_spots_removing ? 'true' : 'false') : $request->allow_white_spots_removing; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->check_more1_d_variants)) { - $queryParamName = lcfirst('CheckMore1DVariants'); - $queryParamValue = is_bool($request->check_more1_d_variants) ? ($request->check_more1_d_variants ? 'true' : 'false') : $request->check_more1_d_variants; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->fast_scan_only)) { - $queryParamName = lcfirst('FastScanOnly'); - $queryParamValue = is_bool($request->fast_scan_only) ? ($request->fast_scan_only ? 'true' : 'false') : $request->fast_scan_only; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->allow_additional_restorations)) { - $queryParamName = lcfirst('AllowAdditionalRestorations'); - $queryParamValue = is_bool($request->allow_additional_restorations) ? ($request->allow_additional_restorations ? 'true' : 'false') : $request->allow_additional_restorations; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->region_likelihood_threshold_percent)) { - $queryParamName = lcfirst('RegionLikelihoodThresholdPercent'); - $queryParamValue = is_bool($request->region_likelihood_threshold_percent) ? ($request->region_likelihood_threshold_percent ? 'true' : 'false') : $request->region_likelihood_threshold_percent; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (is_array($request->scan_window_sizes)) { - $queryParamName = lcfirst('ScanWindowSizes'); - $queryParams[$queryParamName] = $request->scan_window_sizes; - } - if (isset($request->similarity)) { - $queryParamName = lcfirst('Similarity'); - $queryParamValue = is_bool($request->similarity) ? ($request->similarity ? 'true' : 'false') : $request->similarity; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->skip_diagonal_search)) { - $queryParamName = lcfirst('SkipDiagonalSearch'); - $queryParamValue = is_bool($request->skip_diagonal_search) ? ($request->skip_diagonal_search ? 'true' : 'false') : $request->skip_diagonal_search; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->read_tiny_barcodes)) { - $queryParamName = lcfirst('ReadTinyBarcodes'); - $queryParamValue = is_bool($request->read_tiny_barcodes) ? ($request->read_tiny_barcodes ? 'true' : 'false') : $request->read_tiny_barcodes; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->australian_post_encoding_table)) { - $queryParamName = lcfirst('AustralianPostEncodingTable'); - $queryParamValue = is_bool($request->australian_post_encoding_table) ? ($request->australian_post_encoding_table ? 'true' : 'false') : $request->australian_post_encoding_table; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->ignore_ending_filling_patterns_for_c_table)) { - $queryParamName = lcfirst('IgnoreEndingFillingPatternsForCTable'); - $queryParamValue = is_bool($request->ignore_ending_filling_patterns_for_c_table) ? ($request->ignore_ending_filling_patterns_for_c_table ? 'true' : 'false') : $request->ignore_ending_filling_patterns_for_c_table; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->url)) { - $queryParamName = lcfirst('url'); - $queryParamValue = is_bool($request->url) ? ($request->url ? 'true' : 'false') : $request->url; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - - $resourcePath = $this->_parseURL($resourcePath, $queryParams); - - // form params - $multipart = true; - $filename = ObjectSerializer::toFormValue($request->image); - $handle = fopen($filename, 'rb'); - $fsize = filesize($filename); - $contents = fread($handle, $fsize); - $fileField = 'image'; - $formParams['image'][] = $contents; - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['multipart/form-data', 'application/x-www-form-urlencoded', 'application/octet-stream'] - ); - } - - // for model (json/xml) - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValues) { - if (is_array($formParamValues)) { - foreach ($formParamValues as $formParamValue) { - if ($formParamName === $fileField) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue, - 'filename' => $filename - ]; - } else { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue, - ]; - } - } - } else { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValues, - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = $formParams['image'][0]; - } - - if (!$this->config->getAccessToken()) { - $this->_requestToken(); - } - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['x-aspose-client'] = $this->config->getUserAgent(); - } - - $defaultHeaders['x-aspose-client-version'] = $this->config->getClientVersion(); - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $req = new Request( - 'POST', - $this->config->getHost() . $resourcePath, - $headers, - $httpBody - ); - if ($this->config->getDebug()) { - $this->_writeRequestLog('POST', $this->config->getHost() . $resourcePath, $headers, $httpBody); - } - - return $req; - } - - /** - * Operation postGenerateMultiple - * - * Generate multiple barcodes and return in response stream - * - * @param Requests\PostGenerateMultipleRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return \SplFileObject - */ - public function postGenerateMultiple(Requests\PostGenerateMultipleRequest $request) - { - try { - list($response) = $this->postGenerateMultipleWithHttpInfo($request); - return $response; - } catch (RepeatRequestException $e) { - list($response) = $this->postGenerateMultipleWithHttpInfo($request); - return $response; - } - } - - /** - * Operation postGenerateMultipleWithHttpInfo - * - * Generate multiple barcodes and return in response stream - * - * @param Requests\PostGenerateMultipleRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) - */ - public function postGenerateMultipleWithHttpInfo(Requests\PostGenerateMultipleRequest $request) - { - $returnType = '\SplFileObject'; - $request = $this->PostGenerateMultipleRequest($request); - - try { - $options = $this->_createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - if ($statusCode === 401) { - $this->_requestToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody()); - } - - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - if ($this->config->getDebug()) { - $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\SplFileObject', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation postGenerateMultipleAsync - * - * Generate multiple barcodes and return in response stream - * - * @param Requests\PostGenerateMultipleRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function postGenerateMultipleAsync(Requests\PostGenerateMultipleRequest $request) - { - return $this->postGenerateMultipleAsyncWithHttpInfo($request) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation postGenerateMultipleAsyncWithHttpInfo - * - * Generate multiple barcodes and return in response stream - * - * @param Requests\PostGenerateMultipleRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function postGenerateMultipleAsyncWithHttpInfo(Requests\PostGenerateMultipleRequest $request) - { - $returnType = '\SplFileObject'; - $request = $this->PostGenerateMultipleRequest($request); - - return $this->client - ->sendAsync($request, $this->_createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - if ($this->config->getDebug()) { - $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - - if ($exception instanceof RepeatRequestException) { - //$this->_refreshToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException( - sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'postGenerateMultiple' - * - * @param Requests\PostGenerateMultipleRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function PostGenerateMultipleRequest(Requests\PostGenerateMultipleRequest $request) - { - // verify the required parameter 'generator_params_list' is set - if (!isset($request->generator_params_list)) { - throw new InvalidArgumentException('Missing the required parameter $generator_params_list when calling postGenerateMultiple'); - } - - $resourcePath = '/barcode/generateMultiple'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - if (isset($request->format)) { - $queryParamName = lcfirst('format'); - $queryParamValue = is_bool($request->format) ? ($request->format ? 'true' : 'false') : $request->format; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - - $resourcePath = $this->_parseURL($resourcePath, $queryParams); - - // body params - $_tempBody = null; - if (isset($request->generator_params_list)) { - if (is_string($request->generator_params_list)) { - $_tempBody = "\"" . $request->generator_params_list . "\""; - } else { - $_tempBody = $request->generator_params_list; - } - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['image/png', 'image/bmp', 'image/gif', 'image/jpeg', 'image/svg+xml', 'image/tiff'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['image/png', 'image/bmp', 'image/gif', 'image/jpeg', 'image/svg+xml', 'image/tiff'], - ['application/json', 'application/xml'] - ); - } - - // for model (json/xml) - // $_tempBody is the method argument, if present - $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - - if (!$this->config->getAccessToken()) { - $this->_requestToken(); - } - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['x-aspose-client'] = $this->config->getUserAgent(); - } - - $defaultHeaders['x-aspose-client-version'] = $this->config->getClientVersion(); - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $req = new Request( - 'POST', - $this->config->getHost() . $resourcePath, - $headers, - $httpBody - ); - if ($this->config->getDebug()) { - $this->_writeRequestLog('POST', $this->config->getHost() . $resourcePath, $headers, $httpBody); - } - - return $req; - } - - /** - * Operation putBarcodeGenerateFile - * - * Generate barcode and save on server (from query params or from file with json or xml content) - * - * @param Requests\PutBarcodeGenerateFileRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return \Aspose\BarCode\Model\ResultImageInfo - */ - public function putBarcodeGenerateFile(Requests\PutBarcodeGenerateFileRequest $request) - { - try { - list($response) = $this->putBarcodeGenerateFileWithHttpInfo($request); - return $response; - } catch (RepeatRequestException $e) { - list($response) = $this->putBarcodeGenerateFileWithHttpInfo($request); - return $response; - } - } - - /** - * Operation putBarcodeGenerateFileWithHttpInfo - * - * Generate barcode and save on server (from query params or from file with json or xml content) - * - * @param Requests\PutBarcodeGenerateFileRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return array of \Aspose\BarCode\Model\ResultImageInfo, HTTP status code, HTTP response headers (array of strings) - */ - public function putBarcodeGenerateFileWithHttpInfo(Requests\PutBarcodeGenerateFileRequest $request) - { - $returnType = '\Aspose\BarCode\Model\ResultImageInfo'; - $request = $this->PutBarcodeGenerateFileRequest($request); - - try { - $options = $this->_createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - if ($statusCode === 401) { - $this->_requestToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody()); - } - - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - if ($this->config->getDebug()) { - $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ResultImageInfo', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ApiErrorResponse', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation putBarcodeGenerateFileAsync - * - * Generate barcode and save on server (from query params or from file with json or xml content) - * - * @param Requests\PutBarcodeGenerateFileRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function putBarcodeGenerateFileAsync(Requests\PutBarcodeGenerateFileRequest $request) - { - return $this->putBarcodeGenerateFileAsyncWithHttpInfo($request) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation putBarcodeGenerateFileAsyncWithHttpInfo - * - * Generate barcode and save on server (from query params or from file with json or xml content) - * - * @param Requests\PutBarcodeGenerateFileRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function putBarcodeGenerateFileAsyncWithHttpInfo(Requests\PutBarcodeGenerateFileRequest $request) - { - $returnType = '\Aspose\BarCode\Model\ResultImageInfo'; - $request = $this->PutBarcodeGenerateFileRequest($request); - - return $this->client - ->sendAsync($request, $this->_createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - if ($this->config->getDebug()) { - $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - - if ($exception instanceof RepeatRequestException) { - //$this->_refreshToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException( - sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'putBarcodeGenerateFile' - * - * @param Requests\PutBarcodeGenerateFileRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function PutBarcodeGenerateFileRequest(Requests\PutBarcodeGenerateFileRequest $request) - { - // verify the required parameter 'name' is set - if (!isset($request->name)) { - throw new InvalidArgumentException('Missing the required parameter $name when calling putBarcodeGenerateFile'); - } - // verify the required parameter 'type' is set - if (!isset($request->type)) { - throw new InvalidArgumentException('Missing the required parameter $type when calling putBarcodeGenerateFile'); - } - // verify the required parameter 'text' is set - if (!isset($request->text)) { - throw new InvalidArgumentException('Missing the required parameter $text when calling putBarcodeGenerateFile'); - } - - $resourcePath = '/barcode/{name}/generate'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - if (isset($request->name)) { - $localName = lcfirst('name'); - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->name), $resourcePath); - } - if (isset($request->type)) { - $queryParamName = lcfirst('Type'); - $queryParamValue = is_bool($request->type) ? ($request->type ? 'true' : 'false') : $request->type; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->text)) { - $queryParamName = lcfirst('Text'); - $queryParamValue = is_bool($request->text) ? ($request->text ? 'true' : 'false') : $request->text; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->two_d_display_text)) { - $queryParamName = lcfirst('TwoDDisplayText'); - $queryParamValue = is_bool($request->two_d_display_text) ? ($request->two_d_display_text ? 'true' : 'false') : $request->two_d_display_text; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->text_location)) { - $queryParamName = lcfirst('TextLocation'); - $queryParamValue = is_bool($request->text_location) ? ($request->text_location ? 'true' : 'false') : $request->text_location; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->text_alignment)) { - $queryParamName = lcfirst('TextAlignment'); - $queryParamValue = is_bool($request->text_alignment) ? ($request->text_alignment ? 'true' : 'false') : $request->text_alignment; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->text_color)) { - $queryParamName = lcfirst('TextColor'); - $queryParamValue = is_bool($request->text_color) ? ($request->text_color ? 'true' : 'false') : $request->text_color; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->no_wrap)) { - $queryParamName = lcfirst('NoWrap'); - $queryParamValue = is_bool($request->no_wrap) ? ($request->no_wrap ? 'true' : 'false') : $request->no_wrap; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->resolution)) { - $queryParamName = lcfirst('Resolution'); - $queryParamValue = is_bool($request->resolution) ? ($request->resolution ? 'true' : 'false') : $request->resolution; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->resolution_x)) { - $queryParamName = lcfirst('ResolutionX'); - $queryParamValue = is_bool($request->resolution_x) ? ($request->resolution_x ? 'true' : 'false') : $request->resolution_x; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->resolution_y)) { - $queryParamName = lcfirst('ResolutionY'); - $queryParamValue = is_bool($request->resolution_y) ? ($request->resolution_y ? 'true' : 'false') : $request->resolution_y; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->dimension_x)) { - $queryParamName = lcfirst('DimensionX'); - $queryParamValue = is_bool($request->dimension_x) ? ($request->dimension_x ? 'true' : 'false') : $request->dimension_x; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->text_space)) { - $queryParamName = lcfirst('TextSpace'); - $queryParamValue = is_bool($request->text_space) ? ($request->text_space ? 'true' : 'false') : $request->text_space; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->units)) { - $queryParamName = lcfirst('Units'); - $queryParamValue = is_bool($request->units) ? ($request->units ? 'true' : 'false') : $request->units; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->size_mode)) { - $queryParamName = lcfirst('SizeMode'); - $queryParamValue = is_bool($request->size_mode) ? ($request->size_mode ? 'true' : 'false') : $request->size_mode; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->bar_height)) { - $queryParamName = lcfirst('BarHeight'); - $queryParamValue = is_bool($request->bar_height) ? ($request->bar_height ? 'true' : 'false') : $request->bar_height; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->image_height)) { - $queryParamName = lcfirst('ImageHeight'); - $queryParamValue = is_bool($request->image_height) ? ($request->image_height ? 'true' : 'false') : $request->image_height; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->image_width)) { - $queryParamName = lcfirst('ImageWidth'); - $queryParamValue = is_bool($request->image_width) ? ($request->image_width ? 'true' : 'false') : $request->image_width; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->rotation_angle)) { - $queryParamName = lcfirst('RotationAngle'); - $queryParamValue = is_bool($request->rotation_angle) ? ($request->rotation_angle ? 'true' : 'false') : $request->rotation_angle; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->back_color)) { - $queryParamName = lcfirst('BackColor'); - $queryParamValue = is_bool($request->back_color) ? ($request->back_color ? 'true' : 'false') : $request->back_color; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->bar_color)) { - $queryParamName = lcfirst('BarColor'); - $queryParamValue = is_bool($request->bar_color) ? ($request->bar_color ? 'true' : 'false') : $request->bar_color; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->border_color)) { - $queryParamName = lcfirst('BorderColor'); - $queryParamValue = is_bool($request->border_color) ? ($request->border_color ? 'true' : 'false') : $request->border_color; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->border_width)) { - $queryParamName = lcfirst('BorderWidth'); - $queryParamValue = is_bool($request->border_width) ? ($request->border_width ? 'true' : 'false') : $request->border_width; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->border_dash_style)) { - $queryParamName = lcfirst('BorderDashStyle'); - $queryParamValue = is_bool($request->border_dash_style) ? ($request->border_dash_style ? 'true' : 'false') : $request->border_dash_style; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->border_visible)) { - $queryParamName = lcfirst('BorderVisible'); - $queryParamValue = is_bool($request->border_visible) ? ($request->border_visible ? 'true' : 'false') : $request->border_visible; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->enable_checksum)) { - $queryParamName = lcfirst('EnableChecksum'); - $queryParamValue = is_bool($request->enable_checksum) ? ($request->enable_checksum ? 'true' : 'false') : $request->enable_checksum; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->enable_escape)) { - $queryParamName = lcfirst('EnableEscape'); - $queryParamValue = is_bool($request->enable_escape) ? ($request->enable_escape ? 'true' : 'false') : $request->enable_escape; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->filled_bars)) { - $queryParamName = lcfirst('FilledBars'); - $queryParamValue = is_bool($request->filled_bars) ? ($request->filled_bars ? 'true' : 'false') : $request->filled_bars; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->always_show_checksum)) { - $queryParamName = lcfirst('AlwaysShowChecksum'); - $queryParamValue = is_bool($request->always_show_checksum) ? ($request->always_show_checksum ? 'true' : 'false') : $request->always_show_checksum; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->wide_narrow_ratio)) { - $queryParamName = lcfirst('WideNarrowRatio'); - $queryParamValue = is_bool($request->wide_narrow_ratio) ? ($request->wide_narrow_ratio ? 'true' : 'false') : $request->wide_narrow_ratio; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->validate_text)) { - $queryParamName = lcfirst('ValidateText'); - $queryParamValue = is_bool($request->validate_text) ? ($request->validate_text ? 'true' : 'false') : $request->validate_text; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->supplement_data)) { - $queryParamName = lcfirst('SupplementData'); - $queryParamValue = is_bool($request->supplement_data) ? ($request->supplement_data ? 'true' : 'false') : $request->supplement_data; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->supplement_space)) { - $queryParamName = lcfirst('SupplementSpace'); - $queryParamValue = is_bool($request->supplement_space) ? ($request->supplement_space ? 'true' : 'false') : $request->supplement_space; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->bar_width_reduction)) { - $queryParamName = lcfirst('BarWidthReduction'); - $queryParamValue = is_bool($request->bar_width_reduction) ? ($request->bar_width_reduction ? 'true' : 'false') : $request->bar_width_reduction; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->use_anti_alias)) { - $queryParamName = lcfirst('UseAntiAlias'); - $queryParamValue = is_bool($request->use_anti_alias) ? ($request->use_anti_alias ? 'true' : 'false') : $request->use_anti_alias; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->storage)) { - $queryParamName = lcfirst('storage'); - $queryParamValue = is_bool($request->storage) ? ($request->storage ? 'true' : 'false') : $request->storage; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->folder)) { - $queryParamName = lcfirst('folder'); - $queryParamValue = is_bool($request->folder) ? ($request->folder ? 'true' : 'false') : $request->folder; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->format)) { - $queryParamName = lcfirst('format'); - $queryParamValue = is_bool($request->format) ? ($request->format ? 'true' : 'false') : $request->format; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - - $resourcePath = $this->_parseURL($resourcePath, $queryParams); - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['multipart/form-data', 'application/x-www-form-urlencoded', 'application/json', 'application/xml'] - ); - } - - // for model (json/xml) - - if (!$this->config->getAccessToken()) { - $this->_requestToken(); - } - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['x-aspose-client'] = $this->config->getUserAgent(); - } - - $defaultHeaders['x-aspose-client-version'] = $this->config->getClientVersion(); - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $req = new Request( - 'PUT', - $this->config->getHost() . $resourcePath, - $headers, - $httpBody - ); - if ($this->config->getDebug()) { - $this->_writeRequestLog('PUT', $this->config->getHost() . $resourcePath, $headers, $httpBody); - } - - return $req; - } - - /** - * Operation putBarcodeRecognizeFromBody - * - * Recognition of a barcode from file on server with parameters in body. - * - * @param Requests\PutBarcodeRecognizeFromBodyRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return \Aspose\BarCode\Model\BarcodeResponseList - */ - public function putBarcodeRecognizeFromBody(Requests\PutBarcodeRecognizeFromBodyRequest $request) - { - try { - list($response) = $this->putBarcodeRecognizeFromBodyWithHttpInfo($request); - return $response; - } catch (RepeatRequestException $e) { - list($response) = $this->putBarcodeRecognizeFromBodyWithHttpInfo($request); - return $response; - } - } - - /** - * Operation putBarcodeRecognizeFromBodyWithHttpInfo - * - * Recognition of a barcode from file on server with parameters in body. - * - * @param Requests\PutBarcodeRecognizeFromBodyRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return array of \Aspose\BarCode\Model\BarcodeResponseList, HTTP status code, HTTP response headers (array of strings) - */ - public function putBarcodeRecognizeFromBodyWithHttpInfo(Requests\PutBarcodeRecognizeFromBodyRequest $request) - { - $returnType = '\Aspose\BarCode\Model\BarcodeResponseList'; - $request = $this->PutBarcodeRecognizeFromBodyRequest($request); - - try { - $options = $this->_createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - if ($statusCode === 401) { - $this->_requestToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody()); - } - - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - if ($this->config->getDebug()) { - $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\BarcodeResponseList', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation putBarcodeRecognizeFromBodyAsync - * - * Recognition of a barcode from file on server with parameters in body. - * - * @param Requests\PutBarcodeRecognizeFromBodyRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function putBarcodeRecognizeFromBodyAsync(Requests\PutBarcodeRecognizeFromBodyRequest $request) - { - return $this->putBarcodeRecognizeFromBodyAsyncWithHttpInfo($request) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation putBarcodeRecognizeFromBodyAsyncWithHttpInfo - * - * Recognition of a barcode from file on server with parameters in body. - * - * @param Requests\PutBarcodeRecognizeFromBodyRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function putBarcodeRecognizeFromBodyAsyncWithHttpInfo(Requests\PutBarcodeRecognizeFromBodyRequest $request) - { - $returnType = '\Aspose\BarCode\Model\BarcodeResponseList'; - $request = $this->PutBarcodeRecognizeFromBodyRequest($request); - - return $this->client - ->sendAsync($request, $this->_createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - if ($this->config->getDebug()) { - $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - - if ($exception instanceof RepeatRequestException) { - //$this->_refreshToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException( - sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'putBarcodeRecognizeFromBody' - * - * @param Requests\PutBarcodeRecognizeFromBodyRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function PutBarcodeRecognizeFromBodyRequest(Requests\PutBarcodeRecognizeFromBodyRequest $request) - { - // verify the required parameter 'name' is set - if (!isset($request->name)) { - throw new InvalidArgumentException('Missing the required parameter $name when calling putBarcodeRecognizeFromBody'); - } - // verify the required parameter 'reader_params' is set - if (!isset($request->reader_params)) { - throw new InvalidArgumentException('Missing the required parameter $reader_params when calling putBarcodeRecognizeFromBody'); - } - - $resourcePath = '/barcode/{name}/recognize'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - if (isset($request->name)) { - $localName = lcfirst('name'); - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->name), $resourcePath); - } - if (isset($request->type)) { - $queryParamName = lcfirst('type'); - $queryParamValue = is_bool($request->type) ? ($request->type ? 'true' : 'false') : $request->type; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->storage)) { - $queryParamName = lcfirst('storage'); - $queryParamValue = is_bool($request->storage) ? ($request->storage ? 'true' : 'false') : $request->storage; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->folder)) { - $queryParamName = lcfirst('folder'); - $queryParamValue = is_bool($request->folder) ? ($request->folder ? 'true' : 'false') : $request->folder; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - - $resourcePath = $this->_parseURL($resourcePath, $queryParams); - - // body params - $_tempBody = null; - if (isset($request->reader_params)) { - if (is_string($request->reader_params)) { - $_tempBody = "\"" . $request->reader_params . "\""; - } else { - $_tempBody = $request->reader_params; - } - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } - - // for model (json/xml) - // $_tempBody is the method argument, if present - $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - - if (!$this->config->getAccessToken()) { - $this->_requestToken(); - } - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['x-aspose-client'] = $this->config->getUserAgent(); - } - - $defaultHeaders['x-aspose-client-version'] = $this->config->getClientVersion(); - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $req = new Request( - 'PUT', - $this->config->getHost() . $resourcePath, - $headers, - $httpBody - ); - if ($this->config->getDebug()) { - $this->_writeRequestLog('PUT', $this->config->getHost() . $resourcePath, $headers, $httpBody); - } - - return $req; - } - - /** - * Operation putGenerateMultiple - * - * Generate image with multiple barcodes and put new file on server - * - * @param Requests\PutGenerateMultipleRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return \Aspose\BarCode\Model\ResultImageInfo - */ - public function putGenerateMultiple(Requests\PutGenerateMultipleRequest $request) - { - try { - list($response) = $this->putGenerateMultipleWithHttpInfo($request); - return $response; - } catch (RepeatRequestException $e) { - list($response) = $this->putGenerateMultipleWithHttpInfo($request); - return $response; - } - } - - /** - * Operation putGenerateMultipleWithHttpInfo - * - * Generate image with multiple barcodes and put new file on server - * - * @param Requests\PutGenerateMultipleRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return array of \Aspose\BarCode\Model\ResultImageInfo, HTTP status code, HTTP response headers (array of strings) - */ - public function putGenerateMultipleWithHttpInfo(Requests\PutGenerateMultipleRequest $request) - { - $returnType = '\Aspose\BarCode\Model\ResultImageInfo'; - $request = $this->PutGenerateMultipleRequest($request); - - try { - $options = $this->_createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - if ($statusCode === 401) { - $this->_requestToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody()); - } - - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - if ($this->config->getDebug()) { - $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ResultImageInfo', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ApiErrorResponse', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation putGenerateMultipleAsync - * - * Generate image with multiple barcodes and put new file on server - * - * @param Requests\PutGenerateMultipleRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function putGenerateMultipleAsync(Requests\PutGenerateMultipleRequest $request) - { - return $this->putGenerateMultipleAsyncWithHttpInfo($request) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation putGenerateMultipleAsyncWithHttpInfo - * - * Generate image with multiple barcodes and put new file on server - * - * @param Requests\PutGenerateMultipleRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function putGenerateMultipleAsyncWithHttpInfo(Requests\PutGenerateMultipleRequest $request) - { - $returnType = '\Aspose\BarCode\Model\ResultImageInfo'; - $request = $this->PutGenerateMultipleRequest($request); - - return $this->client - ->sendAsync($request, $this->_createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - if ($this->config->getDebug()) { - $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - - if ($exception instanceof RepeatRequestException) { - //$this->_refreshToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException( - sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'putGenerateMultiple' - * - * @param Requests\PutGenerateMultipleRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function PutGenerateMultipleRequest(Requests\PutGenerateMultipleRequest $request) - { - // verify the required parameter 'name' is set - if (!isset($request->name)) { - throw new InvalidArgumentException('Missing the required parameter $name when calling putGenerateMultiple'); - } - // verify the required parameter 'generator_params_list' is set - if (!isset($request->generator_params_list)) { - throw new InvalidArgumentException('Missing the required parameter $generator_params_list when calling putGenerateMultiple'); - } - - $resourcePath = '/barcode/{name}/generateMultiple'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - if (isset($request->name)) { - $localName = lcfirst('name'); - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->name), $resourcePath); - } - if (isset($request->format)) { - $queryParamName = lcfirst('format'); - $queryParamValue = is_bool($request->format) ? ($request->format ? 'true' : 'false') : $request->format; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->folder)) { - $queryParamName = lcfirst('folder'); - $queryParamValue = is_bool($request->folder) ? ($request->folder ? 'true' : 'false') : $request->folder; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->storage)) { - $queryParamName = lcfirst('storage'); - $queryParamValue = is_bool($request->storage) ? ($request->storage ? 'true' : 'false') : $request->storage; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - - $resourcePath = $this->_parseURL($resourcePath, $queryParams); - - // body params - $_tempBody = null; - if (isset($request->generator_params_list)) { - if (is_string($request->generator_params_list)) { - $_tempBody = "\"" . $request->generator_params_list . "\""; - } else { - $_tempBody = $request->generator_params_list; - } - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json', 'application/xml'] - ); - } - - // for model (json/xml) - // $_tempBody is the method argument, if present - $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - - if (!$this->config->getAccessToken()) { - $this->_requestToken(); - } - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['x-aspose-client'] = $this->config->getUserAgent(); - } - - $defaultHeaders['x-aspose-client-version'] = $this->config->getClientVersion(); - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $req = new Request( - 'PUT', - $this->config->getHost() . $resourcePath, - $headers, - $httpBody - ); - if ($this->config->getDebug()) { - $this->_writeRequestLog('PUT', $this->config->getHost() . $resourcePath, $headers, $httpBody); - } - - return $req; - } - - /** - * Operation scanBarcode - * - * Quickly scan a barcode from an image. - * - * @param Requests\ScanBarcodeRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return \Aspose\BarCode\Model\BarcodeResponseList - */ - public function scanBarcode(Requests\ScanBarcodeRequest $request) - { - try { - list($response) = $this->scanBarcodeWithHttpInfo($request); - return $response; - } catch (RepeatRequestException $e) { - list($response) = $this->scanBarcodeWithHttpInfo($request); - return $response; - } - } - - /** - * Operation scanBarcodeWithHttpInfo - * - * Quickly scan a barcode from an image. - * - * @param Requests\ScanBarcodeRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return array of \Aspose\BarCode\Model\BarcodeResponseList, HTTP status code, HTTP response headers (array of strings) - */ - public function scanBarcodeWithHttpInfo(Requests\ScanBarcodeRequest $request) - { - $returnType = '\Aspose\BarCode\Model\BarcodeResponseList'; - $request = $this->ScanBarcodeRequest($request); - - try { - $options = $this->_createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - if ($statusCode === 401) { - $this->_requestToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody()); - } - - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - if ($this->config->getDebug()) { - $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\BarcodeResponseList', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ApiErrorResponse', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation scanBarcodeAsync - * - * Quickly scan a barcode from an image. - * - * @param Requests\ScanBarcodeRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function scanBarcodeAsync(Requests\ScanBarcodeRequest $request) - { - return $this->scanBarcodeAsyncWithHttpInfo($request) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation scanBarcodeAsyncWithHttpInfo - * - * Quickly scan a barcode from an image. - * - * @param Requests\ScanBarcodeRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function scanBarcodeAsyncWithHttpInfo(Requests\ScanBarcodeRequest $request) - { - $returnType = '\Aspose\BarCode\Model\BarcodeResponseList'; - $request = $this->ScanBarcodeRequest($request); - - return $this->client - ->sendAsync($request, $this->_createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - if ($this->config->getDebug()) { - $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - - if ($exception instanceof RepeatRequestException) { - //$this->_refreshToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException( - sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'scanBarcode' - * - * @param Requests\ScanBarcodeRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function ScanBarcodeRequest(Requests\ScanBarcodeRequest $request) - { - // verify the required parameter 'image_file' is set - if (!isset($request->image_file)) { - throw new InvalidArgumentException('Missing the required parameter $image_file when calling scanBarcode'); - } - - $resourcePath = '/barcode/scan'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - $resourcePath = $this->_parseURL($resourcePath, $queryParams); - - // form params - $multipart = true; - $filename = ObjectSerializer::toFormValue($request->image_file); - $handle = fopen($filename, 'rb'); - $fsize = filesize($filename); - $contents = fread($handle, $fsize); - $fileField = 'imageFile'; - $formParams['imageFile'][] = $contents; - - foreach ($request->decode_types as $item) { - $formParams['decodeTypes'][] = ObjectSerializer::toFormValue($item); - } - - if (isset($request->timeout)) { - $formParams['timeout'] = ObjectSerializer::toFormValue($request->timeout); - } - - if (isset($request->checksum_validation)) { - $formParams['checksumValidation'] = ObjectSerializer::toFormValue($request->checksum_validation); - } - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['multipart/form-data'] - ); - } - - // for model (json/xml) - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValues) { - if (is_array($formParamValues)) { - foreach ($formParamValues as $formParamValue) { - if ($formParamName === $fileField) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue, - 'filename' => $filename - ]; - } else { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue, - ]; - } - } - } else { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValues, - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = $formParams['imageFile'][0]; - } - - if (!$this->config->getAccessToken()) { - $this->_requestToken(); - } - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['x-aspose-client'] = $this->config->getUserAgent(); - } - - $defaultHeaders['x-aspose-client-version'] = $this->config->getClientVersion(); - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $req = new Request( - 'POST', - $this->config->getHost() . $resourcePath, - $headers, - $httpBody - ); - if ($this->config->getDebug()) { - $this->_writeRequestLog('POST', $this->config->getHost() . $resourcePath, $headers, $httpBody); - } - - return $req; - } - - /** - * Create http client option - * - * @throws RuntimeException on file opening failure - * @return array of http client options - */ - private function _createHttpClientOption() - { - $options = []; - if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); - if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); - } - } - - return $options; - } - - /** - * Executes response logging - */ - private function _writeResponseLog($statusCode, $headers, $body) - { - $logInfo = "\nResponse: $statusCode \n"; - echo $logInfo . $this->_writeHeadersAndBody($logInfo, $headers, $body); - } - - /** - * Executes request logging - */ - private function _writeRequestLog($method, $url, $headers, $body) - { - $logInfo = "\n$method: $url \n"; - echo $logInfo . $this->_writeHeadersAndBody($logInfo, $headers, $body); - } - - /** - * Executes header and boy formatting - */ - private function _writeHeadersAndBody($logInfo, $headers, $body) - { - foreach ($headers as $name => $value) { - $logInfo .= $name . ': ' . $value . '\n'; - } - - return $logInfo .= 'Body: ' . $body . '\n'; - } - - /** - * Executes url parsing - */ - private function _parseURL($url, $queryParams) - { - // parse the url - $UrlToSign = trim($url, '/'); - $urlQuery = preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($queryParams)); - - $urlPartToSign = $this->config->getBasePath() . '/' . parse_url($UrlToSign, PHP_URL_HOST) . parse_url($UrlToSign, PHP_URL_PATH) . '?' . $urlQuery; - - return $urlPartToSign; - } - - /** - * Gets a request token from server - */ - private function _requestToken() - { - $requestUrl = $this->config->getAuthUrl(); - - $response = $this->client->request('POST', $requestUrl, [ - 'form_params' => [ - 'grant_type' => 'client_credentials', - 'client_id' => $this->config->getClientId(), - 'client_secret' => $this->config->getClientSecret(), - ] - ]); - $result = json_decode($response->getBody()->getContents(), true); - $this->config->setAccessToken($result['access_token']); - } -} diff --git a/src/Aspose/BarCode/Configuration.php b/src/Aspose/BarCode/Configuration.php index c1e58c7..75760c9 100644 --- a/src/Aspose/BarCode/Configuration.php +++ b/src/Aspose/BarCode/Configuration.php @@ -20,7 +20,7 @@ class Configuration implements JsonSerializable * * @var string */ - protected $clientVersion = '24.12.0'; + protected $clientVersion = '25.1.0'; /** * ClientId for API @@ -50,14 +50,14 @@ class Configuration implements JsonSerializable */ protected $host = 'https://api.aspose.cloud'; - protected $authUrl = 'https://api.aspose.cloud/connect/token'; + protected $authUrl = 'https://id.aspose.cloud/connect/token'; /** * Version of API to use, possible values are v1, v1.1, v2, v3 * default value is v1 * @var string */ - protected $base_path = '/v3.0'; + protected $base_path = '/v4.0'; /** * User agent of the HTTP request, set to 'php sdk' by default diff --git a/src/Aspose/BarCode/FolderApi.php b/src/Aspose/BarCode/FolderApi.php deleted file mode 100644 index db49693..0000000 --- a/src/Aspose/BarCode/FolderApi.php +++ /dev/null @@ -1,1300 +0,0 @@ - - * Copyright (c) 2025 Aspose Pty Ltd - * - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * -------------------------------------------------------------------------------------------------------------------- - */ - -namespace Aspose\BarCode; - -use GuzzleHttp\Client; -use GuzzleHttp\ClientInterface; -use GuzzleHttp\Exception\GuzzleException; -use GuzzleHttp\Exception\RequestException; -use GuzzleHttp\Psr7\MultipartStream; -use GuzzleHttp\Psr7\Request; -use GuzzleHttp\RequestOptions; -use Aspose\BarCode\Requests; -use InvalidArgumentException; -use RuntimeException; - -/** - * Aspose.BarCode for Cloud API. - */ - -class FolderApi -{ - /** - * Stores client instance - * @var ClientInterface client for calling api - */ - protected $client; - - /** - * Stores configuration - * @var Configuration configuration info - */ - protected $config; - - /** - * Stores header selector - * HeaderSelector class for header selection - */ - protected $headerSelector; - - /** - * Initialize a new instance of Api - * @param ClientInterface|null $client client for calling api - * @param Configuration|null $config configuration info - * @param HeaderSelector|null $selector class for header selection - */ - public function __construct(ClientInterface $client = null, Configuration $config = null, HeaderSelector $selector = null) - { - $this->client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * Gets the config - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation copyFolder - * - * Copy folder - * - * @param Requests\CopyFolderRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return void - */ - public function copyFolder(Requests\CopyFolderRequest $request) - { - try { - $this->copyFolderWithHttpInfo($request); - } catch (RepeatRequestException $e) { - $this->copyFolderWithHttpInfo($request); - } - } - - /** - * Operation copyFolderWithHttpInfo - * - * Copy folder - * - * @param Requests\CopyFolderRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function copyFolderWithHttpInfo(Requests\CopyFolderRequest $request) - { - $returnType = ''; - $request = $this->CopyFolderRequest($request); - - try { - $options = $this->_createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - if ($statusCode === 401) { - $this->_requestToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody()); - } - - return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation copyFolderAsync - * - * Copy folder - * - * @param Requests\CopyFolderRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function copyFolderAsync(Requests\CopyFolderRequest $request) - { - return $this->copyFolderAsyncWithHttpInfo($request) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation copyFolderAsyncWithHttpInfo - * - * Copy folder - * - * @param Requests\CopyFolderRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function copyFolderAsyncWithHttpInfo(Requests\CopyFolderRequest $request) - { - $returnType = ''; - $request = $this->CopyFolderRequest($request); - - return $this->client - ->sendAsync($request, $this->_createHttpClientOption()) - ->then( - function ($response) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - - if ($exception instanceof RepeatRequestException) { - //$this->_refreshToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException( - sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'copyFolder' - * - * @param Requests\CopyFolderRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function CopyFolderRequest(Requests\CopyFolderRequest $request) - { - // verify the required parameter 'src_path' is set - if (!isset($request->src_path)) { - throw new InvalidArgumentException('Missing the required parameter $src_path when calling copyFolder'); - } - // verify the required parameter 'dest_path' is set - if (!isset($request->dest_path)) { - throw new InvalidArgumentException('Missing the required parameter $dest_path when calling copyFolder'); - } - - $resourcePath = '/barcode/storage/folder/copy/{srcPath}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - if (isset($request->src_path)) { - $localName = lcfirst('srcPath'); - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->src_path), $resourcePath); - } - if (isset($request->dest_path)) { - $queryParamName = lcfirst('destPath'); - $queryParamValue = is_bool($request->dest_path) ? ($request->dest_path ? 'true' : 'false') : $request->dest_path; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->src_storage_name)) { - $queryParamName = lcfirst('srcStorageName'); - $queryParamValue = is_bool($request->src_storage_name) ? ($request->src_storage_name ? 'true' : 'false') : $request->src_storage_name; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->dest_storage_name)) { - $queryParamName = lcfirst('destStorageName'); - $queryParamValue = is_bool($request->dest_storage_name) ? ($request->dest_storage_name ? 'true' : 'false') : $request->dest_storage_name; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - - $resourcePath = $this->_parseURL($resourcePath, $queryParams); - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } - - // for model (json/xml) - - if (!$this->config->getAccessToken()) { - $this->_requestToken(); - } - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['x-aspose-client'] = $this->config->getUserAgent(); - } - - $defaultHeaders['x-aspose-client-version'] = $this->config->getClientVersion(); - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $req = new Request( - 'PUT', - $this->config->getHost() . $resourcePath, - $headers, - $httpBody - ); - if ($this->config->getDebug()) { - $this->_writeRequestLog('PUT', $this->config->getHost() . $resourcePath, $headers, $httpBody); - } - - return $req; - } - - /** - * Operation createFolder - * - * Create the folder - * - * @param Requests\CreateFolderRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return void - */ - public function createFolder(Requests\CreateFolderRequest $request) - { - try { - $this->createFolderWithHttpInfo($request); - } catch (RepeatRequestException $e) { - $this->createFolderWithHttpInfo($request); - } - } - - /** - * Operation createFolderWithHttpInfo - * - * Create the folder - * - * @param Requests\CreateFolderRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function createFolderWithHttpInfo(Requests\CreateFolderRequest $request) - { - $returnType = ''; - $request = $this->CreateFolderRequest($request); - - try { - $options = $this->_createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - if ($statusCode === 401) { - $this->_requestToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody()); - } - - return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation createFolderAsync - * - * Create the folder - * - * @param Requests\CreateFolderRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function createFolderAsync(Requests\CreateFolderRequest $request) - { - return $this->createFolderAsyncWithHttpInfo($request) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation createFolderAsyncWithHttpInfo - * - * Create the folder - * - * @param Requests\CreateFolderRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function createFolderAsyncWithHttpInfo(Requests\CreateFolderRequest $request) - { - $returnType = ''; - $request = $this->CreateFolderRequest($request); - - return $this->client - ->sendAsync($request, $this->_createHttpClientOption()) - ->then( - function ($response) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - - if ($exception instanceof RepeatRequestException) { - //$this->_refreshToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException( - sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'createFolder' - * - * @param Requests\CreateFolderRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function CreateFolderRequest(Requests\CreateFolderRequest $request) - { - // verify the required parameter 'path' is set - if (!isset($request->path)) { - throw new InvalidArgumentException('Missing the required parameter $path when calling createFolder'); - } - - $resourcePath = '/barcode/storage/folder/{path}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - if (isset($request->path)) { - $localName = lcfirst('path'); - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->path), $resourcePath); - } - if (isset($request->storage_name)) { - $queryParamName = lcfirst('storageName'); - $queryParamValue = is_bool($request->storage_name) ? ($request->storage_name ? 'true' : 'false') : $request->storage_name; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - - $resourcePath = $this->_parseURL($resourcePath, $queryParams); - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } - - // for model (json/xml) - - if (!$this->config->getAccessToken()) { - $this->_requestToken(); - } - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['x-aspose-client'] = $this->config->getUserAgent(); - } - - $defaultHeaders['x-aspose-client-version'] = $this->config->getClientVersion(); - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $req = new Request( - 'PUT', - $this->config->getHost() . $resourcePath, - $headers, - $httpBody - ); - if ($this->config->getDebug()) { - $this->_writeRequestLog('PUT', $this->config->getHost() . $resourcePath, $headers, $httpBody); - } - - return $req; - } - - /** - * Operation deleteFolder - * - * Delete folder - * - * @param Requests\DeleteFolderRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return void - */ - public function deleteFolder(Requests\DeleteFolderRequest $request) - { - try { - $this->deleteFolderWithHttpInfo($request); - } catch (RepeatRequestException $e) { - $this->deleteFolderWithHttpInfo($request); - } - } - - /** - * Operation deleteFolderWithHttpInfo - * - * Delete folder - * - * @param Requests\DeleteFolderRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function deleteFolderWithHttpInfo(Requests\DeleteFolderRequest $request) - { - $returnType = ''; - $request = $this->DeleteFolderRequest($request); - - try { - $options = $this->_createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - if ($statusCode === 401) { - $this->_requestToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody()); - } - - return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation deleteFolderAsync - * - * Delete folder - * - * @param Requests\DeleteFolderRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deleteFolderAsync(Requests\DeleteFolderRequest $request) - { - return $this->deleteFolderAsyncWithHttpInfo($request) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation deleteFolderAsyncWithHttpInfo - * - * Delete folder - * - * @param Requests\DeleteFolderRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deleteFolderAsyncWithHttpInfo(Requests\DeleteFolderRequest $request) - { - $returnType = ''; - $request = $this->DeleteFolderRequest($request); - - return $this->client - ->sendAsync($request, $this->_createHttpClientOption()) - ->then( - function ($response) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - - if ($exception instanceof RepeatRequestException) { - //$this->_refreshToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException( - sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'deleteFolder' - * - * @param Requests\DeleteFolderRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function DeleteFolderRequest(Requests\DeleteFolderRequest $request) - { - // verify the required parameter 'path' is set - if (!isset($request->path)) { - throw new InvalidArgumentException('Missing the required parameter $path when calling deleteFolder'); - } - - $resourcePath = '/barcode/storage/folder/{path}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - if (isset($request->path)) { - $localName = lcfirst('path'); - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->path), $resourcePath); - } - if (isset($request->storage_name)) { - $queryParamName = lcfirst('storageName'); - $queryParamValue = is_bool($request->storage_name) ? ($request->storage_name ? 'true' : 'false') : $request->storage_name; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->recursive)) { - $queryParamName = lcfirst('recursive'); - $queryParamValue = is_bool($request->recursive) ? ($request->recursive ? 'true' : 'false') : $request->recursive; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - - $resourcePath = $this->_parseURL($resourcePath, $queryParams); - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } - - // for model (json/xml) - - if (!$this->config->getAccessToken()) { - $this->_requestToken(); - } - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['x-aspose-client'] = $this->config->getUserAgent(); - } - - $defaultHeaders['x-aspose-client-version'] = $this->config->getClientVersion(); - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $req = new Request( - 'DELETE', - $this->config->getHost() . $resourcePath, - $headers, - $httpBody - ); - if ($this->config->getDebug()) { - $this->_writeRequestLog('DELETE', $this->config->getHost() . $resourcePath, $headers, $httpBody); - } - - return $req; - } - - /** - * Operation getFilesList - * - * Get all files and folders within a folder - * - * @param Requests\GetFilesListRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return \Aspose\BarCode\Model\FilesList - */ - public function getFilesList(Requests\GetFilesListRequest $request) - { - try { - list($response) = $this->getFilesListWithHttpInfo($request); - return $response; - } catch (RepeatRequestException $e) { - list($response) = $this->getFilesListWithHttpInfo($request); - return $response; - } - } - - /** - * Operation getFilesListWithHttpInfo - * - * Get all files and folders within a folder - * - * @param Requests\GetFilesListRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return array of \Aspose\BarCode\Model\FilesList, HTTP status code, HTTP response headers (array of strings) - */ - public function getFilesListWithHttpInfo(Requests\GetFilesListRequest $request) - { - $returnType = '\Aspose\BarCode\Model\FilesList'; - $request = $this->GetFilesListRequest($request); - - try { - $options = $this->_createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - if ($statusCode === 401) { - $this->_requestToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody()); - } - - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - if ($this->config->getDebug()) { - $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\FilesList', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation getFilesListAsync - * - * Get all files and folders within a folder - * - * @param Requests\GetFilesListRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getFilesListAsync(Requests\GetFilesListRequest $request) - { - return $this->getFilesListAsyncWithHttpInfo($request) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation getFilesListAsyncWithHttpInfo - * - * Get all files and folders within a folder - * - * @param Requests\GetFilesListRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getFilesListAsyncWithHttpInfo(Requests\GetFilesListRequest $request) - { - $returnType = '\Aspose\BarCode\Model\FilesList'; - $request = $this->GetFilesListRequest($request); - - return $this->client - ->sendAsync($request, $this->_createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - if ($this->config->getDebug()) { - $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - - if ($exception instanceof RepeatRequestException) { - //$this->_refreshToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException( - sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'getFilesList' - * - * @param Requests\GetFilesListRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function GetFilesListRequest(Requests\GetFilesListRequest $request) - { - // verify the required parameter 'path' is set - if (!isset($request->path)) { - throw new InvalidArgumentException('Missing the required parameter $path when calling getFilesList'); - } - - $resourcePath = '/barcode/storage/folder/{path}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - if (isset($request->path)) { - $localName = lcfirst('path'); - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->path), $resourcePath); - } - if (isset($request->storage_name)) { - $queryParamName = lcfirst('storageName'); - $queryParamValue = is_bool($request->storage_name) ? ($request->storage_name ? 'true' : 'false') : $request->storage_name; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - - $resourcePath = $this->_parseURL($resourcePath, $queryParams); - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } - - // for model (json/xml) - - if (!$this->config->getAccessToken()) { - $this->_requestToken(); - } - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['x-aspose-client'] = $this->config->getUserAgent(); - } - - $defaultHeaders['x-aspose-client-version'] = $this->config->getClientVersion(); - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $req = new Request( - 'GET', - $this->config->getHost() . $resourcePath, - $headers, - $httpBody - ); - if ($this->config->getDebug()) { - $this->_writeRequestLog('GET', $this->config->getHost() . $resourcePath, $headers, $httpBody); - } - - return $req; - } - - /** - * Operation moveFolder - * - * Move folder - * - * @param Requests\MoveFolderRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return void - */ - public function moveFolder(Requests\MoveFolderRequest $request) - { - try { - $this->moveFolderWithHttpInfo($request); - } catch (RepeatRequestException $e) { - $this->moveFolderWithHttpInfo($request); - } - } - - /** - * Operation moveFolderWithHttpInfo - * - * Move folder - * - * @param Requests\MoveFolderRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function moveFolderWithHttpInfo(Requests\MoveFolderRequest $request) - { - $returnType = ''; - $request = $this->MoveFolderRequest($request); - - try { - $options = $this->_createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - if ($statusCode === 401) { - $this->_requestToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody()); - } - - return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation moveFolderAsync - * - * Move folder - * - * @param Requests\MoveFolderRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function moveFolderAsync(Requests\MoveFolderRequest $request) - { - return $this->moveFolderAsyncWithHttpInfo($request) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation moveFolderAsyncWithHttpInfo - * - * Move folder - * - * @param Requests\MoveFolderRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function moveFolderAsyncWithHttpInfo(Requests\MoveFolderRequest $request) - { - $returnType = ''; - $request = $this->MoveFolderRequest($request); - - return $this->client - ->sendAsync($request, $this->_createHttpClientOption()) - ->then( - function ($response) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - - if ($exception instanceof RepeatRequestException) { - //$this->_refreshToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException( - sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'moveFolder' - * - * @param Requests\MoveFolderRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function MoveFolderRequest(Requests\MoveFolderRequest $request) - { - // verify the required parameter 'src_path' is set - if (!isset($request->src_path)) { - throw new InvalidArgumentException('Missing the required parameter $src_path when calling moveFolder'); - } - // verify the required parameter 'dest_path' is set - if (!isset($request->dest_path)) { - throw new InvalidArgumentException('Missing the required parameter $dest_path when calling moveFolder'); - } - - $resourcePath = '/barcode/storage/folder/move/{srcPath}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - if (isset($request->src_path)) { - $localName = lcfirst('srcPath'); - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->src_path), $resourcePath); - } - if (isset($request->dest_path)) { - $queryParamName = lcfirst('destPath'); - $queryParamValue = is_bool($request->dest_path) ? ($request->dest_path ? 'true' : 'false') : $request->dest_path; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->src_storage_name)) { - $queryParamName = lcfirst('srcStorageName'); - $queryParamValue = is_bool($request->src_storage_name) ? ($request->src_storage_name ? 'true' : 'false') : $request->src_storage_name; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->dest_storage_name)) { - $queryParamName = lcfirst('destStorageName'); - $queryParamValue = is_bool($request->dest_storage_name) ? ($request->dest_storage_name ? 'true' : 'false') : $request->dest_storage_name; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - - $resourcePath = $this->_parseURL($resourcePath, $queryParams); - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } - - // for model (json/xml) - - if (!$this->config->getAccessToken()) { - $this->_requestToken(); - } - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['x-aspose-client'] = $this->config->getUserAgent(); - } - - $defaultHeaders['x-aspose-client-version'] = $this->config->getClientVersion(); - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $req = new Request( - 'PUT', - $this->config->getHost() . $resourcePath, - $headers, - $httpBody - ); - if ($this->config->getDebug()) { - $this->_writeRequestLog('PUT', $this->config->getHost() . $resourcePath, $headers, $httpBody); - } - - return $req; - } - - /** - * Create http client option - * - * @throws RuntimeException on file opening failure - * @return array of http client options - */ - private function _createHttpClientOption() - { - $options = []; - if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); - if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); - } - } - - return $options; - } - - /** - * Executes response logging - */ - private function _writeResponseLog($statusCode, $headers, $body) - { - $logInfo = "\nResponse: $statusCode \n"; - echo $logInfo . $this->_writeHeadersAndBody($logInfo, $headers, $body); - } - - /** - * Executes request logging - */ - private function _writeRequestLog($method, $url, $headers, $body) - { - $logInfo = "\n$method: $url \n"; - echo $logInfo . $this->_writeHeadersAndBody($logInfo, $headers, $body); - } - - /** - * Executes header and boy formatting - */ - private function _writeHeadersAndBody($logInfo, $headers, $body) - { - foreach ($headers as $name => $value) { - $logInfo .= $name . ': ' . $value . '\n'; - } - - return $logInfo .= 'Body: ' . $body . '\n'; - } - - /** - * Executes url parsing - */ - private function _parseURL($url, $queryParams) - { - // parse the url - $UrlToSign = trim($url, '/'); - $urlQuery = preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($queryParams)); - - $urlPartToSign = $this->config->getBasePath() . '/' . parse_url($UrlToSign, PHP_URL_HOST) . parse_url($UrlToSign, PHP_URL_PATH) . '?' . $urlQuery; - - return $urlPartToSign; - } - - /** - * Gets a request token from server - */ - private function _requestToken() - { - $requestUrl = $this->config->getAuthUrl(); - - $response = $this->client->request('POST', $requestUrl, [ - 'form_params' => [ - 'grant_type' => 'client_credentials', - 'client_id' => $this->config->getClientId(), - 'client_secret' => $this->config->getClientSecret(), - ] - ]); - $result = json_decode($response->getBody()->getContents(), true); - $this->config->setAccessToken($result['access_token']); - } -} diff --git a/src/Aspose/BarCode/FileApi.php b/src/Aspose/BarCode/GenerateApi.php similarity index 51% rename from src/Aspose/BarCode/FileApi.php rename to src/Aspose/BarCode/GenerateApi.php index e5b5bdb..43879c1 100644 --- a/src/Aspose/BarCode/FileApi.php +++ b/src/Aspose/BarCode/GenerateApi.php @@ -3,7 +3,7 @@ declare(strict_types=1); /** * -------------------------------------------------------------------------------------------------------------------- - * + * * Copyright (c) 2025 Aspose Pty Ltd * * @@ -45,7 +45,7 @@ * Aspose.BarCode for Cloud API. */ -class FileApi +class GenerateApi { /** * Stores client instance @@ -88,47 +88,49 @@ public function getConfig() } /** - * Operation copyFile + * Operation generate * - * Copy file + * Generate barcode using GET request with parameters in route and query string. * - * @param Requests\CopyFileRequest $request is a request object for operation + * @param Requests\GenerateRequestWrapper $request is a request object for operation * * @throws ApiException on non-2xx response * @throws InvalidArgumentException - * @return void + * @return \SplFileObject */ - public function copyFile(Requests\CopyFileRequest $request) + public function generate(Requests\GenerateRequestWrapper $request) { try { - $this->copyFileWithHttpInfo($request); + list($response) = $this->generateWithHttpInfo($request); + return $response; } catch (RepeatRequestException $e) { - $this->copyFileWithHttpInfo($request); + list($response) = $this->generateWithHttpInfo($request); + return $response; } } /** - * Operation copyFileWithHttpInfo + * Operation generateWithHttpInfo * - * Copy file + * Generate barcode using GET request with parameters in route and query string. * - * @param Requests\CopyFileRequest $request is a request object for operation + * @param Requests\GenerateRequestWrapper $request is a request object for operation * * @throws ApiException on non-2xx response * @throws InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) */ - public function copyFileWithHttpInfo(Requests\CopyFileRequest $request) + public function generateWithHttpInfo(Requests\GenerateRequestWrapper $request) { - $returnType = ''; - $request = $this->CopyFileRequest($request); + $returnType = '\SplFileObject'; + $request = $this->GenerateRequestWrapper($request); try { $options = $this->_createHttpClientOption(); try { $response = $this->client->send($request, $options); } catch (RequestException $e) { - throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null); + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null); } $statusCode = $response->getStatusCode(); @@ -142,27 +144,57 @@ public function copyFileWithHttpInfo(Requests\CopyFileRequest $request) throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody()); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + if ($this->config->getDebug()) { + $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\SplFileObject', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ApiErrorResponse', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ApiErrorResponse', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation copyFileAsync + * Operation generateAsync * - * Copy file + * Generate barcode using GET request with parameters in route and query string. * - * @param Requests\CopyFileRequest $request is a request object for operation + * @param Requests\GenerateRequestWrapper $request is a request object for operation * * @throws InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function copyFileAsync(Requests\CopyFileRequest $request) + public function generateAsync(Requests\GenerateRequestWrapper $request) { - return $this->copyFileAsyncWithHttpInfo($request) + return $this->generateAsyncWithHttpInfo($request) ->then( function ($response) { return $response[0]; @@ -171,25 +203,43 @@ function ($response) { } /** - * Operation copyFileAsyncWithHttpInfo + * Operation generateAsyncWithHttpInfo * - * Copy file + * Generate barcode using GET request with parameters in route and query string. * - * @param Requests\CopyFileRequest $request is a request object for operation + * @param Requests\GenerateRequestWrapper $request is a request object for operation * * @throws InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function copyFileAsyncWithHttpInfo(Requests\CopyFileRequest $request) + public function generateAsyncWithHttpInfo(Requests\GenerateRequestWrapper $request) { - $returnType = ''; - $request = $this->CopyFileRequest($request); + $returnType = '\SplFileObject'; + $request = $this->GenerateRequestWrapper($request); return $this->client ->sendAsync($request, $this->_createHttpClientOption()) ->then( - function ($response) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + if ($this->config->getDebug()) { + $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -211,280 +261,134 @@ function ($exception) { } /** - * Create request for operation 'copyFile' + * Create request for operation 'generate' * - * @param Requests\CopyFileRequest $request is a request object for operation + * @param Requests\GenerateRequestWrapper $request is a request object for operation * * @throws InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function CopyFileRequest(Requests\CopyFileRequest $request) + protected function GenerateRequestWrapper(Requests\GenerateRequestWrapper $request) { - // verify the required parameter 'src_path' is set - if (!isset($request->src_path)) { - throw new InvalidArgumentException('Missing the required parameter $src_path when calling copyFile'); + // verify the required parameter 'barcode_type' is set + if (!isset($request->barcode_type)) { + throw new InvalidArgumentException('Missing the required parameter $barcode_type when calling generate'); } - // verify the required parameter 'dest_path' is set - if (!isset($request->dest_path)) { - throw new InvalidArgumentException('Missing the required parameter $dest_path when calling copyFile'); + // verify the required parameter 'data' is set + if (!isset($request->data)) { + throw new InvalidArgumentException('Missing the required parameter $data when calling generate'); + } + if (isset($request->resolution) && $request->resolution > 100000) { + throw new InvalidArgumentException("invalid value for resolution when calling GenerateApi.generate, must be smaller than or equal to 100000."); + } + if (isset($request->resolution) && $request->resolution < 1) { + throw new InvalidArgumentException("invalid value for resolution when calling GenerateApi.generate, must be bigger than or equal to 1."); } - $resourcePath = '/barcode/storage/file/copy/{srcPath}'; + + $resourcePath = '/barcode/generate/{barcodeType}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - if (isset($request->src_path)) { - $localName = lcfirst('srcPath'); - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->src_path), $resourcePath); + if (isset($request->barcode_type)) { + $localName = lcfirst('barcodeType'); + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->barcode_type), $resourcePath); } - if (isset($request->dest_path)) { - $queryParamName = lcfirst('destPath'); - $queryParamValue = is_bool($request->dest_path) ? ($request->dest_path ? 'true' : 'false') : $request->dest_path; + if (isset($request->data_type)) { + $queryParamName = lcfirst('dataType'); + $queryParamValue = is_bool($request->data_type) ? ($request->data_type ? 'true' : 'false') : $request->data_type; if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); } else { $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); } } - if (isset($request->src_storage_name)) { - $queryParamName = lcfirst('srcStorageName'); - $queryParamValue = is_bool($request->src_storage_name) ? ($request->src_storage_name ? 'true' : 'false') : $request->src_storage_name; + if (isset($request->data)) { + $queryParamName = lcfirst('data'); + $queryParamValue = is_bool($request->data) ? ($request->data ? 'true' : 'false') : $request->data; if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); } else { $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); } } - if (isset($request->dest_storage_name)) { - $queryParamName = lcfirst('destStorageName'); - $queryParamValue = is_bool($request->dest_storage_name) ? ($request->dest_storage_name ? 'true' : 'false') : $request->dest_storage_name; + if (isset($request->image_format)) { + $queryParamName = lcfirst('imageFormat'); + $queryParamValue = is_bool($request->image_format) ? ($request->image_format ? 'true' : 'false') : $request->image_format; if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); } else { $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); } } - if (isset($request->version_id)) { - $queryParamName = lcfirst('versionId'); - $queryParamValue = is_bool($request->version_id) ? ($request->version_id ? 'true' : 'false') : $request->version_id; + if (isset($request->text_location)) { + $queryParamName = lcfirst('textLocation'); + $queryParamValue = is_bool($request->text_location) ? ($request->text_location ? 'true' : 'false') : $request->text_location; if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); } else { $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); } } - - $resourcePath = $this->_parseURL($resourcePath, $queryParams); - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } - - // for model (json/xml) - - if (!$this->config->getAccessToken()) { - $this->_requestToken(); - } - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['x-aspose-client'] = $this->config->getUserAgent(); - } - - $defaultHeaders['x-aspose-client-version'] = $this->config->getClientVersion(); - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $req = new Request( - 'PUT', - $this->config->getHost() . $resourcePath, - $headers, - $httpBody - ); - if ($this->config->getDebug()) { - $this->_writeRequestLog('PUT', $this->config->getHost() . $resourcePath, $headers, $httpBody); - } - - return $req; - } - - /** - * Operation deleteFile - * - * Delete file - * - * @param Requests\DeleteFileRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return void - */ - public function deleteFile(Requests\DeleteFileRequest $request) - { - try { - $this->deleteFileWithHttpInfo($request); - } catch (RepeatRequestException $e) { - $this->deleteFileWithHttpInfo($request); - } - } - - /** - * Operation deleteFileWithHttpInfo - * - * Delete file - * - * @param Requests\DeleteFileRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function deleteFileWithHttpInfo(Requests\DeleteFileRequest $request) - { - $returnType = ''; - $request = $this->DeleteFileRequest($request); - - try { - $options = $this->_createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null); + if (isset($request->foreground_color)) { + $queryParamName = lcfirst('foregroundColor'); + $queryParamValue = is_bool($request->foreground_color) ? ($request->foreground_color ? 'true' : 'false') : $request->foreground_color; + if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { + $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); + } else { + $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - if ($statusCode === 401) { - $this->_requestToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody()); + } + if (isset($request->background_color)) { + $queryParamName = lcfirst('backgroundColor'); + $queryParamValue = is_bool($request->background_color) ? ($request->background_color ? 'true' : 'false') : $request->background_color; + if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { + $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); + } else { + $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); } - - return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { - switch ($e->getCode()) { + } + if (isset($request->units)) { + $queryParamName = lcfirst('units'); + $queryParamValue = is_bool($request->units) ? ($request->units ? 'true' : 'false') : $request->units; + if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { + $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); + } else { + $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); } - throw $e; } - } - - /** - * Operation deleteFileAsync - * - * Delete file - * - * @param Requests\DeleteFileRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deleteFileAsync(Requests\DeleteFileRequest $request) - { - return $this->deleteFileAsyncWithHttpInfo($request) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation deleteFileAsyncWithHttpInfo - * - * Delete file - * - * @param Requests\DeleteFileRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deleteFileAsyncWithHttpInfo(Requests\DeleteFileRequest $request) - { - $returnType = ''; - $request = $this->DeleteFileRequest($request); - - return $this->client - ->sendAsync($request, $this->_createHttpClientOption()) - ->then( - function ($response) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - - if ($exception instanceof RepeatRequestException) { - //$this->_refreshToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException( - sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'deleteFile' - * - * @param Requests\DeleteFileRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function DeleteFileRequest(Requests\DeleteFileRequest $request) - { - // verify the required parameter 'path' is set - if (!isset($request->path)) { - throw new InvalidArgumentException('Missing the required parameter $path when calling deleteFile'); + if (isset($request->resolution)) { + $queryParamName = lcfirst('resolution'); + $queryParamValue = is_bool($request->resolution) ? ($request->resolution ? 'true' : 'false') : $request->resolution; + if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { + $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); + } else { + $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); + } } - - $resourcePath = '/barcode/storage/file/{path}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - if (isset($request->path)) { - $localName = lcfirst('path'); - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->path), $resourcePath); + if (isset($request->image_height)) { + $queryParamName = lcfirst('imageHeight'); + $queryParamValue = is_bool($request->image_height) ? ($request->image_height ? 'true' : 'false') : $request->image_height; + if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { + $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); + } else { + $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); + } } - if (isset($request->storage_name)) { - $queryParamName = lcfirst('storageName'); - $queryParamValue = is_bool($request->storage_name) ? ($request->storage_name ? 'true' : 'false') : $request->storage_name; + if (isset($request->image_width)) { + $queryParamName = lcfirst('imageWidth'); + $queryParamValue = is_bool($request->image_width) ? ($request->image_width ? 'true' : 'false') : $request->image_width; if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); } else { $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); } } - if (isset($request->version_id)) { - $queryParamName = lcfirst('versionId'); - $queryParamValue = is_bool($request->version_id) ? ($request->version_id ? 'true' : 'false') : $request->version_id; + if (isset($request->rotation_angle)) { + $queryParamName = lcfirst('rotationAngle'); + $queryParamValue = is_bool($request->rotation_angle) ? ($request->rotation_angle ? 'true' : 'false') : $request->rotation_angle; if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); } else { @@ -499,12 +403,12 @@ protected function DeleteFileRequest(Requests\DeleteFileRequest $request) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['image/png', 'image/bmp', 'image/gif', 'image/jpeg', 'image/svg+xml', 'image/tiff', 'application/json', 'application/xml'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['image/png', 'image/bmp', 'image/gif', 'image/jpeg', 'image/svg+xml', 'image/tiff', 'application/json', 'application/xml'], + [] ); } @@ -529,62 +433,62 @@ protected function DeleteFileRequest(Requests\DeleteFileRequest $request) ); $req = new Request( - 'DELETE', + 'GET', $this->config->getHost() . $resourcePath, $headers, $httpBody ); if ($this->config->getDebug()) { - $this->_writeRequestLog('DELETE', $this->config->getHost() . $resourcePath, $headers, $httpBody); + $this->_writeRequestLog('GET', $this->config->getHost() . $resourcePath, $headers, $httpBody); } return $req; } /** - * Operation downloadFile + * Operation generateBody * - * Download file + * Generate barcode using POST request with parameters in body in json or xml format. * - * @param Requests\DownloadFileRequest $request is a request object for operation + * @param Requests\GenerateBodyRequestWrapper $request is a request object for operation * * @throws ApiException on non-2xx response * @throws InvalidArgumentException * @return \SplFileObject */ - public function downloadFile(Requests\DownloadFileRequest $request) + public function generateBody(Requests\GenerateBodyRequestWrapper $request) { try { - list($response) = $this->downloadFileWithHttpInfo($request); + list($response) = $this->generateBodyWithHttpInfo($request); return $response; } catch (RepeatRequestException $e) { - list($response) = $this->downloadFileWithHttpInfo($request); + list($response) = $this->generateBodyWithHttpInfo($request); return $response; } } /** - * Operation downloadFileWithHttpInfo + * Operation generateBodyWithHttpInfo * - * Download file + * Generate barcode using POST request with parameters in body in json or xml format. * - * @param Requests\DownloadFileRequest $request is a request object for operation + * @param Requests\GenerateBodyRequestWrapper $request is a request object for operation * * @throws ApiException on non-2xx response * @throws InvalidArgumentException * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) */ - public function downloadFileWithHttpInfo(Requests\DownloadFileRequest $request) + public function generateBodyWithHttpInfo(Requests\GenerateBodyRequestWrapper $request) { $returnType = '\SplFileObject'; - $request = $this->DownloadFileRequest($request); + $request = $this->GenerateBodyRequestWrapper($request); try { $options = $this->_createHttpClientOption(); try { $response = $this->client->send($request, $options); } catch (RequestException $e) { - throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null); + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null); } $statusCode = $response->getStatusCode(); @@ -623,24 +527,32 @@ public function downloadFileWithHttpInfo(Requests\DownloadFileRequest $request) $data = ObjectSerializer::deserialize($e->getResponseBody(), '\SplFileObject', $e->getResponseHeaders()); $e->setResponseObject($data); break; + case 401: + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ApiErrorResponse', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ApiErrorResponse', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation downloadFileAsync + * Operation generateBodyAsync * - * Download file + * Generate barcode using POST request with parameters in body in json or xml format. * - * @param Requests\DownloadFileRequest $request is a request object for operation + * @param Requests\GenerateBodyRequestWrapper $request is a request object for operation * * @throws InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function downloadFileAsync(Requests\DownloadFileRequest $request) + public function generateBodyAsync(Requests\GenerateBodyRequestWrapper $request) { - return $this->downloadFileAsyncWithHttpInfo($request) + return $this->generateBodyAsyncWithHttpInfo($request) ->then( function ($response) { return $response[0]; @@ -649,19 +561,19 @@ function ($response) { } /** - * Operation downloadFileAsyncWithHttpInfo + * Operation generateBodyAsyncWithHttpInfo * - * Download file + * Generate barcode using POST request with parameters in body in json or xml format. * - * @param Requests\DownloadFileRequest $request is a request object for operation + * @param Requests\GenerateBodyRequestWrapper $request is a request object for operation * * @throws InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function downloadFileAsyncWithHttpInfo(Requests\DownloadFileRequest $request) + public function generateBodyAsyncWithHttpInfo(Requests\GenerateBodyRequestWrapper $request) { $returnType = '\SplFileObject'; - $request = $this->DownloadFileRequest($request); + $request = $this->GenerateBodyRequestWrapper($request); return $this->client ->sendAsync($request, $this->_createHttpClientOption()) @@ -707,304 +619,57 @@ function ($exception) { } /** - * Create request for operation 'downloadFile' + * Create request for operation 'generateBody' * - * @param Requests\DownloadFileRequest $request is a request object for operation + * @param Requests\GenerateBodyRequestWrapper $request is a request object for operation * * @throws InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function DownloadFileRequest(Requests\DownloadFileRequest $request) + protected function GenerateBodyRequestWrapper(Requests\GenerateBodyRequestWrapper $request) { - // verify the required parameter 'path' is set - if (!isset($request->path)) { - throw new InvalidArgumentException('Missing the required parameter $path when calling downloadFile'); + // verify the required parameter 'generate_params' is set + if (!isset($request->generate_params)) { + throw new InvalidArgumentException('Missing the required parameter $generate_params when calling generateBody'); } - $resourcePath = '/barcode/storage/file/{path}'; + $resourcePath = '/barcode/generate-body'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - if (isset($request->path)) { - $localName = lcfirst('path'); - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->path), $resourcePath); - } - if (isset($request->storage_name)) { - $queryParamName = lcfirst('storageName'); - $queryParamValue = is_bool($request->storage_name) ? ($request->storage_name ? 'true' : 'false') : $request->storage_name; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->version_id)) { - $queryParamName = lcfirst('versionId'); - $queryParamValue = is_bool($request->version_id) ? ($request->version_id ? 'true' : 'false') : $request->version_id; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } $resourcePath = $this->_parseURL($resourcePath, $queryParams); // body params $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['multipart/form-data'], - ['application/json'] - ); - } - - // for model (json/xml) - - if (!$this->config->getAccessToken()) { - $this->_requestToken(); - } - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['x-aspose-client'] = $this->config->getUserAgent(); - } - - $defaultHeaders['x-aspose-client-version'] = $this->config->getClientVersion(); - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $req = new Request( - 'GET', - $this->config->getHost() . $resourcePath, - $headers, - $httpBody - ); - if ($this->config->getDebug()) { - $this->_writeRequestLog('GET', $this->config->getHost() . $resourcePath, $headers, $httpBody); - } - - return $req; - } - - /** - * Operation moveFile - * - * Move file - * - * @param Requests\MoveFileRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return void - */ - public function moveFile(Requests\MoveFileRequest $request) - { - try { - $this->moveFileWithHttpInfo($request); - } catch (RepeatRequestException $e) { - $this->moveFileWithHttpInfo($request); - } - } - - /** - * Operation moveFileWithHttpInfo - * - * Move file - * - * @param Requests\MoveFileRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function moveFileWithHttpInfo(Requests\MoveFileRequest $request) - { - $returnType = ''; - $request = $this->MoveFileRequest($request); - - try { - $options = $this->_createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - if ($statusCode === 401) { - $this->_requestToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody()); - } - - return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation moveFileAsync - * - * Move file - * - * @param Requests\MoveFileRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function moveFileAsync(Requests\MoveFileRequest $request) - { - return $this->moveFileAsyncWithHttpInfo($request) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation moveFileAsyncWithHttpInfo - * - * Move file - * - * @param Requests\MoveFileRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function moveFileAsyncWithHttpInfo(Requests\MoveFileRequest $request) - { - $returnType = ''; - $request = $this->MoveFileRequest($request); - - return $this->client - ->sendAsync($request, $this->_createHttpClientOption()) - ->then( - function ($response) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - - if ($exception instanceof RepeatRequestException) { - //$this->_refreshToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException( - sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'moveFile' - * - * @param Requests\MoveFileRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function MoveFileRequest(Requests\MoveFileRequest $request) - { - // verify the required parameter 'src_path' is set - if (!isset($request->src_path)) { - throw new InvalidArgumentException('Missing the required parameter $src_path when calling moveFile'); - } - // verify the required parameter 'dest_path' is set - if (!isset($request->dest_path)) { - throw new InvalidArgumentException('Missing the required parameter $dest_path when calling moveFile'); - } - - $resourcePath = '/barcode/storage/file/move/{srcPath}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - if (isset($request->src_path)) { - $localName = lcfirst('srcPath'); - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->src_path), $resourcePath); - } - if (isset($request->dest_path)) { - $queryParamName = lcfirst('destPath'); - $queryParamValue = is_bool($request->dest_path) ? ($request->dest_path ? 'true' : 'false') : $request->dest_path; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->src_storage_name)) { - $queryParamName = lcfirst('srcStorageName'); - $queryParamValue = is_bool($request->src_storage_name) ? ($request->src_storage_name ? 'true' : 'false') : $request->src_storage_name; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->dest_storage_name)) { - $queryParamName = lcfirst('destStorageName'); - $queryParamValue = is_bool($request->dest_storage_name) ? ($request->dest_storage_name ? 'true' : 'false') : $request->dest_storage_name; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); + if (isset($request->generate_params)) { + if (is_string($request->generate_params)) { + $_tempBody = "\"" . $request->generate_params . "\""; } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->version_id)) { - $queryParamName = lcfirst('versionId'); - $queryParamValue = is_bool($request->version_id) ? ($request->version_id ? 'true' : 'false') : $request->version_id; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); + $_tempBody = $request->generate_params; } } - $resourcePath = $this->_parseURL($resourcePath, $queryParams); - - // body params - $_tempBody = null; - if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['image/png', 'image/bmp', 'image/gif', 'image/jpeg', 'image/svg+xml', 'image/tiff', 'application/json', 'application/xml'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['image/png', 'image/bmp', 'image/gif', 'image/jpeg', 'image/svg+xml', 'image/tiff', 'application/json', 'application/xml'], + ['application/json', 'application/xml'] ); } // for model (json/xml) + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } if (!$this->config->getAccessToken()) { $this->_requestToken(); @@ -1025,62 +690,62 @@ protected function MoveFileRequest(Requests\MoveFileRequest $request) ); $req = new Request( - 'PUT', + 'POST', $this->config->getHost() . $resourcePath, $headers, $httpBody ); if ($this->config->getDebug()) { - $this->_writeRequestLog('PUT', $this->config->getHost() . $resourcePath, $headers, $httpBody); + $this->_writeRequestLog('POST', $this->config->getHost() . $resourcePath, $headers, $httpBody); } return $req; } /** - * Operation uploadFile + * Operation generateMultipart * - * Upload file + * Generate barcode using POST request with parameters in multipart form. * - * @param Requests\UploadFileRequest $request is a request object for operation + * @param Requests\GenerateMultipartRequestWrapper $request is a request object for operation * * @throws ApiException on non-2xx response * @throws InvalidArgumentException - * @return \Aspose\BarCode\Model\FilesUploadResult + * @return \SplFileObject */ - public function uploadFile(Requests\UploadFileRequest $request) + public function generateMultipart(Requests\GenerateMultipartRequestWrapper $request) { try { - list($response) = $this->uploadFileWithHttpInfo($request); + list($response) = $this->generateMultipartWithHttpInfo($request); return $response; } catch (RepeatRequestException $e) { - list($response) = $this->uploadFileWithHttpInfo($request); + list($response) = $this->generateMultipartWithHttpInfo($request); return $response; } } /** - * Operation uploadFileWithHttpInfo + * Operation generateMultipartWithHttpInfo * - * Upload file + * Generate barcode using POST request with parameters in multipart form. * - * @param Requests\UploadFileRequest $request is a request object for operation + * @param Requests\GenerateMultipartRequestWrapper $request is a request object for operation * * @throws ApiException on non-2xx response * @throws InvalidArgumentException - * @return array of \Aspose\BarCode\Model\FilesUploadResult, HTTP status code, HTTP response headers (array of strings) + * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) */ - public function uploadFileWithHttpInfo(Requests\UploadFileRequest $request) + public function generateMultipartWithHttpInfo(Requests\GenerateMultipartRequestWrapper $request) { - $returnType = '\Aspose\BarCode\Model\FilesUploadResult'; - $request = $this->UploadFileRequest($request); + $returnType = '\SplFileObject'; + $request = $this->GenerateMultipartRequestWrapper($request); try { $options = $this->_createHttpClientOption(); try { $response = $this->client->send($request, $options); } catch (RequestException $e) { - throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null); + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null); } $statusCode = $response->getStatusCode(); @@ -1116,7 +781,15 @@ public function uploadFileWithHttpInfo(Requests\UploadFileRequest $request) } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\FilesUploadResult', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\SplFileObject', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ApiErrorResponse', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ApiErrorResponse', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -1125,18 +798,18 @@ public function uploadFileWithHttpInfo(Requests\UploadFileRequest $request) } /** - * Operation uploadFileAsync + * Operation generateMultipartAsync * - * Upload file + * Generate barcode using POST request with parameters in multipart form. * - * @param Requests\UploadFileRequest $request is a request object for operation + * @param Requests\GenerateMultipartRequestWrapper $request is a request object for operation * * @throws InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function uploadFileAsync(Requests\UploadFileRequest $request) + public function generateMultipartAsync(Requests\GenerateMultipartRequestWrapper $request) { - return $this->uploadFileAsyncWithHttpInfo($request) + return $this->generateMultipartAsyncWithHttpInfo($request) ->then( function ($response) { return $response[0]; @@ -1145,19 +818,19 @@ function ($response) { } /** - * Operation uploadFileAsyncWithHttpInfo + * Operation generateMultipartAsyncWithHttpInfo * - * Upload file + * Generate barcode using POST request with parameters in multipart form. * - * @param Requests\UploadFileRequest $request is a request object for operation + * @param Requests\GenerateMultipartRequestWrapper $request is a request object for operation * * @throws InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function uploadFileAsyncWithHttpInfo(Requests\UploadFileRequest $request) + public function generateMultipartAsyncWithHttpInfo(Requests\GenerateMultipartRequestWrapper $request) { - $returnType = '\Aspose\BarCode\Model\FilesUploadResult'; - $request = $this->UploadFileRequest($request); + $returnType = '\SplFileObject'; + $request = $this->GenerateMultipartRequestWrapper($request); return $this->client ->sendAsync($request, $this->_createHttpClientOption()) @@ -1203,104 +876,119 @@ function ($exception) { } /** - * Create request for operation 'uploadFile' + * Create request for operation 'generateMultipart' * - * @param Requests\UploadFileRequest $request is a request object for operation + * @param Requests\GenerateMultipartRequestWrapper $request is a request object for operation * * @throws InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function UploadFileRequest(Requests\UploadFileRequest $request) + protected function GenerateMultipartRequestWrapper(Requests\GenerateMultipartRequestWrapper $request) { - // verify the required parameter 'path' is set - if (!isset($request->path)) { - throw new InvalidArgumentException('Missing the required parameter $path when calling uploadFile'); + // verify the required parameter 'barcode_type' is set + if (!isset($request->barcode_type)) { + throw new InvalidArgumentException('Missing the required parameter $barcode_type when calling generateMultipart'); } - // verify the required parameter 'file' is set - if (!isset($request->file)) { - throw new InvalidArgumentException('Missing the required parameter $file when calling uploadFile'); + // verify the required parameter 'data' is set + if (!isset($request->data)) { + throw new InvalidArgumentException('Missing the required parameter $data when calling generateMultipart'); + } + if (isset($request->resolution) && $request->resolution > 100000) { + throw new InvalidArgumentException("invalid value for resolution when calling GenerateApi.generateMultipart, must be smaller than or equal to 100000."); + } + if (isset($request->resolution) && $request->resolution < 1) { + throw new InvalidArgumentException("invalid value for resolution when calling GenerateApi.generateMultipart, must be bigger than or equal to 1."); } - $resourcePath = '/barcode/storage/file/{path}'; + + $resourcePath = '/barcode/generate-multipart'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - if (isset($request->path)) { - $localName = lcfirst('path'); - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->path), $resourcePath); - } - if (isset($request->storage_name)) { - $queryParamName = lcfirst('storageName'); - $queryParamValue = is_bool($request->storage_name) ? ($request->storage_name ? 'true' : 'false') : $request->storage_name; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } $resourcePath = $this->_parseURL($resourcePath, $queryParams); - // form params $multipart = true; - $filename = ObjectSerializer::toFormValue($request->file); - $handle = fopen($filename, 'rb'); - $fsize = filesize($filename); - $contents = fread($handle, $fsize); - $fileField = 'File'; - $formParams['File'][] = $contents; + // form params + if (isset($request->barcode_type)) { + $formParams['barcodeType'][] = ObjectSerializer::toFormValue($request->barcode_type); + } + + if (isset($request->data_type)) { + $formParams['dataType'][] = ObjectSerializer::toFormValue($request->data_type); + } + + if (isset($request->data)) { + $formParams['data'][] = ObjectSerializer::toFormValue($request->data); + } + + if (isset($request->image_format)) { + $formParams['imageFormat'][] = ObjectSerializer::toFormValue($request->image_format); + } + + if (isset($request->text_location)) { + $formParams['textLocation'][] = ObjectSerializer::toFormValue($request->text_location); + } + + if (isset($request->foreground_color)) { + $formParams['foregroundColor'][] = ObjectSerializer::toFormValue($request->foreground_color); + } + + if (isset($request->background_color)) { + $formParams['backgroundColor'][] = ObjectSerializer::toFormValue($request->background_color); + } + + if (isset($request->units)) { + $formParams['units'][] = ObjectSerializer::toFormValue($request->units); + } + + if (isset($request->resolution)) { + $formParams['resolution'][] = ObjectSerializer::toFormValue($request->resolution); + } + + if (isset($request->image_height)) { + $formParams['imageHeight'][] = ObjectSerializer::toFormValue($request->image_height); + } + + if (isset($request->image_width)) { + $formParams['imageWidth'][] = ObjectSerializer::toFormValue($request->image_width); + } + + if (isset($request->rotation_angle)) { + $formParams['rotationAngle'][] = ObjectSerializer::toFormValue($request->rotation_angle); + } // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['image/png', 'image/bmp', 'image/gif', 'image/jpeg', 'image/svg+xml', 'image/tiff', 'application/json', 'application/xml'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['image/png', 'image/bmp', 'image/gif', 'image/jpeg', 'image/svg+xml', 'image/tiff', 'application/json', 'application/xml'], ['multipart/form-data'] ); } // for model (json/xml) - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValues) { - if (is_array($formParamValues)) { - foreach ($formParamValues as $formParamValue) { - if ($formParamName === $fileField) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue, - 'filename' => $filename - ]; - } else { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue, - ]; - } - } - } else { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValues, - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - } else { - // for HTTP post (form) - $httpBody = $formParams['File'][0]; + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValues) { + foreach ($formParamValues as $formParamValue) { + $multipartFileName = ''; + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue, + 'filename' => $multipartFileName + ]; + } } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + if (!$this->config->getAccessToken()) { $this->_requestToken(); @@ -1321,13 +1009,13 @@ protected function UploadFileRequest(Requests\UploadFileRequest $request) ); $req = new Request( - 'PUT', + 'POST', $this->config->getHost() . $resourcePath, $headers, $httpBody ); if ($this->config->getDebug()) { - $this->_writeRequestLog('PUT', $this->config->getHost() . $resourcePath, $headers, $httpBody); + $this->_writeRequestLog('POST', $this->config->getHost() . $resourcePath, $headers, $httpBody); } return $req; @@ -1376,7 +1064,8 @@ private function _writeRequestLog($method, $url, $headers, $body) private function _writeHeadersAndBody($logInfo, $headers, $body) { foreach ($headers as $name => $value) { - $logInfo .= $name . ': ' . $value . '\n'; + $strValue = is_array($value) ? implode($value) : $value; + $logInfo .= $name . ': ' . $strValue . '\n'; } return $logInfo .= 'Body: ' . $body . '\n'; diff --git a/src/Aspose/BarCode/Model/ApiError.php b/src/Aspose/BarCode/Model/ApiError.php index c01dc24..e51fa36 100644 --- a/src/Aspose/BarCode/Model/ApiError.php +++ b/src/Aspose/BarCode/Model/ApiError.php @@ -10,6 +10,7 @@ /** * ApiError * + * @description Api Error. */ class ApiError implements ArrayAccess { @@ -75,11 +76,11 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'code' => 'Code', - 'message' => 'Message', - 'description' => 'Description', - 'date_time' => 'DateTime', - 'inner_error' => 'InnerError' + 'code' => 'code', + 'message' => 'message', + 'description' => 'description', + 'date_time' => 'dateTime', + 'inner_error' => 'innerError' ]; /** @@ -184,6 +185,12 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + if ($this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } return $invalidProperties; } @@ -195,6 +202,12 @@ public function listInvalidProperties() */ public function valid() { + if ($this->container['code'] === null) { + return false; + } + if ($this->container['message'] === null) { + return false; + } return true; } @@ -212,7 +225,7 @@ public function getCode() /** * Sets code * - * @param string $code code + * @param string $code Gets or sets api error code. * * @return $this */ @@ -236,7 +249,7 @@ public function getMessage() /** * Sets message * - * @param string $message message + * @param string $message Gets or sets error message. * * @return $this */ @@ -260,7 +273,7 @@ public function getDescription() /** * Sets description * - * @param string $description description + * @param string $description Gets or sets error description. * * @return $this */ @@ -284,7 +297,7 @@ public function getDateTime() /** * Sets date_time * - * @param \DateTime $date_time date_time + * @param \DateTime $date_time Gets or sets server datetime. * * @return $this */ diff --git a/src/Aspose/BarCode/Model/ApiErrorResponse.php b/src/Aspose/BarCode/Model/ApiErrorResponse.php index b340467..50b3ebf 100644 --- a/src/Aspose/BarCode/Model/ApiErrorResponse.php +++ b/src/Aspose/BarCode/Model/ApiErrorResponse.php @@ -10,6 +10,7 @@ /** * ApiErrorResponse * + * @description ApiError Response */ class ApiErrorResponse implements ArrayAccess { @@ -69,8 +70,8 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'request_id' => 'RequestId', - 'error' => 'Error' + 'request_id' => 'requestId', + 'error' => 'error' ]; /** @@ -166,6 +167,12 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['error'] === null) { + $invalidProperties[] = "'error' can't be null"; + } return $invalidProperties; } @@ -177,6 +184,12 @@ public function listInvalidProperties() */ public function valid() { + if ($this->container['request_id'] === null) { + return false; + } + if ($this->container['error'] === null) { + return false; + } return true; } @@ -194,7 +207,7 @@ public function getRequestId() /** * Sets request_id * - * @param string $request_id request_id + * @param string $request_id Gets or sets request Id. * * @return $this */ diff --git a/src/Aspose/BarCode/Model/AustralianPostParams.php b/src/Aspose/BarCode/Model/AustralianPostParams.php deleted file mode 100644 index 1439e0d..0000000 --- a/src/Aspose/BarCode/Model/AustralianPostParams.php +++ /dev/null @@ -1,303 +0,0 @@ - '\Aspose\BarCode\Model\CustomerInformationInterpretingType', - 'short_bar_height' => 'double' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'encoding_table' => null, - 'short_bar_height' => 'double' - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'encoding_table' => 'EncodingTable', - 'short_bar_height' => 'ShortBarHeight' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'encoding_table' => 'setEncodingTable', - 'short_bar_height' => 'setShortBarHeight' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'encoding_table' => 'getEncodingTable', - 'short_bar_height' => 'getShortBarHeight' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['encoding_table'] = isset($data['encoding_table']) ? $data['encoding_table'] : null; - $this->container['short_bar_height'] = isset($data['short_bar_height']) ? $data['short_bar_height'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets encoding_table - * - * @return \Aspose\BarCode\Model\CustomerInformationInterpretingType - */ - public function getEncodingTable() - { - return $this->container['encoding_table']; - } - - /** - * Sets encoding_table - * - * @param \Aspose\BarCode\Model\CustomerInformationInterpretingType $encoding_table Interpreting type for the Customer Information of AustralianPost, default to CustomerInformationInterpretingType.Other - * - * @return $this - */ - public function setEncodingTable($encoding_table) - { - $this->container['encoding_table'] = $encoding_table; - - return $this; - } - - /** - * Gets short_bar_height - * - * @return double - */ - public function getShortBarHeight() - { - return $this->container['short_bar_height']; - } - - /** - * Sets short_bar_height - * - * @param double $short_bar_height Short bar's height of AustralianPost barcode. - * - * @return $this - */ - public function setShortBarHeight($short_bar_height) - { - $this->container['short_bar_height'] = $short_bar_height; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/AutoSizeMode.php b/src/Aspose/BarCode/Model/AutoSizeMode.php deleted file mode 100644 index f193fc4..0000000 --- a/src/Aspose/BarCode/Model/AutoSizeMode.php +++ /dev/null @@ -1,31 +0,0 @@ - - /// Enum value None - /// - public const None = "None"; - - /// - /// Enum value Nearest - /// - public const Nearest = "Nearest"; - - /// - /// Enum value Interpolation - /// - public const Interpolation = "Interpolation"; - -} diff --git a/src/Aspose/BarCode/Model/AztecEncodeMode.php b/src/Aspose/BarCode/Model/AztecEncodeMode.php deleted file mode 100644 index 547a40d..0000000 --- a/src/Aspose/BarCode/Model/AztecEncodeMode.php +++ /dev/null @@ -1,31 +0,0 @@ - - /// Enum value Auto - /// - public const Auto = "Auto"; - - /// - /// Enum value Bytes - /// - public const Bytes = "Bytes"; - - /// - /// Enum value ExtendedCodetext - /// - public const ExtendedCodetext = "ExtendedCodetext"; - -} diff --git a/src/Aspose/BarCode/Model/AztecParams.php b/src/Aspose/BarCode/Model/AztecParams.php deleted file mode 100644 index 6a398f8..0000000 --- a/src/Aspose/BarCode/Model/AztecParams.php +++ /dev/null @@ -1,484 +0,0 @@ - 'double', - 'error_level' => 'int', - 'symbol_mode' => '\Aspose\BarCode\Model\AztecSymbolMode', - 'text_encoding' => 'string', - 'encode_mode' => '\Aspose\BarCode\Model\AztecEncodeMode', - 'eci_encoding' => '\Aspose\BarCode\Model\ECIEncodings', - 'is_reader_initialization' => 'bool', - 'layers_count' => 'int' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'aspect_ratio' => 'double', - 'error_level' => 'int32', - 'symbol_mode' => null, - 'text_encoding' => null, - 'encode_mode' => null, - 'eci_encoding' => null, - 'is_reader_initialization' => null, - 'layers_count' => 'int32' - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'aspect_ratio' => 'AspectRatio', - 'error_level' => 'ErrorLevel', - 'symbol_mode' => 'SymbolMode', - 'text_encoding' => 'TextEncoding', - 'encode_mode' => 'EncodeMode', - 'eci_encoding' => 'ECIEncoding', - 'is_reader_initialization' => 'IsReaderInitialization', - 'layers_count' => 'LayersCount' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'aspect_ratio' => 'setAspectRatio', - 'error_level' => 'setErrorLevel', - 'symbol_mode' => 'setSymbolMode', - 'text_encoding' => 'setTextEncoding', - 'encode_mode' => 'setEncodeMode', - 'eci_encoding' => 'setEciEncoding', - 'is_reader_initialization' => 'setIsReaderInitialization', - 'layers_count' => 'setLayersCount' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'aspect_ratio' => 'getAspectRatio', - 'error_level' => 'getErrorLevel', - 'symbol_mode' => 'getSymbolMode', - 'text_encoding' => 'getTextEncoding', - 'encode_mode' => 'getEncodeMode', - 'eci_encoding' => 'getEciEncoding', - 'is_reader_initialization' => 'getIsReaderInitialization', - 'layers_count' => 'getLayersCount' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['aspect_ratio'] = isset($data['aspect_ratio']) ? $data['aspect_ratio'] : null; - $this->container['error_level'] = isset($data['error_level']) ? $data['error_level'] : null; - $this->container['symbol_mode'] = isset($data['symbol_mode']) ? $data['symbol_mode'] : null; - $this->container['text_encoding'] = isset($data['text_encoding']) ? $data['text_encoding'] : null; - $this->container['encode_mode'] = isset($data['encode_mode']) ? $data['encode_mode'] : null; - $this->container['eci_encoding'] = isset($data['eci_encoding']) ? $data['eci_encoding'] : null; - $this->container['is_reader_initialization'] = isset($data['is_reader_initialization']) ? $data['is_reader_initialization'] : null; - $this->container['layers_count'] = isset($data['layers_count']) ? $data['layers_count'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets aspect_ratio - * - * @return double - */ - public function getAspectRatio() - { - return $this->container['aspect_ratio']; - } - - /** - * Sets aspect_ratio - * - * @param double $aspect_ratio Height/Width ratio of 2D BarCode module. - * - * @return $this - */ - public function setAspectRatio($aspect_ratio) - { - $this->container['aspect_ratio'] = $aspect_ratio; - - return $this; - } - - /** - * Gets error_level - * - * @return int - */ - public function getErrorLevel() - { - return $this->container['error_level']; - } - - /** - * Sets error_level - * - * @param int $error_level Level of error correction of Aztec types of barcode. Value should between 10 to 95. - * - * @return $this - */ - public function setErrorLevel($error_level) - { - $this->container['error_level'] = $error_level; - - return $this; - } - - /** - * Gets symbol_mode - * - * @return \Aspose\BarCode\Model\AztecSymbolMode - */ - public function getSymbolMode() - { - return $this->container['symbol_mode']; - } - - /** - * Sets symbol_mode - * - * @param \Aspose\BarCode\Model\AztecSymbolMode $symbol_mode Aztec Symbol mode. Default value: AztecSymbolMode.Auto. - * - * @return $this - */ - public function setSymbolMode($symbol_mode) - { - $this->container['symbol_mode'] = $symbol_mode; - - return $this; - } - - /** - * Gets text_encoding - * - * @return string - */ - public function getTextEncoding() - { - return $this->container['text_encoding']; - } - - /** - * Sets text_encoding - * - * @param string $text_encoding DEPRECATED: This property is obsolete and will be removed in future releases. Unicode symbols detection and encoding will be processed in Auto mode with Extended Channel Interpretation charset designator. Using of own encodings requires manual CodeText encoding into byte[] array. Sets the encoding of codetext. - * - * @return $this - */ - public function setTextEncoding($text_encoding) - { - trigger_error('Property $text_encoding is deprecated. This property is obsolete and will be removed in future releases. Unicode symbols detection and encoding will be processed in Auto mode with Extended Channel Interpretation charset designator. Using of own encodings requires manual CodeText encoding into byte[] array. Sets the encoding of codetext.', E_USER_DEPRECATED); - $this->container['text_encoding'] = $text_encoding; - - return $this; - } - - /** - * Gets encode_mode - * - * @return \Aspose\BarCode\Model\AztecEncodeMode - */ - public function getEncodeMode() - { - return $this->container['encode_mode']; - } - - /** - * Sets encode_mode - * - * @param \Aspose\BarCode\Model\AztecEncodeMode $encode_mode Encoding mode for Aztec barcodes. Default value: Auto - * - * @return $this - */ - public function setEncodeMode($encode_mode) - { - $this->container['encode_mode'] = $encode_mode; - - return $this; - } - - /** - * Gets eci_encoding - * - * @return \Aspose\BarCode\Model\ECIEncodings - */ - public function getEciEncoding() - { - return $this->container['eci_encoding']; - } - - /** - * Sets eci_encoding - * - * @param \Aspose\BarCode\Model\ECIEncodings $eci_encoding Identifies ECI encoding. Used when AztecEncodeMode is Auto. Default value: ISO-8859-1. - * - * @return $this - */ - public function setEciEncoding($eci_encoding) - { - $this->container['eci_encoding'] = $eci_encoding; - - return $this; - } - - /** - * Gets is_reader_initialization - * - * @return bool - */ - public function getIsReaderInitialization() - { - return $this->container['is_reader_initialization']; - } - - /** - * Sets is_reader_initialization - * - * @param bool $is_reader_initialization Used to instruct the reader to interpret the data contained within the symbol as programming for reader initialization. - * - * @return $this - */ - public function setIsReaderInitialization($is_reader_initialization) - { - $this->container['is_reader_initialization'] = $is_reader_initialization; - - return $this; - } - - /** - * Gets layers_count - * - * @return int - */ - public function getLayersCount() - { - return $this->container['layers_count']; - } - - /** - * Sets layers_count - * - * @param int $layers_count Gets or sets layers count of Aztec symbol. Layers count should be in range from 1 to 3 for Compact mode and in range from 1 to 32 for Full Range mode. Default value: 0 (auto). - * - * @return $this - */ - public function setLayersCount($layers_count) - { - $this->container['layers_count'] = $layers_count; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/AztecSymbolMode.php b/src/Aspose/BarCode/Model/AztecSymbolMode.php deleted file mode 100644 index 553011d..0000000 --- a/src/Aspose/BarCode/Model/AztecSymbolMode.php +++ /dev/null @@ -1,36 +0,0 @@ - - /// Enum value Auto - /// - public const Auto = "Auto"; - - /// - /// Enum value Compact - /// - public const Compact = "Compact"; - - /// - /// Enum value FullRange - /// - public const FullRange = "FullRange"; - - /// - /// Enum value Rune - /// - public const Rune = "Rune"; - -} diff --git a/src/Aspose/BarCode/Model/BarcodeImageFormat.php b/src/Aspose/BarCode/Model/BarcodeImageFormat.php new file mode 100644 index 0000000..f7e1270 --- /dev/null +++ b/src/Aspose/BarCode/Model/BarcodeImageFormat.php @@ -0,0 +1,41 @@ + + /// Enum value Png + /// + public const Png = "Png"; + + /// + /// Enum value Jpeg + /// + public const Jpeg = "Jpeg"; + + /// + /// Enum value Svg + /// + public const Svg = "Svg"; + + /// + /// Enum value Tiff + /// + public const Tiff = "Tiff"; + + /// + /// Enum value Gif + /// + public const Gif = "Gif"; + +} diff --git a/src/Aspose/BarCode/Model/BarcodeImageParams.php b/src/Aspose/BarCode/Model/BarcodeImageParams.php new file mode 100644 index 0000000..ce3363b --- /dev/null +++ b/src/Aspose/BarCode/Model/BarcodeImageParams.php @@ -0,0 +1,535 @@ + '\Aspose\BarCode\Model\BarcodeImageFormat', + 'text_location' => '\Aspose\BarCode\Model\CodeLocation', + 'foreground_color' => 'string', + 'background_color' => 'string', + 'units' => '\Aspose\BarCode\Model\GraphicsUnit', + 'resolution' => 'float', + 'image_height' => 'float', + 'image_width' => 'float', + 'rotation_angle' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var (string|null)[] + */ + protected static array $swaggerFormats = [ + 'image_format' => null, + 'text_location' => null, + 'foreground_color' => null, + 'background_color' => null, + 'units' => null, + 'resolution' => 'float', + 'image_height' => 'float', + 'image_width' => 'float', + 'rotation_angle' => 'int32' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'image_format' => 'imageFormat', + 'text_location' => 'textLocation', + 'foreground_color' => 'foregroundColor', + 'background_color' => 'backgroundColor', + 'units' => 'units', + 'resolution' => 'resolution', + 'image_height' => 'imageHeight', + 'image_width' => 'imageWidth', + 'rotation_angle' => 'rotationAngle' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'image_format' => 'setImageFormat', + 'text_location' => 'setTextLocation', + 'foreground_color' => 'setForegroundColor', + 'background_color' => 'setBackgroundColor', + 'units' => 'setUnits', + 'resolution' => 'setResolution', + 'image_height' => 'setImageHeight', + 'image_width' => 'setImageWidth', + 'rotation_angle' => 'setRotationAngle' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'image_format' => 'getImageFormat', + 'text_location' => 'getTextLocation', + 'foreground_color' => 'getForegroundColor', + 'background_color' => 'getBackgroundColor', + 'units' => 'getUnits', + 'resolution' => 'getResolution', + 'image_height' => 'getImageHeight', + 'image_width' => 'getImageWidth', + 'rotation_angle' => 'getRotationAngle' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['image_format'] = isset($data['image_format']) ? $data['image_format'] : null; + $this->container['text_location'] = isset($data['text_location']) ? $data['text_location'] : null; + $this->container['foreground_color'] = isset($data['foreground_color']) ? $data['foreground_color'] : 'Black'; + $this->container['background_color'] = isset($data['background_color']) ? $data['background_color'] : 'White'; + $this->container['units'] = isset($data['units']) ? $data['units'] : null; + $this->container['resolution'] = isset($data['resolution']) ? $data['resolution'] : null; + $this->container['image_height'] = isset($data['image_height']) ? $data['image_height'] : null; + $this->container['image_width'] = isset($data['image_width']) ? $data['image_width'] : null; + $this->container['rotation_angle'] = isset($data['rotation_angle']) ? $data['rotation_angle'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['resolution']) && ($this->container['resolution'] > 100000)) { + $invalidProperties[] = "invalid value for 'resolution', must be smaller than or equal to 100000."; + } + + if (!is_null($this->container['resolution']) && ($this->container['resolution'] < 1)) { + $invalidProperties[] = "invalid value for 'resolution', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + if ($this->container['resolution'] > 100000) { + return false; + } + if ($this->container['resolution'] < 1) { + return false; + } + return true; + } + + + /** + * Gets image_format + * + * @return \Aspose\BarCode\Model\BarcodeImageFormat + */ + public function getImageFormat() + { + return $this->container['image_format']; + } + + /** + * Sets image_format + * + * @param \Aspose\BarCode\Model\BarcodeImageFormat $image_format image_format + * + * @return $this + */ + public function setImageFormat($image_format) + { + $this->container['image_format'] = $image_format; + + return $this; + } + + /** + * Gets text_location + * + * @return \Aspose\BarCode\Model\CodeLocation + */ + public function getTextLocation() + { + return $this->container['text_location']; + } + + /** + * Sets text_location + * + * @param \Aspose\BarCode\Model\CodeLocation $text_location text_location + * + * @return $this + */ + public function setTextLocation($text_location) + { + $this->container['text_location'] = $text_location; + + return $this; + } + + /** + * Gets foreground_color + * + * @return string + */ + public function getForegroundColor() + { + return $this->container['foreground_color']; + } + + /** + * Sets foreground_color + * + * @param string $foreground_color Specify the displaying bars and content Color. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: Black. + * + * @return $this + */ + public function setForegroundColor($foreground_color) + { + $this->container['foreground_color'] = $foreground_color; + + return $this; + } + + /** + * Gets background_color + * + * @return string + */ + public function getBackgroundColor() + { + return $this->container['background_color']; + } + + /** + * Sets background_color + * + * @param string $background_color Background color of the barcode image. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: White. + * + * @return $this + */ + public function setBackgroundColor($background_color) + { + $this->container['background_color'] = $background_color; + + return $this; + } + + /** + * Gets units + * + * @return \Aspose\BarCode\Model\GraphicsUnit + */ + public function getUnits() + { + return $this->container['units']; + } + + /** + * Sets units + * + * @param \Aspose\BarCode\Model\GraphicsUnit $units units + * + * @return $this + */ + public function setUnits($units) + { + $this->container['units'] = $units; + + return $this; + } + + /** + * Gets resolution + * + * @return float + */ + public function getResolution() + { + return $this->container['resolution']; + } + + /** + * Sets resolution + * + * @param float $resolution Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. Decimal separator is dot. + * + * @return $this + */ + public function setResolution($resolution) + { + + if (!is_null($resolution) && ($resolution > 100000)) { + throw new \InvalidArgumentException('invalid value for $resolution when calling BarcodeImageParams., must be smaller than or equal to 100000.'); + } + if (!is_null($resolution) && ($resolution < 1)) { + throw new \InvalidArgumentException('invalid value for $resolution when calling BarcodeImageParams., must be bigger than or equal to 1.'); + } + + $this->container['resolution'] = $resolution; + + return $this; + } + + /** + * Gets image_height + * + * @return float + */ + public function getImageHeight() + { + return $this->container['image_height']; + } + + /** + * Sets image_height + * + * @param float $image_height Height of the barcode image in given units. Default units: pixel. Decimal separator is dot. + * + * @return $this + */ + public function setImageHeight($image_height) + { + $this->container['image_height'] = $image_height; + + return $this; + } + + /** + * Gets image_width + * + * @return float + */ + public function getImageWidth() + { + return $this->container['image_width']; + } + + /** + * Sets image_width + * + * @param float $image_width Width of the barcode image in given units. Default units: pixel. Decimal separator is dot. + * + * @return $this + */ + public function setImageWidth($image_width) + { + $this->container['image_width'] = $image_width; + + return $this; + } + + /** + * Gets rotation_angle + * + * @return int + */ + public function getRotationAngle() + { + return $this->container['rotation_angle']; + } + + /** + * Sets rotation_angle + * + * @param int $rotation_angle BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0. + * + * @return $this + */ + public function setRotationAngle($rotation_angle) + { + $this->container['rotation_angle'] = $rotation_angle; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/src/Aspose/BarCode/Model/BarcodeResponse.php b/src/Aspose/BarCode/Model/BarcodeResponse.php index 1d7e28c..f0ba940 100644 --- a/src/Aspose/BarCode/Model/BarcodeResponse.php +++ b/src/Aspose/BarCode/Model/BarcodeResponse.php @@ -74,10 +74,10 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'barcode_value' => 'BarcodeValue', - 'type' => 'Type', - 'region' => 'Region', - 'checksum' => 'Checksum' + 'barcode_value' => 'barcodeValue', + 'type' => 'type', + 'region' => 'region', + 'checksum' => 'checksum' ]; /** diff --git a/src/Aspose/BarCode/Model/BarcodeResponseList.php b/src/Aspose/BarCode/Model/BarcodeResponseList.php index 55ea6e6..6feca83 100644 --- a/src/Aspose/BarCode/Model/BarcodeResponseList.php +++ b/src/Aspose/BarCode/Model/BarcodeResponseList.php @@ -68,7 +68,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'barcodes' => 'Barcodes' + 'barcodes' => 'barcodes' ]; /** @@ -161,6 +161,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['barcodes'] === null) { + $invalidProperties[] = "'barcodes' can't be null"; + } return $invalidProperties; } @@ -172,6 +175,9 @@ public function listInvalidProperties() */ public function valid() { + if ($this->container['barcodes'] === null) { + return false; + } return true; } diff --git a/src/Aspose/BarCode/Model/BorderDashStyle.php b/src/Aspose/BarCode/Model/BorderDashStyle.php deleted file mode 100644 index 50002b7..0000000 --- a/src/Aspose/BarCode/Model/BorderDashStyle.php +++ /dev/null @@ -1,41 +0,0 @@ - - /// Enum value Solid - /// - public const Solid = "Solid"; - - /// - /// Enum value Dash - /// - public const Dash = "Dash"; - - /// - /// Enum value Dot - /// - public const Dot = "Dot"; - - /// - /// Enum value DashDot - /// - public const DashDot = "DashDot"; - - /// - /// Enum value DashDotDot - /// - public const DashDotDot = "DashDotDot"; - -} diff --git a/src/Aspose/BarCode/Model/CaptionParams.php b/src/Aspose/BarCode/Model/CaptionParams.php deleted file mode 100644 index a0081d1..0000000 --- a/src/Aspose/BarCode/Model/CaptionParams.php +++ /dev/null @@ -1,453 +0,0 @@ - 'string', - 'alignment' => '\Aspose\BarCode\Model\TextAlignment', - 'color' => 'string', - 'visible' => 'bool', - 'font' => '\Aspose\BarCode\Model\FontParams', - 'padding' => '\Aspose\BarCode\Model\Padding', - 'no_wrap' => 'bool' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'text' => null, - 'alignment' => null, - 'color' => null, - 'visible' => null, - 'font' => null, - 'padding' => null, - 'no_wrap' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'text' => 'Text', - 'alignment' => 'Alignment', - 'color' => 'Color', - 'visible' => 'Visible', - 'font' => 'Font', - 'padding' => 'Padding', - 'no_wrap' => 'NoWrap' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'text' => 'setText', - 'alignment' => 'setAlignment', - 'color' => 'setColor', - 'visible' => 'setVisible', - 'font' => 'setFont', - 'padding' => 'setPadding', - 'no_wrap' => 'setNoWrap' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'text' => 'getText', - 'alignment' => 'getAlignment', - 'color' => 'getColor', - 'visible' => 'getVisible', - 'font' => 'getFont', - 'padding' => 'getPadding', - 'no_wrap' => 'getNoWrap' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['text'] = isset($data['text']) ? $data['text'] : null; - $this->container['alignment'] = isset($data['alignment']) ? $data['alignment'] : null; - $this->container['color'] = isset($data['color']) ? $data['color'] : null; - $this->container['visible'] = isset($data['visible']) ? $data['visible'] : null; - $this->container['font'] = isset($data['font']) ? $data['font'] : null; - $this->container['padding'] = isset($data['padding']) ? $data['padding'] : null; - $this->container['no_wrap'] = isset($data['no_wrap']) ? $data['no_wrap'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets text - * - * @return string - */ - public function getText() - { - return $this->container['text']; - } - - /** - * Sets text - * - * @param string $text Caption text. - * - * @return $this - */ - public function setText($text) - { - $this->container['text'] = $text; - - return $this; - } - - /** - * Gets alignment - * - * @return \Aspose\BarCode\Model\TextAlignment - */ - public function getAlignment() - { - return $this->container['alignment']; - } - - /** - * Sets alignment - * - * @param \Aspose\BarCode\Model\TextAlignment $alignment Text alignment. - * - * @return $this - */ - public function setAlignment($alignment) - { - $this->container['alignment'] = $alignment; - - return $this; - } - - /** - * Gets color - * - * @return string - */ - public function getColor() - { - return $this->container['color']; - } - - /** - * Sets color - * - * @param string $color Text color. Default value: black Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF - * - * @return $this - */ - public function setColor($color) - { - $this->container['color'] = $color; - - return $this; - } - - /** - * Gets visible - * - * @return bool - */ - public function getVisible() - { - return $this->container['visible']; - } - - /** - * Sets visible - * - * @param bool $visible Is caption visible. - * - * @return $this - */ - public function setVisible($visible) - { - $this->container['visible'] = $visible; - - return $this; - } - - /** - * Gets font - * - * @return \Aspose\BarCode\Model\FontParams - */ - public function getFont() - { - return $this->container['font']; - } - - /** - * Sets font - * - * @param \Aspose\BarCode\Model\FontParams $font Font. - * - * @return $this - */ - public function setFont($font) - { - $this->container['font'] = $font; - - return $this; - } - - /** - * Gets padding - * - * @return \Aspose\BarCode\Model\Padding - */ - public function getPadding() - { - return $this->container['padding']; - } - - /** - * Sets padding - * - * @param \Aspose\BarCode\Model\Padding $padding Padding. - * - * @return $this - */ - public function setPadding($padding) - { - $this->container['padding'] = $padding; - - return $this; - } - - /** - * Gets no_wrap - * - * @return bool - */ - public function getNoWrap() - { - return $this->container['no_wrap']; - } - - /** - * Sets no_wrap - * - * @param bool $no_wrap Specify word wraps (line breaks) within text. Default value: false. - * - * @return $this - */ - public function setNoWrap($no_wrap) - { - $this->container['no_wrap'] = $no_wrap; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/ChecksumValidation.php b/src/Aspose/BarCode/Model/ChecksumValidation.php deleted file mode 100644 index 9107b69..0000000 --- a/src/Aspose/BarCode/Model/ChecksumValidation.php +++ /dev/null @@ -1,31 +0,0 @@ - - /// Enum value Default - /// - public const Default = "Default"; - - /// - /// Enum value On - /// - public const On = "On"; - - /// - /// Enum value Off - /// - public const Off = "Off"; - -} diff --git a/src/Aspose/BarCode/Model/CodabarChecksumMode.php b/src/Aspose/BarCode/Model/CodabarChecksumMode.php deleted file mode 100644 index f567462..0000000 --- a/src/Aspose/BarCode/Model/CodabarChecksumMode.php +++ /dev/null @@ -1,26 +0,0 @@ - - /// Enum value Mod10 - /// - public const Mod10 = "Mod10"; - - /// - /// Enum value Mod16 - /// - public const Mod16 = "Mod16"; - -} diff --git a/src/Aspose/BarCode/Model/CodabarParams.php b/src/Aspose/BarCode/Model/CodabarParams.php deleted file mode 100644 index 791ea32..0000000 --- a/src/Aspose/BarCode/Model/CodabarParams.php +++ /dev/null @@ -1,333 +0,0 @@ - '\Aspose\BarCode\Model\CodabarChecksumMode', - 'start_symbol' => '\Aspose\BarCode\Model\CodabarSymbol', - 'stop_symbol' => '\Aspose\BarCode\Model\CodabarSymbol' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'checksum_mode' => null, - 'start_symbol' => null, - 'stop_symbol' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'checksum_mode' => 'ChecksumMode', - 'start_symbol' => 'StartSymbol', - 'stop_symbol' => 'StopSymbol' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'checksum_mode' => 'setChecksumMode', - 'start_symbol' => 'setStartSymbol', - 'stop_symbol' => 'setStopSymbol' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'checksum_mode' => 'getChecksumMode', - 'start_symbol' => 'getStartSymbol', - 'stop_symbol' => 'getStopSymbol' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['checksum_mode'] = isset($data['checksum_mode']) ? $data['checksum_mode'] : null; - $this->container['start_symbol'] = isset($data['start_symbol']) ? $data['start_symbol'] : null; - $this->container['stop_symbol'] = isset($data['stop_symbol']) ? $data['stop_symbol'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets checksum_mode - * - * @return \Aspose\BarCode\Model\CodabarChecksumMode - */ - public function getChecksumMode() - { - return $this->container['checksum_mode']; - } - - /** - * Sets checksum_mode - * - * @param \Aspose\BarCode\Model\CodabarChecksumMode $checksum_mode Checksum algorithm for Codabar barcodes. Default value: CodabarChecksumMode.Mod16. To enable checksum calculation set value EnableChecksum.Yes to property EnableChecksum. - * - * @return $this - */ - public function setChecksumMode($checksum_mode) - { - $this->container['checksum_mode'] = $checksum_mode; - - return $this; - } - - /** - * Gets start_symbol - * - * @return \Aspose\BarCode\Model\CodabarSymbol - */ - public function getStartSymbol() - { - return $this->container['start_symbol']; - } - - /** - * Sets start_symbol - * - * @param \Aspose\BarCode\Model\CodabarSymbol $start_symbol Start symbol (character) of Codabar symbology. Default value: CodabarSymbol.A - * - * @return $this - */ - public function setStartSymbol($start_symbol) - { - $this->container['start_symbol'] = $start_symbol; - - return $this; - } - - /** - * Gets stop_symbol - * - * @return \Aspose\BarCode\Model\CodabarSymbol - */ - public function getStopSymbol() - { - return $this->container['stop_symbol']; - } - - /** - * Sets stop_symbol - * - * @param \Aspose\BarCode\Model\CodabarSymbol $stop_symbol Stop symbol (character) of Codabar symbology. Default value: CodabarSymbol.A - * - * @return $this - */ - public function setStopSymbol($stop_symbol) - { - $this->container['stop_symbol'] = $stop_symbol; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/CodabarSymbol.php b/src/Aspose/BarCode/Model/CodabarSymbol.php deleted file mode 100644 index 02e3a4a..0000000 --- a/src/Aspose/BarCode/Model/CodabarSymbol.php +++ /dev/null @@ -1,36 +0,0 @@ - - /// Enum value A - /// - public const A = "A"; - - /// - /// Enum value B - /// - public const B = "B"; - - /// - /// Enum value C - /// - public const C = "C"; - - /// - /// Enum value D - /// - public const D = "D"; - -} diff --git a/src/Aspose/BarCode/Model/CodablockParams.php b/src/Aspose/BarCode/Model/CodablockParams.php deleted file mode 100644 index 5c7dbb7..0000000 --- a/src/Aspose/BarCode/Model/CodablockParams.php +++ /dev/null @@ -1,333 +0,0 @@ - 'double', - 'columns' => 'int', - 'rows' => 'int' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'aspect_ratio' => 'double', - 'columns' => 'int32', - 'rows' => 'int32' - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'aspect_ratio' => 'AspectRatio', - 'columns' => 'Columns', - 'rows' => 'Rows' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'aspect_ratio' => 'setAspectRatio', - 'columns' => 'setColumns', - 'rows' => 'setRows' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'aspect_ratio' => 'getAspectRatio', - 'columns' => 'getColumns', - 'rows' => 'getRows' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['aspect_ratio'] = isset($data['aspect_ratio']) ? $data['aspect_ratio'] : null; - $this->container['columns'] = isset($data['columns']) ? $data['columns'] : null; - $this->container['rows'] = isset($data['rows']) ? $data['rows'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets aspect_ratio - * - * @return double - */ - public function getAspectRatio() - { - return $this->container['aspect_ratio']; - } - - /** - * Sets aspect_ratio - * - * @param double $aspect_ratio Height/Width ratio of 2D BarCode module. - * - * @return $this - */ - public function setAspectRatio($aspect_ratio) - { - $this->container['aspect_ratio'] = $aspect_ratio; - - return $this; - } - - /** - * Gets columns - * - * @return int - */ - public function getColumns() - { - return $this->container['columns']; - } - - /** - * Sets columns - * - * @param int $columns Columns count. - * - * @return $this - */ - public function setColumns($columns) - { - $this->container['columns'] = $columns; - - return $this; - } - - /** - * Gets rows - * - * @return int - */ - public function getRows() - { - return $this->container['rows']; - } - - /** - * Sets rows - * - * @param int $rows Rows count. - * - * @return $this - */ - public function setRows($rows) - { - $this->container['rows'] = $rows; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/Code128Emulation.php b/src/Aspose/BarCode/Model/Code128Emulation.php deleted file mode 100644 index 5bf378d..0000000 --- a/src/Aspose/BarCode/Model/Code128Emulation.php +++ /dev/null @@ -1,36 +0,0 @@ - - /// Enum value None - /// - public const None = "None"; - - /// - /// Enum value Code903 - /// - public const Code903 = "Code903"; - - /// - /// Enum value Code904 - /// - public const Code904 = "Code904"; - - /// - /// Enum value Code905 - /// - public const Code905 = "Code905"; - -} diff --git a/src/Aspose/BarCode/Model/Code128EncodeMode.php b/src/Aspose/BarCode/Model/Code128EncodeMode.php deleted file mode 100644 index 6fcae89..0000000 --- a/src/Aspose/BarCode/Model/Code128EncodeMode.php +++ /dev/null @@ -1,51 +0,0 @@ - - /// Enum value Auto - /// - public const Auto = "Auto"; - - /// - /// Enum value CodeA - /// - public const CodeA = "CodeA"; - - /// - /// Enum value CodeB - /// - public const CodeB = "CodeB"; - - /// - /// Enum value CodeAB - /// - public const CodeAB = "CodeAB"; - - /// - /// Enum value CodeC - /// - public const CodeC = "CodeC"; - - /// - /// Enum value CodeAC - /// - public const CodeAC = "CodeAC"; - - /// - /// Enum value CodeBC - /// - public const CodeBC = "CodeBC"; - -} diff --git a/src/Aspose/BarCode/Model/Code128Params.php b/src/Aspose/BarCode/Model/Code128Params.php deleted file mode 100644 index 078d6b3..0000000 --- a/src/Aspose/BarCode/Model/Code128Params.php +++ /dev/null @@ -1,273 +0,0 @@ - '\Aspose\BarCode\Model\Code128EncodeMode' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'encode_mode' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'encode_mode' => 'EncodeMode' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'encode_mode' => 'setEncodeMode' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'encode_mode' => 'getEncodeMode' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['encode_mode'] = isset($data['encode_mode']) ? $data['encode_mode'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets encode_mode - * - * @return \Aspose\BarCode\Model\Code128EncodeMode - */ - public function getEncodeMode() - { - return $this->container['encode_mode']; - } - - /** - * Sets encode_mode - * - * @param \Aspose\BarCode\Model\Code128EncodeMode $encode_mode Encoding mode for Code128 barcodes. Code 128 specification Default value: Code128EncodeMode.Auto. - * - * @return $this - */ - public function setEncodeMode($encode_mode) - { - $this->container['encode_mode'] = $encode_mode; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/Code16KParams.php b/src/Aspose/BarCode/Model/Code16KParams.php deleted file mode 100644 index 7c8d5fe..0000000 --- a/src/Aspose/BarCode/Model/Code16KParams.php +++ /dev/null @@ -1,333 +0,0 @@ - 'double', - 'quiet_zone_left_coef' => 'int', - 'quiet_zone_right_coef' => 'int' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'aspect_ratio' => 'double', - 'quiet_zone_left_coef' => 'int32', - 'quiet_zone_right_coef' => 'int32' - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'aspect_ratio' => 'AspectRatio', - 'quiet_zone_left_coef' => 'QuietZoneLeftCoef', - 'quiet_zone_right_coef' => 'QuietZoneRightCoef' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'aspect_ratio' => 'setAspectRatio', - 'quiet_zone_left_coef' => 'setQuietZoneLeftCoef', - 'quiet_zone_right_coef' => 'setQuietZoneRightCoef' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'aspect_ratio' => 'getAspectRatio', - 'quiet_zone_left_coef' => 'getQuietZoneLeftCoef', - 'quiet_zone_right_coef' => 'getQuietZoneRightCoef' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['aspect_ratio'] = isset($data['aspect_ratio']) ? $data['aspect_ratio'] : null; - $this->container['quiet_zone_left_coef'] = isset($data['quiet_zone_left_coef']) ? $data['quiet_zone_left_coef'] : null; - $this->container['quiet_zone_right_coef'] = isset($data['quiet_zone_right_coef']) ? $data['quiet_zone_right_coef'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets aspect_ratio - * - * @return double - */ - public function getAspectRatio() - { - return $this->container['aspect_ratio']; - } - - /** - * Sets aspect_ratio - * - * @param double $aspect_ratio Height/Width ratio of 2D BarCode module. - * - * @return $this - */ - public function setAspectRatio($aspect_ratio) - { - $this->container['aspect_ratio'] = $aspect_ratio; - - return $this; - } - - /** - * Gets quiet_zone_left_coef - * - * @return int - */ - public function getQuietZoneLeftCoef() - { - return $this->container['quiet_zone_left_coef']; - } - - /** - * Sets quiet_zone_left_coef - * - * @param int $quiet_zone_left_coef Size of the left quiet zone in xDimension. Default value: 10, meaning if xDimension = 2px than left quiet zone will be 20px. - * - * @return $this - */ - public function setQuietZoneLeftCoef($quiet_zone_left_coef) - { - $this->container['quiet_zone_left_coef'] = $quiet_zone_left_coef; - - return $this; - } - - /** - * Gets quiet_zone_right_coef - * - * @return int - */ - public function getQuietZoneRightCoef() - { - return $this->container['quiet_zone_right_coef']; - } - - /** - * Sets quiet_zone_right_coef - * - * @param int $quiet_zone_right_coef Size of the right quiet zone in xDimension. Default value: 1, meaning if xDimension = 2px than right quiet zone will be 2px. - * - * @return $this - */ - public function setQuietZoneRightCoef($quiet_zone_right_coef) - { - $this->container['quiet_zone_right_coef'] = $quiet_zone_right_coef; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/CodeLocation.php b/src/Aspose/BarCode/Model/CodeLocation.php index 7651ebe..5cc94b7 100644 --- a/src/Aspose/BarCode/Model/CodeLocation.php +++ b/src/Aspose/BarCode/Model/CodeLocation.php @@ -9,7 +9,6 @@ /** * CodeLocation * - * @description */ class CodeLocation { diff --git a/src/Aspose/BarCode/Model/CouponParams.php b/src/Aspose/BarCode/Model/CouponParams.php deleted file mode 100644 index 06fd7f7..0000000 --- a/src/Aspose/BarCode/Model/CouponParams.php +++ /dev/null @@ -1,273 +0,0 @@ - 'double' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'supplement_space' => 'double' - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'supplement_space' => 'SupplementSpace' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'supplement_space' => 'setSupplementSpace' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'supplement_space' => 'getSupplementSpace' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['supplement_space'] = isset($data['supplement_space']) ? $data['supplement_space'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets supplement_space - * - * @return double - */ - public function getSupplementSpace() - { - return $this->container['supplement_space']; - } - - /** - * Sets supplement_space - * - * @param double $supplement_space Space between main the BarCode and supplement BarCode in Unit value. - * - * @return $this - */ - public function setSupplementSpace($supplement_space) - { - $this->container['supplement_space'] = $supplement_space; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/CustomerInformationInterpretingType.php b/src/Aspose/BarCode/Model/CustomerInformationInterpretingType.php deleted file mode 100644 index 437bd06..0000000 --- a/src/Aspose/BarCode/Model/CustomerInformationInterpretingType.php +++ /dev/null @@ -1,31 +0,0 @@ - - /// Enum value CTable - /// - public const CTable = "CTable"; - - /// - /// Enum value NTable - /// - public const NTable = "NTable"; - - /// - /// Enum value Other - /// - public const Other = "Other"; - -} diff --git a/src/Aspose/BarCode/Model/DataBarParams.php b/src/Aspose/BarCode/Model/DataBarParams.php deleted file mode 100644 index 055bc00..0000000 --- a/src/Aspose/BarCode/Model/DataBarParams.php +++ /dev/null @@ -1,393 +0,0 @@ - 'double', - 'columns' => 'int', - 'rows' => 'int', - 'is2_d_composite_component' => 'bool', - 'is_allow_only_gs1_encoding' => 'bool' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'aspect_ratio' => 'double', - 'columns' => 'int32', - 'rows' => 'int32', - 'is2_d_composite_component' => null, - 'is_allow_only_gs1_encoding' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'aspect_ratio' => 'AspectRatio', - 'columns' => 'Columns', - 'rows' => 'Rows', - 'is2_d_composite_component' => 'Is2DCompositeComponent', - 'is_allow_only_gs1_encoding' => 'IsAllowOnlyGS1Encoding' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'aspect_ratio' => 'setAspectRatio', - 'columns' => 'setColumns', - 'rows' => 'setRows', - 'is2_d_composite_component' => 'setIs2DCompositeComponent', - 'is_allow_only_gs1_encoding' => 'setIsAllowOnlyGs1Encoding' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'aspect_ratio' => 'getAspectRatio', - 'columns' => 'getColumns', - 'rows' => 'getRows', - 'is2_d_composite_component' => 'getIs2DCompositeComponent', - 'is_allow_only_gs1_encoding' => 'getIsAllowOnlyGs1Encoding' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['aspect_ratio'] = isset($data['aspect_ratio']) ? $data['aspect_ratio'] : null; - $this->container['columns'] = isset($data['columns']) ? $data['columns'] : null; - $this->container['rows'] = isset($data['rows']) ? $data['rows'] : null; - $this->container['is2_d_composite_component'] = isset($data['is2_d_composite_component']) ? $data['is2_d_composite_component'] : null; - $this->container['is_allow_only_gs1_encoding'] = isset($data['is_allow_only_gs1_encoding']) ? $data['is_allow_only_gs1_encoding'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets aspect_ratio - * - * @return double - */ - public function getAspectRatio() - { - return $this->container['aspect_ratio']; - } - - /** - * Sets aspect_ratio - * - * @param double $aspect_ratio Height/Width ratio of 2D BarCode module. Used for DataBar stacked. - * - * @return $this - */ - public function setAspectRatio($aspect_ratio) - { - $this->container['aspect_ratio'] = $aspect_ratio; - - return $this; - } - - /** - * Gets columns - * - * @return int - */ - public function getColumns() - { - return $this->container['columns']; - } - - /** - * Sets columns - * - * @param int $columns Columns count. - * - * @return $this - */ - public function setColumns($columns) - { - $this->container['columns'] = $columns; - - return $this; - } - - /** - * Gets rows - * - * @return int - */ - public function getRows() - { - return $this->container['rows']; - } - - /** - * Sets rows - * - * @param int $rows Rows count. - * - * @return $this - */ - public function setRows($rows) - { - $this->container['rows'] = $rows; - - return $this; - } - - /** - * Gets is2_d_composite_component - * - * @return bool - */ - public function getIs2DCompositeComponent() - { - return $this->container['is2_d_composite_component']; - } - - /** - * Sets is2_d_composite_component - * - * @param bool $is2_d_composite_component Enables flag of 2D composite component with DataBar barcode - * - * @return $this - */ - public function setIs2DCompositeComponent($is2_d_composite_component) - { - $this->container['is2_d_composite_component'] = $is2_d_composite_component; - - return $this; - } - - /** - * Gets is_allow_only_gs1_encoding - * - * @return bool - */ - public function getIsAllowOnlyGs1Encoding() - { - return $this->container['is_allow_only_gs1_encoding']; - } - - /** - * Sets is_allow_only_gs1_encoding - * - * @param bool $is_allow_only_gs1_encoding If this flag is set, it allows only GS1 encoding standard for Databar barcode types - * - * @return $this - */ - public function setIsAllowOnlyGs1Encoding($is_allow_only_gs1_encoding) - { - $this->container['is_allow_only_gs1_encoding'] = $is_allow_only_gs1_encoding; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/DataMatrixEccType.php b/src/Aspose/BarCode/Model/DataMatrixEccType.php deleted file mode 100644 index ccb8182..0000000 --- a/src/Aspose/BarCode/Model/DataMatrixEccType.php +++ /dev/null @@ -1,51 +0,0 @@ - - /// Enum value EccAuto - /// - public const EccAuto = "EccAuto"; - - /// - /// Enum value Ecc000 - /// - public const Ecc000 = "Ecc000"; - - /// - /// Enum value Ecc050 - /// - public const Ecc050 = "Ecc050"; - - /// - /// Enum value Ecc080 - /// - public const Ecc080 = "Ecc080"; - - /// - /// Enum value Ecc100 - /// - public const Ecc100 = "Ecc100"; - - /// - /// Enum value Ecc140 - /// - public const Ecc140 = "Ecc140"; - - /// - /// Enum value Ecc200 - /// - public const Ecc200 = "Ecc200"; - -} diff --git a/src/Aspose/BarCode/Model/DataMatrixEncodeMode.php b/src/Aspose/BarCode/Model/DataMatrixEncodeMode.php deleted file mode 100644 index 222242c..0000000 --- a/src/Aspose/BarCode/Model/DataMatrixEncodeMode.php +++ /dev/null @@ -1,61 +0,0 @@ - - /// Enum value Auto - /// - public const Auto = "Auto"; - - /// - /// Enum value ASCII - /// - public const ASCII = "ASCII"; - - /// - /// Enum value Full - /// - public const Full = "Full"; - - /// - /// Enum value Custom - /// - public const Custom = "Custom"; - - /// - /// Enum value C40 - /// - public const C40 = "C40"; - - /// - /// Enum value Text - /// - public const Text = "Text"; - - /// - /// Enum value EDIFACT - /// - public const EDIFACT = "EDIFACT"; - - /// - /// Enum value ANSIX12 - /// - public const ANSIX12 = "ANSIX12"; - - /// - /// Enum value ExtendedCodetext - /// - public const ExtendedCodetext = "ExtendedCodetext"; - -} diff --git a/src/Aspose/BarCode/Model/DataMatrixParams.php b/src/Aspose/BarCode/Model/DataMatrixParams.php deleted file mode 100644 index 471b756..0000000 --- a/src/Aspose/BarCode/Model/DataMatrixParams.php +++ /dev/null @@ -1,486 +0,0 @@ - 'double', - 'text_encoding' => 'string', - 'columns' => 'int', - 'data_matrix_ecc' => '\Aspose\BarCode\Model\DataMatrixEccType', - 'data_matrix_encode_mode' => '\Aspose\BarCode\Model\DataMatrixEncodeMode', - 'rows' => 'int', - 'macro_characters' => '\Aspose\BarCode\Model\MacroCharacter', - 'version' => '\Aspose\BarCode\Model\DataMatrixVersion' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'aspect_ratio' => 'double', - 'text_encoding' => null, - 'columns' => 'int32', - 'data_matrix_ecc' => null, - 'data_matrix_encode_mode' => null, - 'rows' => 'int32', - 'macro_characters' => null, - 'version' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'aspect_ratio' => 'AspectRatio', - 'text_encoding' => 'TextEncoding', - 'columns' => 'Columns', - 'data_matrix_ecc' => 'DataMatrixEcc', - 'data_matrix_encode_mode' => 'DataMatrixEncodeMode', - 'rows' => 'Rows', - 'macro_characters' => 'MacroCharacters', - 'version' => 'Version' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'aspect_ratio' => 'setAspectRatio', - 'text_encoding' => 'setTextEncoding', - 'columns' => 'setColumns', - 'data_matrix_ecc' => 'setDataMatrixEcc', - 'data_matrix_encode_mode' => 'setDataMatrixEncodeMode', - 'rows' => 'setRows', - 'macro_characters' => 'setMacroCharacters', - 'version' => 'setVersion' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'aspect_ratio' => 'getAspectRatio', - 'text_encoding' => 'getTextEncoding', - 'columns' => 'getColumns', - 'data_matrix_ecc' => 'getDataMatrixEcc', - 'data_matrix_encode_mode' => 'getDataMatrixEncodeMode', - 'rows' => 'getRows', - 'macro_characters' => 'getMacroCharacters', - 'version' => 'getVersion' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['aspect_ratio'] = isset($data['aspect_ratio']) ? $data['aspect_ratio'] : null; - $this->container['text_encoding'] = isset($data['text_encoding']) ? $data['text_encoding'] : null; - $this->container['columns'] = isset($data['columns']) ? $data['columns'] : null; - $this->container['data_matrix_ecc'] = isset($data['data_matrix_ecc']) ? $data['data_matrix_ecc'] : null; - $this->container['data_matrix_encode_mode'] = isset($data['data_matrix_encode_mode']) ? $data['data_matrix_encode_mode'] : null; - $this->container['rows'] = isset($data['rows']) ? $data['rows'] : null; - $this->container['macro_characters'] = isset($data['macro_characters']) ? $data['macro_characters'] : null; - $this->container['version'] = isset($data['version']) ? $data['version'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets aspect_ratio - * - * @return double - */ - public function getAspectRatio() - { - return $this->container['aspect_ratio']; - } - - /** - * Sets aspect_ratio - * - * @param double $aspect_ratio Height/Width ratio of 2D BarCode module - * - * @return $this - */ - public function setAspectRatio($aspect_ratio) - { - $this->container['aspect_ratio'] = $aspect_ratio; - - return $this; - } - - /** - * Gets text_encoding - * - * @return string - */ - public function getTextEncoding() - { - return $this->container['text_encoding']; - } - - /** - * Sets text_encoding - * - * @param string $text_encoding DEPRECATED: This property is obsolete and will be removed in future releases. Unicode symbols detection and encoding will be processed in Auto mode with Extended Channel Interpretation charset designator. Using of own encodings requires manual CodeText encoding into byte[] array. Sets the encoding of codetext. - * - * @return $this - */ - public function setTextEncoding($text_encoding) - { - trigger_error('Property $text_encoding is deprecated. This property is obsolete and will be removed in future releases. Unicode symbols detection and encoding will be processed in Auto mode with Extended Channel Interpretation charset designator. Using of own encodings requires manual CodeText encoding into byte[] array. Sets the encoding of codetext.', E_USER_DEPRECATED); - $this->container['text_encoding'] = $text_encoding; - - return $this; - } - - /** - * Gets columns - * - * @return int - */ - public function getColumns() - { - return $this->container['columns']; - } - - /** - * Sets columns - * - * @param int $columns DEPRECATED: Will be replaced with 'DataMatrix.Version' in the next release Columns count. - * - * @return $this - */ - public function setColumns($columns) - { - trigger_error('Property $columns is deprecated. Will be replaced with \'DataMatrix.Version\' in the next release Columns count.', E_USER_DEPRECATED); - $this->container['columns'] = $columns; - - return $this; - } - - /** - * Gets data_matrix_ecc - * - * @return \Aspose\BarCode\Model\DataMatrixEccType - */ - public function getDataMatrixEcc() - { - return $this->container['data_matrix_ecc']; - } - - /** - * Sets data_matrix_ecc - * - * @param \Aspose\BarCode\Model\DataMatrixEccType $data_matrix_ecc Datamatrix ECC type. Default value: DataMatrixEccType.Ecc200. - * - * @return $this - */ - public function setDataMatrixEcc($data_matrix_ecc) - { - $this->container['data_matrix_ecc'] = $data_matrix_ecc; - - return $this; - } - - /** - * Gets data_matrix_encode_mode - * - * @return \Aspose\BarCode\Model\DataMatrixEncodeMode - */ - public function getDataMatrixEncodeMode() - { - return $this->container['data_matrix_encode_mode']; - } - - /** - * Sets data_matrix_encode_mode - * - * @param \Aspose\BarCode\Model\DataMatrixEncodeMode $data_matrix_encode_mode Encode mode of Datamatrix barcode. Default value: DataMatrixEncodeMode.Auto. - * - * @return $this - */ - public function setDataMatrixEncodeMode($data_matrix_encode_mode) - { - $this->container['data_matrix_encode_mode'] = $data_matrix_encode_mode; - - return $this; - } - - /** - * Gets rows - * - * @return int - */ - public function getRows() - { - return $this->container['rows']; - } - - /** - * Sets rows - * - * @param int $rows DEPRECATED: Will be replaced with 'DataMatrix.Version' in the next release Rows count. - * - * @return $this - */ - public function setRows($rows) - { - trigger_error('Property $rows is deprecated. Will be replaced with \'DataMatrix.Version\' in the next release Rows count.', E_USER_DEPRECATED); - $this->container['rows'] = $rows; - - return $this; - } - - /** - * Gets macro_characters - * - * @return \Aspose\BarCode\Model\MacroCharacter - */ - public function getMacroCharacters() - { - return $this->container['macro_characters']; - } - - /** - * Sets macro_characters - * - * @param \Aspose\BarCode\Model\MacroCharacter $macro_characters Macro Characters 05 and 06 values are used to obtain more compact encoding in special modes. Can be used only with DataMatrixEccType.Ecc200 or DataMatrixEccType.EccAuto. Cannot be used with EncodeTypes.GS1DataMatrix Default value: MacroCharacters.None. - * - * @return $this - */ - public function setMacroCharacters($macro_characters) - { - $this->container['macro_characters'] = $macro_characters; - - return $this; - } - - /** - * Gets version - * - * @return \Aspose\BarCode\Model\DataMatrixVersion - */ - public function getVersion() - { - return $this->container['version']; - } - - /** - * Sets version - * - * @param \Aspose\BarCode\Model\DataMatrixVersion $version Sets a Datamatrix symbol size. Default value: DataMatrixVersion.Auto. - * - * @return $this - */ - public function setVersion($version) - { - $this->container['version'] = $version; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/DataMatrixVersion.php b/src/Aspose/BarCode/Model/DataMatrixVersion.php deleted file mode 100644 index 64ba66f..0000000 --- a/src/Aspose/BarCode/Model/DataMatrixVersion.php +++ /dev/null @@ -1,371 +0,0 @@ - - /// Enum value Auto - /// - public const Auto = "Auto"; - - /// - /// Enum value RowsColumns - /// - public const RowsColumns = "RowsColumns"; - - /// - /// Enum value ECC000_9x9 - /// - public const ECC000_9x9 = "ECC000_9x9"; - - /// - /// Enum value ECC000_050_11x11 - /// - public const ECC000_050_11x11 = "ECC000_050_11x11"; - - /// - /// Enum value ECC000_100_13x13 - /// - public const ECC000_100_13x13 = "ECC000_100_13x13"; - - /// - /// Enum value ECC000_100_15x15 - /// - public const ECC000_100_15x15 = "ECC000_100_15x15"; - - /// - /// Enum value ECC000_140_17x17 - /// - public const ECC000_140_17x17 = "ECC000_140_17x17"; - - /// - /// Enum value ECC000_140_19x19 - /// - public const ECC000_140_19x19 = "ECC000_140_19x19"; - - /// - /// Enum value ECC000_140_21x21 - /// - public const ECC000_140_21x21 = "ECC000_140_21x21"; - - /// - /// Enum value ECC000_140_23x23 - /// - public const ECC000_140_23x23 = "ECC000_140_23x23"; - - /// - /// Enum value ECC000_140_25x25 - /// - public const ECC000_140_25x25 = "ECC000_140_25x25"; - - /// - /// Enum value ECC000_140_27x27 - /// - public const ECC000_140_27x27 = "ECC000_140_27x27"; - - /// - /// Enum value ECC000_140_29x29 - /// - public const ECC000_140_29x29 = "ECC000_140_29x29"; - - /// - /// Enum value ECC000_140_31x31 - /// - public const ECC000_140_31x31 = "ECC000_140_31x31"; - - /// - /// Enum value ECC000_140_33x33 - /// - public const ECC000_140_33x33 = "ECC000_140_33x33"; - - /// - /// Enum value ECC000_140_35x35 - /// - public const ECC000_140_35x35 = "ECC000_140_35x35"; - - /// - /// Enum value ECC000_140_37x37 - /// - public const ECC000_140_37x37 = "ECC000_140_37x37"; - - /// - /// Enum value ECC000_140_39x39 - /// - public const ECC000_140_39x39 = "ECC000_140_39x39"; - - /// - /// Enum value ECC000_140_41x41 - /// - public const ECC000_140_41x41 = "ECC000_140_41x41"; - - /// - /// Enum value ECC000_140_43x43 - /// - public const ECC000_140_43x43 = "ECC000_140_43x43"; - - /// - /// Enum value ECC000_140_45x45 - /// - public const ECC000_140_45x45 = "ECC000_140_45x45"; - - /// - /// Enum value ECC000_140_47x47 - /// - public const ECC000_140_47x47 = "ECC000_140_47x47"; - - /// - /// Enum value ECC000_140_49x49 - /// - public const ECC000_140_49x49 = "ECC000_140_49x49"; - - /// - /// Enum value ECC200_10x10 - /// - public const ECC200_10x10 = "ECC200_10x10"; - - /// - /// Enum value ECC200_12x12 - /// - public const ECC200_12x12 = "ECC200_12x12"; - - /// - /// Enum value ECC200_14x14 - /// - public const ECC200_14x14 = "ECC200_14x14"; - - /// - /// Enum value ECC200_16x16 - /// - public const ECC200_16x16 = "ECC200_16x16"; - - /// - /// Enum value ECC200_18x18 - /// - public const ECC200_18x18 = "ECC200_18x18"; - - /// - /// Enum value ECC200_20x20 - /// - public const ECC200_20x20 = "ECC200_20x20"; - - /// - /// Enum value ECC200_22x22 - /// - public const ECC200_22x22 = "ECC200_22x22"; - - /// - /// Enum value ECC200_24x24 - /// - public const ECC200_24x24 = "ECC200_24x24"; - - /// - /// Enum value ECC200_26x26 - /// - public const ECC200_26x26 = "ECC200_26x26"; - - /// - /// Enum value ECC200_32x32 - /// - public const ECC200_32x32 = "ECC200_32x32"; - - /// - /// Enum value ECC200_36x36 - /// - public const ECC200_36x36 = "ECC200_36x36"; - - /// - /// Enum value ECC200_40x40 - /// - public const ECC200_40x40 = "ECC200_40x40"; - - /// - /// Enum value ECC200_44x44 - /// - public const ECC200_44x44 = "ECC200_44x44"; - - /// - /// Enum value ECC200_48x48 - /// - public const ECC200_48x48 = "ECC200_48x48"; - - /// - /// Enum value ECC200_52x52 - /// - public const ECC200_52x52 = "ECC200_52x52"; - - /// - /// Enum value ECC200_64x64 - /// - public const ECC200_64x64 = "ECC200_64x64"; - - /// - /// Enum value ECC200_72x72 - /// - public const ECC200_72x72 = "ECC200_72x72"; - - /// - /// Enum value ECC200_80x80 - /// - public const ECC200_80x80 = "ECC200_80x80"; - - /// - /// Enum value ECC200_88x88 - /// - public const ECC200_88x88 = "ECC200_88x88"; - - /// - /// Enum value ECC200_96x96 - /// - public const ECC200_96x96 = "ECC200_96x96"; - - /// - /// Enum value ECC200_104x104 - /// - public const ECC200_104x104 = "ECC200_104x104"; - - /// - /// Enum value ECC200_120x120 - /// - public const ECC200_120x120 = "ECC200_120x120"; - - /// - /// Enum value ECC200_132x132 - /// - public const ECC200_132x132 = "ECC200_132x132"; - - /// - /// Enum value ECC200_144x144 - /// - public const ECC200_144x144 = "ECC200_144x144"; - - /// - /// Enum value ECC200_8x18 - /// - public const ECC200_8x18 = "ECC200_8x18"; - - /// - /// Enum value ECC200_8x32 - /// - public const ECC200_8x32 = "ECC200_8x32"; - - /// - /// Enum value ECC200_12x26 - /// - public const ECC200_12x26 = "ECC200_12x26"; - - /// - /// Enum value ECC200_12x36 - /// - public const ECC200_12x36 = "ECC200_12x36"; - - /// - /// Enum value ECC200_16x36 - /// - public const ECC200_16x36 = "ECC200_16x36"; - - /// - /// Enum value ECC200_16x48 - /// - public const ECC200_16x48 = "ECC200_16x48"; - - /// - /// Enum value DMRE_8x48 - /// - public const DMRE_8x48 = "DMRE_8x48"; - - /// - /// Enum value DMRE_8x64 - /// - public const DMRE_8x64 = "DMRE_8x64"; - - /// - /// Enum value DMRE_8x80 - /// - public const DMRE_8x80 = "DMRE_8x80"; - - /// - /// Enum value DMRE_8x96 - /// - public const DMRE_8x96 = "DMRE_8x96"; - - /// - /// Enum value DMRE_8x120 - /// - public const DMRE_8x120 = "DMRE_8x120"; - - /// - /// Enum value DMRE_8x144 - /// - public const DMRE_8x144 = "DMRE_8x144"; - - /// - /// Enum value DMRE_12x64 - /// - public const DMRE_12x64 = "DMRE_12x64"; - - /// - /// Enum value DMRE_12x88 - /// - public const DMRE_12x88 = "DMRE_12x88"; - - /// - /// Enum value DMRE_16x64 - /// - public const DMRE_16x64 = "DMRE_16x64"; - - /// - /// Enum value DMRE_20x36 - /// - public const DMRE_20x36 = "DMRE_20x36"; - - /// - /// Enum value DMRE_20x44 - /// - public const DMRE_20x44 = "DMRE_20x44"; - - /// - /// Enum value DMRE_20x64 - /// - public const DMRE_20x64 = "DMRE_20x64"; - - /// - /// Enum value DMRE_22x48 - /// - public const DMRE_22x48 = "DMRE_22x48"; - - /// - /// Enum value DMRE_24x48 - /// - public const DMRE_24x48 = "DMRE_24x48"; - - /// - /// Enum value DMRE_24x64 - /// - public const DMRE_24x64 = "DMRE_24x64"; - - /// - /// Enum value DMRE_26x40 - /// - public const DMRE_26x40 = "DMRE_26x40"; - - /// - /// Enum value DMRE_26x48 - /// - public const DMRE_26x48 = "DMRE_26x48"; - - /// - /// Enum value DMRE_26x64 - /// - public const DMRE_26x64 = "DMRE_26x64"; - -} diff --git a/src/Aspose/BarCode/Model/DecodeBarcodeType.php b/src/Aspose/BarCode/Model/DecodeBarcodeType.php index f25faee..d9887de 100644 --- a/src/Aspose/BarCode/Model/DecodeBarcodeType.php +++ b/src/Aspose/BarCode/Model/DecodeBarcodeType.php @@ -9,14 +9,19 @@ /** * DecodeBarcodeType * - * @description See DecodeType + * @description See Aspose.BarCode.Aspose.BarCode.BarCodeRecognition.DecodeType */ class DecodeBarcodeType { /// - /// Enum value all + /// Enum value MostCommonlyUsed /// - public const all = "all"; + public const MostCommonlyUsed = "MostCommonlyUsed"; + + /// + /// Enum value QR + /// + public const QR = "QR"; /// /// Enum value AustraliaPost @@ -24,20 +29,25 @@ class DecodeBarcodeType public const AustraliaPost = "AustraliaPost"; /// - /// Enum value Aztec + /// Enum value AustralianPosteParcel /// - public const Aztec = "Aztec"; + public const AustralianPosteParcel = "AustralianPosteParcel"; /// - /// Enum value ISBN + /// Enum value Aztec /// - public const ISBN = "ISBN"; + public const Aztec = "Aztec"; /// /// Enum value Codabar /// public const Codabar = "Codabar"; + /// + /// Enum value CodablockF + /// + public const CodablockF = "CodablockF"; + /// /// Enum value Code11 /// @@ -49,269 +59,264 @@ class DecodeBarcodeType public const Code128 = "Code128"; /// - /// Enum value GS1Code128 - /// - public const GS1Code128 = "GS1Code128"; - - /// - /// Enum value Code39Extended + /// Enum value Code16K /// - public const Code39Extended = "Code39Extended"; + public const Code16K = "Code16K"; /// - /// Enum value Code39Standard + /// Enum value Code32 /// - public const Code39Standard = "Code39Standard"; + public const Code32 = "Code32"; /// - /// Enum value Code93Extended + /// Enum value Code39 /// - public const Code93Extended = "Code93Extended"; + public const Code39 = "Code39"; /// - /// Enum value Code93Standard + /// Enum value Code39FullASCII /// - public const Code93Standard = "Code93Standard"; + public const Code39FullASCII = "Code39FullASCII"; /// - /// Enum value DataMatrix + /// Enum value Code93 /// - public const DataMatrix = "DataMatrix"; + public const Code93 = "Code93"; /// - /// Enum value DeutschePostIdentcode + /// Enum value CompactPdf417 /// - public const DeutschePostIdentcode = "DeutschePostIdentcode"; + public const CompactPdf417 = "CompactPdf417"; /// - /// Enum value DeutschePostLeitcode + /// Enum value DataLogic2of5 /// - public const DeutschePostLeitcode = "DeutschePostLeitcode"; + public const DataLogic2of5 = "DataLogic2of5"; /// - /// Enum value EAN13 + /// Enum value DataMatrix /// - public const EAN13 = "EAN13"; + public const DataMatrix = "DataMatrix"; /// - /// Enum value EAN14 + /// Enum value DatabarExpanded /// - public const EAN14 = "EAN14"; + public const DatabarExpanded = "DatabarExpanded"; /// - /// Enum value EAN8 + /// Enum value DatabarExpandedStacked /// - public const EAN8 = "EAN8"; + public const DatabarExpandedStacked = "DatabarExpandedStacked"; /// - /// Enum value IATA2of5 + /// Enum value DatabarLimited /// - public const IATA2of5 = "IATA2of5"; + public const DatabarLimited = "DatabarLimited"; /// - /// Enum value Interleaved2of5 + /// Enum value DatabarOmniDirectional /// - public const Interleaved2of5 = "Interleaved2of5"; + public const DatabarOmniDirectional = "DatabarOmniDirectional"; /// - /// Enum value ISSN + /// Enum value DatabarStacked /// - public const ISSN = "ISSN"; + public const DatabarStacked = "DatabarStacked"; /// - /// Enum value ISMN + /// Enum value DatabarStackedOmniDirectional /// - public const ISMN = "ISMN"; + public const DatabarStackedOmniDirectional = "DatabarStackedOmniDirectional"; /// - /// Enum value ItalianPost25 + /// Enum value DatabarTruncated /// - public const ItalianPost25 = "ItalianPost25"; + public const DatabarTruncated = "DatabarTruncated"; /// - /// Enum value ITF14 + /// Enum value DeutschePostIdentcode /// - public const ITF14 = "ITF14"; + public const DeutschePostIdentcode = "DeutschePostIdentcode"; /// - /// Enum value ITF6 + /// Enum value DeutschePostLeitcode /// - public const ITF6 = "ITF6"; + public const DeutschePostLeitcode = "DeutschePostLeitcode"; /// - /// Enum value MacroPdf417 + /// Enum value DotCode /// - public const MacroPdf417 = "MacroPdf417"; + public const DotCode = "DotCode"; /// - /// Enum value Matrix2of5 + /// Enum value DutchKIX /// - public const Matrix2of5 = "Matrix2of5"; + public const DutchKIX = "DutchKIX"; /// - /// Enum value MSI + /// Enum value EAN13 /// - public const MSI = "MSI"; + public const EAN13 = "EAN13"; /// - /// Enum value OneCode + /// Enum value EAN14 /// - public const OneCode = "OneCode"; + public const EAN14 = "EAN14"; /// - /// Enum value OPC + /// Enum value EAN8 /// - public const OPC = "OPC"; + public const EAN8 = "EAN8"; /// - /// Enum value PatchCode + /// Enum value GS1Aztec /// - public const PatchCode = "PatchCode"; + public const GS1Aztec = "GS1Aztec"; /// - /// Enum value Pdf417 + /// Enum value GS1Code128 /// - public const Pdf417 = "Pdf417"; + public const GS1Code128 = "GS1Code128"; /// - /// Enum value MicroPdf417 + /// Enum value GS1CompositeBar /// - public const MicroPdf417 = "MicroPdf417"; + public const GS1CompositeBar = "GS1CompositeBar"; /// - /// Enum value Planet + /// Enum value GS1DataMatrix /// - public const Planet = "Planet"; + public const GS1DataMatrix = "GS1DataMatrix"; /// - /// Enum value Postnet + /// Enum value GS1DotCode /// - public const Postnet = "Postnet"; + public const GS1DotCode = "GS1DotCode"; /// - /// Enum value PZN + /// Enum value GS1HanXin /// - public const PZN = "PZN"; + public const GS1HanXin = "GS1HanXin"; /// - /// Enum value QR + /// Enum value GS1MicroPdf417 /// - public const QR = "QR"; + public const GS1MicroPdf417 = "GS1MicroPdf417"; /// - /// Enum value MicroQR + /// Enum value GS1QR /// - public const MicroQR = "MicroQR"; + public const GS1QR = "GS1QR"; /// - /// Enum value RM4SCC + /// Enum value HanXin /// - public const RM4SCC = "RM4SCC"; + public const HanXin = "HanXin"; /// - /// Enum value SCC14 + /// Enum value HIBCAztecLIC /// - public const SCC14 = "SCC14"; + public const HIBCAztecLIC = "HIBCAztecLIC"; /// - /// Enum value SSCC18 + /// Enum value HIBCAztecPAS /// - public const SSCC18 = "SSCC18"; + public const HIBCAztecPAS = "HIBCAztecPAS"; /// - /// Enum value Standard2of5 + /// Enum value HIBCCode128LIC /// - public const Standard2of5 = "Standard2of5"; + public const HIBCCode128LIC = "HIBCCode128LIC"; /// - /// Enum value Supplement + /// Enum value HIBCCode128PAS /// - public const Supplement = "Supplement"; + public const HIBCCode128PAS = "HIBCCode128PAS"; /// - /// Enum value UPCA + /// Enum value HIBCCode39LIC /// - public const UPCA = "UPCA"; + public const HIBCCode39LIC = "HIBCCode39LIC"; /// - /// Enum value UPCE + /// Enum value HIBCCode39PAS /// - public const UPCE = "UPCE"; + public const HIBCCode39PAS = "HIBCCode39PAS"; /// - /// Enum value VIN + /// Enum value HIBCDataMatrixLIC /// - public const VIN = "VIN"; + public const HIBCDataMatrixLIC = "HIBCDataMatrixLIC"; /// - /// Enum value Pharmacode + /// Enum value HIBCDataMatrixPAS /// - public const Pharmacode = "Pharmacode"; + public const HIBCDataMatrixPAS = "HIBCDataMatrixPAS"; /// - /// Enum value GS1DataMatrix + /// Enum value HIBCQRLIC /// - public const GS1DataMatrix = "GS1DataMatrix"; + public const HIBCQRLIC = "HIBCQRLIC"; /// - /// Enum value DatabarOmniDirectional + /// Enum value HIBCQRPAS /// - public const DatabarOmniDirectional = "DatabarOmniDirectional"; + public const HIBCQRPAS = "HIBCQRPAS"; /// - /// Enum value DatabarTruncated + /// Enum value IATA2of5 /// - public const DatabarTruncated = "DatabarTruncated"; + public const IATA2of5 = "IATA2of5"; /// - /// Enum value DatabarLimited + /// Enum value ISBN /// - public const DatabarLimited = "DatabarLimited"; + public const ISBN = "ISBN"; /// - /// Enum value DatabarExpanded + /// Enum value ISMN /// - public const DatabarExpanded = "DatabarExpanded"; + public const ISMN = "ISMN"; /// - /// Enum value SwissPostParcel + /// Enum value ISSN /// - public const SwissPostParcel = "SwissPostParcel"; + public const ISSN = "ISSN"; /// - /// Enum value AustralianPosteParcel + /// Enum value ITF14 /// - public const AustralianPosteParcel = "AustralianPosteParcel"; + public const ITF14 = "ITF14"; /// - /// Enum value Code16K + /// Enum value ITF6 /// - public const Code16K = "Code16K"; + public const ITF6 = "ITF6"; /// - /// Enum value DatabarStackedOmniDirectional + /// Enum value Interleaved2of5 /// - public const DatabarStackedOmniDirectional = "DatabarStackedOmniDirectional"; + public const Interleaved2of5 = "Interleaved2of5"; /// - /// Enum value DatabarStacked + /// Enum value ItalianPost25 /// - public const DatabarStacked = "DatabarStacked"; + public const ItalianPost25 = "ItalianPost25"; /// - /// Enum value DatabarExpandedStacked + /// Enum value MacroPdf417 /// - public const DatabarExpandedStacked = "DatabarExpandedStacked"; + public const MacroPdf417 = "MacroPdf417"; /// - /// Enum value CompactPdf417 + /// Enum value Mailmark /// - public const CompactPdf417 = "CompactPdf417"; + public const Mailmark = "Mailmark"; /// - /// Enum value GS1QR + /// Enum value Matrix2of5 /// - public const GS1QR = "GS1QR"; + public const Matrix2of5 = "Matrix2of5"; /// /// Enum value MaxiCode @@ -324,118 +329,108 @@ class DecodeBarcodeType public const MicrE13B = "MicrE13B"; /// - /// Enum value Code32 - /// - public const Code32 = "Code32"; - - /// - /// Enum value DataLogic2of5 - /// - public const DataLogic2of5 = "DataLogic2of5"; - - /// - /// Enum value DotCode + /// Enum value MicroPdf417 /// - public const DotCode = "DotCode"; + public const MicroPdf417 = "MicroPdf417"; /// - /// Enum value DutchKIX + /// Enum value MicroQR /// - public const DutchKIX = "DutchKIX"; + public const MicroQR = "MicroQR"; /// - /// Enum value CodablockF + /// Enum value MSI /// - public const CodablockF = "CodablockF"; + public const MSI = "MSI"; /// - /// Enum value Mailmark + /// Enum value OneCode /// - public const Mailmark = "Mailmark"; + public const OneCode = "OneCode"; /// - /// Enum value GS1DotCode + /// Enum value OPC /// - public const GS1DotCode = "GS1DotCode"; + public const OPC = "OPC"; /// - /// Enum value HIBCCode39LIC + /// Enum value PatchCode /// - public const HIBCCode39LIC = "HIBCCode39LIC"; + public const PatchCode = "PatchCode"; /// - /// Enum value HIBCCode128LIC + /// Enum value Pdf417 /// - public const HIBCCode128LIC = "HIBCCode128LIC"; + public const Pdf417 = "Pdf417"; /// - /// Enum value HIBCAztecLIC + /// Enum value Pharmacode /// - public const HIBCAztecLIC = "HIBCAztecLIC"; + public const Pharmacode = "Pharmacode"; /// - /// Enum value HIBCDataMatrixLIC + /// Enum value Planet /// - public const HIBCDataMatrixLIC = "HIBCDataMatrixLIC"; + public const Planet = "Planet"; /// - /// Enum value HIBCQRLIC + /// Enum value Postnet /// - public const HIBCQRLIC = "HIBCQRLIC"; + public const Postnet = "Postnet"; /// - /// Enum value HIBCCode39PAS + /// Enum value PZN /// - public const HIBCCode39PAS = "HIBCCode39PAS"; + public const PZN = "PZN"; /// - /// Enum value HIBCCode128PAS + /// Enum value RectMicroQR /// - public const HIBCCode128PAS = "HIBCCode128PAS"; + public const RectMicroQR = "RectMicroQR"; /// - /// Enum value HIBCAztecPAS + /// Enum value RM4SCC /// - public const HIBCAztecPAS = "HIBCAztecPAS"; + public const RM4SCC = "RM4SCC"; /// - /// Enum value HIBCDataMatrixPAS + /// Enum value SCC14 /// - public const HIBCDataMatrixPAS = "HIBCDataMatrixPAS"; + public const SCC14 = "SCC14"; /// - /// Enum value HIBCQRPAS + /// Enum value SSCC18 /// - public const HIBCQRPAS = "HIBCQRPAS"; + public const SSCC18 = "SSCC18"; /// - /// Enum value HanXin + /// Enum value Standard2of5 /// - public const HanXin = "HanXin"; + public const Standard2of5 = "Standard2of5"; /// - /// Enum value GS1HanXin + /// Enum value Supplement /// - public const GS1HanXin = "GS1HanXin"; + public const Supplement = "Supplement"; /// - /// Enum value GS1Aztec + /// Enum value SwissPostParcel /// - public const GS1Aztec = "GS1Aztec"; + public const SwissPostParcel = "SwissPostParcel"; /// - /// Enum value GS1CompositeBar + /// Enum value UPCA /// - public const GS1CompositeBar = "GS1CompositeBar"; + public const UPCA = "UPCA"; /// - /// Enum value GS1MicroPdf417 + /// Enum value UPCE /// - public const GS1MicroPdf417 = "GS1MicroPdf417"; + public const UPCE = "UPCE"; /// - /// Enum value mostCommonlyUsed + /// Enum value VIN /// - public const mostCommonlyUsed = "mostCommonlyUsed"; + public const VIN = "VIN"; } diff --git a/src/Aspose/BarCode/Model/DotCodeEncodeMode.php b/src/Aspose/BarCode/Model/DotCodeEncodeMode.php deleted file mode 100644 index df58012..0000000 --- a/src/Aspose/BarCode/Model/DotCodeEncodeMode.php +++ /dev/null @@ -1,31 +0,0 @@ - - /// Enum value Auto - /// - public const Auto = "Auto"; - - /// - /// Enum value Bytes - /// - public const Bytes = "Bytes"; - - /// - /// Enum value ExtendedCodetext - /// - public const ExtendedCodetext = "ExtendedCodetext"; - -} diff --git a/src/Aspose/BarCode/Model/DotCodeParams.php b/src/Aspose/BarCode/Model/DotCodeParams.php deleted file mode 100644 index e40831f..0000000 --- a/src/Aspose/BarCode/Model/DotCodeParams.php +++ /dev/null @@ -1,423 +0,0 @@ - 'double', - 'columns' => 'int', - 'encode_mode' => '\Aspose\BarCode\Model\DotCodeEncodeMode', - 'eci_encoding' => '\Aspose\BarCode\Model\ECIEncodings', - 'is_reader_initialization' => 'bool', - 'rows' => 'int' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'aspect_ratio' => 'double', - 'columns' => 'int32', - 'encode_mode' => null, - 'eci_encoding' => null, - 'is_reader_initialization' => null, - 'rows' => 'int32' - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'aspect_ratio' => 'AspectRatio', - 'columns' => 'Columns', - 'encode_mode' => 'EncodeMode', - 'eci_encoding' => 'ECIEncoding', - 'is_reader_initialization' => 'IsReaderInitialization', - 'rows' => 'Rows' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'aspect_ratio' => 'setAspectRatio', - 'columns' => 'setColumns', - 'encode_mode' => 'setEncodeMode', - 'eci_encoding' => 'setEciEncoding', - 'is_reader_initialization' => 'setIsReaderInitialization', - 'rows' => 'setRows' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'aspect_ratio' => 'getAspectRatio', - 'columns' => 'getColumns', - 'encode_mode' => 'getEncodeMode', - 'eci_encoding' => 'getEciEncoding', - 'is_reader_initialization' => 'getIsReaderInitialization', - 'rows' => 'getRows' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['aspect_ratio'] = isset($data['aspect_ratio']) ? $data['aspect_ratio'] : null; - $this->container['columns'] = isset($data['columns']) ? $data['columns'] : null; - $this->container['encode_mode'] = isset($data['encode_mode']) ? $data['encode_mode'] : null; - $this->container['eci_encoding'] = isset($data['eci_encoding']) ? $data['eci_encoding'] : null; - $this->container['is_reader_initialization'] = isset($data['is_reader_initialization']) ? $data['is_reader_initialization'] : null; - $this->container['rows'] = isset($data['rows']) ? $data['rows'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets aspect_ratio - * - * @return double - */ - public function getAspectRatio() - { - return $this->container['aspect_ratio']; - } - - /** - * Sets aspect_ratio - * - * @param double $aspect_ratio Height/Width ratio of 2D BarCode module. - * - * @return $this - */ - public function setAspectRatio($aspect_ratio) - { - $this->container['aspect_ratio'] = $aspect_ratio; - - return $this; - } - - /** - * Gets columns - * - * @return int - */ - public function getColumns() - { - return $this->container['columns']; - } - - /** - * Sets columns - * - * @param int $columns Identifies columns count. Sum of the number of rows plus the number of columns of a DotCode symbol must be odd. Number of columns must be at least 5. - * - * @return $this - */ - public function setColumns($columns) - { - $this->container['columns'] = $columns; - - return $this; - } - - /** - * Gets encode_mode - * - * @return \Aspose\BarCode\Model\DotCodeEncodeMode - */ - public function getEncodeMode() - { - return $this->container['encode_mode']; - } - - /** - * Sets encode_mode - * - * @param \Aspose\BarCode\Model\DotCodeEncodeMode $encode_mode Identifies DotCode encode mode. Default value: Auto. - * - * @return $this - */ - public function setEncodeMode($encode_mode) - { - $this->container['encode_mode'] = $encode_mode; - - return $this; - } - - /** - * Gets eci_encoding - * - * @return \Aspose\BarCode\Model\ECIEncodings - */ - public function getEciEncoding() - { - return $this->container['eci_encoding']; - } - - /** - * Sets eci_encoding - * - * @param \Aspose\BarCode\Model\ECIEncodings $eci_encoding Identifies ECI encoding. Used when DotCodeEncodeMode is Auto. Default value: ISO-8859-1. - * - * @return $this - */ - public function setEciEncoding($eci_encoding) - { - $this->container['eci_encoding'] = $eci_encoding; - - return $this; - } - - /** - * Gets is_reader_initialization - * - * @return bool - */ - public function getIsReaderInitialization() - { - return $this->container['is_reader_initialization']; - } - - /** - * Sets is_reader_initialization - * - * @param bool $is_reader_initialization Indicates whether code is used for instruct reader to interpret the following data as instructions for initialization or reprogramming of the bar code reader. Default value is false. - * - * @return $this - */ - public function setIsReaderInitialization($is_reader_initialization) - { - $this->container['is_reader_initialization'] = $is_reader_initialization; - - return $this; - } - - /** - * Gets rows - * - * @return int - */ - public function getRows() - { - return $this->container['rows']; - } - - /** - * Sets rows - * - * @param int $rows Identifies rows count. Sum of the number of rows plus the number of columns of a DotCode symbol must be odd. Number of rows must be at least 5. - * - * @return $this - */ - public function setRows($rows) - { - $this->container['rows'] = $rows; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/ECIEncodings.php b/src/Aspose/BarCode/Model/ECIEncodings.php deleted file mode 100644 index 26ec3cb..0000000 --- a/src/Aspose/BarCode/Model/ECIEncodings.php +++ /dev/null @@ -1,151 +0,0 @@ - - /// Enum value NONE - /// - public const NONE = "NONE"; - - /// - /// Enum value ISO_8859_1 - /// - public const ISO_8859_1 = "ISO_8859_1"; - - /// - /// Enum value ISO_8859_2 - /// - public const ISO_8859_2 = "ISO_8859_2"; - - /// - /// Enum value ISO_8859_3 - /// - public const ISO_8859_3 = "ISO_8859_3"; - - /// - /// Enum value ISO_8859_4 - /// - public const ISO_8859_4 = "ISO_8859_4"; - - /// - /// Enum value ISO_8859_5 - /// - public const ISO_8859_5 = "ISO_8859_5"; - - /// - /// Enum value ISO_8859_6 - /// - public const ISO_8859_6 = "ISO_8859_6"; - - /// - /// Enum value ISO_8859_7 - /// - public const ISO_8859_7 = "ISO_8859_7"; - - /// - /// Enum value ISO_8859_8 - /// - public const ISO_8859_8 = "ISO_8859_8"; - - /// - /// Enum value ISO_8859_9 - /// - public const ISO_8859_9 = "ISO_8859_9"; - - /// - /// Enum value ISO_8859_10 - /// - public const ISO_8859_10 = "ISO_8859_10"; - - /// - /// Enum value ISO_8859_11 - /// - public const ISO_8859_11 = "ISO_8859_11"; - - /// - /// Enum value ISO_8859_13 - /// - public const ISO_8859_13 = "ISO_8859_13"; - - /// - /// Enum value ISO_8859_14 - /// - public const ISO_8859_14 = "ISO_8859_14"; - - /// - /// Enum value ISO_8859_15 - /// - public const ISO_8859_15 = "ISO_8859_15"; - - /// - /// Enum value ISO_8859_16 - /// - public const ISO_8859_16 = "ISO_8859_16"; - - /// - /// Enum value Shift_JIS - /// - public const Shift_JIS = "Shift_JIS"; - - /// - /// Enum value Win1250 - /// - public const Win1250 = "Win1250"; - - /// - /// Enum value Win1251 - /// - public const Win1251 = "Win1251"; - - /// - /// Enum value Win1252 - /// - public const Win1252 = "Win1252"; - - /// - /// Enum value Win1256 - /// - public const Win1256 = "Win1256"; - - /// - /// Enum value UTF16BE - /// - public const UTF16BE = "UTF16BE"; - - /// - /// Enum value UTF8 - /// - public const UTF8 = "UTF8"; - - /// - /// Enum value US_ASCII - /// - public const US_ASCII = "US_ASCII"; - - /// - /// Enum value Big5 - /// - public const Big5 = "Big5"; - - /// - /// Enum value GB18030 - /// - public const GB18030 = "GB18030"; - - /// - /// Enum value EUC_KR - /// - public const EUC_KR = "EUC_KR"; - -} diff --git a/src/Aspose/BarCode/Model/EnableChecksum.php b/src/Aspose/BarCode/Model/EnableChecksum.php deleted file mode 100644 index e1e20a3..0000000 --- a/src/Aspose/BarCode/Model/EnableChecksum.php +++ /dev/null @@ -1,31 +0,0 @@ - - /// Enum value Default - /// - public const Default = "Default"; - - /// - /// Enum value Yes - /// - public const Yes = "Yes"; - - /// - /// Enum value No - /// - public const No = "No"; - -} diff --git a/src/Aspose/BarCode/Model/EncodeBarcodeType.php b/src/Aspose/BarCode/Model/EncodeBarcodeType.php index f4892fb..1b3d936 100644 --- a/src/Aspose/BarCode/Model/EncodeBarcodeType.php +++ b/src/Aspose/BarCode/Model/EncodeBarcodeType.php @@ -9,39 +9,44 @@ /** * EncodeBarcodeType * - * @description See EncodeTypes + * @description See Aspose.BarCode.Generation.EncodeTypes */ class EncodeBarcodeType { /// - /// Enum value Codabar + /// Enum value QR /// - public const Codabar = "Codabar"; + public const QR = "QR"; /// - /// Enum value Code11 + /// Enum value AustraliaPost /// - public const Code11 = "Code11"; + public const AustraliaPost = "AustraliaPost"; /// - /// Enum value Code39Standard + /// Enum value AustralianPosteParcel /// - public const Code39Standard = "Code39Standard"; + public const AustralianPosteParcel = "AustralianPosteParcel"; + + /// + /// Enum value Aztec + /// + public const Aztec = "Aztec"; /// - /// Enum value Code39Extended + /// Enum value Codabar /// - public const Code39Extended = "Code39Extended"; + public const Codabar = "Codabar"; /// - /// Enum value Code93Standard + /// Enum value CodablockF /// - public const Code93Standard = "Code93Standard"; + public const CodablockF = "CodablockF"; /// - /// Enum value Code93Extended + /// Enum value Code11 /// - public const Code93Extended = "Code93Extended"; + public const Code11 = "Code11"; /// /// Enum value Code128 @@ -49,328 +54,328 @@ class EncodeBarcodeType public const Code128 = "Code128"; /// - /// Enum value GS1Code128 + /// Enum value Code16K /// - public const GS1Code128 = "GS1Code128"; + public const Code16K = "Code16K"; /// - /// Enum value EAN8 + /// Enum value Code32 /// - public const EAN8 = "EAN8"; + public const Code32 = "Code32"; /// - /// Enum value EAN13 + /// Enum value Code39 /// - public const EAN13 = "EAN13"; + public const Code39 = "Code39"; /// - /// Enum value EAN14 + /// Enum value Code39FullASCII /// - public const EAN14 = "EAN14"; + public const Code39FullASCII = "Code39FullASCII"; /// - /// Enum value SCC14 + /// Enum value Code93 /// - public const SCC14 = "SCC14"; + public const Code93 = "Code93"; /// - /// Enum value SSCC18 + /// Enum value DataLogic2of5 /// - public const SSCC18 = "SSCC18"; + public const DataLogic2of5 = "DataLogic2of5"; /// - /// Enum value UPCA + /// Enum value DataMatrix /// - public const UPCA = "UPCA"; + public const DataMatrix = "DataMatrix"; /// - /// Enum value UPCE + /// Enum value DatabarExpanded /// - public const UPCE = "UPCE"; + public const DatabarExpanded = "DatabarExpanded"; /// - /// Enum value ISBN + /// Enum value DatabarExpandedStacked /// - public const ISBN = "ISBN"; + public const DatabarExpandedStacked = "DatabarExpandedStacked"; /// - /// Enum value ISSN + /// Enum value DatabarLimited /// - public const ISSN = "ISSN"; + public const DatabarLimited = "DatabarLimited"; /// - /// Enum value ISMN + /// Enum value DatabarOmniDirectional /// - public const ISMN = "ISMN"; + public const DatabarOmniDirectional = "DatabarOmniDirectional"; /// - /// Enum value Standard2of5 + /// Enum value DatabarStacked /// - public const Standard2of5 = "Standard2of5"; + public const DatabarStacked = "DatabarStacked"; /// - /// Enum value Interleaved2of5 + /// Enum value DatabarStackedOmniDirectional /// - public const Interleaved2of5 = "Interleaved2of5"; + public const DatabarStackedOmniDirectional = "DatabarStackedOmniDirectional"; /// - /// Enum value Matrix2of5 + /// Enum value DatabarTruncated /// - public const Matrix2of5 = "Matrix2of5"; + public const DatabarTruncated = "DatabarTruncated"; /// - /// Enum value ItalianPost25 + /// Enum value DeutschePostIdentcode /// - public const ItalianPost25 = "ItalianPost25"; + public const DeutschePostIdentcode = "DeutschePostIdentcode"; /// - /// Enum value IATA2of5 + /// Enum value DeutschePostLeitcode /// - public const IATA2of5 = "IATA2of5"; + public const DeutschePostLeitcode = "DeutschePostLeitcode"; /// - /// Enum value ITF14 + /// Enum value DotCode /// - public const ITF14 = "ITF14"; + public const DotCode = "DotCode"; /// - /// Enum value ITF6 + /// Enum value DutchKIX /// - public const ITF6 = "ITF6"; + public const DutchKIX = "DutchKIX"; /// - /// Enum value MSI + /// Enum value EAN13 /// - public const MSI = "MSI"; + public const EAN13 = "EAN13"; /// - /// Enum value VIN + /// Enum value EAN14 /// - public const VIN = "VIN"; + public const EAN14 = "EAN14"; /// - /// Enum value DeutschePostIdentcode + /// Enum value EAN8 /// - public const DeutschePostIdentcode = "DeutschePostIdentcode"; + public const EAN8 = "EAN8"; /// - /// Enum value DeutschePostLeitcode + /// Enum value GS1Aztec /// - public const DeutschePostLeitcode = "DeutschePostLeitcode"; + public const GS1Aztec = "GS1Aztec"; /// - /// Enum value OPC + /// Enum value GS1CodablockF /// - public const OPC = "OPC"; + public const GS1CodablockF = "GS1CodablockF"; /// - /// Enum value PZN + /// Enum value GS1Code128 /// - public const PZN = "PZN"; + public const GS1Code128 = "GS1Code128"; /// - /// Enum value Code16K + /// Enum value GS1DataMatrix /// - public const Code16K = "Code16K"; + public const GS1DataMatrix = "GS1DataMatrix"; /// - /// Enum value Pharmacode + /// Enum value GS1DotCode /// - public const Pharmacode = "Pharmacode"; + public const GS1DotCode = "GS1DotCode"; /// - /// Enum value DataMatrix + /// Enum value GS1HanXin /// - public const DataMatrix = "DataMatrix"; + public const GS1HanXin = "GS1HanXin"; /// - /// Enum value QR + /// Enum value GS1MicroPdf417 /// - public const QR = "QR"; + public const GS1MicroPdf417 = "GS1MicroPdf417"; /// - /// Enum value Aztec + /// Enum value GS1QR /// - public const Aztec = "Aztec"; + public const GS1QR = "GS1QR"; /// - /// Enum value Pdf417 + /// Enum value HanXin /// - public const Pdf417 = "Pdf417"; + public const HanXin = "HanXin"; /// - /// Enum value MacroPdf417 + /// Enum value IATA2of5 /// - public const MacroPdf417 = "MacroPdf417"; + public const IATA2of5 = "IATA2of5"; /// - /// Enum value AustraliaPost + /// Enum value ISBN /// - public const AustraliaPost = "AustraliaPost"; + public const ISBN = "ISBN"; /// - /// Enum value Postnet + /// Enum value ISMN /// - public const Postnet = "Postnet"; + public const ISMN = "ISMN"; /// - /// Enum value Planet + /// Enum value ISSN /// - public const Planet = "Planet"; + public const ISSN = "ISSN"; /// - /// Enum value OneCode + /// Enum value ITF14 /// - public const OneCode = "OneCode"; + public const ITF14 = "ITF14"; /// - /// Enum value RM4SCC + /// Enum value ITF6 /// - public const RM4SCC = "RM4SCC"; + public const ITF6 = "ITF6"; /// - /// Enum value DatabarOmniDirectional + /// Enum value Interleaved2of5 /// - public const DatabarOmniDirectional = "DatabarOmniDirectional"; + public const Interleaved2of5 = "Interleaved2of5"; /// - /// Enum value DatabarTruncated + /// Enum value ItalianPost25 /// - public const DatabarTruncated = "DatabarTruncated"; + public const ItalianPost25 = "ItalianPost25"; /// - /// Enum value DatabarLimited + /// Enum value MSI /// - public const DatabarLimited = "DatabarLimited"; + public const MSI = "MSI"; /// - /// Enum value DatabarExpanded + /// Enum value MacroPdf417 /// - public const DatabarExpanded = "DatabarExpanded"; + public const MacroPdf417 = "MacroPdf417"; /// - /// Enum value SingaporePost + /// Enum value Mailmark /// - public const SingaporePost = "SingaporePost"; + public const Mailmark = "Mailmark"; /// - /// Enum value GS1DataMatrix + /// Enum value Matrix2of5 /// - public const GS1DataMatrix = "GS1DataMatrix"; + public const Matrix2of5 = "Matrix2of5"; /// - /// Enum value AustralianPosteParcel + /// Enum value MaxiCode /// - public const AustralianPosteParcel = "AustralianPosteParcel"; + public const MaxiCode = "MaxiCode"; /// - /// Enum value SwissPostParcel + /// Enum value MicroPdf417 /// - public const SwissPostParcel = "SwissPostParcel"; + public const MicroPdf417 = "MicroPdf417"; /// - /// Enum value PatchCode + /// Enum value MicroQR /// - public const PatchCode = "PatchCode"; + public const MicroQR = "MicroQR"; /// - /// Enum value DatabarExpandedStacked + /// Enum value OPC /// - public const DatabarExpandedStacked = "DatabarExpandedStacked"; + public const OPC = "OPC"; /// - /// Enum value DatabarStacked + /// Enum value OneCode /// - public const DatabarStacked = "DatabarStacked"; + public const OneCode = "OneCode"; /// - /// Enum value DatabarStackedOmniDirectional + /// Enum value PZN /// - public const DatabarStackedOmniDirectional = "DatabarStackedOmniDirectional"; + public const PZN = "PZN"; /// - /// Enum value MicroPdf417 + /// Enum value PatchCode /// - public const MicroPdf417 = "MicroPdf417"; + public const PatchCode = "PatchCode"; /// - /// Enum value GS1QR + /// Enum value Pdf417 /// - public const GS1QR = "GS1QR"; + public const Pdf417 = "Pdf417"; /// - /// Enum value MaxiCode + /// Enum value Pharmacode /// - public const MaxiCode = "MaxiCode"; + public const Pharmacode = "Pharmacode"; /// - /// Enum value Code32 + /// Enum value Planet /// - public const Code32 = "Code32"; + public const Planet = "Planet"; /// - /// Enum value DataLogic2of5 + /// Enum value Postnet /// - public const DataLogic2of5 = "DataLogic2of5"; + public const Postnet = "Postnet"; /// - /// Enum value DotCode + /// Enum value RM4SCC /// - public const DotCode = "DotCode"; + public const RM4SCC = "RM4SCC"; /// - /// Enum value DutchKIX + /// Enum value RectMicroQR /// - public const DutchKIX = "DutchKIX"; + public const RectMicroQR = "RectMicroQR"; /// - /// Enum value UpcaGs1Code128Coupon + /// Enum value SCC14 /// - public const UpcaGs1Code128Coupon = "UpcaGs1Code128Coupon"; + public const SCC14 = "SCC14"; /// - /// Enum value UpcaGs1DatabarCoupon + /// Enum value SSCC18 /// - public const UpcaGs1DatabarCoupon = "UpcaGs1DatabarCoupon"; + public const SSCC18 = "SSCC18"; /// - /// Enum value CodablockF + /// Enum value SingaporePost /// - public const CodablockF = "CodablockF"; + public const SingaporePost = "SingaporePost"; /// - /// Enum value GS1CodablockF + /// Enum value Standard2of5 /// - public const GS1CodablockF = "GS1CodablockF"; + public const Standard2of5 = "Standard2of5"; /// - /// Enum value Mailmark + /// Enum value SwissPostParcel /// - public const Mailmark = "Mailmark"; + public const SwissPostParcel = "SwissPostParcel"; /// - /// Enum value GS1DotCode + /// Enum value UPCA /// - public const GS1DotCode = "GS1DotCode"; + public const UPCA = "UPCA"; /// - /// Enum value HanXin + /// Enum value UPCE /// - public const HanXin = "HanXin"; + public const UPCE = "UPCE"; /// - /// Enum value GS1HanXin + /// Enum value UpcaGs1Code128Coupon /// - public const GS1HanXin = "GS1HanXin"; + public const UpcaGs1Code128Coupon = "UpcaGs1Code128Coupon"; /// - /// Enum value GS1Aztec + /// Enum value UpcaGs1DatabarCoupon /// - public const GS1Aztec = "GS1Aztec"; + public const UpcaGs1DatabarCoupon = "UpcaGs1DatabarCoupon"; /// - /// Enum value GS1MicroPdf417 + /// Enum value VIN /// - public const GS1MicroPdf417 = "GS1MicroPdf417"; + public const VIN = "VIN"; } diff --git a/src/Aspose/BarCode/Model/DiscUsage.php b/src/Aspose/BarCode/Model/EncodeData.php similarity index 73% rename from src/Aspose/BarCode/Model/DiscUsage.php rename to src/Aspose/BarCode/Model/EncodeData.php index 5614f67..1e1b25e 100644 --- a/src/Aspose/BarCode/Model/DiscUsage.php +++ b/src/Aspose/BarCode/Model/EncodeData.php @@ -8,11 +8,11 @@ use Aspose\BarCode\ObjectSerializer; /** - * DiscUsage + * EncodeData * - * @description Class for disc space information. + * @description Data to encode in barcode */ -class DiscUsage implements ArrayAccess +class EncodeData implements ArrayAccess { public const DISCRIMINATOR = null; @@ -21,7 +21,7 @@ class DiscUsage implements ArrayAccess * * @var string */ - protected static string $swaggerModelName = "DiscUsage"; + protected static string $swaggerModelName = "EncodeData"; /** * Array of property to type mappings. Used for (de)serialization @@ -29,8 +29,8 @@ class DiscUsage implements ArrayAccess * @var string[] */ protected static array $swaggerTypes = [ - 'used_size' => 'int', - 'total_size' => 'int' + 'data_type' => '\Aspose\BarCode\Model\EncodeDataType', + 'data' => 'string' ]; /** @@ -39,8 +39,8 @@ class DiscUsage implements ArrayAccess * @var (string|null)[] */ protected static array $swaggerFormats = [ - 'used_size' => 'int64', - 'total_size' => 'int64' + 'data_type' => null, + 'data' => null ]; /** @@ -70,8 +70,8 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'used_size' => 'UsedSize', - 'total_size' => 'TotalSize' + 'data_type' => 'dataType', + 'data' => 'data' ]; /** @@ -80,8 +80,8 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'used_size' => 'setUsedSize', - 'total_size' => 'setTotalSize' + 'data_type' => 'setDataType', + 'data' => 'setData' ]; /** @@ -90,8 +90,8 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'used_size' => 'getUsedSize', - 'total_size' => 'getTotalSize' + 'data_type' => 'getDataType', + 'data' => 'getData' ]; /** @@ -154,8 +154,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['used_size'] = isset($data['used_size']) ? $data['used_size'] : null; - $this->container['total_size'] = isset($data['total_size']) ? $data['total_size'] : null; + $this->container['data_type'] = isset($data['data_type']) ? $data['data_type'] : null; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; } /** @@ -167,12 +167,13 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['used_size'] === null) { - $invalidProperties[] = "'used_size' can't be null"; + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; } - if ($this->container['total_size'] === null) { - $invalidProperties[] = "'total_size' can't be null"; + if ((strlen($this->container['data']) < 1)) { + $invalidProperties[] = "invalid value for 'data', the character length must be bigger than or equal to 1."; } + return $invalidProperties; } @@ -184,10 +185,10 @@ public function listInvalidProperties() */ public function valid() { - if ($this->container['used_size'] === null) { + if ($this->container['data'] === null) { return false; } - if ($this->container['total_size'] === null) { + if (strlen($this->container['data']) < 1) { return false; } return true; @@ -195,49 +196,54 @@ public function valid() /** - * Gets used_size + * Gets data_type * - * @return int + * @return \Aspose\BarCode\Model\EncodeDataType */ - public function getUsedSize() + public function getDataType() { - return $this->container['used_size']; + return $this->container['data_type']; } /** - * Sets used_size + * Sets data_type * - * @param int $used_size Application used disc space. + * @param \Aspose\BarCode\Model\EncodeDataType $data_type data_type * * @return $this */ - public function setUsedSize($used_size) + public function setDataType($data_type) { - $this->container['used_size'] = $used_size; + $this->container['data_type'] = $data_type; return $this; } /** - * Gets total_size + * Gets data * - * @return int + * @return string */ - public function getTotalSize() + public function getData() { - return $this->container['total_size']; + return $this->container['data']; } /** - * Sets total_size + * Sets data * - * @param int $total_size Total disc space. + * @param string $data String represents data to encode * * @return $this */ - public function setTotalSize($total_size) + public function setData($data) { - $this->container['total_size'] = $total_size; + + if ((strlen($data) < 1)) { + throw new \InvalidArgumentException('invalid length for $data when calling EncodeData., must be bigger than or equal to 1.'); + } + + $this->container['data'] = $data; return $this; } diff --git a/src/Aspose/BarCode/Model/EncodeDataType.php b/src/Aspose/BarCode/Model/EncodeDataType.php new file mode 100644 index 0000000..5639c10 --- /dev/null +++ b/src/Aspose/BarCode/Model/EncodeDataType.php @@ -0,0 +1,31 @@ + + /// Enum value StringData + /// + public const StringData = "StringData"; + + /// + /// Enum value Base64Bytes + /// + public const Base64Bytes = "Base64Bytes"; + + /// + /// Enum value HexBytes + /// + public const HexBytes = "HexBytes"; + +} diff --git a/src/Aspose/BarCode/Model/Error.php b/src/Aspose/BarCode/Model/Error.php deleted file mode 100644 index b6060f2..0000000 --- a/src/Aspose/BarCode/Model/Error.php +++ /dev/null @@ -1,363 +0,0 @@ - 'string', - 'message' => 'string', - 'description' => 'string', - 'inner_error' => '\Aspose\BarCode\Model\ErrorDetails' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'code' => null, - 'message' => null, - 'description' => null, - 'inner_error' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'code' => 'Code', - 'message' => 'Message', - 'description' => 'Description', - 'inner_error' => 'InnerError' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'code' => 'setCode', - 'message' => 'setMessage', - 'description' => 'setDescription', - 'inner_error' => 'setInnerError' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'code' => 'getCode', - 'message' => 'getMessage', - 'description' => 'getDescription', - 'inner_error' => 'getInnerError' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['code'] = isset($data['code']) ? $data['code'] : null; - $this->container['message'] = isset($data['message']) ? $data['message'] : null; - $this->container['description'] = isset($data['description']) ? $data['description'] : null; - $this->container['inner_error'] = isset($data['inner_error']) ? $data['inner_error'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code Code - * - * @return $this - */ - public function setCode($code) - { - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets message - * - * @return string - */ - public function getMessage() - { - return $this->container['message']; - } - - /** - * Sets message - * - * @param string $message Message - * - * @return $this - */ - public function setMessage($message) - { - $this->container['message'] = $message; - - return $this; - } - - /** - * Gets description - * - * @return string - */ - public function getDescription() - { - return $this->container['description']; - } - - /** - * Sets description - * - * @param string $description Description - * - * @return $this - */ - public function setDescription($description) - { - $this->container['description'] = $description; - - return $this; - } - - /** - * Gets inner_error - * - * @return \Aspose\BarCode\Model\ErrorDetails - */ - public function getInnerError() - { - return $this->container['inner_error']; - } - - /** - * Sets inner_error - * - * @param \Aspose\BarCode\Model\ErrorDetails $inner_error Inner Error - * - * @return $this - */ - public function setInnerError($inner_error) - { - $this->container['inner_error'] = $inner_error; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/FileVersion.php b/src/Aspose/BarCode/Model/FileVersion.php deleted file mode 100644 index ea9c707..0000000 --- a/src/Aspose/BarCode/Model/FileVersion.php +++ /dev/null @@ -1,470 +0,0 @@ - 'string', - 'is_folder' => 'bool', - 'modified_date' => '\DateTime', - 'size' => 'int', - 'path' => 'string', - 'version_id' => 'string', - 'is_latest' => 'bool' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'name' => null, - 'is_folder' => null, - 'modified_date' => 'date-time', - 'size' => 'int64', - 'path' => null, - 'version_id' => null, - 'is_latest' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'name' => 'Name', - 'is_folder' => 'IsFolder', - 'modified_date' => 'ModifiedDate', - 'size' => 'Size', - 'path' => 'Path', - 'version_id' => 'VersionId', - 'is_latest' => 'IsLatest' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'name' => 'setName', - 'is_folder' => 'setIsFolder', - 'modified_date' => 'setModifiedDate', - 'size' => 'setSize', - 'path' => 'setPath', - 'version_id' => 'setVersionId', - 'is_latest' => 'setIsLatest' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'name' => 'getName', - 'is_folder' => 'getIsFolder', - 'modified_date' => 'getModifiedDate', - 'size' => 'getSize', - 'path' => 'getPath', - 'version_id' => 'getVersionId', - 'is_latest' => 'getIsLatest' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['is_folder'] = isset($data['is_folder']) ? $data['is_folder'] : null; - $this->container['modified_date'] = isset($data['modified_date']) ? $data['modified_date'] : null; - $this->container['size'] = isset($data['size']) ? $data['size'] : null; - $this->container['path'] = isset($data['path']) ? $data['path'] : null; - $this->container['version_id'] = isset($data['version_id']) ? $data['version_id'] : null; - $this->container['is_latest'] = isset($data['is_latest']) ? $data['is_latest'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['is_folder'] === null) { - $invalidProperties[] = "'is_folder' can't be null"; - } - if ($this->container['size'] === null) { - $invalidProperties[] = "'size' can't be null"; - } - if ($this->container['is_latest'] === null) { - $invalidProperties[] = "'is_latest' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - if ($this->container['is_folder'] === null) { - return false; - } - if ($this->container['size'] === null) { - return false; - } - if ($this->container['is_latest'] === null) { - return false; - } - return true; - } - - - /** - * Gets name - * - * @return string - */ - public function getName() - { - return $this->container['name']; - } - - /** - * Sets name - * - * @param string $name File or folder name. - * - * @return $this - */ - public function setName($name) - { - $this->container['name'] = $name; - - return $this; - } - - /** - * Gets is_folder - * - * @return bool - */ - public function getIsFolder() - { - return $this->container['is_folder']; - } - - /** - * Sets is_folder - * - * @param bool $is_folder True if it is a folder. - * - * @return $this - */ - public function setIsFolder($is_folder) - { - $this->container['is_folder'] = $is_folder; - - return $this; - } - - /** - * Gets modified_date - * - * @return \DateTime - */ - public function getModifiedDate() - { - return $this->container['modified_date']; - } - - /** - * Sets modified_date - * - * @param \DateTime $modified_date File or folder last modified DateTime. - * - * @return $this - */ - public function setModifiedDate($modified_date) - { - $this->container['modified_date'] = $modified_date; - - return $this; - } - - /** - * Gets size - * - * @return int - */ - public function getSize() - { - return $this->container['size']; - } - - /** - * Sets size - * - * @param int $size File or folder size. - * - * @return $this - */ - public function setSize($size) - { - $this->container['size'] = $size; - - return $this; - } - - /** - * Gets path - * - * @return string - */ - public function getPath() - { - return $this->container['path']; - } - - /** - * Sets path - * - * @param string $path File or folder path. - * - * @return $this - */ - public function setPath($path) - { - $this->container['path'] = $path; - - return $this; - } - - /** - * Gets version_id - * - * @return string - */ - public function getVersionId() - { - return $this->container['version_id']; - } - - /** - * Sets version_id - * - * @param string $version_id File Version ID. - * - * @return $this - */ - public function setVersionId($version_id) - { - $this->container['version_id'] = $version_id; - - return $this; - } - - /** - * Gets is_latest - * - * @return bool - */ - public function getIsLatest() - { - return $this->container['is_latest']; - } - - /** - * Sets is_latest - * - * @param bool $is_latest Specifies whether the file is (true) or is not (false) the latest version of an file. - * - * @return $this - */ - public function setIsLatest($is_latest) - { - $this->container['is_latest'] = $is_latest; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/FileVersions.php b/src/Aspose/BarCode/Model/FileVersions.php deleted file mode 100644 index 00edad2..0000000 --- a/src/Aspose/BarCode/Model/FileVersions.php +++ /dev/null @@ -1,273 +0,0 @@ - '\Aspose\BarCode\Model\FileVersion[]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'value' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'value' => 'Value' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'value' => 'setValue' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'value' => 'getValue' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['value'] = isset($data['value']) ? $data['value'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets value - * - * @return \Aspose\BarCode\Model\FileVersion[] - */ - public function getValue() - { - return $this->container['value']; - } - - /** - * Sets value - * - * @param \Aspose\BarCode\Model\FileVersion[] $value File versions FileVersion. - * - * @return $this - */ - public function setValue($value) - { - $this->container['value'] = $value; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/FilesList.php b/src/Aspose/BarCode/Model/FilesList.php deleted file mode 100644 index 04db2db..0000000 --- a/src/Aspose/BarCode/Model/FilesList.php +++ /dev/null @@ -1,273 +0,0 @@ - '\Aspose\BarCode\Model\StorageFile[]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'value' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'value' => 'Value' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'value' => 'setValue' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'value' => 'getValue' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['value'] = isset($data['value']) ? $data['value'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets value - * - * @return \Aspose\BarCode\Model\StorageFile[] - */ - public function getValue() - { - return $this->container['value']; - } - - /** - * Sets value - * - * @param \Aspose\BarCode\Model\StorageFile[] $value Files and folders contained by folder StorageFile. - * - * @return $this - */ - public function setValue($value) - { - $this->container['value'] = $value; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/FilesUploadResult.php b/src/Aspose/BarCode/Model/FilesUploadResult.php deleted file mode 100644 index f63c4dd..0000000 --- a/src/Aspose/BarCode/Model/FilesUploadResult.php +++ /dev/null @@ -1,303 +0,0 @@ - 'string[]', - 'errors' => '\Aspose\BarCode\Model\Error[]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'uploaded' => null, - 'errors' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'uploaded' => 'Uploaded', - 'errors' => 'Errors' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'uploaded' => 'setUploaded', - 'errors' => 'setErrors' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'uploaded' => 'getUploaded', - 'errors' => 'getErrors' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['uploaded'] = isset($data['uploaded']) ? $data['uploaded'] : null; - $this->container['errors'] = isset($data['errors']) ? $data['errors'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets uploaded - * - * @return string[] - */ - public function getUploaded() - { - return $this->container['uploaded']; - } - - /** - * Sets uploaded - * - * @param string[] $uploaded List of uploaded file names - * - * @return $this - */ - public function setUploaded($uploaded) - { - $this->container['uploaded'] = $uploaded; - - return $this; - } - - /** - * Gets errors - * - * @return \Aspose\BarCode\Model\Error[] - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \Aspose\BarCode\Model\Error[] $errors List of errors. - * - * @return $this - */ - public function setErrors($errors) - { - $this->container['errors'] = $errors; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/FontMode.php b/src/Aspose/BarCode/Model/FontMode.php deleted file mode 100644 index b02af61..0000000 --- a/src/Aspose/BarCode/Model/FontMode.php +++ /dev/null @@ -1,26 +0,0 @@ - - /// Enum value Auto - /// - public const Auto = "Auto"; - - /// - /// Enum value Manual - /// - public const Manual = "Manual"; - -} diff --git a/src/Aspose/BarCode/Model/FontParams.php b/src/Aspose/BarCode/Model/FontParams.php deleted file mode 100644 index 7013430..0000000 --- a/src/Aspose/BarCode/Model/FontParams.php +++ /dev/null @@ -1,333 +0,0 @@ - 'string', - 'size' => 'double', - 'style' => '\Aspose\BarCode\Model\FontStyle' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'family' => null, - 'size' => 'double', - 'style' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'family' => 'Family', - 'size' => 'Size', - 'style' => 'Style' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'family' => 'setFamily', - 'size' => 'setSize', - 'style' => 'setStyle' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'family' => 'getFamily', - 'size' => 'getSize', - 'style' => 'getStyle' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['family'] = isset($data['family']) ? $data['family'] : null; - $this->container['size'] = isset($data['size']) ? $data['size'] : null; - $this->container['style'] = isset($data['style']) ? $data['style'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets family - * - * @return string - */ - public function getFamily() - { - return $this->container['family']; - } - - /** - * Sets family - * - * @param string $family Font family. - * - * @return $this - */ - public function setFamily($family) - { - $this->container['family'] = $family; - - return $this; - } - - /** - * Gets size - * - * @return double - */ - public function getSize() - { - return $this->container['size']; - } - - /** - * Sets size - * - * @param double $size Font size in units. - * - * @return $this - */ - public function setSize($size) - { - $this->container['size'] = $size; - - return $this; - } - - /** - * Gets style - * - * @return \Aspose\BarCode\Model\FontStyle - */ - public function getStyle() - { - return $this->container['style']; - } - - /** - * Sets style - * - * @param \Aspose\BarCode\Model\FontStyle $style Font style. - * - * @return $this - */ - public function setStyle($style) - { - $this->container['style'] = $style; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/FontStyle.php b/src/Aspose/BarCode/Model/FontStyle.php deleted file mode 100644 index 9e284c6..0000000 --- a/src/Aspose/BarCode/Model/FontStyle.php +++ /dev/null @@ -1,41 +0,0 @@ - - /// Enum value Regular - /// - public const Regular = "Regular"; - - /// - /// Enum value Bold - /// - public const Bold = "Bold"; - - /// - /// Enum value Italic - /// - public const Italic = "Italic"; - - /// - /// Enum value Underline - /// - public const Underline = "Underline"; - - /// - /// Enum value Strikeout - /// - public const Strikeout = "Strikeout"; - -} diff --git a/src/Aspose/BarCode/Model/GeneratorParamsList.php b/src/Aspose/BarCode/Model/GenerateParams.php similarity index 65% rename from src/Aspose/BarCode/Model/GeneratorParamsList.php rename to src/Aspose/BarCode/Model/GenerateParams.php index daff2f1..3b32db4 100644 --- a/src/Aspose/BarCode/Model/GeneratorParamsList.php +++ b/src/Aspose/BarCode/Model/GenerateParams.php @@ -8,11 +8,11 @@ use Aspose\BarCode\ObjectSerializer; /** - * GeneratorParamsList + * GenerateParams * - * @description Represents list of barcode generators + * @description Barcode generation parameters */ -class GeneratorParamsList implements ArrayAccess +class GenerateParams implements ArrayAccess { public const DISCRIMINATOR = null; @@ -21,7 +21,7 @@ class GeneratorParamsList implements ArrayAccess * * @var string */ - protected static string $swaggerModelName = "GeneratorParamsList"; + protected static string $swaggerModelName = "GenerateParams"; /** * Array of property to type mappings. Used for (de)serialization @@ -29,9 +29,9 @@ class GeneratorParamsList implements ArrayAccess * @var string[] */ protected static array $swaggerTypes = [ - 'barcode_builders' => '\Aspose\BarCode\Model\GeneratorParams[]', - 'x_step' => 'int', - 'y_step' => 'int' + 'barcode_type' => '\Aspose\BarCode\Model\EncodeBarcodeType', + 'encode_data' => '\Aspose\BarCode\Model\EncodeData', + 'barcode_image_params' => '\Aspose\BarCode\Model\BarcodeImageParams' ]; /** @@ -40,9 +40,9 @@ class GeneratorParamsList implements ArrayAccess * @var (string|null)[] */ protected static array $swaggerFormats = [ - 'barcode_builders' => null, - 'x_step' => 'int32', - 'y_step' => 'int32' + 'barcode_type' => null, + 'encode_data' => null, + 'barcode_image_params' => null ]; /** @@ -72,9 +72,9 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'barcode_builders' => 'BarcodeBuilders', - 'x_step' => 'XStep', - 'y_step' => 'YStep' + 'barcode_type' => 'barcodeType', + 'encode_data' => 'encodeData', + 'barcode_image_params' => 'barcodeImageParams' ]; /** @@ -83,9 +83,9 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'barcode_builders' => 'setBarcodeBuilders', - 'x_step' => 'setXStep', - 'y_step' => 'setYStep' + 'barcode_type' => 'setBarcodeType', + 'encode_data' => 'setEncodeData', + 'barcode_image_params' => 'setBarcodeImageParams' ]; /** @@ -94,9 +94,9 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'barcode_builders' => 'getBarcodeBuilders', - 'x_step' => 'getXStep', - 'y_step' => 'getYStep' + 'barcode_type' => 'getBarcodeType', + 'encode_data' => 'getEncodeData', + 'barcode_image_params' => 'getBarcodeImageParams' ]; /** @@ -159,9 +159,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['barcode_builders'] = isset($data['barcode_builders']) ? $data['barcode_builders'] : null; - $this->container['x_step'] = isset($data['x_step']) ? $data['x_step'] : null; - $this->container['y_step'] = isset($data['y_step']) ? $data['y_step'] : null; + $this->container['barcode_type'] = isset($data['barcode_type']) ? $data['barcode_type'] : null; + $this->container['encode_data'] = isset($data['encode_data']) ? $data['encode_data'] : null; + $this->container['barcode_image_params'] = isset($data['barcode_image_params']) ? $data['barcode_image_params'] : null; } /** @@ -173,11 +173,11 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['x_step'] === null) { - $invalidProperties[] = "'x_step' can't be null"; + if ($this->container['barcode_type'] === null) { + $invalidProperties[] = "'barcode_type' can't be null"; } - if ($this->container['y_step'] === null) { - $invalidProperties[] = "'y_step' can't be null"; + if ($this->container['encode_data'] === null) { + $invalidProperties[] = "'encode_data' can't be null"; } return $invalidProperties; } @@ -190,10 +190,10 @@ public function listInvalidProperties() */ public function valid() { - if ($this->container['x_step'] === null) { + if ($this->container['barcode_type'] === null) { return false; } - if ($this->container['y_step'] === null) { + if ($this->container['encode_data'] === null) { return false; } return true; @@ -201,73 +201,73 @@ public function valid() /** - * Gets barcode_builders + * Gets barcode_type * - * @return \Aspose\BarCode\Model\GeneratorParams[] + * @return \Aspose\BarCode\Model\EncodeBarcodeType */ - public function getBarcodeBuilders() + public function getBarcodeType() { - return $this->container['barcode_builders']; + return $this->container['barcode_type']; } /** - * Sets barcode_builders + * Sets barcode_type * - * @param \Aspose\BarCode\Model\GeneratorParams[] $barcode_builders List of barcode generators + * @param \Aspose\BarCode\Model\EncodeBarcodeType $barcode_type barcode_type * * @return $this */ - public function setBarcodeBuilders($barcode_builders) + public function setBarcodeType($barcode_type) { - $this->container['barcode_builders'] = $barcode_builders; + $this->container['barcode_type'] = $barcode_type; return $this; } /** - * Gets x_step + * Gets encode_data * - * @return int + * @return \Aspose\BarCode\Model\EncodeData */ - public function getXStep() + public function getEncodeData() { - return $this->container['x_step']; + return $this->container['encode_data']; } /** - * Sets x_step + * Sets encode_data * - * @param int $x_step Shift step according to X axis + * @param \Aspose\BarCode\Model\EncodeData $encode_data encode_data * * @return $this */ - public function setXStep($x_step) + public function setEncodeData($encode_data) { - $this->container['x_step'] = $x_step; + $this->container['encode_data'] = $encode_data; return $this; } /** - * Gets y_step + * Gets barcode_image_params * - * @return int + * @return \Aspose\BarCode\Model\BarcodeImageParams */ - public function getYStep() + public function getBarcodeImageParams() { - return $this->container['y_step']; + return $this->container['barcode_image_params']; } /** - * Sets y_step + * Sets barcode_image_params * - * @param int $y_step Shift step according to Y axis + * @param \Aspose\BarCode\Model\BarcodeImageParams $barcode_image_params barcode_image_params * * @return $this */ - public function setYStep($y_step) + public function setBarcodeImageParams($barcode_image_params) { - $this->container['y_step'] = $y_step; + $this->container['barcode_image_params'] = $barcode_image_params; return $this; } diff --git a/src/Aspose/BarCode/Model/GeneratorParams.php b/src/Aspose/BarCode/Model/GeneratorParams.php deleted file mode 100644 index 9d0061c..0000000 --- a/src/Aspose/BarCode/Model/GeneratorParams.php +++ /dev/null @@ -1,1937 +0,0 @@ - '\Aspose\BarCode\Model\EncodeBarcodeType', - 'text' => 'string', - 'two_d_display_text' => 'string', - 'text_location' => '\Aspose\BarCode\Model\CodeLocation', - 'text_alignment' => '\Aspose\BarCode\Model\TextAlignment', - 'text_color' => 'string', - 'font' => '\Aspose\BarCode\Model\FontParams', - 'font_size_mode' => '\Aspose\BarCode\Model\FontMode', - 'no_wrap' => 'bool', - 'resolution' => 'double', - 'resolution_x' => 'double', - 'resolution_y' => 'double', - 'dimension_x' => 'double', - 'text_space' => 'double', - 'units' => '\Aspose\BarCode\Model\AvailableGraphicsUnit', - 'size_mode' => '\Aspose\BarCode\Model\AutoSizeMode', - 'bar_height' => 'double', - 'image_height' => 'double', - 'image_width' => 'double', - 'rotation_angle' => 'double', - 'padding' => '\Aspose\BarCode\Model\Padding', - 'caption_above' => '\Aspose\BarCode\Model\CaptionParams', - 'caption_below' => '\Aspose\BarCode\Model\CaptionParams', - 'back_color' => 'string', - 'bar_color' => 'string', - 'border_color' => 'string', - 'border_width' => 'double', - 'border_dash_style' => '\Aspose\BarCode\Model\BorderDashStyle', - 'border_visible' => 'bool', - 'enable_checksum' => '\Aspose\BarCode\Model\EnableChecksum', - 'enable_escape' => 'bool', - 'filled_bars' => 'bool', - 'always_show_checksum' => 'bool', - 'wide_narrow_ratio' => 'double', - 'validate_text' => 'bool', - 'supplement_data' => 'string', - 'supplement_space' => 'double', - 'bar_width_reduction' => 'double', - 'use_anti_alias' => 'bool', - 'australian_post' => '\Aspose\BarCode\Model\AustralianPostParams', - 'aztec' => '\Aspose\BarCode\Model\AztecParams', - 'codabar' => '\Aspose\BarCode\Model\CodabarParams', - 'codablock' => '\Aspose\BarCode\Model\CodablockParams', - 'code16_k' => '\Aspose\BarCode\Model\Code16KParams', - 'coupon' => '\Aspose\BarCode\Model\CouponParams', - 'data_bar' => '\Aspose\BarCode\Model\DataBarParams', - 'data_matrix' => '\Aspose\BarCode\Model\DataMatrixParams', - 'dot_code' => '\Aspose\BarCode\Model\DotCodeParams', - 'itf' => '\Aspose\BarCode\Model\ITFParams', - 'maxi_code' => '\Aspose\BarCode\Model\MaxiCodeParams', - 'pdf417' => '\Aspose\BarCode\Model\Pdf417Params', - 'postal' => '\Aspose\BarCode\Model\PostalParams', - 'qr' => '\Aspose\BarCode\Model\QrParams', - 'patch_code' => '\Aspose\BarCode\Model\PatchCodeParams', - 'code128' => '\Aspose\BarCode\Model\Code128Params', - 'han_xin' => '\Aspose\BarCode\Model\HanXinParams' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'type_of_barcode' => null, - 'text' => null, - 'two_d_display_text' => null, - 'text_location' => null, - 'text_alignment' => null, - 'text_color' => null, - 'font' => null, - 'font_size_mode' => null, - 'no_wrap' => null, - 'resolution' => 'double', - 'resolution_x' => 'double', - 'resolution_y' => 'double', - 'dimension_x' => 'double', - 'text_space' => 'double', - 'units' => null, - 'size_mode' => null, - 'bar_height' => 'double', - 'image_height' => 'double', - 'image_width' => 'double', - 'rotation_angle' => 'double', - 'padding' => null, - 'caption_above' => null, - 'caption_below' => null, - 'back_color' => null, - 'bar_color' => null, - 'border_color' => null, - 'border_width' => 'double', - 'border_dash_style' => null, - 'border_visible' => null, - 'enable_checksum' => null, - 'enable_escape' => null, - 'filled_bars' => null, - 'always_show_checksum' => null, - 'wide_narrow_ratio' => 'double', - 'validate_text' => null, - 'supplement_data' => null, - 'supplement_space' => 'double', - 'bar_width_reduction' => 'double', - 'use_anti_alias' => null, - 'australian_post' => null, - 'aztec' => null, - 'codabar' => null, - 'codablock' => null, - 'code16_k' => null, - 'coupon' => null, - 'data_bar' => null, - 'data_matrix' => null, - 'dot_code' => null, - 'itf' => null, - 'maxi_code' => null, - 'pdf417' => null, - 'postal' => null, - 'qr' => null, - 'patch_code' => null, - 'code128' => null, - 'han_xin' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'type_of_barcode' => 'TypeOfBarcode', - 'text' => 'Text', - 'two_d_display_text' => 'TwoDDisplayText', - 'text_location' => 'TextLocation', - 'text_alignment' => 'TextAlignment', - 'text_color' => 'TextColor', - 'font' => 'Font', - 'font_size_mode' => 'FontSizeMode', - 'no_wrap' => 'NoWrap', - 'resolution' => 'Resolution', - 'resolution_x' => 'ResolutionX', - 'resolution_y' => 'ResolutionY', - 'dimension_x' => 'DimensionX', - 'text_space' => 'TextSpace', - 'units' => 'Units', - 'size_mode' => 'SizeMode', - 'bar_height' => 'BarHeight', - 'image_height' => 'ImageHeight', - 'image_width' => 'ImageWidth', - 'rotation_angle' => 'RotationAngle', - 'padding' => 'Padding', - 'caption_above' => 'CaptionAbove', - 'caption_below' => 'CaptionBelow', - 'back_color' => 'BackColor', - 'bar_color' => 'BarColor', - 'border_color' => 'BorderColor', - 'border_width' => 'BorderWidth', - 'border_dash_style' => 'BorderDashStyle', - 'border_visible' => 'BorderVisible', - 'enable_checksum' => 'EnableChecksum', - 'enable_escape' => 'EnableEscape', - 'filled_bars' => 'FilledBars', - 'always_show_checksum' => 'AlwaysShowChecksum', - 'wide_narrow_ratio' => 'WideNarrowRatio', - 'validate_text' => 'ValidateText', - 'supplement_data' => 'SupplementData', - 'supplement_space' => 'SupplementSpace', - 'bar_width_reduction' => 'BarWidthReduction', - 'use_anti_alias' => 'UseAntiAlias', - 'australian_post' => 'AustralianPost', - 'aztec' => 'Aztec', - 'codabar' => 'Codabar', - 'codablock' => 'Codablock', - 'code16_k' => 'Code16K', - 'coupon' => 'Coupon', - 'data_bar' => 'DataBar', - 'data_matrix' => 'DataMatrix', - 'dot_code' => 'DotCode', - 'itf' => 'ITF', - 'maxi_code' => 'MaxiCode', - 'pdf417' => 'Pdf417', - 'postal' => 'Postal', - 'qr' => 'QR', - 'patch_code' => 'PatchCode', - 'code128' => 'Code128', - 'han_xin' => 'HanXin' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'type_of_barcode' => 'setTypeOfBarcode', - 'text' => 'setText', - 'two_d_display_text' => 'setTwoDDisplayText', - 'text_location' => 'setTextLocation', - 'text_alignment' => 'setTextAlignment', - 'text_color' => 'setTextColor', - 'font' => 'setFont', - 'font_size_mode' => 'setFontSizeMode', - 'no_wrap' => 'setNoWrap', - 'resolution' => 'setResolution', - 'resolution_x' => 'setResolutionX', - 'resolution_y' => 'setResolutionY', - 'dimension_x' => 'setDimensionX', - 'text_space' => 'setTextSpace', - 'units' => 'setUnits', - 'size_mode' => 'setSizeMode', - 'bar_height' => 'setBarHeight', - 'image_height' => 'setImageHeight', - 'image_width' => 'setImageWidth', - 'rotation_angle' => 'setRotationAngle', - 'padding' => 'setPadding', - 'caption_above' => 'setCaptionAbove', - 'caption_below' => 'setCaptionBelow', - 'back_color' => 'setBackColor', - 'bar_color' => 'setBarColor', - 'border_color' => 'setBorderColor', - 'border_width' => 'setBorderWidth', - 'border_dash_style' => 'setBorderDashStyle', - 'border_visible' => 'setBorderVisible', - 'enable_checksum' => 'setEnableChecksum', - 'enable_escape' => 'setEnableEscape', - 'filled_bars' => 'setFilledBars', - 'always_show_checksum' => 'setAlwaysShowChecksum', - 'wide_narrow_ratio' => 'setWideNarrowRatio', - 'validate_text' => 'setValidateText', - 'supplement_data' => 'setSupplementData', - 'supplement_space' => 'setSupplementSpace', - 'bar_width_reduction' => 'setBarWidthReduction', - 'use_anti_alias' => 'setUseAntiAlias', - 'australian_post' => 'setAustralianPost', - 'aztec' => 'setAztec', - 'codabar' => 'setCodabar', - 'codablock' => 'setCodablock', - 'code16_k' => 'setCode16K', - 'coupon' => 'setCoupon', - 'data_bar' => 'setDataBar', - 'data_matrix' => 'setDataMatrix', - 'dot_code' => 'setDotCode', - 'itf' => 'setItf', - 'maxi_code' => 'setMaxiCode', - 'pdf417' => 'setPdf417', - 'postal' => 'setPostal', - 'qr' => 'setQr', - 'patch_code' => 'setPatchCode', - 'code128' => 'setCode128', - 'han_xin' => 'setHanXin' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'type_of_barcode' => 'getTypeOfBarcode', - 'text' => 'getText', - 'two_d_display_text' => 'getTwoDDisplayText', - 'text_location' => 'getTextLocation', - 'text_alignment' => 'getTextAlignment', - 'text_color' => 'getTextColor', - 'font' => 'getFont', - 'font_size_mode' => 'getFontSizeMode', - 'no_wrap' => 'getNoWrap', - 'resolution' => 'getResolution', - 'resolution_x' => 'getResolutionX', - 'resolution_y' => 'getResolutionY', - 'dimension_x' => 'getDimensionX', - 'text_space' => 'getTextSpace', - 'units' => 'getUnits', - 'size_mode' => 'getSizeMode', - 'bar_height' => 'getBarHeight', - 'image_height' => 'getImageHeight', - 'image_width' => 'getImageWidth', - 'rotation_angle' => 'getRotationAngle', - 'padding' => 'getPadding', - 'caption_above' => 'getCaptionAbove', - 'caption_below' => 'getCaptionBelow', - 'back_color' => 'getBackColor', - 'bar_color' => 'getBarColor', - 'border_color' => 'getBorderColor', - 'border_width' => 'getBorderWidth', - 'border_dash_style' => 'getBorderDashStyle', - 'border_visible' => 'getBorderVisible', - 'enable_checksum' => 'getEnableChecksum', - 'enable_escape' => 'getEnableEscape', - 'filled_bars' => 'getFilledBars', - 'always_show_checksum' => 'getAlwaysShowChecksum', - 'wide_narrow_ratio' => 'getWideNarrowRatio', - 'validate_text' => 'getValidateText', - 'supplement_data' => 'getSupplementData', - 'supplement_space' => 'getSupplementSpace', - 'bar_width_reduction' => 'getBarWidthReduction', - 'use_anti_alias' => 'getUseAntiAlias', - 'australian_post' => 'getAustralianPost', - 'aztec' => 'getAztec', - 'codabar' => 'getCodabar', - 'codablock' => 'getCodablock', - 'code16_k' => 'getCode16K', - 'coupon' => 'getCoupon', - 'data_bar' => 'getDataBar', - 'data_matrix' => 'getDataMatrix', - 'dot_code' => 'getDotCode', - 'itf' => 'getItf', - 'maxi_code' => 'getMaxiCode', - 'pdf417' => 'getPdf417', - 'postal' => 'getPostal', - 'qr' => 'getQr', - 'patch_code' => 'getPatchCode', - 'code128' => 'getCode128', - 'han_xin' => 'getHanXin' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['type_of_barcode'] = isset($data['type_of_barcode']) ? $data['type_of_barcode'] : null; - $this->container['text'] = isset($data['text']) ? $data['text'] : null; - $this->container['two_d_display_text'] = isset($data['two_d_display_text']) ? $data['two_d_display_text'] : null; - $this->container['text_location'] = isset($data['text_location']) ? $data['text_location'] : null; - $this->container['text_alignment'] = isset($data['text_alignment']) ? $data['text_alignment'] : null; - $this->container['text_color'] = isset($data['text_color']) ? $data['text_color'] : null; - $this->container['font'] = isset($data['font']) ? $data['font'] : null; - $this->container['font_size_mode'] = isset($data['font_size_mode']) ? $data['font_size_mode'] : null; - $this->container['no_wrap'] = isset($data['no_wrap']) ? $data['no_wrap'] : null; - $this->container['resolution'] = isset($data['resolution']) ? $data['resolution'] : null; - $this->container['resolution_x'] = isset($data['resolution_x']) ? $data['resolution_x'] : null; - $this->container['resolution_y'] = isset($data['resolution_y']) ? $data['resolution_y'] : null; - $this->container['dimension_x'] = isset($data['dimension_x']) ? $data['dimension_x'] : null; - $this->container['text_space'] = isset($data['text_space']) ? $data['text_space'] : null; - $this->container['units'] = isset($data['units']) ? $data['units'] : null; - $this->container['size_mode'] = isset($data['size_mode']) ? $data['size_mode'] : null; - $this->container['bar_height'] = isset($data['bar_height']) ? $data['bar_height'] : null; - $this->container['image_height'] = isset($data['image_height']) ? $data['image_height'] : null; - $this->container['image_width'] = isset($data['image_width']) ? $data['image_width'] : null; - $this->container['rotation_angle'] = isset($data['rotation_angle']) ? $data['rotation_angle'] : null; - $this->container['padding'] = isset($data['padding']) ? $data['padding'] : null; - $this->container['caption_above'] = isset($data['caption_above']) ? $data['caption_above'] : null; - $this->container['caption_below'] = isset($data['caption_below']) ? $data['caption_below'] : null; - $this->container['back_color'] = isset($data['back_color']) ? $data['back_color'] : null; - $this->container['bar_color'] = isset($data['bar_color']) ? $data['bar_color'] : null; - $this->container['border_color'] = isset($data['border_color']) ? $data['border_color'] : null; - $this->container['border_width'] = isset($data['border_width']) ? $data['border_width'] : null; - $this->container['border_dash_style'] = isset($data['border_dash_style']) ? $data['border_dash_style'] : null; - $this->container['border_visible'] = isset($data['border_visible']) ? $data['border_visible'] : null; - $this->container['enable_checksum'] = isset($data['enable_checksum']) ? $data['enable_checksum'] : null; - $this->container['enable_escape'] = isset($data['enable_escape']) ? $data['enable_escape'] : null; - $this->container['filled_bars'] = isset($data['filled_bars']) ? $data['filled_bars'] : null; - $this->container['always_show_checksum'] = isset($data['always_show_checksum']) ? $data['always_show_checksum'] : null; - $this->container['wide_narrow_ratio'] = isset($data['wide_narrow_ratio']) ? $data['wide_narrow_ratio'] : null; - $this->container['validate_text'] = isset($data['validate_text']) ? $data['validate_text'] : null; - $this->container['supplement_data'] = isset($data['supplement_data']) ? $data['supplement_data'] : null; - $this->container['supplement_space'] = isset($data['supplement_space']) ? $data['supplement_space'] : null; - $this->container['bar_width_reduction'] = isset($data['bar_width_reduction']) ? $data['bar_width_reduction'] : null; - $this->container['use_anti_alias'] = isset($data['use_anti_alias']) ? $data['use_anti_alias'] : null; - $this->container['australian_post'] = isset($data['australian_post']) ? $data['australian_post'] : null; - $this->container['aztec'] = isset($data['aztec']) ? $data['aztec'] : null; - $this->container['codabar'] = isset($data['codabar']) ? $data['codabar'] : null; - $this->container['codablock'] = isset($data['codablock']) ? $data['codablock'] : null; - $this->container['code16_k'] = isset($data['code16_k']) ? $data['code16_k'] : null; - $this->container['coupon'] = isset($data['coupon']) ? $data['coupon'] : null; - $this->container['data_bar'] = isset($data['data_bar']) ? $data['data_bar'] : null; - $this->container['data_matrix'] = isset($data['data_matrix']) ? $data['data_matrix'] : null; - $this->container['dot_code'] = isset($data['dot_code']) ? $data['dot_code'] : null; - $this->container['itf'] = isset($data['itf']) ? $data['itf'] : null; - $this->container['maxi_code'] = isset($data['maxi_code']) ? $data['maxi_code'] : null; - $this->container['pdf417'] = isset($data['pdf417']) ? $data['pdf417'] : null; - $this->container['postal'] = isset($data['postal']) ? $data['postal'] : null; - $this->container['qr'] = isset($data['qr']) ? $data['qr'] : null; - $this->container['patch_code'] = isset($data['patch_code']) ? $data['patch_code'] : null; - $this->container['code128'] = isset($data['code128']) ? $data['code128'] : null; - $this->container['han_xin'] = isset($data['han_xin']) ? $data['han_xin'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['type_of_barcode'] === null) { - $invalidProperties[] = "'type_of_barcode' can't be null"; - } - if ($this->container['text'] === null) { - $invalidProperties[] = "'text' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - if ($this->container['type_of_barcode'] === null) { - return false; - } - if ($this->container['text'] === null) { - return false; - } - return true; - } - - - /** - * Gets type_of_barcode - * - * @return \Aspose\BarCode\Model\EncodeBarcodeType - */ - public function getTypeOfBarcode() - { - return $this->container['type_of_barcode']; - } - - /** - * Sets type_of_barcode - * - * @param \Aspose\BarCode\Model\EncodeBarcodeType $type_of_barcode Type of barcode to generate. - * - * @return $this - */ - public function setTypeOfBarcode($type_of_barcode) - { - $this->container['type_of_barcode'] = $type_of_barcode; - - return $this; - } - - /** - * Gets text - * - * @return string - */ - public function getText() - { - return $this->container['text']; - } - - /** - * Sets text - * - * @param string $text Text to encode. - * - * @return $this - */ - public function setText($text) - { - $this->container['text'] = $text; - - return $this; - } - - /** - * Gets two_d_display_text - * - * @return string - */ - public function getTwoDDisplayText() - { - return $this->container['two_d_display_text']; - } - - /** - * Sets two_d_display_text - * - * @param string $two_d_display_text Text that will be displayed instead of codetext in 2D barcodes. Used for: Aztec, Pdf417, DataMatrix, QR, MaxiCode, DotCode - * - * @return $this - */ - public function setTwoDDisplayText($two_d_display_text) - { - $this->container['two_d_display_text'] = $two_d_display_text; - - return $this; - } - - /** - * Gets text_location - * - * @return \Aspose\BarCode\Model\CodeLocation - */ - public function getTextLocation() - { - return $this->container['text_location']; - } - - /** - * Sets text_location - * - * @param \Aspose\BarCode\Model\CodeLocation $text_location Specify the displaying Text Location, set to CodeLocation.None to hide CodeText. Default value: CodeLocation.Below. - * - * @return $this - */ - public function setTextLocation($text_location) - { - $this->container['text_location'] = $text_location; - - return $this; - } - - /** - * Gets text_alignment - * - * @return \Aspose\BarCode\Model\TextAlignment - */ - public function getTextAlignment() - { - return $this->container['text_alignment']; - } - - /** - * Sets text_alignment - * - * @param \Aspose\BarCode\Model\TextAlignment $text_alignment Text alignment. - * - * @return $this - */ - public function setTextAlignment($text_alignment) - { - $this->container['text_alignment'] = $text_alignment; - - return $this; - } - - /** - * Gets text_color - * - * @return string - */ - public function getTextColor() - { - return $this->container['text_color']; - } - - /** - * Sets text_color - * - * @param string $text_color Specify the displaying CodeText's Color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF - * - * @return $this - */ - public function setTextColor($text_color) - { - $this->container['text_color'] = $text_color; - - return $this; - } - - /** - * Gets font - * - * @return \Aspose\BarCode\Model\FontParams - */ - public function getFont() - { - return $this->container['font']; - } - - /** - * Sets font - * - * @param \Aspose\BarCode\Model\FontParams $font Specify the displaying Text's font. Default value: Arial 5pt regular. Ignored if FontSizeMode is set to FontSizeMode.Auto. - * - * @return $this - */ - public function setFont($font) - { - $this->container['font'] = $font; - - return $this; - } - - /** - * Gets font_size_mode - * - * @return \Aspose\BarCode\Model\FontMode - */ - public function getFontSizeMode() - { - return $this->container['font_size_mode']; - } - - /** - * Sets font_size_mode - * - * @param \Aspose\BarCode\Model\FontMode $font_size_mode Specify FontSizeMode. If FontSizeMode is set to Auto, font size will be calculated automatically based on xDimension value. It is recommended to use FontSizeMode.Auto especially in AutoSizeMode.Nearest or AutoSizeMode.Interpolation. Default value: FontSizeMode.Auto. - * - * @return $this - */ - public function setFontSizeMode($font_size_mode) - { - $this->container['font_size_mode'] = $font_size_mode; - - return $this; - } - - /** - * Gets no_wrap - * - * @return bool - */ - public function getNoWrap() - { - return $this->container['no_wrap']; - } - - /** - * Sets no_wrap - * - * @param bool $no_wrap Specify word wraps (line breaks) within text. Default value: false. - * - * @return $this - */ - public function setNoWrap($no_wrap) - { - $this->container['no_wrap'] = $no_wrap; - - return $this; - } - - /** - * Gets resolution - * - * @return double - */ - public function getResolution() - { - return $this->container['resolution']; - } - - /** - * Sets resolution - * - * @param double $resolution Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. - * - * @return $this - */ - public function setResolution($resolution) - { - $this->container['resolution'] = $resolution; - - return $this; - } - - /** - * Gets resolution_x - * - * @return double - */ - public function getResolutionX() - { - return $this->container['resolution_x']; - } - - /** - * Sets resolution_x - * - * @param double $resolution_x DEPRECATED: Use 'Resolution' instead. - * - * @return $this - */ - public function setResolutionX($resolution_x) - { - trigger_error('Property $resolution_x is deprecated. Use \'Resolution\' instead.', E_USER_DEPRECATED); - $this->container['resolution_x'] = $resolution_x; - - return $this; - } - - /** - * Gets resolution_y - * - * @return double - */ - public function getResolutionY() - { - return $this->container['resolution_y']; - } - - /** - * Sets resolution_y - * - * @param double $resolution_y DEPRECATED: Use 'Resolution' instead. - * - * @return $this - */ - public function setResolutionY($resolution_y) - { - trigger_error('Property $resolution_y is deprecated. Use \'Resolution\' instead.', E_USER_DEPRECATED); - $this->container['resolution_y'] = $resolution_y; - - return $this; - } - - /** - * Gets dimension_x - * - * @return double - */ - public function getDimensionX() - { - return $this->container['dimension_x']; - } - - /** - * Sets dimension_x - * - * @param double $dimension_x The smallest width of the unit of BarCode bars or spaces. Increase this will increase the whole barcode image width. Ignored if AutoSizeMode property is set to AutoSizeMode.Nearest or AutoSizeMode.Interpolation. - * - * @return $this - */ - public function setDimensionX($dimension_x) - { - $this->container['dimension_x'] = $dimension_x; - - return $this; - } - - /** - * Gets text_space - * - * @return double - */ - public function getTextSpace() - { - return $this->container['text_space']; - } - - /** - * Sets text_space - * - * @param double $text_space Space between the CodeText and the BarCode in Unit value. Default value: 2pt. Ignored for EAN8, EAN13, UPCE, UPCA, ISBN, ISMN, ISSN, UpcaGs1DatabarCoupon. - * - * @return $this - */ - public function setTextSpace($text_space) - { - $this->container['text_space'] = $text_space; - - return $this; - } - - /** - * Gets units - * - * @return \Aspose\BarCode\Model\AvailableGraphicsUnit - */ - public function getUnits() - { - return $this->container['units']; - } - - /** - * Sets units - * - * @param \Aspose\BarCode\Model\AvailableGraphicsUnit $units Common Units for all measuring in query. Default units: pixel. - * - * @return $this - */ - public function setUnits($units) - { - $this->container['units'] = $units; - - return $this; - } - - /** - * Gets size_mode - * - * @return \Aspose\BarCode\Model\AutoSizeMode - */ - public function getSizeMode() - { - return $this->container['size_mode']; - } - - /** - * Sets size_mode - * - * @param \Aspose\BarCode\Model\AutoSizeMode $size_mode Specifies the different types of automatic sizing modes. Default value: AutoSizeMode.None. - * - * @return $this - */ - public function setSizeMode($size_mode) - { - $this->container['size_mode'] = $size_mode; - - return $this; - } - - /** - * Gets bar_height - * - * @return double - */ - public function getBarHeight() - { - return $this->container['bar_height']; - } - - /** - * Sets bar_height - * - * @param double $bar_height Height of the barcode in given units. Default units: pixel. - * - * @return $this - */ - public function setBarHeight($bar_height) - { - $this->container['bar_height'] = $bar_height; - - return $this; - } - - /** - * Gets image_height - * - * @return double - */ - public function getImageHeight() - { - return $this->container['image_height']; - } - - /** - * Sets image_height - * - * @param double $image_height Height of the barcode image in given units. Default units: pixel. - * - * @return $this - */ - public function setImageHeight($image_height) - { - $this->container['image_height'] = $image_height; - - return $this; - } - - /** - * Gets image_width - * - * @return double - */ - public function getImageWidth() - { - return $this->container['image_width']; - } - - /** - * Sets image_width - * - * @param double $image_width Width of the barcode image in given units. Default units: pixel. - * - * @return $this - */ - public function setImageWidth($image_width) - { - $this->container['image_width'] = $image_width; - - return $this; - } - - /** - * Gets rotation_angle - * - * @return double - */ - public function getRotationAngle() - { - return $this->container['rotation_angle']; - } - - /** - * Sets rotation_angle - * - * @param double $rotation_angle BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0. - * - * @return $this - */ - public function setRotationAngle($rotation_angle) - { - $this->container['rotation_angle'] = $rotation_angle; - - return $this; - } - - /** - * Gets padding - * - * @return \Aspose\BarCode\Model\Padding - */ - public function getPadding() - { - return $this->container['padding']; - } - - /** - * Sets padding - * - * @param \Aspose\BarCode\Model\Padding $padding Barcode paddings. Default value: 5pt 5pt 5pt 5pt. - * - * @return $this - */ - public function setPadding($padding) - { - $this->container['padding'] = $padding; - - return $this; - } - - /** - * Gets caption_above - * - * @return \Aspose\BarCode\Model\CaptionParams - */ - public function getCaptionAbove() - { - return $this->container['caption_above']; - } - - /** - * Sets caption_above - * - * @param \Aspose\BarCode\Model\CaptionParams $caption_above Additional caption above barcode. - * - * @return $this - */ - public function setCaptionAbove($caption_above) - { - $this->container['caption_above'] = $caption_above; - - return $this; - } - - /** - * Gets caption_below - * - * @return \Aspose\BarCode\Model\CaptionParams - */ - public function getCaptionBelow() - { - return $this->container['caption_below']; - } - - /** - * Sets caption_below - * - * @param \Aspose\BarCode\Model\CaptionParams $caption_below Additional caption below barcode. - * - * @return $this - */ - public function setCaptionBelow($caption_below) - { - $this->container['caption_below'] = $caption_below; - - return $this; - } - - /** - * Gets back_color - * - * @return string - */ - public function getBackColor() - { - return $this->container['back_color']; - } - - /** - * Sets back_color - * - * @param string $back_color Background color of the barcode image. Default value: white. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF - * - * @return $this - */ - public function setBackColor($back_color) - { - $this->container['back_color'] = $back_color; - - return $this; - } - - /** - * Gets bar_color - * - * @return string - */ - public function getBarColor() - { - return $this->container['bar_color']; - } - - /** - * Sets bar_color - * - * @param string $bar_color Bars color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF - * - * @return $this - */ - public function setBarColor($bar_color) - { - $this->container['bar_color'] = $bar_color; - - return $this; - } - - /** - * Gets border_color - * - * @return string - */ - public function getBorderColor() - { - return $this->container['border_color']; - } - - /** - * Sets border_color - * - * @param string $border_color Border color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF - * - * @return $this - */ - public function setBorderColor($border_color) - { - $this->container['border_color'] = $border_color; - - return $this; - } - - /** - * Gets border_width - * - * @return double - */ - public function getBorderWidth() - { - return $this->container['border_width']; - } - - /** - * Sets border_width - * - * @param double $border_width Border width. Default value: 0. Ignored if Visible is set to false. - * - * @return $this - */ - public function setBorderWidth($border_width) - { - $this->container['border_width'] = $border_width; - - return $this; - } - - /** - * Gets border_dash_style - * - * @return \Aspose\BarCode\Model\BorderDashStyle - */ - public function getBorderDashStyle() - { - return $this->container['border_dash_style']; - } - - /** - * Sets border_dash_style - * - * @param \Aspose\BarCode\Model\BorderDashStyle $border_dash_style Border dash style. Default value: BorderDashStyle.Solid. - * - * @return $this - */ - public function setBorderDashStyle($border_dash_style) - { - $this->container['border_dash_style'] = $border_dash_style; - - return $this; - } - - /** - * Gets border_visible - * - * @return bool - */ - public function getBorderVisible() - { - return $this->container['border_visible']; - } - - /** - * Sets border_visible - * - * @param bool $border_visible Border visibility. If false than parameter Width is always ignored (0). Default value: false. - * - * @return $this - */ - public function setBorderVisible($border_visible) - { - $this->container['border_visible'] = $border_visible; - - return $this; - } - - /** - * Gets enable_checksum - * - * @return \Aspose\BarCode\Model\EnableChecksum - */ - public function getEnableChecksum() - { - return $this->container['enable_checksum']; - } - - /** - * Sets enable_checksum - * - * @param \Aspose\BarCode\Model\EnableChecksum $enable_checksum Enable checksum during generation 1D barcodes. Default is treated as Yes for symbology which must contain checksum, as No where checksum only possible. Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN, Codabar Checksum always used: Rest symbology - * - * @return $this - */ - public function setEnableChecksum($enable_checksum) - { - $this->container['enable_checksum'] = $enable_checksum; - - return $this; - } - - /** - * Gets enable_escape - * - * @return bool - */ - public function getEnableEscape() - { - return $this->container['enable_escape']; - } - - /** - * Sets enable_escape - * - * @param bool $enable_escape Indicates whether explains the character \"\\\" as an escape character in CodeText property. Used for Pdf417, DataMatrix, Code128 only If the EnableEscape is true, \"\\\" will be explained as a special escape character. Otherwise, \"\\\" acts as normal characters. Aspose.BarCode supports input decimal ascii code and mnemonic for ASCII control-code characters. For example, \\013 and \\\\CR stands for CR. - * - * @return $this - */ - public function setEnableEscape($enable_escape) - { - $this->container['enable_escape'] = $enable_escape; - - return $this; - } - - /** - * Gets filled_bars - * - * @return bool - */ - public function getFilledBars() - { - return $this->container['filled_bars']; - } - - /** - * Sets filled_bars - * - * @param bool $filled_bars Value indicating whether bars are filled. Only for 1D barcodes. Default value: true. - * - * @return $this - */ - public function setFilledBars($filled_bars) - { - $this->container['filled_bars'] = $filled_bars; - - return $this; - } - - /** - * Gets always_show_checksum - * - * @return bool - */ - public function getAlwaysShowChecksum() - { - return $this->container['always_show_checksum']; - } - - /** - * Sets always_show_checksum - * - * @param bool $always_show_checksum Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes. - * - * @return $this - */ - public function setAlwaysShowChecksum($always_show_checksum) - { - $this->container['always_show_checksum'] = $always_show_checksum; - - return $this; - } - - /** - * Gets wide_narrow_ratio - * - * @return double - */ - public function getWideNarrowRatio() - { - return $this->container['wide_narrow_ratio']; - } - - /** - * Sets wide_narrow_ratio - * - * @param double $wide_narrow_ratio Wide bars to Narrow bars ratio. Default value: 3, that is, wide bars are 3 times as wide as narrow bars. Used for ITF, PZN, PharmaCode, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, IATA2of5, VIN, DeutschePost, OPC, Code32, DataLogic2of5, PatchCode, Code39Extended, Code39Standard - * - * @return $this - */ - public function setWideNarrowRatio($wide_narrow_ratio) - { - $this->container['wide_narrow_ratio'] = $wide_narrow_ratio; - - return $this; - } - - /** - * Gets validate_text - * - * @return bool - */ - public function getValidateText() - { - return $this->container['validate_text']; - } - - /** - * Sets validate_text - * - * @param bool $validate_text Only for 1D barcodes. If codetext is incorrect and value set to true - exception will be thrown. Otherwise codetext will be corrected to match barcode's specification. Exception always will be thrown for: Databar symbology if codetext is incorrect. Exception always will not be thrown for: AustraliaPost, SingaporePost, Code39Extended, Code93Extended, Code16K, Code128 symbology if codetext is incorrect. - * - * @return $this - */ - public function setValidateText($validate_text) - { - $this->container['validate_text'] = $validate_text; - - return $this; - } - - /** - * Gets supplement_data - * - * @return string - */ - public function getSupplementData() - { - return $this->container['supplement_data']; - } - - /** - * Sets supplement_data - * - * @param string $supplement_data Supplement parameters. Used for Interleaved2of5, Standard2of5, EAN13, EAN8, UPCA, UPCE, ISBN, ISSN, ISMN. - * - * @return $this - */ - public function setSupplementData($supplement_data) - { - $this->container['supplement_data'] = $supplement_data; - - return $this; - } - - /** - * Gets supplement_space - * - * @return double - */ - public function getSupplementSpace() - { - return $this->container['supplement_space']; - } - - /** - * Sets supplement_space - * - * @param double $supplement_space Space between main the BarCode and supplement BarCode. - * - * @return $this - */ - public function setSupplementSpace($supplement_space) - { - $this->container['supplement_space'] = $supplement_space; - - return $this; - } - - /** - * Gets bar_width_reduction - * - * @return double - */ - public function getBarWidthReduction() - { - return $this->container['bar_width_reduction']; - } - - /** - * Sets bar_width_reduction - * - * @param double $bar_width_reduction Bars reduction value that is used to compensate ink spread while printing. - * - * @return $this - */ - public function setBarWidthReduction($bar_width_reduction) - { - $this->container['bar_width_reduction'] = $bar_width_reduction; - - return $this; - } - - /** - * Gets use_anti_alias - * - * @return bool - */ - public function getUseAntiAlias() - { - return $this->container['use_anti_alias']; - } - - /** - * Sets use_anti_alias - * - * @param bool $use_anti_alias Indicates whether is used anti-aliasing mode to render image. Anti-aliasing mode is applied to barcode and text drawing. - * - * @return $this - */ - public function setUseAntiAlias($use_anti_alias) - { - $this->container['use_anti_alias'] = $use_anti_alias; - - return $this; - } - - /** - * Gets australian_post - * - * @return \Aspose\BarCode\Model\AustralianPostParams - */ - public function getAustralianPost() - { - return $this->container['australian_post']; - } - - /** - * Sets australian_post - * - * @param \Aspose\BarCode\Model\AustralianPostParams $australian_post AustralianPost params. - * - * @return $this - */ - public function setAustralianPost($australian_post) - { - $this->container['australian_post'] = $australian_post; - - return $this; - } - - /** - * Gets aztec - * - * @return \Aspose\BarCode\Model\AztecParams - */ - public function getAztec() - { - return $this->container['aztec']; - } - - /** - * Sets aztec - * - * @param \Aspose\BarCode\Model\AztecParams $aztec Aztec params. - * - * @return $this - */ - public function setAztec($aztec) - { - $this->container['aztec'] = $aztec; - - return $this; - } - - /** - * Gets codabar - * - * @return \Aspose\BarCode\Model\CodabarParams - */ - public function getCodabar() - { - return $this->container['codabar']; - } - - /** - * Sets codabar - * - * @param \Aspose\BarCode\Model\CodabarParams $codabar Codabar params. - * - * @return $this - */ - public function setCodabar($codabar) - { - $this->container['codabar'] = $codabar; - - return $this; - } - - /** - * Gets codablock - * - * @return \Aspose\BarCode\Model\CodablockParams - */ - public function getCodablock() - { - return $this->container['codablock']; - } - - /** - * Sets codablock - * - * @param \Aspose\BarCode\Model\CodablockParams $codablock Codablock params. - * - * @return $this - */ - public function setCodablock($codablock) - { - $this->container['codablock'] = $codablock; - - return $this; - } - - /** - * Gets code16_k - * - * @return \Aspose\BarCode\Model\Code16KParams - */ - public function getCode16K() - { - return $this->container['code16_k']; - } - - /** - * Sets code16_k - * - * @param \Aspose\BarCode\Model\Code16KParams $code16_k Code16K params. - * - * @return $this - */ - public function setCode16K($code16_k) - { - $this->container['code16_k'] = $code16_k; - - return $this; - } - - /** - * Gets coupon - * - * @return \Aspose\BarCode\Model\CouponParams - */ - public function getCoupon() - { - return $this->container['coupon']; - } - - /** - * Sets coupon - * - * @param \Aspose\BarCode\Model\CouponParams $coupon Coupon params. - * - * @return $this - */ - public function setCoupon($coupon) - { - $this->container['coupon'] = $coupon; - - return $this; - } - - /** - * Gets data_bar - * - * @return \Aspose\BarCode\Model\DataBarParams - */ - public function getDataBar() - { - return $this->container['data_bar']; - } - - /** - * Sets data_bar - * - * @param \Aspose\BarCode\Model\DataBarParams $data_bar DataBar params. - * - * @return $this - */ - public function setDataBar($data_bar) - { - $this->container['data_bar'] = $data_bar; - - return $this; - } - - /** - * Gets data_matrix - * - * @return \Aspose\BarCode\Model\DataMatrixParams - */ - public function getDataMatrix() - { - return $this->container['data_matrix']; - } - - /** - * Sets data_matrix - * - * @param \Aspose\BarCode\Model\DataMatrixParams $data_matrix DataMatrix params. - * - * @return $this - */ - public function setDataMatrix($data_matrix) - { - $this->container['data_matrix'] = $data_matrix; - - return $this; - } - - /** - * Gets dot_code - * - * @return \Aspose\BarCode\Model\DotCodeParams - */ - public function getDotCode() - { - return $this->container['dot_code']; - } - - /** - * Sets dot_code - * - * @param \Aspose\BarCode\Model\DotCodeParams $dot_code DotCode params. - * - * @return $this - */ - public function setDotCode($dot_code) - { - $this->container['dot_code'] = $dot_code; - - return $this; - } - - /** - * Gets itf - * - * @return \Aspose\BarCode\Model\ITFParams - */ - public function getItf() - { - return $this->container['itf']; - } - - /** - * Sets itf - * - * @param \Aspose\BarCode\Model\ITFParams $itf ITF params. - * - * @return $this - */ - public function setItf($itf) - { - $this->container['itf'] = $itf; - - return $this; - } - - /** - * Gets maxi_code - * - * @return \Aspose\BarCode\Model\MaxiCodeParams - */ - public function getMaxiCode() - { - return $this->container['maxi_code']; - } - - /** - * Sets maxi_code - * - * @param \Aspose\BarCode\Model\MaxiCodeParams $maxi_code MaxiCode params. - * - * @return $this - */ - public function setMaxiCode($maxi_code) - { - $this->container['maxi_code'] = $maxi_code; - - return $this; - } - - /** - * Gets pdf417 - * - * @return \Aspose\BarCode\Model\Pdf417Params - */ - public function getPdf417() - { - return $this->container['pdf417']; - } - - /** - * Sets pdf417 - * - * @param \Aspose\BarCode\Model\Pdf417Params $pdf417 Pdf417 params. - * - * @return $this - */ - public function setPdf417($pdf417) - { - $this->container['pdf417'] = $pdf417; - - return $this; - } - - /** - * Gets postal - * - * @return \Aspose\BarCode\Model\PostalParams - */ - public function getPostal() - { - return $this->container['postal']; - } - - /** - * Sets postal - * - * @param \Aspose\BarCode\Model\PostalParams $postal Postal params. - * - * @return $this - */ - public function setPostal($postal) - { - $this->container['postal'] = $postal; - - return $this; - } - - /** - * Gets qr - * - * @return \Aspose\BarCode\Model\QrParams - */ - public function getQr() - { - return $this->container['qr']; - } - - /** - * Sets qr - * - * @param \Aspose\BarCode\Model\QrParams $qr QR params. - * - * @return $this - */ - public function setQr($qr) - { - $this->container['qr'] = $qr; - - return $this; - } - - /** - * Gets patch_code - * - * @return \Aspose\BarCode\Model\PatchCodeParams - */ - public function getPatchCode() - { - return $this->container['patch_code']; - } - - /** - * Sets patch_code - * - * @param \Aspose\BarCode\Model\PatchCodeParams $patch_code PatchCode params. - * - * @return $this - */ - public function setPatchCode($patch_code) - { - $this->container['patch_code'] = $patch_code; - - return $this; - } - - /** - * Gets code128 - * - * @return \Aspose\BarCode\Model\Code128Params - */ - public function getCode128() - { - return $this->container['code128']; - } - - /** - * Sets code128 - * - * @param \Aspose\BarCode\Model\Code128Params $code128 Code128 parameters - * - * @return $this - */ - public function setCode128($code128) - { - $this->container['code128'] = $code128; - - return $this; - } - - /** - * Gets han_xin - * - * @return \Aspose\BarCode\Model\HanXinParams - */ - public function getHanXin() - { - return $this->container['han_xin']; - } - - /** - * Sets han_xin - * - * @param \Aspose\BarCode\Model\HanXinParams $han_xin HanXin params. - * - * @return $this - */ - public function setHanXin($han_xin) - { - $this->container['han_xin'] = $han_xin; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/AvailableGraphicsUnit.php b/src/Aspose/BarCode/Model/GraphicsUnit.php similarity index 84% rename from src/Aspose/BarCode/Model/AvailableGraphicsUnit.php rename to src/Aspose/BarCode/Model/GraphicsUnit.php index bfa7607..2ad45d1 100644 --- a/src/Aspose/BarCode/Model/AvailableGraphicsUnit.php +++ b/src/Aspose/BarCode/Model/GraphicsUnit.php @@ -7,11 +7,11 @@ use Aspose\BarCode\ObjectSerializer; /** - * AvailableGraphicsUnit + * GraphicsUnit * - * @description Subset of GraphicsUnit. + * @description Subset of Aspose.Drawing.GraphicsUnit. */ -class AvailableGraphicsUnit +class GraphicsUnit { /// /// Enum value Pixel diff --git a/src/Aspose/BarCode/Model/HanXinEncodeMode.php b/src/Aspose/BarCode/Model/HanXinEncodeMode.php deleted file mode 100644 index 76de8b6..0000000 --- a/src/Aspose/BarCode/Model/HanXinEncodeMode.php +++ /dev/null @@ -1,46 +0,0 @@ - - /// Enum value Auto - /// - public const Auto = "Auto"; - - /// - /// Enum value Binary - /// - public const Binary = "Binary"; - - /// - /// Enum value ECI - /// - public const ECI = "ECI"; - - /// - /// Enum value Unicode - /// - public const Unicode = "Unicode"; - - /// - /// Enum value URI - /// - public const URI = "URI"; - - /// - /// Enum value Extended - /// - public const Extended = "Extended"; - -} diff --git a/src/Aspose/BarCode/Model/HanXinErrorLevel.php b/src/Aspose/BarCode/Model/HanXinErrorLevel.php deleted file mode 100644 index 473cd13..0000000 --- a/src/Aspose/BarCode/Model/HanXinErrorLevel.php +++ /dev/null @@ -1,36 +0,0 @@ - - /// Enum value L1 - /// - public const L1 = "L1"; - - /// - /// Enum value L2 - /// - public const L2 = "L2"; - - /// - /// Enum value L3 - /// - public const L3 = "L3"; - - /// - /// Enum value L4 - /// - public const L4 = "L4"; - -} diff --git a/src/Aspose/BarCode/Model/HanXinParams.php b/src/Aspose/BarCode/Model/HanXinParams.php deleted file mode 100644 index a6645dd..0000000 --- a/src/Aspose/BarCode/Model/HanXinParams.php +++ /dev/null @@ -1,363 +0,0 @@ - '\Aspose\BarCode\Model\HanXinEncodeMode', - 'error_level' => '\Aspose\BarCode\Model\HanXinErrorLevel', - 'version' => '\Aspose\BarCode\Model\HanXinVersion', - 'eci_encoding' => '\Aspose\BarCode\Model\ECIEncodings' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'encode_mode' => null, - 'error_level' => null, - 'version' => null, - 'eci_encoding' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'encode_mode' => 'EncodeMode', - 'error_level' => 'ErrorLevel', - 'version' => 'Version', - 'eci_encoding' => 'ECIEncoding' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'encode_mode' => 'setEncodeMode', - 'error_level' => 'setErrorLevel', - 'version' => 'setVersion', - 'eci_encoding' => 'setEciEncoding' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'encode_mode' => 'getEncodeMode', - 'error_level' => 'getErrorLevel', - 'version' => 'getVersion', - 'eci_encoding' => 'getEciEncoding' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['encode_mode'] = isset($data['encode_mode']) ? $data['encode_mode'] : null; - $this->container['error_level'] = isset($data['error_level']) ? $data['error_level'] : null; - $this->container['version'] = isset($data['version']) ? $data['version'] : null; - $this->container['eci_encoding'] = isset($data['eci_encoding']) ? $data['eci_encoding'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets encode_mode - * - * @return \Aspose\BarCode\Model\HanXinEncodeMode - */ - public function getEncodeMode() - { - return $this->container['encode_mode']; - } - - /** - * Sets encode_mode - * - * @param \Aspose\BarCode\Model\HanXinEncodeMode $encode_mode Encoding mode for XanXin barcodes. Default value: HanXinEncodeMode.Auto. - * - * @return $this - */ - public function setEncodeMode($encode_mode) - { - $this->container['encode_mode'] = $encode_mode; - - return $this; - } - - /** - * Gets error_level - * - * @return \Aspose\BarCode\Model\HanXinErrorLevel - */ - public function getErrorLevel() - { - return $this->container['error_level']; - } - - /** - * Sets error_level - * - * @param \Aspose\BarCode\Model\HanXinErrorLevel $error_level Allowed Han Xin error correction levels from L1 to L4. Default value: HanXinErrorLevel.L1. - * - * @return $this - */ - public function setErrorLevel($error_level) - { - $this->container['error_level'] = $error_level; - - return $this; - } - - /** - * Gets version - * - * @return \Aspose\BarCode\Model\HanXinVersion - */ - public function getVersion() - { - return $this->container['version']; - } - - /** - * Sets version - * - * @param \Aspose\BarCode\Model\HanXinVersion $version Allowed Han Xin versions, Auto and Version01 - Version84. Default value: HanXinVersion.Auto. - * - * @return $this - */ - public function setVersion($version) - { - $this->container['version'] = $version; - - return $this; - } - - /** - * Gets eci_encoding - * - * @return \Aspose\BarCode\Model\ECIEncodings - */ - public function getEciEncoding() - { - return $this->container['eci_encoding']; - } - - /** - * Sets eci_encoding - * - * @param \Aspose\BarCode\Model\ECIEncodings $eci_encoding Extended Channel Interpretation Identifiers. It is used to tell the barcode reader details about the used references for encoding the data in the symbol. Current implementation consists all well known charset encodings. Default value: ECIEncodings.ISO_8859_1 - * - * @return $this - */ - public function setEciEncoding($eci_encoding) - { - $this->container['eci_encoding'] = $eci_encoding; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/HanXinVersion.php b/src/Aspose/BarCode/Model/HanXinVersion.php deleted file mode 100644 index 01cb208..0000000 --- a/src/Aspose/BarCode/Model/HanXinVersion.php +++ /dev/null @@ -1,441 +0,0 @@ - - /// Enum value Auto - /// - public const Auto = "Auto"; - - /// - /// Enum value Version01 - /// - public const Version01 = "Version01"; - - /// - /// Enum value Version02 - /// - public const Version02 = "Version02"; - - /// - /// Enum value Version03 - /// - public const Version03 = "Version03"; - - /// - /// Enum value Version04 - /// - public const Version04 = "Version04"; - - /// - /// Enum value Version05 - /// - public const Version05 = "Version05"; - - /// - /// Enum value Version06 - /// - public const Version06 = "Version06"; - - /// - /// Enum value Version07 - /// - public const Version07 = "Version07"; - - /// - /// Enum value Version08 - /// - public const Version08 = "Version08"; - - /// - /// Enum value Version09 - /// - public const Version09 = "Version09"; - - /// - /// Enum value Version10 - /// - public const Version10 = "Version10"; - - /// - /// Enum value Version11 - /// - public const Version11 = "Version11"; - - /// - /// Enum value Version12 - /// - public const Version12 = "Version12"; - - /// - /// Enum value Version13 - /// - public const Version13 = "Version13"; - - /// - /// Enum value Version14 - /// - public const Version14 = "Version14"; - - /// - /// Enum value Version15 - /// - public const Version15 = "Version15"; - - /// - /// Enum value Version16 - /// - public const Version16 = "Version16"; - - /// - /// Enum value Version17 - /// - public const Version17 = "Version17"; - - /// - /// Enum value Version18 - /// - public const Version18 = "Version18"; - - /// - /// Enum value Version19 - /// - public const Version19 = "Version19"; - - /// - /// Enum value Version20 - /// - public const Version20 = "Version20"; - - /// - /// Enum value Version21 - /// - public const Version21 = "Version21"; - - /// - /// Enum value Version22 - /// - public const Version22 = "Version22"; - - /// - /// Enum value Version23 - /// - public const Version23 = "Version23"; - - /// - /// Enum value Version24 - /// - public const Version24 = "Version24"; - - /// - /// Enum value Version25 - /// - public const Version25 = "Version25"; - - /// - /// Enum value Version26 - /// - public const Version26 = "Version26"; - - /// - /// Enum value Version27 - /// - public const Version27 = "Version27"; - - /// - /// Enum value Version28 - /// - public const Version28 = "Version28"; - - /// - /// Enum value Version29 - /// - public const Version29 = "Version29"; - - /// - /// Enum value Version30 - /// - public const Version30 = "Version30"; - - /// - /// Enum value Version31 - /// - public const Version31 = "Version31"; - - /// - /// Enum value Version32 - /// - public const Version32 = "Version32"; - - /// - /// Enum value Version33 - /// - public const Version33 = "Version33"; - - /// - /// Enum value Version34 - /// - public const Version34 = "Version34"; - - /// - /// Enum value Version35 - /// - public const Version35 = "Version35"; - - /// - /// Enum value Version36 - /// - public const Version36 = "Version36"; - - /// - /// Enum value Version37 - /// - public const Version37 = "Version37"; - - /// - /// Enum value Version38 - /// - public const Version38 = "Version38"; - - /// - /// Enum value Version39 - /// - public const Version39 = "Version39"; - - /// - /// Enum value Version40 - /// - public const Version40 = "Version40"; - - /// - /// Enum value Version41 - /// - public const Version41 = "Version41"; - - /// - /// Enum value Version42 - /// - public const Version42 = "Version42"; - - /// - /// Enum value Version43 - /// - public const Version43 = "Version43"; - - /// - /// Enum value Version44 - /// - public const Version44 = "Version44"; - - /// - /// Enum value Version45 - /// - public const Version45 = "Version45"; - - /// - /// Enum value Version46 - /// - public const Version46 = "Version46"; - - /// - /// Enum value Version47 - /// - public const Version47 = "Version47"; - - /// - /// Enum value Version48 - /// - public const Version48 = "Version48"; - - /// - /// Enum value Version49 - /// - public const Version49 = "Version49"; - - /// - /// Enum value Version50 - /// - public const Version50 = "Version50"; - - /// - /// Enum value Version51 - /// - public const Version51 = "Version51"; - - /// - /// Enum value Version52 - /// - public const Version52 = "Version52"; - - /// - /// Enum value Version53 - /// - public const Version53 = "Version53"; - - /// - /// Enum value Version54 - /// - public const Version54 = "Version54"; - - /// - /// Enum value Version55 - /// - public const Version55 = "Version55"; - - /// - /// Enum value Version56 - /// - public const Version56 = "Version56"; - - /// - /// Enum value Version57 - /// - public const Version57 = "Version57"; - - /// - /// Enum value Version58 - /// - public const Version58 = "Version58"; - - /// - /// Enum value Version59 - /// - public const Version59 = "Version59"; - - /// - /// Enum value Version60 - /// - public const Version60 = "Version60"; - - /// - /// Enum value Version61 - /// - public const Version61 = "Version61"; - - /// - /// Enum value Version62 - /// - public const Version62 = "Version62"; - - /// - /// Enum value Version63 - /// - public const Version63 = "Version63"; - - /// - /// Enum value Version64 - /// - public const Version64 = "Version64"; - - /// - /// Enum value Version65 - /// - public const Version65 = "Version65"; - - /// - /// Enum value Version66 - /// - public const Version66 = "Version66"; - - /// - /// Enum value Version67 - /// - public const Version67 = "Version67"; - - /// - /// Enum value Version68 - /// - public const Version68 = "Version68"; - - /// - /// Enum value Version69 - /// - public const Version69 = "Version69"; - - /// - /// Enum value Version70 - /// - public const Version70 = "Version70"; - - /// - /// Enum value Version71 - /// - public const Version71 = "Version71"; - - /// - /// Enum value Version72 - /// - public const Version72 = "Version72"; - - /// - /// Enum value Version73 - /// - public const Version73 = "Version73"; - - /// - /// Enum value Version74 - /// - public const Version74 = "Version74"; - - /// - /// Enum value Version75 - /// - public const Version75 = "Version75"; - - /// - /// Enum value Version76 - /// - public const Version76 = "Version76"; - - /// - /// Enum value Version77 - /// - public const Version77 = "Version77"; - - /// - /// Enum value Version78 - /// - public const Version78 = "Version78"; - - /// - /// Enum value Version79 - /// - public const Version79 = "Version79"; - - /// - /// Enum value Version80 - /// - public const Version80 = "Version80"; - - /// - /// Enum value Version81 - /// - public const Version81 = "Version81"; - - /// - /// Enum value Version82 - /// - public const Version82 = "Version82"; - - /// - /// Enum value Version83 - /// - public const Version83 = "Version83"; - - /// - /// Enum value Version84 - /// - public const Version84 = "Version84"; - -} diff --git a/src/Aspose/BarCode/Model/ITF14BorderType.php b/src/Aspose/BarCode/Model/ITF14BorderType.php deleted file mode 100644 index e135b11..0000000 --- a/src/Aspose/BarCode/Model/ITF14BorderType.php +++ /dev/null @@ -1,41 +0,0 @@ - - /// Enum value None - /// - public const None = "None"; - - /// - /// Enum value Frame - /// - public const Frame = "Frame"; - - /// - /// Enum value Bar - /// - public const Bar = "Bar"; - - /// - /// Enum value FrameOut - /// - public const FrameOut = "FrameOut"; - - /// - /// Enum value BarOut - /// - public const BarOut = "BarOut"; - -} diff --git a/src/Aspose/BarCode/Model/ITFParams.php b/src/Aspose/BarCode/Model/ITFParams.php deleted file mode 100644 index dd44007..0000000 --- a/src/Aspose/BarCode/Model/ITFParams.php +++ /dev/null @@ -1,333 +0,0 @@ - 'double', - 'border_type' => '\Aspose\BarCode\Model\ITF14BorderType', - 'quiet_zone_coef' => 'int' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'border_thickness' => 'double', - 'border_type' => null, - 'quiet_zone_coef' => 'int32' - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'border_thickness' => 'BorderThickness', - 'border_type' => 'BorderType', - 'quiet_zone_coef' => 'QuietZoneCoef' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'border_thickness' => 'setBorderThickness', - 'border_type' => 'setBorderType', - 'quiet_zone_coef' => 'setQuietZoneCoef' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'border_thickness' => 'getBorderThickness', - 'border_type' => 'getBorderType', - 'quiet_zone_coef' => 'getQuietZoneCoef' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['border_thickness'] = isset($data['border_thickness']) ? $data['border_thickness'] : null; - $this->container['border_type'] = isset($data['border_type']) ? $data['border_type'] : null; - $this->container['quiet_zone_coef'] = isset($data['quiet_zone_coef']) ? $data['quiet_zone_coef'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets border_thickness - * - * @return double - */ - public function getBorderThickness() - { - return $this->container['border_thickness']; - } - - /** - * Sets border_thickness - * - * @param double $border_thickness ITF border (bearer bar) thickness in Unit value. Default value: 12pt. - * - * @return $this - */ - public function setBorderThickness($border_thickness) - { - $this->container['border_thickness'] = $border_thickness; - - return $this; - } - - /** - * Gets border_type - * - * @return \Aspose\BarCode\Model\ITF14BorderType - */ - public function getBorderType() - { - return $this->container['border_type']; - } - - /** - * Sets border_type - * - * @param \Aspose\BarCode\Model\ITF14BorderType $border_type Border type of ITF barcode. Default value: ITF14BorderType.Bar. - * - * @return $this - */ - public function setBorderType($border_type) - { - $this->container['border_type'] = $border_type; - - return $this; - } - - /** - * Gets quiet_zone_coef - * - * @return int - */ - public function getQuietZoneCoef() - { - return $this->container['quiet_zone_coef']; - } - - /** - * Sets quiet_zone_coef - * - * @param int $quiet_zone_coef Size of the quiet zones in xDimension. Default value: 10, meaning if xDimension = 2px than quiet zones will be 20px. - * - * @return $this - */ - public function setQuietZoneCoef($quiet_zone_coef) - { - $this->container['quiet_zone_coef'] = $quiet_zone_coef; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/MacroCharacter.php b/src/Aspose/BarCode/Model/MacroCharacter.php deleted file mode 100644 index a0102d1..0000000 --- a/src/Aspose/BarCode/Model/MacroCharacter.php +++ /dev/null @@ -1,31 +0,0 @@ - - /// Enum value None - /// - public const None = "None"; - - /// - /// Enum value Macro05 - /// - public const Macro05 = "Macro05"; - - /// - /// Enum value Macro06 - /// - public const Macro06 = "Macro06"; - -} diff --git a/src/Aspose/BarCode/Model/MaxiCodeEncodeMode.php b/src/Aspose/BarCode/Model/MaxiCodeEncodeMode.php deleted file mode 100644 index 8dec874..0000000 --- a/src/Aspose/BarCode/Model/MaxiCodeEncodeMode.php +++ /dev/null @@ -1,31 +0,0 @@ - - /// Enum value Auto - /// - public const Auto = "Auto"; - - /// - /// Enum value Bytes - /// - public const Bytes = "Bytes"; - - /// - /// Enum value ExtendedCodetext - /// - public const ExtendedCodetext = "ExtendedCodetext"; - -} diff --git a/src/Aspose/BarCode/Model/MaxiCodeMode.php b/src/Aspose/BarCode/Model/MaxiCodeMode.php deleted file mode 100644 index 33e178b..0000000 --- a/src/Aspose/BarCode/Model/MaxiCodeMode.php +++ /dev/null @@ -1,41 +0,0 @@ - - /// Enum value Mode2 - /// - public const Mode2 = "Mode2"; - - /// - /// Enum value Mode3 - /// - public const Mode3 = "Mode3"; - - /// - /// Enum value Mode4 - /// - public const Mode4 = "Mode4"; - - /// - /// Enum value Mode5 - /// - public const Mode5 = "Mode5"; - - /// - /// Enum value Mode6 - /// - public const Mode6 = "Mode6"; - -} diff --git a/src/Aspose/BarCode/Model/MaxiCodeParams.php b/src/Aspose/BarCode/Model/MaxiCodeParams.php deleted file mode 100644 index 86c5776..0000000 --- a/src/Aspose/BarCode/Model/MaxiCodeParams.php +++ /dev/null @@ -1,333 +0,0 @@ - 'double', - 'mode' => '\Aspose\BarCode\Model\MaxiCodeMode', - 'encode_mode' => '\Aspose\BarCode\Model\MaxiCodeEncodeMode' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'aspect_ratio' => 'double', - 'mode' => null, - 'encode_mode' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'aspect_ratio' => 'AspectRatio', - 'mode' => 'Mode', - 'encode_mode' => 'EncodeMode' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'aspect_ratio' => 'setAspectRatio', - 'mode' => 'setMode', - 'encode_mode' => 'setEncodeMode' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'aspect_ratio' => 'getAspectRatio', - 'mode' => 'getMode', - 'encode_mode' => 'getEncodeMode' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['aspect_ratio'] = isset($data['aspect_ratio']) ? $data['aspect_ratio'] : null; - $this->container['mode'] = isset($data['mode']) ? $data['mode'] : null; - $this->container['encode_mode'] = isset($data['encode_mode']) ? $data['encode_mode'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets aspect_ratio - * - * @return double - */ - public function getAspectRatio() - { - return $this->container['aspect_ratio']; - } - - /** - * Sets aspect_ratio - * - * @param double $aspect_ratio Height/Width ratio of 2D BarCode module. - * - * @return $this - */ - public function setAspectRatio($aspect_ratio) - { - $this->container['aspect_ratio'] = $aspect_ratio; - - return $this; - } - - /** - * Gets mode - * - * @return \Aspose\BarCode\Model\MaxiCodeMode - */ - public function getMode() - { - return $this->container['mode']; - } - - /** - * Sets mode - * - * @param \Aspose\BarCode\Model\MaxiCodeMode $mode Mode for MaxiCode barcodes. - * - * @return $this - */ - public function setMode($mode) - { - $this->container['mode'] = $mode; - - return $this; - } - - /** - * Gets encode_mode - * - * @return \Aspose\BarCode\Model\MaxiCodeEncodeMode - */ - public function getEncodeMode() - { - return $this->container['encode_mode']; - } - - /** - * Sets encode_mode - * - * @param \Aspose\BarCode\Model\MaxiCodeEncodeMode $encode_mode Encoding mode for MaxiCode barcodes. - * - * @return $this - */ - public function setEncodeMode($encode_mode) - { - $this->container['encode_mode'] = $encode_mode; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/ModelInterface.php b/src/Aspose/BarCode/Model/ModelInterface.php index aa579ea..89b6be7 100644 --- a/src/Aspose/BarCode/Model/ModelInterface.php +++ b/src/Aspose/BarCode/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * https://github.com/OpenAPITools/openapi-generator * Do not edit the class manually. */ diff --git a/src/Aspose/BarCode/Model/ObjectExist.php b/src/Aspose/BarCode/Model/ObjectExist.php deleted file mode 100644 index b39c8ed..0000000 --- a/src/Aspose/BarCode/Model/ObjectExist.php +++ /dev/null @@ -1,315 +0,0 @@ - 'bool', - 'is_folder' => 'bool' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'exists' => null, - 'is_folder' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'exists' => 'Exists', - 'is_folder' => 'IsFolder' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'exists' => 'setExists', - 'is_folder' => 'setIsFolder' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'exists' => 'getExists', - 'is_folder' => 'getIsFolder' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['exists'] = isset($data['exists']) ? $data['exists'] : null; - $this->container['is_folder'] = isset($data['is_folder']) ? $data['is_folder'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['exists'] === null) { - $invalidProperties[] = "'exists' can't be null"; - } - if ($this->container['is_folder'] === null) { - $invalidProperties[] = "'is_folder' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - if ($this->container['exists'] === null) { - return false; - } - if ($this->container['is_folder'] === null) { - return false; - } - return true; - } - - - /** - * Gets exists - * - * @return bool - */ - public function getExists() - { - return $this->container['exists']; - } - - /** - * Sets exists - * - * @param bool $exists Indicates that the file or folder exists. - * - * @return $this - */ - public function setExists($exists) - { - $this->container['exists'] = $exists; - - return $this; - } - - /** - * Gets is_folder - * - * @return bool - */ - public function getIsFolder() - { - return $this->container['is_folder']; - } - - /** - * Sets is_folder - * - * @param bool $is_folder True if it is a folder, false if it is a file. - * - * @return $this - */ - public function setIsFolder($is_folder) - { - $this->container['is_folder'] = $is_folder; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/Padding.php b/src/Aspose/BarCode/Model/Padding.php deleted file mode 100644 index 7498e25..0000000 --- a/src/Aspose/BarCode/Model/Padding.php +++ /dev/null @@ -1,363 +0,0 @@ - 'double', - 'right' => 'double', - 'top' => 'double', - 'bottom' => 'double' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'left' => 'double', - 'right' => 'double', - 'top' => 'double', - 'bottom' => 'double' - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'left' => 'Left', - 'right' => 'Right', - 'top' => 'Top', - 'bottom' => 'Bottom' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'left' => 'setLeft', - 'right' => 'setRight', - 'top' => 'setTop', - 'bottom' => 'setBottom' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'left' => 'getLeft', - 'right' => 'getRight', - 'top' => 'getTop', - 'bottom' => 'getBottom' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['left'] = isset($data['left']) ? $data['left'] : null; - $this->container['right'] = isset($data['right']) ? $data['right'] : null; - $this->container['top'] = isset($data['top']) ? $data['top'] : null; - $this->container['bottom'] = isset($data['bottom']) ? $data['bottom'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets left - * - * @return double - */ - public function getLeft() - { - return $this->container['left']; - } - - /** - * Sets left - * - * @param double $left Left padding. - * - * @return $this - */ - public function setLeft($left) - { - $this->container['left'] = $left; - - return $this; - } - - /** - * Gets right - * - * @return double - */ - public function getRight() - { - return $this->container['right']; - } - - /** - * Sets right - * - * @param double $right Right padding. - * - * @return $this - */ - public function setRight($right) - { - $this->container['right'] = $right; - - return $this; - } - - /** - * Gets top - * - * @return double - */ - public function getTop() - { - return $this->container['top']; - } - - /** - * Sets top - * - * @param double $top Top padding. - * - * @return $this - */ - public function setTop($top) - { - $this->container['top'] = $top; - - return $this; - } - - /** - * Gets bottom - * - * @return double - */ - public function getBottom() - { - return $this->container['bottom']; - } - - /** - * Sets bottom - * - * @param double $bottom Bottom padding. - * - * @return $this - */ - public function setBottom($bottom) - { - $this->container['bottom'] = $bottom; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/PatchCodeParams.php b/src/Aspose/BarCode/Model/PatchCodeParams.php deleted file mode 100644 index 2287eb3..0000000 --- a/src/Aspose/BarCode/Model/PatchCodeParams.php +++ /dev/null @@ -1,303 +0,0 @@ - 'string', - 'patch_format' => '\Aspose\BarCode\Model\PatchFormat' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'extra_barcode_text' => null, - 'patch_format' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'extra_barcode_text' => 'ExtraBarcodeText', - 'patch_format' => 'PatchFormat' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'extra_barcode_text' => 'setExtraBarcodeText', - 'patch_format' => 'setPatchFormat' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'extra_barcode_text' => 'getExtraBarcodeText', - 'patch_format' => 'getPatchFormat' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['extra_barcode_text'] = isset($data['extra_barcode_text']) ? $data['extra_barcode_text'] : null; - $this->container['patch_format'] = isset($data['patch_format']) ? $data['patch_format'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets extra_barcode_text - * - * @return string - */ - public function getExtraBarcodeText() - { - return $this->container['extra_barcode_text']; - } - - /** - * Sets extra_barcode_text - * - * @param string $extra_barcode_text Specifies codetext for an extra QR barcode, when PatchCode is generated in page mode. - * - * @return $this - */ - public function setExtraBarcodeText($extra_barcode_text) - { - $this->container['extra_barcode_text'] = $extra_barcode_text; - - return $this; - } - - /** - * Gets patch_format - * - * @return \Aspose\BarCode\Model\PatchFormat - */ - public function getPatchFormat() - { - return $this->container['patch_format']; - } - - /** - * Sets patch_format - * - * @param \Aspose\BarCode\Model\PatchFormat $patch_format PatchCode format. Choose PatchOnly to generate single PatchCode. Use page format to generate Patch page with PatchCodes as borders. Default value: PatchFormat.PatchOnly - * - * @return $this - */ - public function setPatchFormat($patch_format) - { - $this->container['patch_format'] = $patch_format; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/PatchFormat.php b/src/Aspose/BarCode/Model/PatchFormat.php deleted file mode 100644 index f3b1162..0000000 --- a/src/Aspose/BarCode/Model/PatchFormat.php +++ /dev/null @@ -1,41 +0,0 @@ - - /// Enum value PatchOnly - /// - public const PatchOnly = "PatchOnly"; - - /// - /// Enum value A4 - /// - public const A4 = "A4"; - - /// - /// Enum value A4_LANDSCAPE - /// - public const A4_LANDSCAPE = "A4_LANDSCAPE"; - - /// - /// Enum value US_Letter - /// - public const US_Letter = "US_Letter"; - - /// - /// Enum value US_Letter_LANDSCAPE - /// - public const US_Letter_LANDSCAPE = "US_Letter_LANDSCAPE"; - -} diff --git a/src/Aspose/BarCode/Model/Pdf417CompactionMode.php b/src/Aspose/BarCode/Model/Pdf417CompactionMode.php deleted file mode 100644 index e014964..0000000 --- a/src/Aspose/BarCode/Model/Pdf417CompactionMode.php +++ /dev/null @@ -1,36 +0,0 @@ - - /// Enum value Auto - /// - public const Auto = "Auto"; - - /// - /// Enum value Text - /// - public const Text = "Text"; - - /// - /// Enum value Numeric - /// - public const Numeric = "Numeric"; - - /// - /// Enum value Binary - /// - public const Binary = "Binary"; - -} diff --git a/src/Aspose/BarCode/Model/Pdf417ErrorLevel.php b/src/Aspose/BarCode/Model/Pdf417ErrorLevel.php deleted file mode 100644 index bf202fa..0000000 --- a/src/Aspose/BarCode/Model/Pdf417ErrorLevel.php +++ /dev/null @@ -1,61 +0,0 @@ - - /// Enum value Level0 - /// - public const Level0 = "Level0"; - - /// - /// Enum value Level1 - /// - public const Level1 = "Level1"; - - /// - /// Enum value Level2 - /// - public const Level2 = "Level2"; - - /// - /// Enum value Level3 - /// - public const Level3 = "Level3"; - - /// - /// Enum value Level4 - /// - public const Level4 = "Level4"; - - /// - /// Enum value Level5 - /// - public const Level5 = "Level5"; - - /// - /// Enum value Level6 - /// - public const Level6 = "Level6"; - - /// - /// Enum value Level7 - /// - public const Level7 = "Level7"; - - /// - /// Enum value Level8 - /// - public const Level8 = "Level8"; - -} diff --git a/src/Aspose/BarCode/Model/Pdf417MacroTerminator.php b/src/Aspose/BarCode/Model/Pdf417MacroTerminator.php deleted file mode 100644 index 30017cb..0000000 --- a/src/Aspose/BarCode/Model/Pdf417MacroTerminator.php +++ /dev/null @@ -1,31 +0,0 @@ - - /// Enum value Auto - /// - public const Auto = "Auto"; - - /// - /// Enum value None - /// - public const None = "None"; - - /// - /// Enum value Set - /// - public const Set = "Set"; - -} diff --git a/src/Aspose/BarCode/Model/Pdf417Params.php b/src/Aspose/BarCode/Model/Pdf417Params.php deleted file mode 100644 index 83cf4b8..0000000 --- a/src/Aspose/BarCode/Model/Pdf417Params.php +++ /dev/null @@ -1,965 +0,0 @@ - 'double', - 'text_encoding' => 'string', - 'columns' => 'int', - 'compaction_mode' => '\Aspose\BarCode\Model\Pdf417CompactionMode', - 'error_level' => '\Aspose\BarCode\Model\Pdf417ErrorLevel', - 'macro_file_id' => 'int', - 'macro_segment_id' => 'int', - 'macro_segments_count' => 'int', - 'rows' => 'int', - 'truncate' => 'bool', - 'pdf417_eci_encoding' => '\Aspose\BarCode\Model\ECIEncodings', - 'is_reader_initialization' => 'bool', - 'macro_time_stamp' => '\DateTime', - 'macro_sender' => 'string', - 'macro_file_size' => 'int', - 'macro_checksum' => 'int', - 'macro_file_name' => 'string', - 'macro_addressee' => 'string', - 'macro_eci_encoding' => '\Aspose\BarCode\Model\ECIEncodings', - 'code128_emulation' => '\Aspose\BarCode\Model\Code128Emulation', - 'is_code128_emulation' => 'bool', - 'pdf417_macro_terminator' => '\Aspose\BarCode\Model\Pdf417MacroTerminator', - 'is_linked' => 'bool', - 'macro_characters' => '\Aspose\BarCode\Model\MacroCharacter' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'aspect_ratio' => 'double', - 'text_encoding' => null, - 'columns' => 'int32', - 'compaction_mode' => null, - 'error_level' => null, - 'macro_file_id' => 'int32', - 'macro_segment_id' => 'int32', - 'macro_segments_count' => 'int32', - 'rows' => 'int32', - 'truncate' => null, - 'pdf417_eci_encoding' => null, - 'is_reader_initialization' => null, - 'macro_time_stamp' => 'date-time', - 'macro_sender' => null, - 'macro_file_size' => 'int32', - 'macro_checksum' => 'int32', - 'macro_file_name' => null, - 'macro_addressee' => null, - 'macro_eci_encoding' => null, - 'code128_emulation' => null, - 'is_code128_emulation' => null, - 'pdf417_macro_terminator' => null, - 'is_linked' => null, - 'macro_characters' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'aspect_ratio' => 'AspectRatio', - 'text_encoding' => 'TextEncoding', - 'columns' => 'Columns', - 'compaction_mode' => 'CompactionMode', - 'error_level' => 'ErrorLevel', - 'macro_file_id' => 'MacroFileID', - 'macro_segment_id' => 'MacroSegmentID', - 'macro_segments_count' => 'MacroSegmentsCount', - 'rows' => 'Rows', - 'truncate' => 'Truncate', - 'pdf417_eci_encoding' => 'Pdf417ECIEncoding', - 'is_reader_initialization' => 'IsReaderInitialization', - 'macro_time_stamp' => 'MacroTimeStamp', - 'macro_sender' => 'MacroSender', - 'macro_file_size' => 'MacroFileSize', - 'macro_checksum' => 'MacroChecksum', - 'macro_file_name' => 'MacroFileName', - 'macro_addressee' => 'MacroAddressee', - 'macro_eci_encoding' => 'MacroECIEncoding', - 'code128_emulation' => 'Code128Emulation', - 'is_code128_emulation' => 'IsCode128Emulation', - 'pdf417_macro_terminator' => 'Pdf417MacroTerminator', - 'is_linked' => 'IsLinked', - 'macro_characters' => 'MacroCharacters' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'aspect_ratio' => 'setAspectRatio', - 'text_encoding' => 'setTextEncoding', - 'columns' => 'setColumns', - 'compaction_mode' => 'setCompactionMode', - 'error_level' => 'setErrorLevel', - 'macro_file_id' => 'setMacroFileId', - 'macro_segment_id' => 'setMacroSegmentId', - 'macro_segments_count' => 'setMacroSegmentsCount', - 'rows' => 'setRows', - 'truncate' => 'setTruncate', - 'pdf417_eci_encoding' => 'setPdf417EciEncoding', - 'is_reader_initialization' => 'setIsReaderInitialization', - 'macro_time_stamp' => 'setMacroTimeStamp', - 'macro_sender' => 'setMacroSender', - 'macro_file_size' => 'setMacroFileSize', - 'macro_checksum' => 'setMacroChecksum', - 'macro_file_name' => 'setMacroFileName', - 'macro_addressee' => 'setMacroAddressee', - 'macro_eci_encoding' => 'setMacroEciEncoding', - 'code128_emulation' => 'setCode128Emulation', - 'is_code128_emulation' => 'setIsCode128Emulation', - 'pdf417_macro_terminator' => 'setPdf417MacroTerminator', - 'is_linked' => 'setIsLinked', - 'macro_characters' => 'setMacroCharacters' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'aspect_ratio' => 'getAspectRatio', - 'text_encoding' => 'getTextEncoding', - 'columns' => 'getColumns', - 'compaction_mode' => 'getCompactionMode', - 'error_level' => 'getErrorLevel', - 'macro_file_id' => 'getMacroFileId', - 'macro_segment_id' => 'getMacroSegmentId', - 'macro_segments_count' => 'getMacroSegmentsCount', - 'rows' => 'getRows', - 'truncate' => 'getTruncate', - 'pdf417_eci_encoding' => 'getPdf417EciEncoding', - 'is_reader_initialization' => 'getIsReaderInitialization', - 'macro_time_stamp' => 'getMacroTimeStamp', - 'macro_sender' => 'getMacroSender', - 'macro_file_size' => 'getMacroFileSize', - 'macro_checksum' => 'getMacroChecksum', - 'macro_file_name' => 'getMacroFileName', - 'macro_addressee' => 'getMacroAddressee', - 'macro_eci_encoding' => 'getMacroEciEncoding', - 'code128_emulation' => 'getCode128Emulation', - 'is_code128_emulation' => 'getIsCode128Emulation', - 'pdf417_macro_terminator' => 'getPdf417MacroTerminator', - 'is_linked' => 'getIsLinked', - 'macro_characters' => 'getMacroCharacters' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['aspect_ratio'] = isset($data['aspect_ratio']) ? $data['aspect_ratio'] : null; - $this->container['text_encoding'] = isset($data['text_encoding']) ? $data['text_encoding'] : null; - $this->container['columns'] = isset($data['columns']) ? $data['columns'] : null; - $this->container['compaction_mode'] = isset($data['compaction_mode']) ? $data['compaction_mode'] : null; - $this->container['error_level'] = isset($data['error_level']) ? $data['error_level'] : null; - $this->container['macro_file_id'] = isset($data['macro_file_id']) ? $data['macro_file_id'] : null; - $this->container['macro_segment_id'] = isset($data['macro_segment_id']) ? $data['macro_segment_id'] : null; - $this->container['macro_segments_count'] = isset($data['macro_segments_count']) ? $data['macro_segments_count'] : null; - $this->container['rows'] = isset($data['rows']) ? $data['rows'] : null; - $this->container['truncate'] = isset($data['truncate']) ? $data['truncate'] : null; - $this->container['pdf417_eci_encoding'] = isset($data['pdf417_eci_encoding']) ? $data['pdf417_eci_encoding'] : null; - $this->container['is_reader_initialization'] = isset($data['is_reader_initialization']) ? $data['is_reader_initialization'] : null; - $this->container['macro_time_stamp'] = isset($data['macro_time_stamp']) ? $data['macro_time_stamp'] : null; - $this->container['macro_sender'] = isset($data['macro_sender']) ? $data['macro_sender'] : null; - $this->container['macro_file_size'] = isset($data['macro_file_size']) ? $data['macro_file_size'] : null; - $this->container['macro_checksum'] = isset($data['macro_checksum']) ? $data['macro_checksum'] : null; - $this->container['macro_file_name'] = isset($data['macro_file_name']) ? $data['macro_file_name'] : null; - $this->container['macro_addressee'] = isset($data['macro_addressee']) ? $data['macro_addressee'] : null; - $this->container['macro_eci_encoding'] = isset($data['macro_eci_encoding']) ? $data['macro_eci_encoding'] : null; - $this->container['code128_emulation'] = isset($data['code128_emulation']) ? $data['code128_emulation'] : null; - $this->container['is_code128_emulation'] = isset($data['is_code128_emulation']) ? $data['is_code128_emulation'] : null; - $this->container['pdf417_macro_terminator'] = isset($data['pdf417_macro_terminator']) ? $data['pdf417_macro_terminator'] : null; - $this->container['is_linked'] = isset($data['is_linked']) ? $data['is_linked'] : null; - $this->container['macro_characters'] = isset($data['macro_characters']) ? $data['macro_characters'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets aspect_ratio - * - * @return double - */ - public function getAspectRatio() - { - return $this->container['aspect_ratio']; - } - - /** - * Sets aspect_ratio - * - * @param double $aspect_ratio Height/Width ratio of 2D BarCode module. - * - * @return $this - */ - public function setAspectRatio($aspect_ratio) - { - $this->container['aspect_ratio'] = $aspect_ratio; - - return $this; - } - - /** - * Gets text_encoding - * - * @return string - */ - public function getTextEncoding() - { - return $this->container['text_encoding']; - } - - /** - * Sets text_encoding - * - * @param string $text_encoding DEPRECATED: This property is obsolete and will be removed in future releases. Unicode symbols detection and encoding will be processed in Auto mode with Extended Channel Interpretation charset designator. Using of own encodings requires manual CodeText encoding into byte[] array. Sets the encoding of codetext. - * - * @return $this - */ - public function setTextEncoding($text_encoding) - { - trigger_error('Property $text_encoding is deprecated. This property is obsolete and will be removed in future releases. Unicode symbols detection and encoding will be processed in Auto mode with Extended Channel Interpretation charset designator. Using of own encodings requires manual CodeText encoding into byte[] array. Sets the encoding of codetext.', E_USER_DEPRECATED); - $this->container['text_encoding'] = $text_encoding; - - return $this; - } - - /** - * Gets columns - * - * @return int - */ - public function getColumns() - { - return $this->container['columns']; - } - - /** - * Sets columns - * - * @param int $columns Columns count. - * - * @return $this - */ - public function setColumns($columns) - { - $this->container['columns'] = $columns; - - return $this; - } - - /** - * Gets compaction_mode - * - * @return \Aspose\BarCode\Model\Pdf417CompactionMode - */ - public function getCompactionMode() - { - return $this->container['compaction_mode']; - } - - /** - * Sets compaction_mode - * - * @param \Aspose\BarCode\Model\Pdf417CompactionMode $compaction_mode Pdf417 symbology type of BarCode's compaction mode. Default value: Pdf417CompactionMode.Auto. - * - * @return $this - */ - public function setCompactionMode($compaction_mode) - { - $this->container['compaction_mode'] = $compaction_mode; - - return $this; - } - - /** - * Gets error_level - * - * @return \Aspose\BarCode\Model\Pdf417ErrorLevel - */ - public function getErrorLevel() - { - return $this->container['error_level']; - } - - /** - * Sets error_level - * - * @param \Aspose\BarCode\Model\Pdf417ErrorLevel $error_level Pdf417 symbology type of BarCode's error correction level ranging from level0 to level8, level0 means no error correction info, level8 means best error correction which means a larger picture. - * - * @return $this - */ - public function setErrorLevel($error_level) - { - $this->container['error_level'] = $error_level; - - return $this; - } - - /** - * Gets macro_file_id - * - * @return int - */ - public function getMacroFileId() - { - return $this->container['macro_file_id']; - } - - /** - * Sets macro_file_id - * - * @param int $macro_file_id Macro Pdf417 barcode's file ID. Used for MacroPdf417. - * - * @return $this - */ - public function setMacroFileId($macro_file_id) - { - $this->container['macro_file_id'] = $macro_file_id; - - return $this; - } - - /** - * Gets macro_segment_id - * - * @return int - */ - public function getMacroSegmentId() - { - return $this->container['macro_segment_id']; - } - - /** - * Sets macro_segment_id - * - * @param int $macro_segment_id Macro Pdf417 barcode's segment ID, which starts from 0, to MacroSegmentsCount - 1. - * - * @return $this - */ - public function setMacroSegmentId($macro_segment_id) - { - $this->container['macro_segment_id'] = $macro_segment_id; - - return $this; - } - - /** - * Gets macro_segments_count - * - * @return int - */ - public function getMacroSegmentsCount() - { - return $this->container['macro_segments_count']; - } - - /** - * Sets macro_segments_count - * - * @param int $macro_segments_count Macro Pdf417 barcode segments count. - * - * @return $this - */ - public function setMacroSegmentsCount($macro_segments_count) - { - $this->container['macro_segments_count'] = $macro_segments_count; - - return $this; - } - - /** - * Gets rows - * - * @return int - */ - public function getRows() - { - return $this->container['rows']; - } - - /** - * Sets rows - * - * @param int $rows Rows count. - * - * @return $this - */ - public function setRows($rows) - { - $this->container['rows'] = $rows; - - return $this; - } - - /** - * Gets truncate - * - * @return bool - */ - public function getTruncate() - { - return $this->container['truncate']; - } - - /** - * Sets truncate - * - * @param bool $truncate Whether Pdf417 symbology type of BarCode is truncated (to reduce space). - * - * @return $this - */ - public function setTruncate($truncate) - { - $this->container['truncate'] = $truncate; - - return $this; - } - - /** - * Gets pdf417_eci_encoding - * - * @return \Aspose\BarCode\Model\ECIEncodings - */ - public function getPdf417EciEncoding() - { - return $this->container['pdf417_eci_encoding']; - } - - /** - * Sets pdf417_eci_encoding - * - * @param \Aspose\BarCode\Model\ECIEncodings $pdf417_eci_encoding Extended Channel Interpretation Identifiers. It is used to tell the barcode reader details about the used references for encoding the data in the symbol. Current implementation consists all well known charset encodings. - * - * @return $this - */ - public function setPdf417EciEncoding($pdf417_eci_encoding) - { - $this->container['pdf417_eci_encoding'] = $pdf417_eci_encoding; - - return $this; - } - - /** - * Gets is_reader_initialization - * - * @return bool - */ - public function getIsReaderInitialization() - { - return $this->container['is_reader_initialization']; - } - - /** - * Sets is_reader_initialization - * - * @param bool $is_reader_initialization Used to instruct the reader to interpret the data contained within the symbol as programming for reader initialization - * - * @return $this - */ - public function setIsReaderInitialization($is_reader_initialization) - { - $this->container['is_reader_initialization'] = $is_reader_initialization; - - return $this; - } - - /** - * Gets macro_time_stamp - * - * @return \DateTime - */ - public function getMacroTimeStamp() - { - return $this->container['macro_time_stamp']; - } - - /** - * Sets macro_time_stamp - * - * @param \DateTime $macro_time_stamp Macro Pdf417 barcode time stamp - * - * @return $this - */ - public function setMacroTimeStamp($macro_time_stamp) - { - $this->container['macro_time_stamp'] = $macro_time_stamp; - - return $this; - } - - /** - * Gets macro_sender - * - * @return string - */ - public function getMacroSender() - { - return $this->container['macro_sender']; - } - - /** - * Sets macro_sender - * - * @param string $macro_sender Macro Pdf417 barcode sender name - * - * @return $this - */ - public function setMacroSender($macro_sender) - { - $this->container['macro_sender'] = $macro_sender; - - return $this; - } - - /** - * Gets macro_file_size - * - * @return int - */ - public function getMacroFileSize() - { - return $this->container['macro_file_size']; - } - - /** - * Sets macro_file_size - * - * @param int $macro_file_size Macro Pdf417 file size. The file size field contains the size in bytes of the entire source file - * - * @return $this - */ - public function setMacroFileSize($macro_file_size) - { - $this->container['macro_file_size'] = $macro_file_size; - - return $this; - } - - /** - * Gets macro_checksum - * - * @return int - */ - public function getMacroChecksum() - { - return $this->container['macro_checksum']; - } - - /** - * Sets macro_checksum - * - * @param int $macro_checksum Macro Pdf417 barcode checksum. The checksum field contains the value of the 16-bit (2 bytes) CRC checksum using the CCITT-16 polynomial - * - * @return $this - */ - public function setMacroChecksum($macro_checksum) - { - $this->container['macro_checksum'] = $macro_checksum; - - return $this; - } - - /** - * Gets macro_file_name - * - * @return string - */ - public function getMacroFileName() - { - return $this->container['macro_file_name']; - } - - /** - * Sets macro_file_name - * - * @param string $macro_file_name Macro Pdf417 barcode file name - * - * @return $this - */ - public function setMacroFileName($macro_file_name) - { - $this->container['macro_file_name'] = $macro_file_name; - - return $this; - } - - /** - * Gets macro_addressee - * - * @return string - */ - public function getMacroAddressee() - { - return $this->container['macro_addressee']; - } - - /** - * Sets macro_addressee - * - * @param string $macro_addressee Macro Pdf417 barcode addressee name - * - * @return $this - */ - public function setMacroAddressee($macro_addressee) - { - $this->container['macro_addressee'] = $macro_addressee; - - return $this; - } - - /** - * Gets macro_eci_encoding - * - * @return \Aspose\BarCode\Model\ECIEncodings - */ - public function getMacroEciEncoding() - { - return $this->container['macro_eci_encoding']; - } - - /** - * Sets macro_eci_encoding - * - * @param \Aspose\BarCode\Model\ECIEncodings $macro_eci_encoding Extended Channel Interpretation Identifiers. Applies for Macro PDF417 text fields. - * - * @return $this - */ - public function setMacroEciEncoding($macro_eci_encoding) - { - $this->container['macro_eci_encoding'] = $macro_eci_encoding; - - return $this; - } - - /** - * Gets code128_emulation - * - * @return \Aspose\BarCode\Model\Code128Emulation - */ - public function getCode128Emulation() - { - return $this->container['code128_emulation']; - } - - /** - * Sets code128_emulation - * - * @param \Aspose\BarCode\Model\Code128Emulation $code128_emulation DEPRECATED: This property is obsolete and will be removed in future releases. See samples of using new parameters on https://releases.aspose.com/barcode/net/release-notes/2023/aspose-barcode-for-net-23-10-release-notes/ Function codeword for Code 128 emulation. Applied for MicroPDF417 only. Ignored for PDF417 and MacroPDF417 barcodes. - * - * @return $this - */ - public function setCode128Emulation($code128_emulation) - { - trigger_error('Property $code128_emulation is deprecated. This property is obsolete and will be removed in future releases. See samples of using new parameters on https://releases.aspose.com/barcode/net/release-notes/2023/aspose-barcode-for-net-23-10-release-notes/ Function codeword for Code 128 emulation. Applied for MicroPDF417 only. Ignored for PDF417 and MacroPDF417 barcodes.', E_USER_DEPRECATED); - $this->container['code128_emulation'] = $code128_emulation; - - return $this; - } - - /** - * Gets is_code128_emulation - * - * @return bool - */ - public function getIsCode128Emulation() - { - return $this->container['is_code128_emulation']; - } - - /** - * Sets is_code128_emulation - * - * @param bool $is_code128_emulation Can be used only with MicroPdf417 and encodes Code 128 emulation modes. Can encode FNC1 in second position modes 908 and 909, also can encode 910 and 911 which just indicate that recognized MicroPdf417 can be interpret as Code 128. - * - * @return $this - */ - public function setIsCode128Emulation($is_code128_emulation) - { - $this->container['is_code128_emulation'] = $is_code128_emulation; - - return $this; - } - - /** - * Gets pdf417_macro_terminator - * - * @return \Aspose\BarCode\Model\Pdf417MacroTerminator - */ - public function getPdf417MacroTerminator() - { - return $this->container['pdf417_macro_terminator']; - } - - /** - * Sets pdf417_macro_terminator - * - * @param \Aspose\BarCode\Model\Pdf417MacroTerminator $pdf417_macro_terminator Used to tell the encoder whether to add Macro PDF417 Terminator (codeword 922) to the segment. Applied only for Macro PDF417. - * - * @return $this - */ - public function setPdf417MacroTerminator($pdf417_macro_terminator) - { - $this->container['pdf417_macro_terminator'] = $pdf417_macro_terminator; - - return $this; - } - - /** - * Gets is_linked - * - * @return bool - */ - public function getIsLinked() - { - return $this->container['is_linked']; - } - - /** - * Sets is_linked - * - * @param bool $is_linked Defines linked modes with GS1MicroPdf417, MicroPdf417 and Pdf417 barcodes. With GS1MicroPdf417 symbology encodes 906, 907, 912, 913, 914, 915 “Linked” UCC/EAN-128 modes. With MicroPdf417 and Pdf417 symbologies encodes 918 linkage flag to associated linear component other than an EAN.UCC. - * - * @return $this - */ - public function setIsLinked($is_linked) - { - $this->container['is_linked'] = $is_linked; - - return $this; - } - - /** - * Gets macro_characters - * - * @return \Aspose\BarCode\Model\MacroCharacter - */ - public function getMacroCharacters() - { - return $this->container['macro_characters']; - } - - /** - * Sets macro_characters - * - * @param \Aspose\BarCode\Model\MacroCharacter $macro_characters Macro Characters 05 and 06 values are used to obtain more compact encoding in special modes. Can be used only with MicroPdf417 and encodes 916 and 917 MicroPdf417 modes. Default value: MacroCharacters.None. - * - * @return $this - */ - public function setMacroCharacters($macro_characters) - { - $this->container['macro_characters'] = $macro_characters; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/PostalParams.php b/src/Aspose/BarCode/Model/PostalParams.php deleted file mode 100644 index dfa310b..0000000 --- a/src/Aspose/BarCode/Model/PostalParams.php +++ /dev/null @@ -1,273 +0,0 @@ - 'double' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'short_bar_height' => 'double' - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'short_bar_height' => 'ShortBarHeight' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'short_bar_height' => 'setShortBarHeight' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'short_bar_height' => 'getShortBarHeight' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['short_bar_height'] = isset($data['short_bar_height']) ? $data['short_bar_height'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets short_bar_height - * - * @return double - */ - public function getShortBarHeight() - { - return $this->container['short_bar_height']; - } - - /** - * Sets short_bar_height - * - * @param double $short_bar_height Short bar's height of Postal barcodes. - * - * @return $this - */ - public function setShortBarHeight($short_bar_height) - { - $this->container['short_bar_height'] = $short_bar_height; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/PresetType.php b/src/Aspose/BarCode/Model/PresetType.php deleted file mode 100644 index 93b3348..0000000 --- a/src/Aspose/BarCode/Model/PresetType.php +++ /dev/null @@ -1,46 +0,0 @@ - - /// Enum value HighPerformance - /// - public const HighPerformance = "HighPerformance"; - - /// - /// Enum value NormalQuality - /// - public const NormalQuality = "NormalQuality"; - - /// - /// Enum value HighQualityDetection - /// - public const HighQualityDetection = "HighQualityDetection"; - - /// - /// Enum value MaxQualityDetection - /// - public const MaxQualityDetection = "MaxQualityDetection"; - - /// - /// Enum value HighQuality - /// - public const HighQuality = "HighQuality"; - - /// - /// Enum value MaxBarCodes - /// - public const MaxBarCodes = "MaxBarCodes"; - -} diff --git a/src/Aspose/BarCode/Model/QREncodeMode.php b/src/Aspose/BarCode/Model/QREncodeMode.php deleted file mode 100644 index 15cc657..0000000 --- a/src/Aspose/BarCode/Model/QREncodeMode.php +++ /dev/null @@ -1,46 +0,0 @@ - - /// Enum value Auto - /// - public const Auto = "Auto"; - - /// - /// Enum value Bytes - /// - public const Bytes = "Bytes"; - - /// - /// Enum value Utf8BOM - /// - public const Utf8BOM = "Utf8BOM"; - - /// - /// Enum value Utf16BEBOM - /// - public const Utf16BEBOM = "Utf16BEBOM"; - - /// - /// Enum value ECIEncoding - /// - public const ECIEncoding = "ECIEncoding"; - - /// - /// Enum value ExtendedCodetext - /// - public const ExtendedCodetext = "ExtendedCodetext"; - -} diff --git a/src/Aspose/BarCode/Model/QREncodeType.php b/src/Aspose/BarCode/Model/QREncodeType.php deleted file mode 100644 index a05a5c3..0000000 --- a/src/Aspose/BarCode/Model/QREncodeType.php +++ /dev/null @@ -1,31 +0,0 @@ - - /// Enum value Auto - /// - public const Auto = "Auto"; - - /// - /// Enum value ForceQR - /// - public const ForceQR = "ForceQR"; - - /// - /// Enum value ForceMicroQR - /// - public const ForceMicroQR = "ForceMicroQR"; - -} diff --git a/src/Aspose/BarCode/Model/QRErrorLevel.php b/src/Aspose/BarCode/Model/QRErrorLevel.php deleted file mode 100644 index 5b62456..0000000 --- a/src/Aspose/BarCode/Model/QRErrorLevel.php +++ /dev/null @@ -1,36 +0,0 @@ - - /// Enum value LevelL - /// - public const LevelL = "LevelL"; - - /// - /// Enum value LevelM - /// - public const LevelM = "LevelM"; - - /// - /// Enum value LevelQ - /// - public const LevelQ = "LevelQ"; - - /// - /// Enum value LevelH - /// - public const LevelH = "LevelH"; - -} diff --git a/src/Aspose/BarCode/Model/QRVersion.php b/src/Aspose/BarCode/Model/QRVersion.php deleted file mode 100644 index 3aa9ad5..0000000 --- a/src/Aspose/BarCode/Model/QRVersion.php +++ /dev/null @@ -1,241 +0,0 @@ - - /// Enum value Auto - /// - public const Auto = "Auto"; - - /// - /// Enum value Version01 - /// - public const Version01 = "Version01"; - - /// - /// Enum value Version02 - /// - public const Version02 = "Version02"; - - /// - /// Enum value Version03 - /// - public const Version03 = "Version03"; - - /// - /// Enum value Version04 - /// - public const Version04 = "Version04"; - - /// - /// Enum value Version05 - /// - public const Version05 = "Version05"; - - /// - /// Enum value Version06 - /// - public const Version06 = "Version06"; - - /// - /// Enum value Version07 - /// - public const Version07 = "Version07"; - - /// - /// Enum value Version08 - /// - public const Version08 = "Version08"; - - /// - /// Enum value Version09 - /// - public const Version09 = "Version09"; - - /// - /// Enum value Version10 - /// - public const Version10 = "Version10"; - - /// - /// Enum value Version11 - /// - public const Version11 = "Version11"; - - /// - /// Enum value Version12 - /// - public const Version12 = "Version12"; - - /// - /// Enum value Version13 - /// - public const Version13 = "Version13"; - - /// - /// Enum value Version14 - /// - public const Version14 = "Version14"; - - /// - /// Enum value Version15 - /// - public const Version15 = "Version15"; - - /// - /// Enum value Version16 - /// - public const Version16 = "Version16"; - - /// - /// Enum value Version17 - /// - public const Version17 = "Version17"; - - /// - /// Enum value Version18 - /// - public const Version18 = "Version18"; - - /// - /// Enum value Version19 - /// - public const Version19 = "Version19"; - - /// - /// Enum value Version20 - /// - public const Version20 = "Version20"; - - /// - /// Enum value Version21 - /// - public const Version21 = "Version21"; - - /// - /// Enum value Version22 - /// - public const Version22 = "Version22"; - - /// - /// Enum value Version23 - /// - public const Version23 = "Version23"; - - /// - /// Enum value Version24 - /// - public const Version24 = "Version24"; - - /// - /// Enum value Version25 - /// - public const Version25 = "Version25"; - - /// - /// Enum value Version26 - /// - public const Version26 = "Version26"; - - /// - /// Enum value Version27 - /// - public const Version27 = "Version27"; - - /// - /// Enum value Version28 - /// - public const Version28 = "Version28"; - - /// - /// Enum value Version29 - /// - public const Version29 = "Version29"; - - /// - /// Enum value Version30 - /// - public const Version30 = "Version30"; - - /// - /// Enum value Version31 - /// - public const Version31 = "Version31"; - - /// - /// Enum value Version32 - /// - public const Version32 = "Version32"; - - /// - /// Enum value Version33 - /// - public const Version33 = "Version33"; - - /// - /// Enum value Version34 - /// - public const Version34 = "Version34"; - - /// - /// Enum value Version35 - /// - public const Version35 = "Version35"; - - /// - /// Enum value Version36 - /// - public const Version36 = "Version36"; - - /// - /// Enum value Version37 - /// - public const Version37 = "Version37"; - - /// - /// Enum value Version38 - /// - public const Version38 = "Version38"; - - /// - /// Enum value Version39 - /// - public const Version39 = "Version39"; - - /// - /// Enum value Version40 - /// - public const Version40 = "Version40"; - - /// - /// Enum value VersionM1 - /// - public const VersionM1 = "VersionM1"; - - /// - /// Enum value VersionM2 - /// - public const VersionM2 = "VersionM2"; - - /// - /// Enum value VersionM3 - /// - public const VersionM3 = "VersionM3"; - - /// - /// Enum value VersionM4 - /// - public const VersionM4 = "VersionM4"; - -} diff --git a/src/Aspose/BarCode/Model/QrParams.php b/src/Aspose/BarCode/Model/QrParams.php deleted file mode 100644 index 8f5f35a..0000000 --- a/src/Aspose/BarCode/Model/QrParams.php +++ /dev/null @@ -1,484 +0,0 @@ - 'double', - 'text_encoding' => 'string', - 'encode_type' => '\Aspose\BarCode\Model\QREncodeType', - 'eci_encoding' => '\Aspose\BarCode\Model\ECIEncodings', - 'encode_mode' => '\Aspose\BarCode\Model\QREncodeMode', - 'error_level' => '\Aspose\BarCode\Model\QRErrorLevel', - 'version' => '\Aspose\BarCode\Model\QRVersion', - 'structured_append' => '\Aspose\BarCode\Model\StructuredAppend' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'aspect_ratio' => 'double', - 'text_encoding' => null, - 'encode_type' => null, - 'eci_encoding' => null, - 'encode_mode' => null, - 'error_level' => null, - 'version' => null, - 'structured_append' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'aspect_ratio' => 'AspectRatio', - 'text_encoding' => 'TextEncoding', - 'encode_type' => 'EncodeType', - 'eci_encoding' => 'ECIEncoding', - 'encode_mode' => 'EncodeMode', - 'error_level' => 'ErrorLevel', - 'version' => 'Version', - 'structured_append' => 'StructuredAppend' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'aspect_ratio' => 'setAspectRatio', - 'text_encoding' => 'setTextEncoding', - 'encode_type' => 'setEncodeType', - 'eci_encoding' => 'setEciEncoding', - 'encode_mode' => 'setEncodeMode', - 'error_level' => 'setErrorLevel', - 'version' => 'setVersion', - 'structured_append' => 'setStructuredAppend' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'aspect_ratio' => 'getAspectRatio', - 'text_encoding' => 'getTextEncoding', - 'encode_type' => 'getEncodeType', - 'eci_encoding' => 'getEciEncoding', - 'encode_mode' => 'getEncodeMode', - 'error_level' => 'getErrorLevel', - 'version' => 'getVersion', - 'structured_append' => 'getStructuredAppend' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['aspect_ratio'] = isset($data['aspect_ratio']) ? $data['aspect_ratio'] : null; - $this->container['text_encoding'] = isset($data['text_encoding']) ? $data['text_encoding'] : null; - $this->container['encode_type'] = isset($data['encode_type']) ? $data['encode_type'] : null; - $this->container['eci_encoding'] = isset($data['eci_encoding']) ? $data['eci_encoding'] : null; - $this->container['encode_mode'] = isset($data['encode_mode']) ? $data['encode_mode'] : null; - $this->container['error_level'] = isset($data['error_level']) ? $data['error_level'] : null; - $this->container['version'] = isset($data['version']) ? $data['version'] : null; - $this->container['structured_append'] = isset($data['structured_append']) ? $data['structured_append'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets aspect_ratio - * - * @return double - */ - public function getAspectRatio() - { - return $this->container['aspect_ratio']; - } - - /** - * Sets aspect_ratio - * - * @param double $aspect_ratio Height/Width ratio of 2D BarCode module. - * - * @return $this - */ - public function setAspectRatio($aspect_ratio) - { - $this->container['aspect_ratio'] = $aspect_ratio; - - return $this; - } - - /** - * Gets text_encoding - * - * @return string - */ - public function getTextEncoding() - { - return $this->container['text_encoding']; - } - - /** - * Sets text_encoding - * - * @param string $text_encoding DEPRECATED: This property is obsolete and will be removed in future releases. Unicode symbols detection and encoding will be processed in Auto mode with Extended Channel Interpretation charset designator. Using of own encodings requires manual CodeText encoding into byte[] array. Sets the encoding of codetext. - * - * @return $this - */ - public function setTextEncoding($text_encoding) - { - trigger_error('Property $text_encoding is deprecated. This property is obsolete and will be removed in future releases. Unicode symbols detection and encoding will be processed in Auto mode with Extended Channel Interpretation charset designator. Using of own encodings requires manual CodeText encoding into byte[] array. Sets the encoding of codetext.', E_USER_DEPRECATED); - $this->container['text_encoding'] = $text_encoding; - - return $this; - } - - /** - * Gets encode_type - * - * @return \Aspose\BarCode\Model\QREncodeType - */ - public function getEncodeType() - { - return $this->container['encode_type']; - } - - /** - * Sets encode_type - * - * @param \Aspose\BarCode\Model\QREncodeType $encode_type QR / MicroQR selector mode. Select ForceQR for standard QR symbols, Auto for MicroQR. - * - * @return $this - */ - public function setEncodeType($encode_type) - { - $this->container['encode_type'] = $encode_type; - - return $this; - } - - /** - * Gets eci_encoding - * - * @return \Aspose\BarCode\Model\ECIEncodings - */ - public function getEciEncoding() - { - return $this->container['eci_encoding']; - } - - /** - * Sets eci_encoding - * - * @param \Aspose\BarCode\Model\ECIEncodings $eci_encoding Extended Channel Interpretation Identifiers. It is used to tell the barcode reader details about the used references for encoding the data in the symbol. Current implementation consists all well known charset encodings. - * - * @return $this - */ - public function setEciEncoding($eci_encoding) - { - $this->container['eci_encoding'] = $eci_encoding; - - return $this; - } - - /** - * Gets encode_mode - * - * @return \Aspose\BarCode\Model\QREncodeMode - */ - public function getEncodeMode() - { - return $this->container['encode_mode']; - } - - /** - * Sets encode_mode - * - * @param \Aspose\BarCode\Model\QREncodeMode $encode_mode QR symbology type of BarCode's encoding mode. Default value: QREncodeMode.Auto. - * - * @return $this - */ - public function setEncodeMode($encode_mode) - { - $this->container['encode_mode'] = $encode_mode; - - return $this; - } - - /** - * Gets error_level - * - * @return \Aspose\BarCode\Model\QRErrorLevel - */ - public function getErrorLevel() - { - return $this->container['error_level']; - } - - /** - * Sets error_level - * - * @param \Aspose\BarCode\Model\QRErrorLevel $error_level Level of Reed-Solomon error correction for QR barcode. From low to high: LevelL, LevelM, LevelQ, LevelH. see QRErrorLevel. - * - * @return $this - */ - public function setErrorLevel($error_level) - { - $this->container['error_level'] = $error_level; - - return $this; - } - - /** - * Gets version - * - * @return \Aspose\BarCode\Model\QRVersion - */ - public function getVersion() - { - return $this->container['version']; - } - - /** - * Sets version - * - * @param \Aspose\BarCode\Model\QRVersion $version Version of QR Code. From Version1 to Version40 for QR code and from M1 to M4 for MicroQr. Default value is QRVersion.Auto. - * - * @return $this - */ - public function setVersion($version) - { - $this->container['version'] = $version; - - return $this; - } - - /** - * Gets structured_append - * - * @return \Aspose\BarCode\Model\StructuredAppend - */ - public function getStructuredAppend() - { - return $this->container['structured_append']; - } - - /** - * Sets structured_append - * - * @param \Aspose\BarCode\Model\StructuredAppend $structured_append QR structured append parameters. - * - * @return $this - */ - public function setStructuredAppend($structured_append) - { - $this->container['structured_append'] = $structured_append; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/ReaderParams.php b/src/Aspose/BarCode/Model/ReaderParams.php deleted file mode 100644 index 1520096..0000000 --- a/src/Aspose/BarCode/Model/ReaderParams.php +++ /dev/null @@ -1,1323 +0,0 @@ - '\Aspose\BarCode\Model\DecodeBarcodeType', - 'types' => '\Aspose\BarCode\Model\DecodeBarcodeType[]', - 'checksum_validation' => '\Aspose\BarCode\Model\ChecksumValidation', - 'detect_encoding' => 'bool', - 'preset' => '\Aspose\BarCode\Model\PresetType', - 'rect_x' => 'int', - 'rect_y' => 'int', - 'rect_width' => 'int', - 'rect_height' => 'int', - 'strip_fnc' => 'bool', - 'timeout' => 'int', - 'median_smoothing_window_size' => 'int', - 'allow_median_smoothing' => 'bool', - 'allow_complex_background' => 'bool', - 'allow_datamatrix_industrial_barcodes' => 'bool', - 'allow_decreased_image' => 'bool', - 'allow_detect_scan_gap' => 'bool', - 'allow_incorrect_barcodes' => 'bool', - 'allow_invert_image' => 'bool', - 'allow_micro_white_spots_removing' => 'bool', - 'allow_one_d_fast_barcodes_detector' => 'bool', - 'allow_one_d_wiped_bars_restoration' => 'bool', - 'allow_qr_micro_qr_restoration' => 'bool', - 'allow_regular_image' => 'bool', - 'allow_salt_and_pepper_filtering' => 'bool', - 'allow_white_spots_removing' => 'bool', - 'check_more1_d_variants' => 'bool', - 'fast_scan_only' => 'bool', - 'allow_additional_restorations' => 'bool', - 'region_likelihood_threshold_percent' => 'double', - 'scan_window_sizes' => 'int[]', - 'similarity' => 'double', - 'skip_diagonal_search' => 'bool', - 'read_tiny_barcodes' => 'bool', - 'australian_post_encoding_table' => '\Aspose\BarCode\Model\CustomerInformationInterpretingType', - 'ignore_ending_filling_patterns_for_c_table' => 'bool' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'type' => null, - 'types' => null, - 'checksum_validation' => null, - 'detect_encoding' => null, - 'preset' => null, - 'rect_x' => 'int32', - 'rect_y' => 'int32', - 'rect_width' => 'int32', - 'rect_height' => 'int32', - 'strip_fnc' => null, - 'timeout' => 'int32', - 'median_smoothing_window_size' => 'int32', - 'allow_median_smoothing' => null, - 'allow_complex_background' => null, - 'allow_datamatrix_industrial_barcodes' => null, - 'allow_decreased_image' => null, - 'allow_detect_scan_gap' => null, - 'allow_incorrect_barcodes' => null, - 'allow_invert_image' => null, - 'allow_micro_white_spots_removing' => null, - 'allow_one_d_fast_barcodes_detector' => null, - 'allow_one_d_wiped_bars_restoration' => null, - 'allow_qr_micro_qr_restoration' => null, - 'allow_regular_image' => null, - 'allow_salt_and_pepper_filtering' => null, - 'allow_white_spots_removing' => null, - 'check_more1_d_variants' => null, - 'fast_scan_only' => null, - 'allow_additional_restorations' => null, - 'region_likelihood_threshold_percent' => 'double', - 'scan_window_sizes' => 'int32', - 'similarity' => 'double', - 'skip_diagonal_search' => null, - 'read_tiny_barcodes' => null, - 'australian_post_encoding_table' => null, - 'ignore_ending_filling_patterns_for_c_table' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'type' => 'Type', - 'types' => 'Types', - 'checksum_validation' => 'ChecksumValidation', - 'detect_encoding' => 'DetectEncoding', - 'preset' => 'Preset', - 'rect_x' => 'RectX', - 'rect_y' => 'RectY', - 'rect_width' => 'RectWidth', - 'rect_height' => 'RectHeight', - 'strip_fnc' => 'StripFNC', - 'timeout' => 'Timeout', - 'median_smoothing_window_size' => 'MedianSmoothingWindowSize', - 'allow_median_smoothing' => 'AllowMedianSmoothing', - 'allow_complex_background' => 'AllowComplexBackground', - 'allow_datamatrix_industrial_barcodes' => 'AllowDatamatrixIndustrialBarcodes', - 'allow_decreased_image' => 'AllowDecreasedImage', - 'allow_detect_scan_gap' => 'AllowDetectScanGap', - 'allow_incorrect_barcodes' => 'AllowIncorrectBarcodes', - 'allow_invert_image' => 'AllowInvertImage', - 'allow_micro_white_spots_removing' => 'AllowMicroWhiteSpotsRemoving', - 'allow_one_d_fast_barcodes_detector' => 'AllowOneDFastBarcodesDetector', - 'allow_one_d_wiped_bars_restoration' => 'AllowOneDWipedBarsRestoration', - 'allow_qr_micro_qr_restoration' => 'AllowQRMicroQrRestoration', - 'allow_regular_image' => 'AllowRegularImage', - 'allow_salt_and_pepper_filtering' => 'AllowSaltAndPepperFiltering', - 'allow_white_spots_removing' => 'AllowWhiteSpotsRemoving', - 'check_more1_d_variants' => 'CheckMore1DVariants', - 'fast_scan_only' => 'FastScanOnly', - 'allow_additional_restorations' => 'AllowAdditionalRestorations', - 'region_likelihood_threshold_percent' => 'RegionLikelihoodThresholdPercent', - 'scan_window_sizes' => 'ScanWindowSizes', - 'similarity' => 'Similarity', - 'skip_diagonal_search' => 'SkipDiagonalSearch', - 'read_tiny_barcodes' => 'ReadTinyBarcodes', - 'australian_post_encoding_table' => 'AustralianPostEncodingTable', - 'ignore_ending_filling_patterns_for_c_table' => 'IgnoreEndingFillingPatternsForCTable' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'type' => 'setType', - 'types' => 'setTypes', - 'checksum_validation' => 'setChecksumValidation', - 'detect_encoding' => 'setDetectEncoding', - 'preset' => 'setPreset', - 'rect_x' => 'setRectX', - 'rect_y' => 'setRectY', - 'rect_width' => 'setRectWidth', - 'rect_height' => 'setRectHeight', - 'strip_fnc' => 'setStripFnc', - 'timeout' => 'setTimeout', - 'median_smoothing_window_size' => 'setMedianSmoothingWindowSize', - 'allow_median_smoothing' => 'setAllowMedianSmoothing', - 'allow_complex_background' => 'setAllowComplexBackground', - 'allow_datamatrix_industrial_barcodes' => 'setAllowDatamatrixIndustrialBarcodes', - 'allow_decreased_image' => 'setAllowDecreasedImage', - 'allow_detect_scan_gap' => 'setAllowDetectScanGap', - 'allow_incorrect_barcodes' => 'setAllowIncorrectBarcodes', - 'allow_invert_image' => 'setAllowInvertImage', - 'allow_micro_white_spots_removing' => 'setAllowMicroWhiteSpotsRemoving', - 'allow_one_d_fast_barcodes_detector' => 'setAllowOneDFastBarcodesDetector', - 'allow_one_d_wiped_bars_restoration' => 'setAllowOneDWipedBarsRestoration', - 'allow_qr_micro_qr_restoration' => 'setAllowQrMicroQrRestoration', - 'allow_regular_image' => 'setAllowRegularImage', - 'allow_salt_and_pepper_filtering' => 'setAllowSaltAndPepperFiltering', - 'allow_white_spots_removing' => 'setAllowWhiteSpotsRemoving', - 'check_more1_d_variants' => 'setCheckMore1DVariants', - 'fast_scan_only' => 'setFastScanOnly', - 'allow_additional_restorations' => 'setAllowAdditionalRestorations', - 'region_likelihood_threshold_percent' => 'setRegionLikelihoodThresholdPercent', - 'scan_window_sizes' => 'setScanWindowSizes', - 'similarity' => 'setSimilarity', - 'skip_diagonal_search' => 'setSkipDiagonalSearch', - 'read_tiny_barcodes' => 'setReadTinyBarcodes', - 'australian_post_encoding_table' => 'setAustralianPostEncodingTable', - 'ignore_ending_filling_patterns_for_c_table' => 'setIgnoreEndingFillingPatternsForCTable' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'type' => 'getType', - 'types' => 'getTypes', - 'checksum_validation' => 'getChecksumValidation', - 'detect_encoding' => 'getDetectEncoding', - 'preset' => 'getPreset', - 'rect_x' => 'getRectX', - 'rect_y' => 'getRectY', - 'rect_width' => 'getRectWidth', - 'rect_height' => 'getRectHeight', - 'strip_fnc' => 'getStripFnc', - 'timeout' => 'getTimeout', - 'median_smoothing_window_size' => 'getMedianSmoothingWindowSize', - 'allow_median_smoothing' => 'getAllowMedianSmoothing', - 'allow_complex_background' => 'getAllowComplexBackground', - 'allow_datamatrix_industrial_barcodes' => 'getAllowDatamatrixIndustrialBarcodes', - 'allow_decreased_image' => 'getAllowDecreasedImage', - 'allow_detect_scan_gap' => 'getAllowDetectScanGap', - 'allow_incorrect_barcodes' => 'getAllowIncorrectBarcodes', - 'allow_invert_image' => 'getAllowInvertImage', - 'allow_micro_white_spots_removing' => 'getAllowMicroWhiteSpotsRemoving', - 'allow_one_d_fast_barcodes_detector' => 'getAllowOneDFastBarcodesDetector', - 'allow_one_d_wiped_bars_restoration' => 'getAllowOneDWipedBarsRestoration', - 'allow_qr_micro_qr_restoration' => 'getAllowQrMicroQrRestoration', - 'allow_regular_image' => 'getAllowRegularImage', - 'allow_salt_and_pepper_filtering' => 'getAllowSaltAndPepperFiltering', - 'allow_white_spots_removing' => 'getAllowWhiteSpotsRemoving', - 'check_more1_d_variants' => 'getCheckMore1DVariants', - 'fast_scan_only' => 'getFastScanOnly', - 'allow_additional_restorations' => 'getAllowAdditionalRestorations', - 'region_likelihood_threshold_percent' => 'getRegionLikelihoodThresholdPercent', - 'scan_window_sizes' => 'getScanWindowSizes', - 'similarity' => 'getSimilarity', - 'skip_diagonal_search' => 'getSkipDiagonalSearch', - 'read_tiny_barcodes' => 'getReadTinyBarcodes', - 'australian_post_encoding_table' => 'getAustralianPostEncodingTable', - 'ignore_ending_filling_patterns_for_c_table' => 'getIgnoreEndingFillingPatternsForCTable' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['type'] = isset($data['type']) ? $data['type'] : null; - $this->container['types'] = isset($data['types']) ? $data['types'] : null; - $this->container['checksum_validation'] = isset($data['checksum_validation']) ? $data['checksum_validation'] : null; - $this->container['detect_encoding'] = isset($data['detect_encoding']) ? $data['detect_encoding'] : null; - $this->container['preset'] = isset($data['preset']) ? $data['preset'] : null; - $this->container['rect_x'] = isset($data['rect_x']) ? $data['rect_x'] : null; - $this->container['rect_y'] = isset($data['rect_y']) ? $data['rect_y'] : null; - $this->container['rect_width'] = isset($data['rect_width']) ? $data['rect_width'] : null; - $this->container['rect_height'] = isset($data['rect_height']) ? $data['rect_height'] : null; - $this->container['strip_fnc'] = isset($data['strip_fnc']) ? $data['strip_fnc'] : null; - $this->container['timeout'] = isset($data['timeout']) ? $data['timeout'] : null; - $this->container['median_smoothing_window_size'] = isset($data['median_smoothing_window_size']) ? $data['median_smoothing_window_size'] : null; - $this->container['allow_median_smoothing'] = isset($data['allow_median_smoothing']) ? $data['allow_median_smoothing'] : null; - $this->container['allow_complex_background'] = isset($data['allow_complex_background']) ? $data['allow_complex_background'] : null; - $this->container['allow_datamatrix_industrial_barcodes'] = isset($data['allow_datamatrix_industrial_barcodes']) ? $data['allow_datamatrix_industrial_barcodes'] : null; - $this->container['allow_decreased_image'] = isset($data['allow_decreased_image']) ? $data['allow_decreased_image'] : null; - $this->container['allow_detect_scan_gap'] = isset($data['allow_detect_scan_gap']) ? $data['allow_detect_scan_gap'] : null; - $this->container['allow_incorrect_barcodes'] = isset($data['allow_incorrect_barcodes']) ? $data['allow_incorrect_barcodes'] : null; - $this->container['allow_invert_image'] = isset($data['allow_invert_image']) ? $data['allow_invert_image'] : null; - $this->container['allow_micro_white_spots_removing'] = isset($data['allow_micro_white_spots_removing']) ? $data['allow_micro_white_spots_removing'] : null; - $this->container['allow_one_d_fast_barcodes_detector'] = isset($data['allow_one_d_fast_barcodes_detector']) ? $data['allow_one_d_fast_barcodes_detector'] : null; - $this->container['allow_one_d_wiped_bars_restoration'] = isset($data['allow_one_d_wiped_bars_restoration']) ? $data['allow_one_d_wiped_bars_restoration'] : null; - $this->container['allow_qr_micro_qr_restoration'] = isset($data['allow_qr_micro_qr_restoration']) ? $data['allow_qr_micro_qr_restoration'] : null; - $this->container['allow_regular_image'] = isset($data['allow_regular_image']) ? $data['allow_regular_image'] : null; - $this->container['allow_salt_and_pepper_filtering'] = isset($data['allow_salt_and_pepper_filtering']) ? $data['allow_salt_and_pepper_filtering'] : null; - $this->container['allow_white_spots_removing'] = isset($data['allow_white_spots_removing']) ? $data['allow_white_spots_removing'] : null; - $this->container['check_more1_d_variants'] = isset($data['check_more1_d_variants']) ? $data['check_more1_d_variants'] : null; - $this->container['fast_scan_only'] = isset($data['fast_scan_only']) ? $data['fast_scan_only'] : null; - $this->container['allow_additional_restorations'] = isset($data['allow_additional_restorations']) ? $data['allow_additional_restorations'] : null; - $this->container['region_likelihood_threshold_percent'] = isset($data['region_likelihood_threshold_percent']) ? $data['region_likelihood_threshold_percent'] : null; - $this->container['scan_window_sizes'] = isset($data['scan_window_sizes']) ? $data['scan_window_sizes'] : null; - $this->container['similarity'] = isset($data['similarity']) ? $data['similarity'] : null; - $this->container['skip_diagonal_search'] = isset($data['skip_diagonal_search']) ? $data['skip_diagonal_search'] : null; - $this->container['read_tiny_barcodes'] = isset($data['read_tiny_barcodes']) ? $data['read_tiny_barcodes'] : null; - $this->container['australian_post_encoding_table'] = isset($data['australian_post_encoding_table']) ? $data['australian_post_encoding_table'] : null; - $this->container['ignore_ending_filling_patterns_for_c_table'] = isset($data['ignore_ending_filling_patterns_for_c_table']) ? $data['ignore_ending_filling_patterns_for_c_table'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets type - * - * @return \Aspose\BarCode\Model\DecodeBarcodeType - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param \Aspose\BarCode\Model\DecodeBarcodeType $type The type of barcode to read. - * - * @return $this - */ - public function setType($type) - { - $this->container['type'] = $type; - - return $this; - } - - /** - * Gets types - * - * @return \Aspose\BarCode\Model\DecodeBarcodeType[] - */ - public function getTypes() - { - return $this->container['types']; - } - - /** - * Sets types - * - * @param \Aspose\BarCode\Model\DecodeBarcodeType[] $types Multiple barcode types to read. - * - * @return $this - */ - public function setTypes($types) - { - $this->container['types'] = $types; - - return $this; - } - - /** - * Gets checksum_validation - * - * @return \Aspose\BarCode\Model\ChecksumValidation - */ - public function getChecksumValidation() - { - return $this->container['checksum_validation']; - } - - /** - * Sets checksum_validation - * - * @param \Aspose\BarCode\Model\ChecksumValidation $checksum_validation Enable checksum validation during recognition for 1D barcodes. Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible. Checksum never used: Codabar Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN Checksum always used: Rest symbologies - * - * @return $this - */ - public function setChecksumValidation($checksum_validation) - { - $this->container['checksum_validation'] = $checksum_validation; - - return $this; - } - - /** - * Gets detect_encoding - * - * @return bool - */ - public function getDetectEncoding() - { - return $this->container['detect_encoding']; - } - - /** - * Sets detect_encoding - * - * @param bool $detect_encoding A flag which force engine to detect codetext encoding for Unicode. - * - * @return $this - */ - public function setDetectEncoding($detect_encoding) - { - $this->container['detect_encoding'] = $detect_encoding; - - return $this; - } - - /** - * Gets preset - * - * @return \Aspose\BarCode\Model\PresetType - */ - public function getPreset() - { - return $this->container['preset']; - } - - /** - * Sets preset - * - * @param \Aspose\BarCode\Model\PresetType $preset Preset allows to configure recognition quality and speed manually. You can quickly set up Preset by embedded presets: HighPerformance, NormalQuality, HighQuality, MaxBarCodes or you can manually configure separate options. Default value of Preset is NormalQuality. - * - * @return $this - */ - public function setPreset($preset) - { - $this->container['preset'] = $preset; - - return $this; - } - - /** - * Gets rect_x - * - * @return int - */ - public function getRectX() - { - return $this->container['rect_x']; - } - - /** - * Sets rect_x - * - * @param int $rect_x Set X of top left corner of area for recognition. - * - * @return $this - */ - public function setRectX($rect_x) - { - $this->container['rect_x'] = $rect_x; - - return $this; - } - - /** - * Gets rect_y - * - * @return int - */ - public function getRectY() - { - return $this->container['rect_y']; - } - - /** - * Sets rect_y - * - * @param int $rect_y Set Y of top left corner of area for recognition. - * - * @return $this - */ - public function setRectY($rect_y) - { - $this->container['rect_y'] = $rect_y; - - return $this; - } - - /** - * Gets rect_width - * - * @return int - */ - public function getRectWidth() - { - return $this->container['rect_width']; - } - - /** - * Sets rect_width - * - * @param int $rect_width Set Width of area for recognition. - * - * @return $this - */ - public function setRectWidth($rect_width) - { - $this->container['rect_width'] = $rect_width; - - return $this; - } - - /** - * Gets rect_height - * - * @return int - */ - public function getRectHeight() - { - return $this->container['rect_height']; - } - - /** - * Sets rect_height - * - * @param int $rect_height Set Height of area for recognition. - * - * @return $this - */ - public function setRectHeight($rect_height) - { - $this->container['rect_height'] = $rect_height; - - return $this; - } - - /** - * Gets strip_fnc - * - * @return bool - */ - public function getStripFnc() - { - return $this->container['strip_fnc']; - } - - /** - * Sets strip_fnc - * - * @param bool $strip_fnc Value indicating whether FNC symbol strip must be done. - * - * @return $this - */ - public function setStripFnc($strip_fnc) - { - $this->container['strip_fnc'] = $strip_fnc; - - return $this; - } - - /** - * Gets timeout - * - * @return int - */ - public function getTimeout() - { - return $this->container['timeout']; - } - - /** - * Sets timeout - * - * @param int $timeout Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). Maximum value is 30_000 (1/2 minute). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout. - * - * @return $this - */ - public function setTimeout($timeout) - { - $this->container['timeout'] = $timeout; - - return $this; - } - - /** - * Gets median_smoothing_window_size - * - * @return int - */ - public function getMedianSmoothingWindowSize() - { - return $this->container['median_smoothing_window_size']; - } - - /** - * Sets median_smoothing_window_size - * - * @param int $median_smoothing_window_size Window size for median smoothing. Typical values are 3 or 4. Default value is 3. AllowMedianSmoothing must be set. - * - * @return $this - */ - public function setMedianSmoothingWindowSize($median_smoothing_window_size) - { - $this->container['median_smoothing_window_size'] = $median_smoothing_window_size; - - return $this; - } - - /** - * Gets allow_median_smoothing - * - * @return bool - */ - public function getAllowMedianSmoothing() - { - return $this->container['allow_median_smoothing']; - } - - /** - * Sets allow_median_smoothing - * - * @param bool $allow_median_smoothing Allows engine to enable median smoothing as additional scan. Mode helps to recognize noised barcodes. - * - * @return $this - */ - public function setAllowMedianSmoothing($allow_median_smoothing) - { - $this->container['allow_median_smoothing'] = $allow_median_smoothing; - - return $this; - } - - /** - * Gets allow_complex_background - * - * @return bool - */ - public function getAllowComplexBackground() - { - return $this->container['allow_complex_background']; - } - - /** - * Sets allow_complex_background - * - * @param bool $allow_complex_background Allows engine to recognize color barcodes on color background as additional scan. Extremely slow mode. - * - * @return $this - */ - public function setAllowComplexBackground($allow_complex_background) - { - $this->container['allow_complex_background'] = $allow_complex_background; - - return $this; - } - - /** - * Gets allow_datamatrix_industrial_barcodes - * - * @return bool - */ - public function getAllowDatamatrixIndustrialBarcodes() - { - return $this->container['allow_datamatrix_industrial_barcodes']; - } - - /** - * Sets allow_datamatrix_industrial_barcodes - * - * @param bool $allow_datamatrix_industrial_barcodes Allows engine for Datamatrix to recognize dashed industrial Datamatrix barcodes. Slow mode which helps only for dashed barcodes which consist from spots. - * - * @return $this - */ - public function setAllowDatamatrixIndustrialBarcodes($allow_datamatrix_industrial_barcodes) - { - $this->container['allow_datamatrix_industrial_barcodes'] = $allow_datamatrix_industrial_barcodes; - - return $this; - } - - /** - * Gets allow_decreased_image - * - * @return bool - */ - public function getAllowDecreasedImage() - { - return $this->container['allow_decreased_image']; - } - - /** - * Sets allow_decreased_image - * - * @param bool $allow_decreased_image Allows engine to recognize decreased image as additional scan. Size for decreasing is selected by internal engine algorithms. Mode helps to recognize barcodes which are noised and blurred but captured with high resolution. - * - * @return $this - */ - public function setAllowDecreasedImage($allow_decreased_image) - { - $this->container['allow_decreased_image'] = $allow_decreased_image; - - return $this; - } - - /** - * Gets allow_detect_scan_gap - * - * @return bool - */ - public function getAllowDetectScanGap() - { - return $this->container['allow_detect_scan_gap']; - } - - /** - * Sets allow_detect_scan_gap - * - * @param bool $allow_detect_scan_gap Allows engine to use gap between scans to increase recognition speed. Mode can make recognition problems with low height barcodes. - * - * @return $this - */ - public function setAllowDetectScanGap($allow_detect_scan_gap) - { - $this->container['allow_detect_scan_gap'] = $allow_detect_scan_gap; - - return $this; - } - - /** - * Gets allow_incorrect_barcodes - * - * @return bool - */ - public function getAllowIncorrectBarcodes() - { - return $this->container['allow_incorrect_barcodes']; - } - - /** - * Sets allow_incorrect_barcodes - * - * @param bool $allow_incorrect_barcodes Allows engine to recognize barcodes which has incorrect checksum or incorrect values. Mode can be used to recognize damaged barcodes with incorrect text. - * - * @return $this - */ - public function setAllowIncorrectBarcodes($allow_incorrect_barcodes) - { - $this->container['allow_incorrect_barcodes'] = $allow_incorrect_barcodes; - - return $this; - } - - /** - * Gets allow_invert_image - * - * @return bool - */ - public function getAllowInvertImage() - { - return $this->container['allow_invert_image']; - } - - /** - * Sets allow_invert_image - * - * @param bool $allow_invert_image Allows engine to recognize inverse color image as additional scan. Mode can be used when barcode is white on black background. - * - * @return $this - */ - public function setAllowInvertImage($allow_invert_image) - { - $this->container['allow_invert_image'] = $allow_invert_image; - - return $this; - } - - /** - * Gets allow_micro_white_spots_removing - * - * @return bool - */ - public function getAllowMicroWhiteSpotsRemoving() - { - return $this->container['allow_micro_white_spots_removing']; - } - - /** - * Sets allow_micro_white_spots_removing - * - * @param bool $allow_micro_white_spots_removing Allows engine for Postal barcodes to recognize slightly noised images. Mode helps to recognize slightly damaged Postal barcodes. - * - * @return $this - */ - public function setAllowMicroWhiteSpotsRemoving($allow_micro_white_spots_removing) - { - $this->container['allow_micro_white_spots_removing'] = $allow_micro_white_spots_removing; - - return $this; - } - - /** - * Gets allow_one_d_fast_barcodes_detector - * - * @return bool - */ - public function getAllowOneDFastBarcodesDetector() - { - return $this->container['allow_one_d_fast_barcodes_detector']; - } - - /** - * Sets allow_one_d_fast_barcodes_detector - * - * @param bool $allow_one_d_fast_barcodes_detector Allows engine for 1D barcodes to quickly recognize high quality barcodes which fill almost whole image. Mode helps to quickly recognize generated barcodes from Internet. - * - * @return $this - */ - public function setAllowOneDFastBarcodesDetector($allow_one_d_fast_barcodes_detector) - { - $this->container['allow_one_d_fast_barcodes_detector'] = $allow_one_d_fast_barcodes_detector; - - return $this; - } - - /** - * Gets allow_one_d_wiped_bars_restoration - * - * @return bool - */ - public function getAllowOneDWipedBarsRestoration() - { - return $this->container['allow_one_d_wiped_bars_restoration']; - } - - /** - * Sets allow_one_d_wiped_bars_restoration - * - * @param bool $allow_one_d_wiped_bars_restoration Allows engine for 1D barcodes to recognize barcodes with single wiped/glued bars in pattern. - * - * @return $this - */ - public function setAllowOneDWipedBarsRestoration($allow_one_d_wiped_bars_restoration) - { - $this->container['allow_one_d_wiped_bars_restoration'] = $allow_one_d_wiped_bars_restoration; - - return $this; - } - - /** - * Gets allow_qr_micro_qr_restoration - * - * @return bool - */ - public function getAllowQrMicroQrRestoration() - { - return $this->container['allow_qr_micro_qr_restoration']; - } - - /** - * Sets allow_qr_micro_qr_restoration - * - * @param bool $allow_qr_micro_qr_restoration Allows engine for QR/MicroQR to recognize damaged MicroQR barcodes. - * - * @return $this - */ - public function setAllowQrMicroQrRestoration($allow_qr_micro_qr_restoration) - { - $this->container['allow_qr_micro_qr_restoration'] = $allow_qr_micro_qr_restoration; - - return $this; - } - - /** - * Gets allow_regular_image - * - * @return bool - */ - public function getAllowRegularImage() - { - return $this->container['allow_regular_image']; - } - - /** - * Sets allow_regular_image - * - * @param bool $allow_regular_image Allows engine to recognize regular image without any restorations as main scan. Mode to recognize image as is. - * - * @return $this - */ - public function setAllowRegularImage($allow_regular_image) - { - $this->container['allow_regular_image'] = $allow_regular_image; - - return $this; - } - - /** - * Gets allow_salt_and_pepper_filtering - * - * @return bool - */ - public function getAllowSaltAndPepperFiltering() - { - return $this->container['allow_salt_and_pepper_filtering']; - } - - /** - * Sets allow_salt_and_pepper_filtering - * - * @param bool $allow_salt_and_pepper_filtering Allows engine to recognize barcodes with salt and pepper noise type. Mode can remove small noise with white and black dots. - * - * @return $this - */ - public function setAllowSaltAndPepperFiltering($allow_salt_and_pepper_filtering) - { - $this->container['allow_salt_and_pepper_filtering'] = $allow_salt_and_pepper_filtering; - - return $this; - } - - /** - * Gets allow_white_spots_removing - * - * @return bool - */ - public function getAllowWhiteSpotsRemoving() - { - return $this->container['allow_white_spots_removing']; - } - - /** - * Sets allow_white_spots_removing - * - * @param bool $allow_white_spots_removing Allows engine to recognize image without small white spots as additional scan. Mode helps to recognize noised image as well as median smoothing filtering. - * - * @return $this - */ - public function setAllowWhiteSpotsRemoving($allow_white_spots_removing) - { - $this->container['allow_white_spots_removing'] = $allow_white_spots_removing; - - return $this; - } - - /** - * Gets check_more1_d_variants - * - * @return bool - */ - public function getCheckMore1DVariants() - { - return $this->container['check_more1_d_variants']; - } - - /** - * Sets check_more1_d_variants - * - * @param bool $check_more1_d_variants Allows engine to recognize 1D barcodes with checksum by checking more recognition variants. Default value: False. - * - * @return $this - */ - public function setCheckMore1DVariants($check_more1_d_variants) - { - $this->container['check_more1_d_variants'] = $check_more1_d_variants; - - return $this; - } - - /** - * Gets fast_scan_only - * - * @return bool - */ - public function getFastScanOnly() - { - return $this->container['fast_scan_only']; - } - - /** - * Sets fast_scan_only - * - * @param bool $fast_scan_only Allows engine for 1D barcodes to quickly recognize middle slice of an image and return result without using any time-consuming algorithms. Default value: False. - * - * @return $this - */ - public function setFastScanOnly($fast_scan_only) - { - $this->container['fast_scan_only'] = $fast_scan_only; - - return $this; - } - - /** - * Gets allow_additional_restorations - * - * @return bool - */ - public function getAllowAdditionalRestorations() - { - return $this->container['allow_additional_restorations']; - } - - /** - * Sets allow_additional_restorations - * - * @param bool $allow_additional_restorations Allows engine using additional image restorations to recognize corrupted barcodes. At this time, it is used only in MicroPdf417 barcode type. Default value: False. - * - * @return $this - */ - public function setAllowAdditionalRestorations($allow_additional_restorations) - { - $this->container['allow_additional_restorations'] = $allow_additional_restorations; - - return $this; - } - - /** - * Gets region_likelihood_threshold_percent - * - * @return double - */ - public function getRegionLikelihoodThresholdPercent() - { - return $this->container['region_likelihood_threshold_percent']; - } - - /** - * Sets region_likelihood_threshold_percent - * - * @param double $region_likelihood_threshold_percent Sets threshold for detected regions that may contain barcodes. Value 0.7 means that bottom 70% of possible regions are filtered out and not processed further. Region likelihood threshold must be between [0.05, 0.9] Use high values for clear images with few barcodes. Use low values for images with many barcodes or for noisy images. Low value may lead to a bigger recognition time. - * - * @return $this - */ - public function setRegionLikelihoodThresholdPercent($region_likelihood_threshold_percent) - { - $this->container['region_likelihood_threshold_percent'] = $region_likelihood_threshold_percent; - - return $this; - } - - /** - * Gets scan_window_sizes - * - * @return int[] - */ - public function getScanWindowSizes() - { - return $this->container['scan_window_sizes']; - } - - /** - * Sets scan_window_sizes - * - * @param int[] $scan_window_sizes Scan window sizes in pixels. Allowed sizes are 10, 15, 20, 25, 30. Scanning with small window size takes more time and provides more accuracy but may fail in detecting very big barcodes. Combining of several window sizes can improve detection quality. - * - * @return $this - */ - public function setScanWindowSizes($scan_window_sizes) - { - $this->container['scan_window_sizes'] = $scan_window_sizes; - - return $this; - } - - /** - * Gets similarity - * - * @return double - */ - public function getSimilarity() - { - return $this->container['similarity']; - } - - /** - * Sets similarity - * - * @param double $similarity Similarity coefficient depends on how homogeneous barcodes are. Use high value for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] - * - * @return $this - */ - public function setSimilarity($similarity) - { - $this->container['similarity'] = $similarity; - - return $this; - } - - /** - * Gets skip_diagonal_search - * - * @return bool - */ - public function getSkipDiagonalSearch() - { - return $this->container['skip_diagonal_search']; - } - - /** - * Sets skip_diagonal_search - * - * @param bool $skip_diagonal_search Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time. - * - * @return $this - */ - public function setSkipDiagonalSearch($skip_diagonal_search) - { - $this->container['skip_diagonal_search'] = $skip_diagonal_search; - - return $this; - } - - /** - * Gets read_tiny_barcodes - * - * @return bool - */ - public function getReadTinyBarcodes() - { - return $this->container['read_tiny_barcodes']; - } - - /** - * Sets read_tiny_barcodes - * - * @param bool $read_tiny_barcodes Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False. - * - * @return $this - */ - public function setReadTinyBarcodes($read_tiny_barcodes) - { - $this->container['read_tiny_barcodes'] = $read_tiny_barcodes; - - return $this; - } - - /** - * Gets australian_post_encoding_table - * - * @return \Aspose\BarCode\Model\CustomerInformationInterpretingType - */ - public function getAustralianPostEncodingTable() - { - return $this->container['australian_post_encoding_table']; - } - - /** - * Sets australian_post_encoding_table - * - * @param \Aspose\BarCode\Model\CustomerInformationInterpretingType $australian_post_encoding_table Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. - * - * @return $this - */ - public function setAustralianPostEncodingTable($australian_post_encoding_table) - { - $this->container['australian_post_encoding_table'] = $australian_post_encoding_table; - - return $this; - } - - /** - * Gets ignore_ending_filling_patterns_for_c_table - * - * @return bool - */ - public function getIgnoreEndingFillingPatternsForCTable() - { - return $this->container['ignore_ending_filling_patterns_for_c_table']; - } - - /** - * Sets ignore_ending_filling_patterns_for_c_table - * - * @param bool $ignore_ending_filling_patterns_for_c_table The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequence \"333\" of filling patterns is decoded as letter \"z\". - * - * @return $this - */ - public function setIgnoreEndingFillingPatternsForCTable($ignore_ending_filling_patterns_for_c_table) - { - $this->container['ignore_ending_filling_patterns_for_c_table'] = $ignore_ending_filling_patterns_for_c_table; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/RecognitionImageKind.php b/src/Aspose/BarCode/Model/RecognitionImageKind.php new file mode 100644 index 0000000..621e8f2 --- /dev/null +++ b/src/Aspose/BarCode/Model/RecognitionImageKind.php @@ -0,0 +1,31 @@ + + /// Enum value Photo + /// + public const Photo = "Photo"; + + /// + /// Enum value ScannedDocument + /// + public const ScannedDocument = "ScannedDocument"; + + /// + /// Enum value ClearImage + /// + public const ClearImage = "ClearImage"; + +} diff --git a/src/Aspose/BarCode/Model/RecognitionMode.php b/src/Aspose/BarCode/Model/RecognitionMode.php new file mode 100644 index 0000000..4b795a5 --- /dev/null +++ b/src/Aspose/BarCode/Model/RecognitionMode.php @@ -0,0 +1,31 @@ + + /// Enum value Fast + /// + public const Fast = "Fast"; + + /// + /// Enum value Normal + /// + public const Normal = "Normal"; + + /// + /// Enum value Excellent + /// + public const Excellent = "Excellent"; + +} diff --git a/src/Aspose/BarCode/Model/StorageFile.php b/src/Aspose/BarCode/Model/RecognizeBase64Request.php similarity index 53% rename from src/Aspose/BarCode/Model/StorageFile.php rename to src/Aspose/BarCode/Model/RecognizeBase64Request.php index 5f97c9c..363c7f9 100644 --- a/src/Aspose/BarCode/Model/StorageFile.php +++ b/src/Aspose/BarCode/Model/RecognizeBase64Request.php @@ -8,11 +8,11 @@ use Aspose\BarCode\ObjectSerializer; /** - * StorageFile + * RecognizeBase64Request * - * @description File or folder information + * @description Barcode recognize request */ -class StorageFile implements ArrayAccess +class RecognizeBase64Request implements ArrayAccess { public const DISCRIMINATOR = null; @@ -21,7 +21,7 @@ class StorageFile implements ArrayAccess * * @var string */ - protected static string $swaggerModelName = "StorageFile"; + protected static string $swaggerModelName = "RecognizeBase64Request"; /** * Array of property to type mappings. Used for (de)serialization @@ -29,11 +29,10 @@ class StorageFile implements ArrayAccess * @var string[] */ protected static array $swaggerTypes = [ - 'name' => 'string', - 'is_folder' => 'bool', - 'modified_date' => '\DateTime', - 'size' => 'int', - 'path' => 'string' + 'barcode_types' => '\Aspose\BarCode\Model\DecodeBarcodeType[]', + 'file_base64' => 'string', + 'recognition_mode' => '\Aspose\BarCode\Model\RecognitionMode', + 'recognition_image_kind' => '\Aspose\BarCode\Model\RecognitionImageKind' ]; /** @@ -42,11 +41,10 @@ class StorageFile implements ArrayAccess * @var (string|null)[] */ protected static array $swaggerFormats = [ - 'name' => null, - 'is_folder' => null, - 'modified_date' => 'date-time', - 'size' => 'int64', - 'path' => null + 'barcode_types' => null, + 'file_base64' => null, + 'recognition_mode' => null, + 'recognition_image_kind' => null ]; /** @@ -76,11 +74,10 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'name' => 'Name', - 'is_folder' => 'IsFolder', - 'modified_date' => 'ModifiedDate', - 'size' => 'Size', - 'path' => 'Path' + 'barcode_types' => 'barcodeTypes', + 'file_base64' => 'fileBase64', + 'recognition_mode' => 'recognitionMode', + 'recognition_image_kind' => 'recognitionImageKind' ]; /** @@ -89,11 +86,10 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'name' => 'setName', - 'is_folder' => 'setIsFolder', - 'modified_date' => 'setModifiedDate', - 'size' => 'setSize', - 'path' => 'setPath' + 'barcode_types' => 'setBarcodeTypes', + 'file_base64' => 'setFileBase64', + 'recognition_mode' => 'setRecognitionMode', + 'recognition_image_kind' => 'setRecognitionImageKind' ]; /** @@ -102,11 +98,10 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'name' => 'getName', - 'is_folder' => 'getIsFolder', - 'modified_date' => 'getModifiedDate', - 'size' => 'getSize', - 'path' => 'getPath' + 'barcode_types' => 'getBarcodeTypes', + 'file_base64' => 'getFileBase64', + 'recognition_mode' => 'getRecognitionMode', + 'recognition_image_kind' => 'getRecognitionImageKind' ]; /** @@ -169,11 +164,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['is_folder'] = isset($data['is_folder']) ? $data['is_folder'] : null; - $this->container['modified_date'] = isset($data['modified_date']) ? $data['modified_date'] : null; - $this->container['size'] = isset($data['size']) ? $data['size'] : null; - $this->container['path'] = isset($data['path']) ? $data['path'] : null; + $this->container['barcode_types'] = isset($data['barcode_types']) ? $data['barcode_types'] : null; + $this->container['file_base64'] = isset($data['file_base64']) ? $data['file_base64'] : null; + $this->container['recognition_mode'] = isset($data['recognition_mode']) ? $data['recognition_mode'] : null; + $this->container['recognition_image_kind'] = isset($data['recognition_image_kind']) ? $data['recognition_image_kind'] : null; } /** @@ -185,12 +179,20 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['is_folder'] === null) { - $invalidProperties[] = "'is_folder' can't be null"; + if ($this->container['barcode_types'] === null) { + $invalidProperties[] = "'barcode_types' can't be null"; } - if ($this->container['size'] === null) { - $invalidProperties[] = "'size' can't be null"; + if ($this->container['file_base64'] === null) { + $invalidProperties[] = "'file_base64' can't be null"; } + if ((strlen($this->container['file_base64']) > 28730982)) { + $invalidProperties[] = "invalid value for 'file_base64', the character length must be smaller than or equal to 28730982."; + } + + if ((strlen($this->container['file_base64']) < 1)) { + $invalidProperties[] = "invalid value for 'file_base64', the character length must be bigger than or equal to 1."; + } + return $invalidProperties; } @@ -202,10 +204,16 @@ public function listInvalidProperties() */ public function valid() { - if ($this->container['is_folder'] === null) { + if ($this->container['barcode_types'] === null) { + return false; + } + if ($this->container['file_base64'] === null) { + return false; + } + if (strlen($this->container['file_base64']) > 28730982) { return false; } - if ($this->container['size'] === null) { + if (strlen($this->container['file_base64']) < 1) { return false; } return true; @@ -213,121 +221,104 @@ public function valid() /** - * Gets name + * Gets barcode_types * - * @return string + * @return \Aspose\BarCode\Model\DecodeBarcodeType[] */ - public function getName() + public function getBarcodeTypes() { - return $this->container['name']; + return $this->container['barcode_types']; } /** - * Sets name + * Sets barcode_types * - * @param string $name File or folder name. + * @param \Aspose\BarCode\Model\DecodeBarcodeType[] $barcode_types Array of decode types to find on barcode * * @return $this */ - public function setName($name) + public function setBarcodeTypes($barcode_types) { - $this->container['name'] = $name; + $this->container['barcode_types'] = $barcode_types; return $this; } /** - * Gets is_folder + * Gets file_base64 * - * @return bool + * @return string */ - public function getIsFolder() + public function getFileBase64() { - return $this->container['is_folder']; + return $this->container['file_base64']; } /** - * Sets is_folder + * Sets file_base64 * - * @param bool $is_folder True if it is a folder. + * @param string $file_base64 Barcode image bytes encoded as base-64. * * @return $this */ - public function setIsFolder($is_folder) - { - $this->container['is_folder'] = $is_folder; - - return $this; - } - - /** - * Gets modified_date - * - * @return \DateTime - */ - public function getModifiedDate() + public function setFileBase64($file_base64) { - return $this->container['modified_date']; - } + if ((strlen($file_base64) > 28730982)) { + throw new \InvalidArgumentException('invalid length for $file_base64 when calling RecognizeBase64Request., must be smaller than or equal to 28730982.'); + } + if ((strlen($file_base64) < 1)) { + throw new \InvalidArgumentException('invalid length for $file_base64 when calling RecognizeBase64Request., must be bigger than or equal to 1.'); + } - /** - * Sets modified_date - * - * @param \DateTime $modified_date File or folder last modified DateTime. - * - * @return $this - */ - public function setModifiedDate($modified_date) - { - $this->container['modified_date'] = $modified_date; + $this->container['file_base64'] = $file_base64; return $this; } /** - * Gets size + * Gets recognition_mode * - * @return int + * @return \Aspose\BarCode\Model\RecognitionMode */ - public function getSize() + public function getRecognitionMode() { - return $this->container['size']; + return $this->container['recognition_mode']; } /** - * Sets size + * Sets recognition_mode * - * @param int $size File or folder size. + * @param \Aspose\BarCode\Model\RecognitionMode $recognition_mode recognition_mode * * @return $this */ - public function setSize($size) + public function setRecognitionMode($recognition_mode) { - $this->container['size'] = $size; + $this->container['recognition_mode'] = $recognition_mode; return $this; } /** - * Gets path + * Gets recognition_image_kind * - * @return string + * @return \Aspose\BarCode\Model\RecognitionImageKind */ - public function getPath() + public function getRecognitionImageKind() { - return $this->container['path']; + return $this->container['recognition_image_kind']; } /** - * Sets path + * Sets recognition_image_kind * - * @param string $path File or folder path. + * @param \Aspose\BarCode\Model\RecognitionImageKind $recognition_image_kind recognition_image_kind * * @return $this */ - public function setPath($path) + public function setRecognitionImageKind($recognition_image_kind) { - $this->container['path'] = $path; + $this->container['recognition_image_kind'] = $recognition_image_kind; return $this; } diff --git a/src/Aspose/BarCode/Model/RegionPoint.php b/src/Aspose/BarCode/Model/RegionPoint.php index 3df691a..d289ac0 100644 --- a/src/Aspose/BarCode/Model/RegionPoint.php +++ b/src/Aspose/BarCode/Model/RegionPoint.php @@ -70,8 +70,8 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'x' => 'X', - 'y' => 'Y' + 'x' => 'x', + 'y' => 'y' ]; /** @@ -167,12 +167,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['x'] === null) { - $invalidProperties[] = "'x' can't be null"; - } - if ($this->container['y'] === null) { - $invalidProperties[] = "'y' can't be null"; - } return $invalidProperties; } @@ -184,12 +178,6 @@ public function listInvalidProperties() */ public function valid() { - if ($this->container['x'] === null) { - return false; - } - if ($this->container['y'] === null) { - return false; - } return true; } diff --git a/src/Aspose/BarCode/Model/ResultImageInfo.php b/src/Aspose/BarCode/Model/ResultImageInfo.php deleted file mode 100644 index cf103cc..0000000 --- a/src/Aspose/BarCode/Model/ResultImageInfo.php +++ /dev/null @@ -1,339 +0,0 @@ - 'int', - 'image_width' => 'int', - 'image_height' => 'int' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'file_size' => 'int64', - 'image_width' => 'int32', - 'image_height' => 'int32' - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'file_size' => 'FileSize', - 'image_width' => 'ImageWidth', - 'image_height' => 'ImageHeight' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'file_size' => 'setFileSize', - 'image_width' => 'setImageWidth', - 'image_height' => 'setImageHeight' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'file_size' => 'getFileSize', - 'image_width' => 'getImageWidth', - 'image_height' => 'getImageHeight' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['file_size'] = isset($data['file_size']) ? $data['file_size'] : null; - $this->container['image_width'] = isset($data['image_width']) ? $data['image_width'] : null; - $this->container['image_height'] = isset($data['image_height']) ? $data['image_height'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['file_size'] === null) { - $invalidProperties[] = "'file_size' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - if ($this->container['file_size'] === null) { - return false; - } - return true; - } - - - /** - * Gets file_size - * - * @return int - */ - public function getFileSize() - { - return $this->container['file_size']; - } - - /** - * Sets file_size - * - * @param int $file_size Result file size. - * - * @return $this - */ - public function setFileSize($file_size) - { - $this->container['file_size'] = $file_size; - - return $this; - } - - /** - * Gets image_width - * - * @return int - */ - public function getImageWidth() - { - return $this->container['image_width']; - } - - /** - * Sets image_width - * - * @param int $image_width Result image width. - * - * @return $this - */ - public function setImageWidth($image_width) - { - $this->container['image_width'] = $image_width; - - return $this; - } - - /** - * Gets image_height - * - * @return int - */ - public function getImageHeight() - { - return $this->container['image_height']; - } - - /** - * Sets image_height - * - * @param int $image_height Result image height. - * - * @return $this - */ - public function setImageHeight($image_height) - { - $this->container['image_height'] = $image_height; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/ErrorDetails.php b/src/Aspose/BarCode/Model/ScanBase64Request.php similarity index 77% rename from src/Aspose/BarCode/Model/ErrorDetails.php rename to src/Aspose/BarCode/Model/ScanBase64Request.php index 8920aaf..08f1e2e 100644 --- a/src/Aspose/BarCode/Model/ErrorDetails.php +++ b/src/Aspose/BarCode/Model/ScanBase64Request.php @@ -8,11 +8,11 @@ use Aspose\BarCode\ObjectSerializer; /** - * ErrorDetails + * ScanBase64Request * - * @description The error details + * @description Scan barcode request. */ -class ErrorDetails implements ArrayAccess +class ScanBase64Request implements ArrayAccess { public const DISCRIMINATOR = null; @@ -21,7 +21,7 @@ class ErrorDetails implements ArrayAccess * * @var string */ - protected static string $swaggerModelName = "ErrorDetails"; + protected static string $swaggerModelName = "ScanBase64Request"; /** * Array of property to type mappings. Used for (de)serialization @@ -29,8 +29,7 @@ class ErrorDetails implements ArrayAccess * @var string[] */ protected static array $swaggerTypes = [ - 'request_id' => 'string', - 'date' => '\DateTime' + 'file_base64' => 'string' ]; /** @@ -39,8 +38,7 @@ class ErrorDetails implements ArrayAccess * @var (string|null)[] */ protected static array $swaggerFormats = [ - 'request_id' => null, - 'date' => 'date-time' + 'file_base64' => null ]; /** @@ -70,8 +68,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'request_id' => 'RequestId', - 'date' => 'Date' + 'file_base64' => 'fileBase64' ]; /** @@ -80,8 +77,7 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'request_id' => 'setRequestId', - 'date' => 'setDate' + 'file_base64' => 'setFileBase64' ]; /** @@ -90,8 +86,7 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'request_id' => 'getRequestId', - 'date' => 'getDate' + 'file_base64' => 'getFileBase64' ]; /** @@ -154,8 +149,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['request_id'] = isset($data['request_id']) ? $data['request_id'] : null; - $this->container['date'] = isset($data['date']) ? $data['date'] : null; + $this->container['file_base64'] = isset($data['file_base64']) ? $data['file_base64'] : null; } /** @@ -167,9 +161,13 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['date'] === null) { - $invalidProperties[] = "'date' can't be null"; + if ($this->container['file_base64'] === null) { + $invalidProperties[] = "'file_base64' can't be null"; } + if ((strlen($this->container['file_base64']) < 1)) { + $invalidProperties[] = "invalid value for 'file_base64', the character length must be bigger than or equal to 1."; + } + return $invalidProperties; } @@ -181,7 +179,10 @@ public function listInvalidProperties() */ public function valid() { - if ($this->container['date'] === null) { + if ($this->container['file_base64'] === null) { + return false; + } + if (strlen($this->container['file_base64']) < 1) { return false; } return true; @@ -189,49 +190,30 @@ public function valid() /** - * Gets request_id + * Gets file_base64 * * @return string */ - public function getRequestId() + public function getFileBase64() { - return $this->container['request_id']; + return $this->container['file_base64']; } /** - * Sets request_id + * Sets file_base64 * - * @param string $request_id The request id + * @param string $file_base64 Barcode image bytes encoded as base-64. * * @return $this */ - public function setRequestId($request_id) + public function setFileBase64($file_base64) { - $this->container['request_id'] = $request_id; - - return $this; - } - /** - * Gets date - * - * @return \DateTime - */ - public function getDate() - { - return $this->container['date']; - } + if ((strlen($file_base64) < 1)) { + throw new \InvalidArgumentException('invalid length for $file_base64 when calling ScanBase64Request., must be bigger than or equal to 1.'); + } - /** - * Sets date - * - * @param \DateTime $date Date - * - * @return $this - */ - public function setDate($date) - { - $this->container['date'] = $date; + $this->container['file_base64'] = $file_base64; return $this; } diff --git a/src/Aspose/BarCode/Model/StorageExist.php b/src/Aspose/BarCode/Model/StorageExist.php deleted file mode 100644 index 4f8c43c..0000000 --- a/src/Aspose/BarCode/Model/StorageExist.php +++ /dev/null @@ -1,279 +0,0 @@ - 'bool' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'exists' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'exists' => 'Exists' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'exists' => 'setExists' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'exists' => 'getExists' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['exists'] = isset($data['exists']) ? $data['exists'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['exists'] === null) { - $invalidProperties[] = "'exists' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - if ($this->container['exists'] === null) { - return false; - } - return true; - } - - - /** - * Gets exists - * - * @return bool - */ - public function getExists() - { - return $this->container['exists']; - } - - /** - * Sets exists - * - * @param bool $exists Shows that the storage exists. - * - * @return $this - */ - public function setExists($exists) - { - $this->container['exists'] = $exists; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/StructuredAppend.php b/src/Aspose/BarCode/Model/StructuredAppend.php deleted file mode 100644 index ba88683..0000000 --- a/src/Aspose/BarCode/Model/StructuredAppend.php +++ /dev/null @@ -1,333 +0,0 @@ - 'int', - 'total_count' => 'int', - 'parity_byte' => 'int' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var (string|null)[] - */ - protected static array $swaggerFormats = [ - 'sequence_indicator' => 'int32', - 'total_count' => 'int32', - 'parity_byte' => 'byte' - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'sequence_indicator' => 'SequenceIndicator', - 'total_count' => 'TotalCount', - 'parity_byte' => 'ParityByte' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'sequence_indicator' => 'setSequenceIndicator', - 'total_count' => 'setTotalCount', - 'parity_byte' => 'setParityByte' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'sequence_indicator' => 'getSequenceIndicator', - 'total_count' => 'getTotalCount', - 'parity_byte' => 'getParityByte' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$swaggerModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['sequence_indicator'] = isset($data['sequence_indicator']) ? $data['sequence_indicator'] : null; - $this->container['total_count'] = isset($data['total_count']) ? $data['total_count'] : null; - $this->container['parity_byte'] = isset($data['parity_byte']) ? $data['parity_byte'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return true; - } - - - /** - * Gets sequence_indicator - * - * @return int - */ - public function getSequenceIndicator() - { - return $this->container['sequence_indicator']; - } - - /** - * Sets sequence_indicator - * - * @param int $sequence_indicator The index of the QR structured append mode barcode. Index starts from 0. - * - * @return $this - */ - public function setSequenceIndicator($sequence_indicator) - { - $this->container['sequence_indicator'] = $sequence_indicator; - - return $this; - } - - /** - * Gets total_count - * - * @return int - */ - public function getTotalCount() - { - return $this->container['total_count']; - } - - /** - * Sets total_count - * - * @param int $total_count QR structured append mode barcodes quantity. Max value is 16. - * - * @return $this - */ - public function setTotalCount($total_count) - { - $this->container['total_count'] = $total_count; - - return $this; - } - - /** - * Gets parity_byte - * - * @return int - */ - public function getParityByte() - { - return $this->container['parity_byte']; - } - - /** - * Sets parity_byte - * - * @param int $parity_byte QR structured append mode parity data. - * - * @return $this - */ - public function setParityByte($parity_byte) - { - $this->container['parity_byte'] = $parity_byte; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/src/Aspose/BarCode/Model/TextAlignment.php b/src/Aspose/BarCode/Model/TextAlignment.php deleted file mode 100644 index f88ac60..0000000 --- a/src/Aspose/BarCode/Model/TextAlignment.php +++ /dev/null @@ -1,31 +0,0 @@ - - /// Enum value Left - /// - public const Left = "Left"; - - /// - /// Enum value Center - /// - public const Center = "Center"; - - /// - /// Enum value Right - /// - public const Right = "Right"; - -} diff --git a/src/Aspose/BarCode/ObjectSerializer.php b/src/Aspose/BarCode/ObjectSerializer.php index e136432..e60e56c 100644 --- a/src/Aspose/BarCode/ObjectSerializer.php +++ b/src/Aspose/BarCode/ObjectSerializer.php @@ -211,9 +211,6 @@ public static function deserialize($data, string $class, array $httpHeaders = nu } return null; - } elseif (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { - settype($data, $class); - return $data; } elseif ($class === '\SplFileObject') { // \Psr\Http\Message\StreamInterface $data @@ -233,7 +230,11 @@ public static function deserialize($data, string $class, array $httpHeaders = nu fclose($file); return new SplFileObject($filename, 'r'); + } elseif (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; } else { + $data = is_string($data) ? json_decode($data) : $data; // If a discriminator is defined and points to a valid subclass, use it. $discriminator = $class::DISCRIMINATOR; if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { @@ -257,4 +258,64 @@ public static function deserialize($data, string $class, array $httpHeaders = nu return $instance; } } + + /** + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * The function is copied from https://github.com/guzzle/psr7/blob/a243f80a1ca7fe8ceed4deee17f12c1930efe662/src/Query.php#L59-L112 + * with a modification which is described in https://github.com/guzzle/psr7/pull/603 + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + */ + public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): string + { + if (!$params) { + return ''; + } + + if ($encoding === false) { + $encoder = function (string $str): string { + return $str; + }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $castBool = function ($v) { return $v ? 'true' : 'false'; }; + + $qs = ''; + foreach ($params as $k => $v) { + $k = $encoder((string) $k); + if (!is_array($v)) { + $qs .= $k; + $v = is_bool($v) ? $castBool($v) : $v; + if ($v !== null) { + $qs .= '='.$encoder((string) $v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + $vv = is_bool($vv) ? $castBool($vv) : $vv; + if ($vv !== null) { + $qs .= '='.$encoder((string) $vv); + } + $qs .= '&'; + } + } + } + + return $qs ? (string) substr($qs, 0, -1) : ''; + } } diff --git a/src/Aspose/BarCode/StorageApi.php b/src/Aspose/BarCode/RecognizeApi.php similarity index 60% rename from src/Aspose/BarCode/StorageApi.php rename to src/Aspose/BarCode/RecognizeApi.php index bd30dfd..86e49e7 100644 --- a/src/Aspose/BarCode/StorageApi.php +++ b/src/Aspose/BarCode/RecognizeApi.php @@ -3,7 +3,7 @@ declare(strict_types=1); /** * -------------------------------------------------------------------------------------------------------------------- - * + * * Copyright (c) 2025 Aspose Pty Ltd * * @@ -45,7 +45,7 @@ * Aspose.BarCode for Cloud API. */ -class StorageApi +class RecognizeApi { /** * Stores client instance @@ -88,49 +88,49 @@ public function getConfig() } /** - * Operation getDiscUsage + * Operation recognize * - * Get disc usage + * Recognize barcode from file on server using GET requests with parameters in route and query string. * - * @param Requests\GetDiscUsageRequest $request is a request object for operation + * @param Requests\RecognizeRequestWrapper $request is a request object for operation * * @throws ApiException on non-2xx response * @throws InvalidArgumentException - * @return \Aspose\BarCode\Model\DiscUsage + * @return \Aspose\BarCode\Model\BarcodeResponseList */ - public function getDiscUsage(Requests\GetDiscUsageRequest $request) + public function recognize(Requests\RecognizeRequestWrapper $request) { try { - list($response) = $this->getDiscUsageWithHttpInfo($request); + list($response) = $this->recognizeWithHttpInfo($request); return $response; } catch (RepeatRequestException $e) { - list($response) = $this->getDiscUsageWithHttpInfo($request); + list($response) = $this->recognizeWithHttpInfo($request); return $response; } } /** - * Operation getDiscUsageWithHttpInfo + * Operation recognizeWithHttpInfo * - * Get disc usage + * Recognize barcode from file on server using GET requests with parameters in route and query string. * - * @param Requests\GetDiscUsageRequest $request is a request object for operation + * @param Requests\RecognizeRequestWrapper $request is a request object for operation * * @throws ApiException on non-2xx response * @throws InvalidArgumentException - * @return array of \Aspose\BarCode\Model\DiscUsage, HTTP status code, HTTP response headers (array of strings) + * @return array of \Aspose\BarCode\Model\BarcodeResponseList, HTTP status code, HTTP response headers (array of strings) */ - public function getDiscUsageWithHttpInfo(Requests\GetDiscUsageRequest $request) + public function recognizeWithHttpInfo(Requests\RecognizeRequestWrapper $request) { - $returnType = '\Aspose\BarCode\Model\DiscUsage'; - $request = $this->GetDiscUsageRequest($request); + $returnType = '\Aspose\BarCode\Model\BarcodeResponseList'; + $request = $this->RecognizeRequestWrapper($request); try { $options = $this->_createHttpClientOption(); try { $response = $this->client->send($request, $options); } catch (RequestException $e) { - throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null); + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null); } $statusCode = $response->getStatusCode(); @@ -166,7 +166,15 @@ public function getDiscUsageWithHttpInfo(Requests\GetDiscUsageRequest $request) } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\DiscUsage', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\BarcodeResponseList', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ApiErrorResponse', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ApiErrorResponse', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -175,18 +183,18 @@ public function getDiscUsageWithHttpInfo(Requests\GetDiscUsageRequest $request) } /** - * Operation getDiscUsageAsync + * Operation recognizeAsync * - * Get disc usage + * Recognize barcode from file on server using GET requests with parameters in route and query string. * - * @param Requests\GetDiscUsageRequest $request is a request object for operation + * @param Requests\RecognizeRequestWrapper $request is a request object for operation * * @throws InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDiscUsageAsync(Requests\GetDiscUsageRequest $request) + public function recognizeAsync(Requests\RecognizeRequestWrapper $request) { - return $this->getDiscUsageAsyncWithHttpInfo($request) + return $this->recognizeAsyncWithHttpInfo($request) ->then( function ($response) { return $response[0]; @@ -195,19 +203,19 @@ function ($response) { } /** - * Operation getDiscUsageAsyncWithHttpInfo + * Operation recognizeAsyncWithHttpInfo * - * Get disc usage + * Recognize barcode from file on server using GET requests with parameters in route and query string. * - * @param Requests\GetDiscUsageRequest $request is a request object for operation + * @param Requests\RecognizeRequestWrapper $request is a request object for operation * * @throws InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDiscUsageAsyncWithHttpInfo(Requests\GetDiscUsageRequest $request) + public function recognizeAsyncWithHttpInfo(Requests\RecognizeRequestWrapper $request) { - $returnType = '\Aspose\BarCode\Model\DiscUsage'; - $request = $this->GetDiscUsageRequest($request); + $returnType = '\Aspose\BarCode\Model\BarcodeResponseList'; + $request = $this->RecognizeRequestWrapper($request); return $this->client ->sendAsync($request, $this->_createHttpClientOption()) @@ -253,274 +261,60 @@ function ($exception) { } /** - * Create request for operation 'getDiscUsage' + * Create request for operation 'recognize' * - * @param Requests\GetDiscUsageRequest $request is a request object for operation + * @param Requests\RecognizeRequestWrapper $request is a request object for operation * * @throws InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function GetDiscUsageRequest(Requests\GetDiscUsageRequest $request) + protected function RecognizeRequestWrapper(Requests\RecognizeRequestWrapper $request) { + // verify the required parameter 'barcode_type' is set + if (!isset($request->barcode_type)) { + throw new InvalidArgumentException('Missing the required parameter $barcode_type when calling recognize'); + } + // verify the required parameter 'file_url' is set + if (!isset($request->file_url)) { + throw new InvalidArgumentException('Missing the required parameter $file_url when calling recognize'); + } - $resourcePath = '/barcode/storage/disc'; + $resourcePath = '/barcode/recognize'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - if (isset($request->storage_name)) { - $queryParamName = lcfirst('storageName'); - $queryParamValue = is_bool($request->storage_name) ? ($request->storage_name ? 'true' : 'false') : $request->storage_name; + if (isset($request->barcode_type)) { + $queryParamName = lcfirst('barcodeType'); + $queryParamValue = is_bool($request->barcode_type) ? ($request->barcode_type ? 'true' : 'false') : $request->barcode_type; if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); } else { $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); } } - - $resourcePath = $this->_parseURL($resourcePath, $queryParams); - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } - - // for model (json/xml) - - if (!$this->config->getAccessToken()) { - $this->_requestToken(); - } - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['x-aspose-client'] = $this->config->getUserAgent(); - } - - $defaultHeaders['x-aspose-client-version'] = $this->config->getClientVersion(); - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $req = new Request( - 'GET', - $this->config->getHost() . $resourcePath, - $headers, - $httpBody - ); - if ($this->config->getDebug()) { - $this->_writeRequestLog('GET', $this->config->getHost() . $resourcePath, $headers, $httpBody); - } - - return $req; - } - - /** - * Operation getFileVersions - * - * Get file versions - * - * @param Requests\GetFileVersionsRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return \Aspose\BarCode\Model\FileVersions - */ - public function getFileVersions(Requests\GetFileVersionsRequest $request) - { - try { - list($response) = $this->getFileVersionsWithHttpInfo($request); - return $response; - } catch (RepeatRequestException $e) { - list($response) = $this->getFileVersionsWithHttpInfo($request); - return $response; - } - } - - /** - * Operation getFileVersionsWithHttpInfo - * - * Get file versions - * - * @param Requests\GetFileVersionsRequest $request is a request object for operation - * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException - * @return array of \Aspose\BarCode\Model\FileVersions, HTTP status code, HTTP response headers (array of strings) - */ - public function getFileVersionsWithHttpInfo(Requests\GetFileVersionsRequest $request) - { - $returnType = '\Aspose\BarCode\Model\FileVersions'; - $request = $this->GetFileVersionsRequest($request); - - try { - $options = $this->_createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - if ($statusCode === 401) { - $this->_requestToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody()); - } - - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if (isset($request->file_url)) { + $queryParamName = lcfirst('fileUrl'); + $queryParamValue = is_bool($request->file_url) ? ($request->file_url ? 'true' : 'false') : $request->file_url; + if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { + $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - if ($this->config->getDebug()) { - $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\FileVersions', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; + $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); } - throw $e; } - } - - /** - * Operation getFileVersionsAsync - * - * Get file versions - * - * @param Requests\GetFileVersionsRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getFileVersionsAsync(Requests\GetFileVersionsRequest $request) - { - return $this->getFileVersionsAsyncWithHttpInfo($request) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation getFileVersionsAsyncWithHttpInfo - * - * Get file versions - * - * @param Requests\GetFileVersionsRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getFileVersionsAsyncWithHttpInfo(Requests\GetFileVersionsRequest $request) - { - $returnType = '\Aspose\BarCode\Model\FileVersions'; - $request = $this->GetFileVersionsRequest($request); - - return $this->client - ->sendAsync($request, $this->_createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - if ($this->config->getDebug()) { - $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - - if ($exception instanceof RepeatRequestException) { - //$this->_refreshToken(); - throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); - } - - throw new ApiException( - sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'getFileVersions' - * - * @param Requests\GetFileVersionsRequest $request is a request object for operation - * - * @throws InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function GetFileVersionsRequest(Requests\GetFileVersionsRequest $request) - { - // verify the required parameter 'path' is set - if (!isset($request->path)) { - throw new InvalidArgumentException('Missing the required parameter $path when calling getFileVersions'); - } - - $resourcePath = '/barcode/storage/version/{path}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - if (isset($request->path)) { - $localName = lcfirst('path'); - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->path), $resourcePath); + if (isset($request->recognition_mode)) { + $queryParamName = lcfirst('recognitionMode'); + $queryParamValue = is_bool($request->recognition_mode) ? ($request->recognition_mode ? 'true' : 'false') : $request->recognition_mode; + if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { + $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); + } else { + $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); + } } - if (isset($request->storage_name)) { - $queryParamName = lcfirst('storageName'); - $queryParamValue = is_bool($request->storage_name) ? ($request->storage_name ? 'true' : 'false') : $request->storage_name; + if (isset($request->recognition_image_kind)) { + $queryParamName = lcfirst('recognitionImageKind'); + $queryParamValue = is_bool($request->recognition_image_kind) ? ($request->recognition_image_kind ? 'true' : 'false') : $request->recognition_image_kind; if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); } else { @@ -535,12 +329,12 @@ protected function GetFileVersionsRequest(Requests\GetFileVersionsRequest $reque if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/json', 'application/xml'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/json', 'application/xml'], + [] ); } @@ -578,49 +372,49 @@ protected function GetFileVersionsRequest(Requests\GetFileVersionsRequest $reque } /** - * Operation objectExists + * Operation recognizeBase64 * - * Check if file or folder exists + * Recognize barcode from file in request body using POST requests with parameters in body in json or xml format. * - * @param Requests\ObjectExistsRequest $request is a request object for operation + * @param Requests\RecognizeBase64RequestWrapper $request is a request object for operation * * @throws ApiException on non-2xx response * @throws InvalidArgumentException - * @return \Aspose\BarCode\Model\ObjectExist + * @return \Aspose\BarCode\Model\BarcodeResponseList */ - public function objectExists(Requests\ObjectExistsRequest $request) + public function recognizeBase64(Requests\RecognizeBase64RequestWrapper $request) { try { - list($response) = $this->objectExistsWithHttpInfo($request); + list($response) = $this->recognizeBase64WithHttpInfo($request); return $response; } catch (RepeatRequestException $e) { - list($response) = $this->objectExistsWithHttpInfo($request); + list($response) = $this->recognizeBase64WithHttpInfo($request); return $response; } } /** - * Operation objectExistsWithHttpInfo + * Operation recognizeBase64WithHttpInfo * - * Check if file or folder exists + * Recognize barcode from file in request body using POST requests with parameters in body in json or xml format. * - * @param Requests\ObjectExistsRequest $request is a request object for operation + * @param Requests\RecognizeBase64RequestWrapper $request is a request object for operation * * @throws ApiException on non-2xx response * @throws InvalidArgumentException - * @return array of \Aspose\BarCode\Model\ObjectExist, HTTP status code, HTTP response headers (array of strings) + * @return array of \Aspose\BarCode\Model\BarcodeResponseList, HTTP status code, HTTP response headers (array of strings) */ - public function objectExistsWithHttpInfo(Requests\ObjectExistsRequest $request) + public function recognizeBase64WithHttpInfo(Requests\RecognizeBase64RequestWrapper $request) { - $returnType = '\Aspose\BarCode\Model\ObjectExist'; - $request = $this->ObjectExistsRequest($request); + $returnType = '\Aspose\BarCode\Model\BarcodeResponseList'; + $request = $this->RecognizeBase64RequestWrapper($request); try { $options = $this->_createHttpClientOption(); try { $response = $this->client->send($request, $options); } catch (RequestException $e) { - throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null); + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null); } $statusCode = $response->getStatusCode(); @@ -656,7 +450,15 @@ public function objectExistsWithHttpInfo(Requests\ObjectExistsRequest $request) } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ObjectExist', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\BarcodeResponseList', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ApiErrorResponse', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ApiErrorResponse', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -665,18 +467,18 @@ public function objectExistsWithHttpInfo(Requests\ObjectExistsRequest $request) } /** - * Operation objectExistsAsync + * Operation recognizeBase64Async * - * Check if file or folder exists + * Recognize barcode from file in request body using POST requests with parameters in body in json or xml format. * - * @param Requests\ObjectExistsRequest $request is a request object for operation + * @param Requests\RecognizeBase64RequestWrapper $request is a request object for operation * * @throws InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function objectExistsAsync(Requests\ObjectExistsRequest $request) + public function recognizeBase64Async(Requests\RecognizeBase64RequestWrapper $request) { - return $this->objectExistsAsyncWithHttpInfo($request) + return $this->recognizeBase64AsyncWithHttpInfo($request) ->then( function ($response) { return $response[0]; @@ -685,19 +487,19 @@ function ($response) { } /** - * Operation objectExistsAsyncWithHttpInfo + * Operation recognizeBase64AsyncWithHttpInfo * - * Check if file or folder exists + * Recognize barcode from file in request body using POST requests with parameters in body in json or xml format. * - * @param Requests\ObjectExistsRequest $request is a request object for operation + * @param Requests\RecognizeBase64RequestWrapper $request is a request object for operation * * @throws InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function objectExistsAsyncWithHttpInfo(Requests\ObjectExistsRequest $request) + public function recognizeBase64AsyncWithHttpInfo(Requests\RecognizeBase64RequestWrapper $request) { - $returnType = '\Aspose\BarCode\Model\ObjectExist'; - $request = $this->ObjectExistsRequest($request); + $returnType = '\Aspose\BarCode\Model\BarcodeResponseList'; + $request = $this->RecognizeBase64RequestWrapper($request); return $this->client ->sendAsync($request, $this->_createHttpClientOption()) @@ -743,66 +545,57 @@ function ($exception) { } /** - * Create request for operation 'objectExists' + * Create request for operation 'recognizeBase64' * - * @param Requests\ObjectExistsRequest $request is a request object for operation + * @param Requests\RecognizeBase64RequestWrapper $request is a request object for operation * * @throws InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function ObjectExistsRequest(Requests\ObjectExistsRequest $request) + protected function RecognizeBase64RequestWrapper(Requests\RecognizeBase64RequestWrapper $request) { - // verify the required parameter 'path' is set - if (!isset($request->path)) { - throw new InvalidArgumentException('Missing the required parameter $path when calling objectExists'); + // verify the required parameter 'recognize_base64_request' is set + if (!isset($request->recognize_base64_request)) { + throw new InvalidArgumentException('Missing the required parameter $recognize_base64_request when calling recognizeBase64'); } - $resourcePath = '/barcode/storage/exist/{path}'; + $resourcePath = '/barcode/recognize-body'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - if (isset($request->path)) { - $localName = lcfirst('path'); - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->path), $resourcePath); - } - if (isset($request->storage_name)) { - $queryParamName = lcfirst('storageName'); - $queryParamValue = is_bool($request->storage_name) ? ($request->storage_name ? 'true' : 'false') : $request->storage_name; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } - if (isset($request->version_id)) { - $queryParamName = lcfirst('versionId'); - $queryParamValue = is_bool($request->version_id) ? ($request->version_id ? 'true' : 'false') : $request->version_id; - if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { - $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); - } else { - $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); - } - } $resourcePath = $this->_parseURL($resourcePath, $queryParams); // body params $_tempBody = null; + if (isset($request->recognize_base64_request)) { + if (is_string($request->recognize_base64_request)) { + $_tempBody = "\"" . $request->recognize_base64_request . "\""; + } else { + $_tempBody = $request->recognize_base64_request; + } + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/json', 'application/xml'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/json', 'application/xml'], + ['application/json', 'application/xml'] ); } // for model (json/xml) + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } if (!$this->config->getAccessToken()) { $this->_requestToken(); @@ -823,62 +616,62 @@ protected function ObjectExistsRequest(Requests\ObjectExistsRequest $request) ); $req = new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath, $headers, $httpBody ); if ($this->config->getDebug()) { - $this->_writeRequestLog('GET', $this->config->getHost() . $resourcePath, $headers, $httpBody); + $this->_writeRequestLog('POST', $this->config->getHost() . $resourcePath, $headers, $httpBody); } return $req; } /** - * Operation storageExists + * Operation recognizeMultipart * - * Check if storage exists + * Recognize barcode from file in request body using POST requests with parameters in multipart form. * - * @param Requests\StorageExistsRequest $request is a request object for operation + * @param Requests\RecognizeMultipartRequestWrapper $request is a request object for operation * * @throws ApiException on non-2xx response * @throws InvalidArgumentException - * @return \Aspose\BarCode\Model\StorageExist + * @return \Aspose\BarCode\Model\BarcodeResponseList */ - public function storageExists(Requests\StorageExistsRequest $request) + public function recognizeMultipart(Requests\RecognizeMultipartRequestWrapper $request) { try { - list($response) = $this->storageExistsWithHttpInfo($request); + list($response) = $this->recognizeMultipartWithHttpInfo($request); return $response; } catch (RepeatRequestException $e) { - list($response) = $this->storageExistsWithHttpInfo($request); + list($response) = $this->recognizeMultipartWithHttpInfo($request); return $response; } } /** - * Operation storageExistsWithHttpInfo + * Operation recognizeMultipartWithHttpInfo * - * Check if storage exists + * Recognize barcode from file in request body using POST requests with parameters in multipart form. * - * @param Requests\StorageExistsRequest $request is a request object for operation + * @param Requests\RecognizeMultipartRequestWrapper $request is a request object for operation * * @throws ApiException on non-2xx response * @throws InvalidArgumentException - * @return array of \Aspose\BarCode\Model\StorageExist, HTTP status code, HTTP response headers (array of strings) + * @return array of \Aspose\BarCode\Model\BarcodeResponseList, HTTP status code, HTTP response headers (array of strings) */ - public function storageExistsWithHttpInfo(Requests\StorageExistsRequest $request) + public function recognizeMultipartWithHttpInfo(Requests\RecognizeMultipartRequestWrapper $request) { - $returnType = '\Aspose\BarCode\Model\StorageExist'; - $request = $this->StorageExistsRequest($request); + $returnType = '\Aspose\BarCode\Model\BarcodeResponseList'; + $request = $this->RecognizeMultipartRequestWrapper($request); try { $options = $this->_createHttpClientOption(); try { $response = $this->client->send($request, $options); } catch (RequestException $e) { - throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null); + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null); } $statusCode = $response->getStatusCode(); @@ -914,7 +707,15 @@ public function storageExistsWithHttpInfo(Requests\StorageExistsRequest $request } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\StorageExist', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\BarcodeResponseList', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ApiErrorResponse', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ApiErrorResponse', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -923,18 +724,18 @@ public function storageExistsWithHttpInfo(Requests\StorageExistsRequest $request } /** - * Operation storageExistsAsync + * Operation recognizeMultipartAsync * - * Check if storage exists + * Recognize barcode from file in request body using POST requests with parameters in multipart form. * - * @param Requests\StorageExistsRequest $request is a request object for operation + * @param Requests\RecognizeMultipartRequestWrapper $request is a request object for operation * * @throws InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function storageExistsAsync(Requests\StorageExistsRequest $request) + public function recognizeMultipartAsync(Requests\RecognizeMultipartRequestWrapper $request) { - return $this->storageExistsAsyncWithHttpInfo($request) + return $this->recognizeMultipartAsyncWithHttpInfo($request) ->then( function ($response) { return $response[0]; @@ -943,19 +744,19 @@ function ($response) { } /** - * Operation storageExistsAsyncWithHttpInfo + * Operation recognizeMultipartAsyncWithHttpInfo * - * Check if storage exists + * Recognize barcode from file in request body using POST requests with parameters in multipart form. * - * @param Requests\StorageExistsRequest $request is a request object for operation + * @param Requests\RecognizeMultipartRequestWrapper $request is a request object for operation * * @throws InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function storageExistsAsyncWithHttpInfo(Requests\StorageExistsRequest $request) + public function recognizeMultipartAsyncWithHttpInfo(Requests\RecognizeMultipartRequestWrapper $request) { - $returnType = '\Aspose\BarCode\Model\StorageExist'; - $request = $this->StorageExistsRequest($request); + $returnType = '\Aspose\BarCode\Model\BarcodeResponseList'; + $request = $this->RecognizeMultipartRequestWrapper($request); return $this->client ->sendAsync($request, $this->_createHttpClientOption()) @@ -1001,49 +802,83 @@ function ($exception) { } /** - * Create request for operation 'storageExists' + * Create request for operation 'recognizeMultipart' * - * @param Requests\StorageExistsRequest $request is a request object for operation + * @param Requests\RecognizeMultipartRequestWrapper $request is a request object for operation * * @throws InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function StorageExistsRequest(Requests\StorageExistsRequest $request) + protected function RecognizeMultipartRequestWrapper(Requests\RecognizeMultipartRequestWrapper $request) { - // verify the required parameter 'storage_name' is set - if (!isset($request->storage_name)) { - throw new InvalidArgumentException('Missing the required parameter $storage_name when calling storageExists'); + // verify the required parameter 'barcode_type' is set + if (!isset($request->barcode_type)) { + throw new InvalidArgumentException('Missing the required parameter $barcode_type when calling recognizeMultipart'); + } + // verify the required parameter 'file' is set + if (!isset($request->file)) { + throw new InvalidArgumentException('Missing the required parameter $file when calling recognizeMultipart'); } - $resourcePath = '/barcode/storage/{storageName}/exist'; + $resourcePath = '/barcode/recognize-multipart'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - if (isset($request->storage_name)) { - $localName = lcfirst('storageName'); - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->storage_name), $resourcePath); - } $resourcePath = $this->_parseURL($resourcePath, $queryParams); + $multipart = true; + // form params + if (isset($request->barcode_type)) { + $formParams['barcodeType'][] = ObjectSerializer::toFormValue($request->barcode_type); + } + + $filename = ObjectSerializer::toFormValue($request->file); + $handle = fopen($filename, 'rb'); + $fsize = filesize($filename); + $contents = fread($handle, $fsize); + $formParams['file'][] = $contents; + + if (isset($request->recognition_mode)) { + $formParams['recognitionMode'][] = ObjectSerializer::toFormValue($request->recognition_mode); + } + + if (isset($request->recognition_image_kind)) { + $formParams['recognitionImageKind'][] = ObjectSerializer::toFormValue($request->recognition_image_kind); + } // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/json', 'application/xml'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/json', 'application/xml'], + ['multipart/form-data'] ); } // for model (json/xml) + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValues) { + foreach ($formParamValues as $formParamValue) { + $multipartFileName = str_contains($formParamName, 'file') ? $filename : ''; + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue, + 'filename' => $multipartFileName + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + if (!$this->config->getAccessToken()) { $this->_requestToken(); } @@ -1063,13 +898,13 @@ protected function StorageExistsRequest(Requests\StorageExistsRequest $request) ); $req = new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath, $headers, $httpBody ); if ($this->config->getDebug()) { - $this->_writeRequestLog('GET', $this->config->getHost() . $resourcePath, $headers, $httpBody); + $this->_writeRequestLog('POST', $this->config->getHost() . $resourcePath, $headers, $httpBody); } return $req; @@ -1118,7 +953,8 @@ private function _writeRequestLog($method, $url, $headers, $body) private function _writeHeadersAndBody($logInfo, $headers, $body) { foreach ($headers as $name => $value) { - $logInfo .= $name . ': ' . $value . '\n'; + $strValue = is_array($value) ? implode($value) : $value; + $logInfo .= $name . ': ' . $strValue . '\n'; } return $logInfo .= 'Body: ' . $body . '\n'; diff --git a/src/Aspose/BarCode/Requests/CopyFileRequest.php b/src/Aspose/BarCode/Requests/CopyFileRequest.php deleted file mode 100644 index 2f1948e..0000000 --- a/src/Aspose/BarCode/Requests/CopyFileRequest.php +++ /dev/null @@ -1,62 +0,0 @@ - - * Copyright (c) 2025 Aspose Pty Ltd - * - * -------------------------------------------------------------------------------------------------------------------- - */ - -declare(strict_types=1); - -namespace Aspose\BarCode\Requests; - -/** - * Request model for "copyFile" operation. - */ -class CopyFileRequest -{ - /** - * Initializes a new instance of the CopyFileRequest class. - * - * @param string $src_path Source file path e.g. '/folder/file.ext' - * @param string $dest_path Destination file path - * @param string $src_storage_name Source storage name - * @param string $dest_storage_name Destination storage name - * @param string $version_id File version ID to copy - */ - public function __construct($src_path, $dest_path, $src_storage_name = null, $dest_storage_name = null, $version_id = null) - { - $this->src_path = $src_path; - $this->dest_path = $dest_path; - $this->src_storage_name = $src_storage_name; - $this->dest_storage_name = $dest_storage_name; - $this->version_id = $version_id; - } - - /** - * Source file path e.g. '/folder/file.ext' - */ - public $src_path; - - /** - * Destination file path - */ - public $dest_path; - - /** - * Source storage name - */ - public $src_storage_name; - - /** - * Destination storage name - */ - public $dest_storage_name; - - /** - * File version ID to copy - */ - public $version_id; -} diff --git a/src/Aspose/BarCode/Requests/CopyFolderRequest.php b/src/Aspose/BarCode/Requests/CopyFolderRequest.php deleted file mode 100644 index 32bd608..0000000 --- a/src/Aspose/BarCode/Requests/CopyFolderRequest.php +++ /dev/null @@ -1,55 +0,0 @@ - - * Copyright (c) 2025 Aspose Pty Ltd - * - * -------------------------------------------------------------------------------------------------------------------- - */ - -declare(strict_types=1); - -namespace Aspose\BarCode\Requests; - -/** - * Request model for "copyFolder" operation. - */ -class CopyFolderRequest -{ - /** - * Initializes a new instance of the CopyFolderRequest class. - * - * @param string $src_path Source folder path e.g. '/src' - * @param string $dest_path Destination folder path e.g. '/dst' - * @param string $src_storage_name Source storage name - * @param string $dest_storage_name Destination storage name - */ - public function __construct($src_path, $dest_path, $src_storage_name = null, $dest_storage_name = null) - { - $this->src_path = $src_path; - $this->dest_path = $dest_path; - $this->src_storage_name = $src_storage_name; - $this->dest_storage_name = $dest_storage_name; - } - - /** - * Source folder path e.g. '/src' - */ - public $src_path; - - /** - * Destination folder path e.g. '/dst' - */ - public $dest_path; - - /** - * Source storage name - */ - public $src_storage_name; - - /** - * Destination storage name - */ - public $dest_storage_name; -} diff --git a/src/Aspose/BarCode/Requests/CreateFolderRequest.php b/src/Aspose/BarCode/Requests/CreateFolderRequest.php deleted file mode 100644 index a554761..0000000 --- a/src/Aspose/BarCode/Requests/CreateFolderRequest.php +++ /dev/null @@ -1,41 +0,0 @@ - - * Copyright (c) 2025 Aspose Pty Ltd - * - * -------------------------------------------------------------------------------------------------------------------- - */ - -declare(strict_types=1); - -namespace Aspose\BarCode\Requests; - -/** - * Request model for "createFolder" operation. - */ -class CreateFolderRequest -{ - /** - * Initializes a new instance of the CreateFolderRequest class. - * - * @param string $path Folder path to create e.g. 'folder_1/folder_2/' - * @param string $storage_name Storage name - */ - public function __construct($path, $storage_name = null) - { - $this->path = $path; - $this->storage_name = $storage_name; - } - - /** - * Folder path to create e.g. 'folder_1/folder_2/' - */ - public $path; - - /** - * Storage name - */ - public $storage_name; -} diff --git a/src/Aspose/BarCode/Requests/DeleteFileRequest.php b/src/Aspose/BarCode/Requests/DeleteFileRequest.php deleted file mode 100644 index c453db8..0000000 --- a/src/Aspose/BarCode/Requests/DeleteFileRequest.php +++ /dev/null @@ -1,48 +0,0 @@ - - * Copyright (c) 2025 Aspose Pty Ltd - * - * -------------------------------------------------------------------------------------------------------------------- - */ - -declare(strict_types=1); - -namespace Aspose\BarCode\Requests; - -/** - * Request model for "deleteFile" operation. - */ -class DeleteFileRequest -{ - /** - * Initializes a new instance of the DeleteFileRequest class. - * - * @param string $path File path e.g. '/folder/file.ext' - * @param string $storage_name Storage name - * @param string $version_id File version ID to delete - */ - public function __construct($path, $storage_name = null, $version_id = null) - { - $this->path = $path; - $this->storage_name = $storage_name; - $this->version_id = $version_id; - } - - /** - * File path e.g. '/folder/file.ext' - */ - public $path; - - /** - * Storage name - */ - public $storage_name; - - /** - * File version ID to delete - */ - public $version_id; -} diff --git a/src/Aspose/BarCode/Requests/DeleteFolderRequest.php b/src/Aspose/BarCode/Requests/DeleteFolderRequest.php deleted file mode 100644 index ac2c22a..0000000 --- a/src/Aspose/BarCode/Requests/DeleteFolderRequest.php +++ /dev/null @@ -1,48 +0,0 @@ - - * Copyright (c) 2025 Aspose Pty Ltd - * - * -------------------------------------------------------------------------------------------------------------------- - */ - -declare(strict_types=1); - -namespace Aspose\BarCode\Requests; - -/** - * Request model for "deleteFolder" operation. - */ -class DeleteFolderRequest -{ - /** - * Initializes a new instance of the DeleteFolderRequest class. - * - * @param string $path Folder path e.g. '/folder' - * @param string $storage_name Storage name - * @param bool $recursive Enable to delete folders, subfolders and files - */ - public function __construct($path, $storage_name = null, $recursive = null) - { - $this->path = $path; - $this->storage_name = $storage_name; - $this->recursive = $recursive; - } - - /** - * Folder path e.g. '/folder' - */ - public $path; - - /** - * Storage name - */ - public $storage_name; - - /** - * Enable to delete folders, subfolders and files - */ - public $recursive; -} diff --git a/src/Aspose/BarCode/Requests/DownloadFileRequest.php b/src/Aspose/BarCode/Requests/DownloadFileRequest.php deleted file mode 100644 index b156a19..0000000 --- a/src/Aspose/BarCode/Requests/DownloadFileRequest.php +++ /dev/null @@ -1,48 +0,0 @@ - - * Copyright (c) 2025 Aspose Pty Ltd - * - * -------------------------------------------------------------------------------------------------------------------- - */ - -declare(strict_types=1); - -namespace Aspose\BarCode\Requests; - -/** - * Request model for "downloadFile" operation. - */ -class DownloadFileRequest -{ - /** - * Initializes a new instance of the DownloadFileRequest class. - * - * @param string $path File path e.g. '/folder/file.ext' - * @param string $storage_name Storage name - * @param string $version_id File version ID to download - */ - public function __construct($path, $storage_name = null, $version_id = null) - { - $this->path = $path; - $this->storage_name = $storage_name; - $this->version_id = $version_id; - } - - /** - * File path e.g. '/folder/file.ext' - */ - public $path; - - /** - * Storage name - */ - public $storage_name; - - /** - * File version ID to download - */ - public $version_id; -} diff --git a/src/Aspose/BarCode/Requests/GenerateBodyRequestWrapper.php b/src/Aspose/BarCode/Requests/GenerateBodyRequestWrapper.php new file mode 100644 index 0000000..7c10852 --- /dev/null +++ b/src/Aspose/BarCode/Requests/GenerateBodyRequestWrapper.php @@ -0,0 +1,34 @@ + + * Copyright (c) 2025 Aspose Pty Ltd + * + * -------------------------------------------------------------------------------------------------------------------- + */ + +declare(strict_types=1); + +namespace Aspose\BarCode\Requests; + +/** + * Request model for "generateBody" operation. + */ +class GenerateBodyRequestWrapper +{ + /** + * Initializes a new instance of the GenerateBodyRequestWrapper class. + * + * @param \Aspose\BarCode\Model\GenerateParams $generate_params Parameters of generation + */ + public function __construct($generate_params) + { + $this->generate_params = $generate_params; + } + + /** + * Parameters of generation + */ + public $generate_params; +} diff --git a/src/Aspose/BarCode/Requests/GenerateMultipartRequestWrapper.php b/src/Aspose/BarCode/Requests/GenerateMultipartRequestWrapper.php new file mode 100644 index 0000000..c165490 --- /dev/null +++ b/src/Aspose/BarCode/Requests/GenerateMultipartRequestWrapper.php @@ -0,0 +1,111 @@ + + * Copyright (c) 2025 Aspose Pty Ltd + * + * -------------------------------------------------------------------------------------------------------------------- + */ + +declare(strict_types=1); + +namespace Aspose\BarCode\Requests; + +/** + * Request model for "generateMultipart" operation. + */ +class GenerateMultipartRequestWrapper +{ + /** + * Initializes a new instance of the GenerateMultipartRequestWrapper class. + * + * @param \Aspose\BarCode\Model\EncodeBarcodeType $barcode_type + * @param string $data String represents data to encode + * @param \Aspose\BarCode\Model\EncodeDataType $data_type + * @param \Aspose\BarCode\Model\BarcodeImageFormat $image_format + * @param \Aspose\BarCode\Model\CodeLocation $text_location + * @param string $foreground_color Specify the displaying bars and content Color. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: Black. + * @param string $background_color Background color of the barcode image. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: White. + * @param \Aspose\BarCode\Model\GraphicsUnit $units + * @param float $resolution Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. Decimal separator is dot. + * @param float $image_height Height of the barcode image in given units. Default units: pixel. Decimal separator is dot. + * @param float $image_width Width of the barcode image in given units. Default units: pixel. Decimal separator is dot. + * @param int $rotation_angle BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0. + */ + public function __construct($barcode_type, $data, $data_type = null, $image_format = null, $text_location = null, $foreground_color = null, $background_color = null, $units = null, $resolution = null, $image_height = null, $image_width = null, $rotation_angle = null) + { + $this->barcode_type = $barcode_type; + $this->data = $data; + $this->data_type = $data_type; + $this->image_format = $image_format; + $this->text_location = $text_location; + $this->foreground_color = $foreground_color; + $this->background_color = $background_color; + $this->units = $units; + $this->resolution = $resolution; + $this->image_height = $image_height; + $this->image_width = $image_width; + $this->rotation_angle = $rotation_angle; + } + + /** + * Gets or sets barcode_type + */ + public $barcode_type; + + /** + * String represents data to encode + */ + public $data; + + /** + * Gets or sets data_type + */ + public $data_type; + + /** + * Gets or sets image_format + */ + public $image_format; + + /** + * Gets or sets text_location + */ + public $text_location; + + /** + * Specify the displaying bars and content Color. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: Black. + */ + public $foreground_color; + + /** + * Background color of the barcode image. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: White. + */ + public $background_color; + + /** + * Gets or sets units + */ + public $units; + + /** + * Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. Decimal separator is dot. + */ + public $resolution; + + /** + * Height of the barcode image in given units. Default units: pixel. Decimal separator is dot. + */ + public $image_height; + + /** + * Width of the barcode image in given units. Default units: pixel. Decimal separator is dot. + */ + public $image_width; + + /** + * BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0. + */ + public $rotation_angle; +} diff --git a/src/Aspose/BarCode/Requests/GenerateRequestWrapper.php b/src/Aspose/BarCode/Requests/GenerateRequestWrapper.php new file mode 100644 index 0000000..f1e5461 --- /dev/null +++ b/src/Aspose/BarCode/Requests/GenerateRequestWrapper.php @@ -0,0 +1,111 @@ + + * Copyright (c) 2025 Aspose Pty Ltd + * + * -------------------------------------------------------------------------------------------------------------------- + */ + +declare(strict_types=1); + +namespace Aspose\BarCode\Requests; + +/** + * Request model for "generate" operation. + */ +class GenerateRequestWrapper +{ + /** + * Initializes a new instance of the GenerateRequestWrapper class. + * + * @param \Aspose\BarCode\Model\EncodeBarcodeType $barcode_type Type of barcode to generate. + * @param string $data String represents data to encode + * @param \Aspose\BarCode\Model\EncodeDataType $data_type Type of data to encode. Default value: StringData. + * @param \Aspose\BarCode\Model\BarcodeImageFormat $image_format Barcode output image format. Default value: png + * @param \Aspose\BarCode\Model\CodeLocation $text_location Specify the displaying Text Location, set to CodeLocation.None to hide CodeText. Default value: CodeLocation.Below. + * @param string $foreground_color Specify the displaying bars and content Color. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: Black. + * @param string $background_color Background color of the barcode image. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: White. + * @param \Aspose\BarCode\Model\GraphicsUnit $units Common Units for all measuring in query. Default units: pixel. + * @param float $resolution Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. Decimal separator is dot. + * @param float $image_height Height of the barcode image in given units. Default units: pixel. Decimal separator is dot. + * @param float $image_width Width of the barcode image in given units. Default units: pixel. Decimal separator is dot. + * @param int $rotation_angle BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0. + */ + public function __construct($barcode_type, $data, $data_type = null, $image_format = null, $text_location = null, $foreground_color = null, $background_color = null, $units = null, $resolution = null, $image_height = null, $image_width = null, $rotation_angle = null) + { + $this->barcode_type = $barcode_type; + $this->data = $data; + $this->data_type = $data_type; + $this->image_format = $image_format; + $this->text_location = $text_location; + $this->foreground_color = $foreground_color; + $this->background_color = $background_color; + $this->units = $units; + $this->resolution = $resolution; + $this->image_height = $image_height; + $this->image_width = $image_width; + $this->rotation_angle = $rotation_angle; + } + + /** + * Type of barcode to generate. + */ + public $barcode_type; + + /** + * String represents data to encode + */ + public $data; + + /** + * Type of data to encode. Default value: StringData. + */ + public $data_type; + + /** + * Barcode output image format. Default value: png + */ + public $image_format; + + /** + * Specify the displaying Text Location, set to CodeLocation.None to hide CodeText. Default value: CodeLocation.Below. + */ + public $text_location; + + /** + * Specify the displaying bars and content Color. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: Black. + */ + public $foreground_color; + + /** + * Background color of the barcode image. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: White. + */ + public $background_color; + + /** + * Common Units for all measuring in query. Default units: pixel. + */ + public $units; + + /** + * Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. Decimal separator is dot. + */ + public $resolution; + + /** + * Height of the barcode image in given units. Default units: pixel. Decimal separator is dot. + */ + public $image_height; + + /** + * Width of the barcode image in given units. Default units: pixel. Decimal separator is dot. + */ + public $image_width; + + /** + * BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0. + */ + public $rotation_angle; +} diff --git a/src/Aspose/BarCode/Requests/GetBarcodeGenerateRequest.php b/src/Aspose/BarCode/Requests/GetBarcodeGenerateRequest.php deleted file mode 100644 index 1da2a4a..0000000 --- a/src/Aspose/BarCode/Requests/GetBarcodeGenerateRequest.php +++ /dev/null @@ -1,272 +0,0 @@ - - * Copyright (c) 2025 Aspose Pty Ltd - * - * -------------------------------------------------------------------------------------------------------------------- - */ - -declare(strict_types=1); - -namespace Aspose\BarCode\Requests; - -/** - * Request model for "getBarcodeGenerate" operation. - */ -class GetBarcodeGenerateRequest -{ - /** - * Initializes a new instance of the GetBarcodeGenerateRequest class. - * - * @param string $type Type of barcode to generate. - * @param string $text Text to encode. - * @param string $two_d_display_text Text that will be displayed instead of codetext in 2D barcodes. Used for: Aztec, Pdf417, DataMatrix, QR, MaxiCode, DotCode - * @param string $text_location Specify the displaying Text Location, set to CodeLocation.None to hide CodeText. Default value: CodeLocation.Below. - * @param string $text_alignment Text alignment. - * @param string $text_color Specify the displaying CodeText's Color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF - * @param bool $no_wrap Specify word wraps (line breaks) within text. Default value: false. - * @param double $resolution Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. - * @param double $resolution_x DEPRECATED: Use 'Resolution' instead. - * @param double $resolution_y DEPRECATED: Use 'Resolution' instead. - * @param double $dimension_x The smallest width of the unit of BarCode bars or spaces. Increase this will increase the whole barcode image width. Ignored if AutoSizeMode property is set to AutoSizeMode.Nearest or AutoSizeMode.Interpolation. - * @param double $text_space Space between the CodeText and the BarCode in Unit value. Default value: 2pt. Ignored for EAN8, EAN13, UPCE, UPCA, ISBN, ISMN, ISSN, UpcaGs1DatabarCoupon. - * @param string $units Common Units for all measuring in query. Default units: pixel. - * @param string $size_mode Specifies the different types of automatic sizing modes. Default value: AutoSizeMode.None. - * @param double $bar_height Height of the barcode in given units. Default units: pixel. - * @param double $image_height Height of the barcode image in given units. Default units: pixel. - * @param double $image_width Width of the barcode image in given units. Default units: pixel. - * @param double $rotation_angle BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0. - * @param string $back_color Background color of the barcode image. Default value: white. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF - * @param string $bar_color Bars color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF - * @param string $border_color Border color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF - * @param double $border_width Border width. Default value: 0. Ignored if Visible is set to false. - * @param string $border_dash_style Border dash style. Default value: BorderDashStyle.Solid. - * @param bool $border_visible Border visibility. If false than parameter Width is always ignored (0). Default value: false. - * @param string $enable_checksum Enable checksum during generation 1D barcodes. Default is treated as Yes for symbology which must contain checksum, as No where checksum only possible. Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN, Codabar Checksum always used: Rest symbology - * @param bool $enable_escape Indicates whether explains the character \"\\\" as an escape character in CodeText property. Used for Pdf417, DataMatrix, Code128 only If the EnableEscape is true, \"\\\" will be explained as a special escape character. Otherwise, \"\\\" acts as normal characters. Aspose.BarCode supports input decimal ascii code and mnemonic for ASCII control-code characters. For example, \\013 and \\\\CR stands for CR. - * @param bool $filled_bars Value indicating whether bars are filled. Only for 1D barcodes. Default value: true. - * @param bool $always_show_checksum Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes. - * @param double $wide_narrow_ratio Wide bars to Narrow bars ratio. Default value: 3, that is, wide bars are 3 times as wide as narrow bars. Used for ITF, PZN, PharmaCode, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, IATA2of5, VIN, DeutschePost, OPC, Code32, DataLogic2of5, PatchCode, Code39Extended, Code39Standard - * @param bool $validate_text Only for 1D barcodes. If codetext is incorrect and value set to true - exception will be thrown. Otherwise codetext will be corrected to match barcode's specification. Exception always will be thrown for: Databar symbology if codetext is incorrect. Exception always will not be thrown for: AustraliaPost, SingaporePost, Code39Extended, Code93Extended, Code16K, Code128 symbology if codetext is incorrect. - * @param string $supplement_data Supplement parameters. Used for Interleaved2of5, Standard2of5, EAN13, EAN8, UPCA, UPCE, ISBN, ISSN, ISMN. - * @param double $supplement_space Space between main the BarCode and supplement BarCode. - * @param double $bar_width_reduction Bars reduction value that is used to compensate ink spread while printing. - * @param bool $use_anti_alias Indicates whether is used anti-aliasing mode to render image. Anti-aliasing mode is applied to barcode and text drawing. - * @param string $format Result image format. - */ - public function __construct($type, $text, $two_d_display_text = null, $text_location = null, $text_alignment = null, $text_color = null, $no_wrap = null, $resolution = null, $resolution_x = null, $resolution_y = null, $dimension_x = null, $text_space = null, $units = null, $size_mode = null, $bar_height = null, $image_height = null, $image_width = null, $rotation_angle = null, $back_color = null, $bar_color = null, $border_color = null, $border_width = null, $border_dash_style = null, $border_visible = null, $enable_checksum = null, $enable_escape = null, $filled_bars = null, $always_show_checksum = null, $wide_narrow_ratio = null, $validate_text = null, $supplement_data = null, $supplement_space = null, $bar_width_reduction = null, $use_anti_alias = null, $format = null) - { - $this->type = $type; - $this->text = $text; - $this->two_d_display_text = $two_d_display_text; - $this->text_location = $text_location; - $this->text_alignment = $text_alignment; - $this->text_color = $text_color; - $this->no_wrap = $no_wrap; - $this->resolution = $resolution; - $this->resolution_x = $resolution_x; - $this->resolution_y = $resolution_y; - $this->dimension_x = $dimension_x; - $this->text_space = $text_space; - $this->units = $units; - $this->size_mode = $size_mode; - $this->bar_height = $bar_height; - $this->image_height = $image_height; - $this->image_width = $image_width; - $this->rotation_angle = $rotation_angle; - $this->back_color = $back_color; - $this->bar_color = $bar_color; - $this->border_color = $border_color; - $this->border_width = $border_width; - $this->border_dash_style = $border_dash_style; - $this->border_visible = $border_visible; - $this->enable_checksum = $enable_checksum; - $this->enable_escape = $enable_escape; - $this->filled_bars = $filled_bars; - $this->always_show_checksum = $always_show_checksum; - $this->wide_narrow_ratio = $wide_narrow_ratio; - $this->validate_text = $validate_text; - $this->supplement_data = $supplement_data; - $this->supplement_space = $supplement_space; - $this->bar_width_reduction = $bar_width_reduction; - $this->use_anti_alias = $use_anti_alias; - $this->format = $format; - } - - /** - * Type of barcode to generate. - */ - public $type; - - /** - * Text to encode. - */ - public $text; - - /** - * Text that will be displayed instead of codetext in 2D barcodes. Used for: Aztec, Pdf417, DataMatrix, QR, MaxiCode, DotCode - */ - public $two_d_display_text; - - /** - * Specify the displaying Text Location, set to CodeLocation.None to hide CodeText. Default value: CodeLocation.Below. - */ - public $text_location; - - /** - * Text alignment. - */ - public $text_alignment; - - /** - * Specify the displaying CodeText's Color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF - */ - public $text_color; - - /** - * Specify word wraps (line breaks) within text. Default value: false. - */ - public $no_wrap; - - /** - * Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. - */ - public $resolution; - - /** - * DEPRECATED: Use 'Resolution' instead. - */ - public $resolution_x; - - /** - * DEPRECATED: Use 'Resolution' instead. - */ - public $resolution_y; - - /** - * The smallest width of the unit of BarCode bars or spaces. Increase this will increase the whole barcode image width. Ignored if AutoSizeMode property is set to AutoSizeMode.Nearest or AutoSizeMode.Interpolation. - */ - public $dimension_x; - - /** - * Space between the CodeText and the BarCode in Unit value. Default value: 2pt. Ignored for EAN8, EAN13, UPCE, UPCA, ISBN, ISMN, ISSN, UpcaGs1DatabarCoupon. - */ - public $text_space; - - /** - * Common Units for all measuring in query. Default units: pixel. - */ - public $units; - - /** - * Specifies the different types of automatic sizing modes. Default value: AutoSizeMode.None. - */ - public $size_mode; - - /** - * Height of the barcode in given units. Default units: pixel. - */ - public $bar_height; - - /** - * Height of the barcode image in given units. Default units: pixel. - */ - public $image_height; - - /** - * Width of the barcode image in given units. Default units: pixel. - */ - public $image_width; - - /** - * BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0. - */ - public $rotation_angle; - - /** - * Background color of the barcode image. Default value: white. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF - */ - public $back_color; - - /** - * Bars color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF - */ - public $bar_color; - - /** - * Border color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF - */ - public $border_color; - - /** - * Border width. Default value: 0. Ignored if Visible is set to false. - */ - public $border_width; - - /** - * Border dash style. Default value: BorderDashStyle.Solid. - */ - public $border_dash_style; - - /** - * Border visibility. If false than parameter Width is always ignored (0). Default value: false. - */ - public $border_visible; - - /** - * Enable checksum during generation 1D barcodes. Default is treated as Yes for symbology which must contain checksum, as No where checksum only possible. Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN, Codabar Checksum always used: Rest symbology - */ - public $enable_checksum; - - /** - * Indicates whether explains the character \"\\\" as an escape character in CodeText property. Used for Pdf417, DataMatrix, Code128 only If the EnableEscape is true, \"\\\" will be explained as a special escape character. Otherwise, \"\\\" acts as normal characters. Aspose.BarCode supports input decimal ascii code and mnemonic for ASCII control-code characters. For example, \\013 and \\\\CR stands for CR. - */ - public $enable_escape; - - /** - * Value indicating whether bars are filled. Only for 1D barcodes. Default value: true. - */ - public $filled_bars; - - /** - * Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes. - */ - public $always_show_checksum; - - /** - * Wide bars to Narrow bars ratio. Default value: 3, that is, wide bars are 3 times as wide as narrow bars. Used for ITF, PZN, PharmaCode, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, IATA2of5, VIN, DeutschePost, OPC, Code32, DataLogic2of5, PatchCode, Code39Extended, Code39Standard - */ - public $wide_narrow_ratio; - - /** - * Only for 1D barcodes. If codetext is incorrect and value set to true - exception will be thrown. Otherwise codetext will be corrected to match barcode's specification. Exception always will be thrown for: Databar symbology if codetext is incorrect. Exception always will not be thrown for: AustraliaPost, SingaporePost, Code39Extended, Code93Extended, Code16K, Code128 symbology if codetext is incorrect. - */ - public $validate_text; - - /** - * Supplement parameters. Used for Interleaved2of5, Standard2of5, EAN13, EAN8, UPCA, UPCE, ISBN, ISSN, ISMN. - */ - public $supplement_data; - - /** - * Space between main the BarCode and supplement BarCode. - */ - public $supplement_space; - - /** - * Bars reduction value that is used to compensate ink spread while printing. - */ - public $bar_width_reduction; - - /** - * Indicates whether is used anti-aliasing mode to render image. Anti-aliasing mode is applied to barcode and text drawing. - */ - public $use_anti_alias; - - /** - * Result image format. - */ - public $format; -} diff --git a/src/Aspose/BarCode/Requests/GetBarcodeRecognizeRequest.php b/src/Aspose/BarCode/Requests/GetBarcodeRecognizeRequest.php deleted file mode 100644 index e998f9e..0000000 --- a/src/Aspose/BarCode/Requests/GetBarcodeRecognizeRequest.php +++ /dev/null @@ -1,300 +0,0 @@ - - * Copyright (c) 2025 Aspose Pty Ltd - * - * -------------------------------------------------------------------------------------------------------------------- - */ - -declare(strict_types=1); - -namespace Aspose\BarCode\Requests; - -/** - * Request model for "getBarcodeRecognize" operation. - */ -class GetBarcodeRecognizeRequest -{ - /** - * Initializes a new instance of the GetBarcodeRecognizeRequest class. - * - * @param string $name The image file name. - * @param string $type The type of barcode to read. - * @param \Aspose\BarCode\Model\DecodeBarcodeType[] $types Multiple barcode types to read. - * @param string $checksum_validation Enable checksum validation during recognition for 1D barcodes. Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible. Checksum never used: Codabar Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN Checksum always used: Rest symbologies - * @param bool $detect_encoding A flag which force engine to detect codetext encoding for Unicode. - * @param string $preset Preset allows to configure recognition quality and speed manually. You can quickly set up Preset by embedded presets: HighPerformance, NormalQuality, HighQuality, MaxBarCodes or you can manually configure separate options. Default value of Preset is NormalQuality. - * @param int $rect_x Set X of top left corner of area for recognition. - * @param int $rect_y Set Y of top left corner of area for recognition. - * @param int $rect_width Set Width of area for recognition. - * @param int $rect_height Set Height of area for recognition. - * @param bool $strip_fnc Value indicating whether FNC symbol strip must be done. - * @param int $timeout Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). Maximum value is 30_000 (1/2 minute). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout. - * @param int $median_smoothing_window_size Window size for median smoothing. Typical values are 3 or 4. Default value is 3. AllowMedianSmoothing must be set. - * @param bool $allow_median_smoothing Allows engine to enable median smoothing as additional scan. Mode helps to recognize noised barcodes. - * @param bool $allow_complex_background Allows engine to recognize color barcodes on color background as additional scan. Extremely slow mode. - * @param bool $allow_datamatrix_industrial_barcodes Allows engine for Datamatrix to recognize dashed industrial Datamatrix barcodes. Slow mode which helps only for dashed barcodes which consist from spots. - * @param bool $allow_decreased_image Allows engine to recognize decreased image as additional scan. Size for decreasing is selected by internal engine algorithms. Mode helps to recognize barcodes which are noised and blurred but captured with high resolution. - * @param bool $allow_detect_scan_gap Allows engine to use gap between scans to increase recognition speed. Mode can make recognition problems with low height barcodes. - * @param bool $allow_incorrect_barcodes Allows engine to recognize barcodes which has incorrect checksum or incorrect values. Mode can be used to recognize damaged barcodes with incorrect text. - * @param bool $allow_invert_image Allows engine to recognize inverse color image as additional scan. Mode can be used when barcode is white on black background. - * @param bool $allow_micro_white_spots_removing Allows engine for Postal barcodes to recognize slightly noised images. Mode helps to recognize slightly damaged Postal barcodes. - * @param bool $allow_one_d_fast_barcodes_detector Allows engine for 1D barcodes to quickly recognize high quality barcodes which fill almost whole image. Mode helps to quickly recognize generated barcodes from Internet. - * @param bool $allow_one_d_wiped_bars_restoration Allows engine for 1D barcodes to recognize barcodes with single wiped/glued bars in pattern. - * @param bool $allow_qr_micro_qr_restoration Allows engine for QR/MicroQR to recognize damaged MicroQR barcodes. - * @param bool $allow_regular_image Allows engine to recognize regular image without any restorations as main scan. Mode to recognize image as is. - * @param bool $allow_salt_and_pepper_filtering Allows engine to recognize barcodes with salt and pepper noise type. Mode can remove small noise with white and black dots. - * @param bool $allow_white_spots_removing Allows engine to recognize image without small white spots as additional scan. Mode helps to recognize noised image as well as median smoothing filtering. - * @param bool $check_more1_d_variants Allows engine to recognize 1D barcodes with checksum by checking more recognition variants. Default value: False. - * @param bool $fast_scan_only Allows engine for 1D barcodes to quickly recognize middle slice of an image and return result without using any time-consuming algorithms. Default value: False. - * @param bool $allow_additional_restorations Allows engine using additional image restorations to recognize corrupted barcodes. At this time, it is used only in MicroPdf417 barcode type. Default value: False. - * @param double $region_likelihood_threshold_percent Sets threshold for detected regions that may contain barcodes. Value 0.7 means that bottom 70% of possible regions are filtered out and not processed further. Region likelihood threshold must be between [0.05, 0.9] Use high values for clear images with few barcodes. Use low values for images with many barcodes or for noisy images. Low value may lead to a bigger recognition time. - * @param int[] $scan_window_sizes Scan window sizes in pixels. Allowed sizes are 10, 15, 20, 25, 30. Scanning with small window size takes more time and provides more accuracy but may fail in detecting very big barcodes. Combining of several window sizes can improve detection quality. - * @param double $similarity Similarity coefficient depends on how homogeneous barcodes are. Use high value for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] - * @param bool $skip_diagonal_search Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time. - * @param bool $read_tiny_barcodes Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False. - * @param string $australian_post_encoding_table Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. - * @param bool $ignore_ending_filling_patterns_for_c_table The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequence \"333\" of filling patterns is decoded as letter \"z\". - * @param string $storage The image storage. - * @param string $folder The image folder. - */ - public function __construct($name, $type = null, $types = null, $checksum_validation = null, $detect_encoding = null, $preset = null, $rect_x = null, $rect_y = null, $rect_width = null, $rect_height = null, $strip_fnc = null, $timeout = null, $median_smoothing_window_size = null, $allow_median_smoothing = null, $allow_complex_background = null, $allow_datamatrix_industrial_barcodes = null, $allow_decreased_image = null, $allow_detect_scan_gap = null, $allow_incorrect_barcodes = null, $allow_invert_image = null, $allow_micro_white_spots_removing = null, $allow_one_d_fast_barcodes_detector = null, $allow_one_d_wiped_bars_restoration = null, $allow_qr_micro_qr_restoration = null, $allow_regular_image = null, $allow_salt_and_pepper_filtering = null, $allow_white_spots_removing = null, $check_more1_d_variants = null, $fast_scan_only = null, $allow_additional_restorations = null, $region_likelihood_threshold_percent = null, $scan_window_sizes = null, $similarity = null, $skip_diagonal_search = null, $read_tiny_barcodes = null, $australian_post_encoding_table = null, $ignore_ending_filling_patterns_for_c_table = null, $storage = null, $folder = null) - { - $this->name = $name; - $this->type = $type; - $this->types = $types; - $this->checksum_validation = $checksum_validation; - $this->detect_encoding = $detect_encoding; - $this->preset = $preset; - $this->rect_x = $rect_x; - $this->rect_y = $rect_y; - $this->rect_width = $rect_width; - $this->rect_height = $rect_height; - $this->strip_fnc = $strip_fnc; - $this->timeout = $timeout; - $this->median_smoothing_window_size = $median_smoothing_window_size; - $this->allow_median_smoothing = $allow_median_smoothing; - $this->allow_complex_background = $allow_complex_background; - $this->allow_datamatrix_industrial_barcodes = $allow_datamatrix_industrial_barcodes; - $this->allow_decreased_image = $allow_decreased_image; - $this->allow_detect_scan_gap = $allow_detect_scan_gap; - $this->allow_incorrect_barcodes = $allow_incorrect_barcodes; - $this->allow_invert_image = $allow_invert_image; - $this->allow_micro_white_spots_removing = $allow_micro_white_spots_removing; - $this->allow_one_d_fast_barcodes_detector = $allow_one_d_fast_barcodes_detector; - $this->allow_one_d_wiped_bars_restoration = $allow_one_d_wiped_bars_restoration; - $this->allow_qr_micro_qr_restoration = $allow_qr_micro_qr_restoration; - $this->allow_regular_image = $allow_regular_image; - $this->allow_salt_and_pepper_filtering = $allow_salt_and_pepper_filtering; - $this->allow_white_spots_removing = $allow_white_spots_removing; - $this->check_more1_d_variants = $check_more1_d_variants; - $this->fast_scan_only = $fast_scan_only; - $this->allow_additional_restorations = $allow_additional_restorations; - $this->region_likelihood_threshold_percent = $region_likelihood_threshold_percent; - $this->scan_window_sizes = $scan_window_sizes; - $this->similarity = $similarity; - $this->skip_diagonal_search = $skip_diagonal_search; - $this->read_tiny_barcodes = $read_tiny_barcodes; - $this->australian_post_encoding_table = $australian_post_encoding_table; - $this->ignore_ending_filling_patterns_for_c_table = $ignore_ending_filling_patterns_for_c_table; - $this->storage = $storage; - $this->folder = $folder; - } - - /** - * The image file name. - */ - public $name; - - /** - * The type of barcode to read. - */ - public $type; - - /** - * Multiple barcode types to read. - */ - public $types; - - /** - * Enable checksum validation during recognition for 1D barcodes. Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible. Checksum never used: Codabar Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN Checksum always used: Rest symbologies - */ - public $checksum_validation; - - /** - * A flag which force engine to detect codetext encoding for Unicode. - */ - public $detect_encoding; - - /** - * Preset allows to configure recognition quality and speed manually. You can quickly set up Preset by embedded presets: HighPerformance, NormalQuality, HighQuality, MaxBarCodes or you can manually configure separate options. Default value of Preset is NormalQuality. - */ - public $preset; - - /** - * Set X of top left corner of area for recognition. - */ - public $rect_x; - - /** - * Set Y of top left corner of area for recognition. - */ - public $rect_y; - - /** - * Set Width of area for recognition. - */ - public $rect_width; - - /** - * Set Height of area for recognition. - */ - public $rect_height; - - /** - * Value indicating whether FNC symbol strip must be done. - */ - public $strip_fnc; - - /** - * Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). Maximum value is 30_000 (1/2 minute). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout. - */ - public $timeout; - - /** - * Window size for median smoothing. Typical values are 3 or 4. Default value is 3. AllowMedianSmoothing must be set. - */ - public $median_smoothing_window_size; - - /** - * Allows engine to enable median smoothing as additional scan. Mode helps to recognize noised barcodes. - */ - public $allow_median_smoothing; - - /** - * Allows engine to recognize color barcodes on color background as additional scan. Extremely slow mode. - */ - public $allow_complex_background; - - /** - * Allows engine for Datamatrix to recognize dashed industrial Datamatrix barcodes. Slow mode which helps only for dashed barcodes which consist from spots. - */ - public $allow_datamatrix_industrial_barcodes; - - /** - * Allows engine to recognize decreased image as additional scan. Size for decreasing is selected by internal engine algorithms. Mode helps to recognize barcodes which are noised and blurred but captured with high resolution. - */ - public $allow_decreased_image; - - /** - * Allows engine to use gap between scans to increase recognition speed. Mode can make recognition problems with low height barcodes. - */ - public $allow_detect_scan_gap; - - /** - * Allows engine to recognize barcodes which has incorrect checksum or incorrect values. Mode can be used to recognize damaged barcodes with incorrect text. - */ - public $allow_incorrect_barcodes; - - /** - * Allows engine to recognize inverse color image as additional scan. Mode can be used when barcode is white on black background. - */ - public $allow_invert_image; - - /** - * Allows engine for Postal barcodes to recognize slightly noised images. Mode helps to recognize slightly damaged Postal barcodes. - */ - public $allow_micro_white_spots_removing; - - /** - * Allows engine for 1D barcodes to quickly recognize high quality barcodes which fill almost whole image. Mode helps to quickly recognize generated barcodes from Internet. - */ - public $allow_one_d_fast_barcodes_detector; - - /** - * Allows engine for 1D barcodes to recognize barcodes with single wiped/glued bars in pattern. - */ - public $allow_one_d_wiped_bars_restoration; - - /** - * Allows engine for QR/MicroQR to recognize damaged MicroQR barcodes. - */ - public $allow_qr_micro_qr_restoration; - - /** - * Allows engine to recognize regular image without any restorations as main scan. Mode to recognize image as is. - */ - public $allow_regular_image; - - /** - * Allows engine to recognize barcodes with salt and pepper noise type. Mode can remove small noise with white and black dots. - */ - public $allow_salt_and_pepper_filtering; - - /** - * Allows engine to recognize image without small white spots as additional scan. Mode helps to recognize noised image as well as median smoothing filtering. - */ - public $allow_white_spots_removing; - - /** - * Allows engine to recognize 1D barcodes with checksum by checking more recognition variants. Default value: False. - */ - public $check_more1_d_variants; - - /** - * Allows engine for 1D barcodes to quickly recognize middle slice of an image and return result without using any time-consuming algorithms. Default value: False. - */ - public $fast_scan_only; - - /** - * Allows engine using additional image restorations to recognize corrupted barcodes. At this time, it is used only in MicroPdf417 barcode type. Default value: False. - */ - public $allow_additional_restorations; - - /** - * Sets threshold for detected regions that may contain barcodes. Value 0.7 means that bottom 70% of possible regions are filtered out and not processed further. Region likelihood threshold must be between [0.05, 0.9] Use high values for clear images with few barcodes. Use low values for images with many barcodes or for noisy images. Low value may lead to a bigger recognition time. - */ - public $region_likelihood_threshold_percent; - - /** - * Scan window sizes in pixels. Allowed sizes are 10, 15, 20, 25, 30. Scanning with small window size takes more time and provides more accuracy but may fail in detecting very big barcodes. Combining of several window sizes can improve detection quality. - */ - public $scan_window_sizes; - - /** - * Similarity coefficient depends on how homogeneous barcodes are. Use high value for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] - */ - public $similarity; - - /** - * Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time. - */ - public $skip_diagonal_search; - - /** - * Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False. - */ - public $read_tiny_barcodes; - - /** - * Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. - */ - public $australian_post_encoding_table; - - /** - * The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequence \"333\" of filling patterns is decoded as letter \"z\". - */ - public $ignore_ending_filling_patterns_for_c_table; - - /** - * The image storage. - */ - public $storage; - - /** - * The image folder. - */ - public $folder; -} diff --git a/src/Aspose/BarCode/Requests/GetFileVersionsRequest.php b/src/Aspose/BarCode/Requests/GetFileVersionsRequest.php deleted file mode 100644 index fd988fa..0000000 --- a/src/Aspose/BarCode/Requests/GetFileVersionsRequest.php +++ /dev/null @@ -1,41 +0,0 @@ - - * Copyright (c) 2025 Aspose Pty Ltd - * - * -------------------------------------------------------------------------------------------------------------------- - */ - -declare(strict_types=1); - -namespace Aspose\BarCode\Requests; - -/** - * Request model for "getFileVersions" operation. - */ -class GetFileVersionsRequest -{ - /** - * Initializes a new instance of the GetFileVersionsRequest class. - * - * @param string $path File path e.g. '/file.ext' - * @param string $storage_name Storage name - */ - public function __construct($path, $storage_name = null) - { - $this->path = $path; - $this->storage_name = $storage_name; - } - - /** - * File path e.g. '/file.ext' - */ - public $path; - - /** - * Storage name - */ - public $storage_name; -} diff --git a/src/Aspose/BarCode/Requests/GetFilesListRequest.php b/src/Aspose/BarCode/Requests/GetFilesListRequest.php deleted file mode 100644 index 0fc2ce1..0000000 --- a/src/Aspose/BarCode/Requests/GetFilesListRequest.php +++ /dev/null @@ -1,41 +0,0 @@ - - * Copyright (c) 2025 Aspose Pty Ltd - * - * -------------------------------------------------------------------------------------------------------------------- - */ - -declare(strict_types=1); - -namespace Aspose\BarCode\Requests; - -/** - * Request model for "getFilesList" operation. - */ -class GetFilesListRequest -{ - /** - * Initializes a new instance of the GetFilesListRequest class. - * - * @param string $path Folder path e.g. '/folder' - * @param string $storage_name Storage name - */ - public function __construct($path, $storage_name = null) - { - $this->path = $path; - $this->storage_name = $storage_name; - } - - /** - * Folder path e.g. '/folder' - */ - public $path; - - /** - * Storage name - */ - public $storage_name; -} diff --git a/src/Aspose/BarCode/Requests/MoveFileRequest.php b/src/Aspose/BarCode/Requests/MoveFileRequest.php deleted file mode 100644 index d796b05..0000000 --- a/src/Aspose/BarCode/Requests/MoveFileRequest.php +++ /dev/null @@ -1,62 +0,0 @@ - - * Copyright (c) 2025 Aspose Pty Ltd - * - * -------------------------------------------------------------------------------------------------------------------- - */ - -declare(strict_types=1); - -namespace Aspose\BarCode\Requests; - -/** - * Request model for "moveFile" operation. - */ -class MoveFileRequest -{ - /** - * Initializes a new instance of the MoveFileRequest class. - * - * @param string $src_path Source file path e.g. '/src.ext' - * @param string $dest_path Destination file path e.g. '/dest.ext' - * @param string $src_storage_name Source storage name - * @param string $dest_storage_name Destination storage name - * @param string $version_id File version ID to move - */ - public function __construct($src_path, $dest_path, $src_storage_name = null, $dest_storage_name = null, $version_id = null) - { - $this->src_path = $src_path; - $this->dest_path = $dest_path; - $this->src_storage_name = $src_storage_name; - $this->dest_storage_name = $dest_storage_name; - $this->version_id = $version_id; - } - - /** - * Source file path e.g. '/src.ext' - */ - public $src_path; - - /** - * Destination file path e.g. '/dest.ext' - */ - public $dest_path; - - /** - * Source storage name - */ - public $src_storage_name; - - /** - * Destination storage name - */ - public $dest_storage_name; - - /** - * File version ID to move - */ - public $version_id; -} diff --git a/src/Aspose/BarCode/Requests/MoveFolderRequest.php b/src/Aspose/BarCode/Requests/MoveFolderRequest.php deleted file mode 100644 index d2773b8..0000000 --- a/src/Aspose/BarCode/Requests/MoveFolderRequest.php +++ /dev/null @@ -1,55 +0,0 @@ - - * Copyright (c) 2025 Aspose Pty Ltd - * - * -------------------------------------------------------------------------------------------------------------------- - */ - -declare(strict_types=1); - -namespace Aspose\BarCode\Requests; - -/** - * Request model for "moveFolder" operation. - */ -class MoveFolderRequest -{ - /** - * Initializes a new instance of the MoveFolderRequest class. - * - * @param string $src_path Folder path to move e.g. '/folder' - * @param string $dest_path Destination folder path to move to e.g '/dst' - * @param string $src_storage_name Source storage name - * @param string $dest_storage_name Destination storage name - */ - public function __construct($src_path, $dest_path, $src_storage_name = null, $dest_storage_name = null) - { - $this->src_path = $src_path; - $this->dest_path = $dest_path; - $this->src_storage_name = $src_storage_name; - $this->dest_storage_name = $dest_storage_name; - } - - /** - * Folder path to move e.g. '/folder' - */ - public $src_path; - - /** - * Destination folder path to move to e.g '/dst' - */ - public $dest_path; - - /** - * Source storage name - */ - public $src_storage_name; - - /** - * Destination storage name - */ - public $dest_storage_name; -} diff --git a/src/Aspose/BarCode/Requests/ObjectExistsRequest.php b/src/Aspose/BarCode/Requests/ObjectExistsRequest.php deleted file mode 100644 index f58e4f0..0000000 --- a/src/Aspose/BarCode/Requests/ObjectExistsRequest.php +++ /dev/null @@ -1,48 +0,0 @@ - - * Copyright (c) 2025 Aspose Pty Ltd - * - * -------------------------------------------------------------------------------------------------------------------- - */ - -declare(strict_types=1); - -namespace Aspose\BarCode\Requests; - -/** - * Request model for "objectExists" operation. - */ -class ObjectExistsRequest -{ - /** - * Initializes a new instance of the ObjectExistsRequest class. - * - * @param string $path File or folder path e.g. '/file.ext' or '/folder' - * @param string $storage_name Storage name - * @param string $version_id File version ID - */ - public function __construct($path, $storage_name = null, $version_id = null) - { - $this->path = $path; - $this->storage_name = $storage_name; - $this->version_id = $version_id; - } - - /** - * File or folder path e.g. '/file.ext' or '/folder' - */ - public $path; - - /** - * Storage name - */ - public $storage_name; - - /** - * File version ID - */ - public $version_id; -} diff --git a/src/Aspose/BarCode/Requests/PostBarcodeRecognizeFromUrlOrContentRequest.php b/src/Aspose/BarCode/Requests/PostBarcodeRecognizeFromUrlOrContentRequest.php deleted file mode 100644 index a8a66b4..0000000 --- a/src/Aspose/BarCode/Requests/PostBarcodeRecognizeFromUrlOrContentRequest.php +++ /dev/null @@ -1,293 +0,0 @@ - - * Copyright (c) 2025 Aspose Pty Ltd - * - * -------------------------------------------------------------------------------------------------------------------- - */ - -declare(strict_types=1); - -namespace Aspose\BarCode\Requests; - -/** - * Request model for "postBarcodeRecognizeFromUrlOrContent" operation. - */ -class PostBarcodeRecognizeFromUrlOrContentRequest -{ - /** - * Initializes a new instance of the PostBarcodeRecognizeFromUrlOrContentRequest class. - * - * @param string $type The type of barcode to read. - * @param \Aspose\BarCode\Model\DecodeBarcodeType[] $types Multiple barcode types to read. - * @param string $checksum_validation Enable checksum validation during recognition for 1D barcodes. Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible. Checksum never used: Codabar Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN Checksum always used: Rest symbologies - * @param bool $detect_encoding A flag which force engine to detect codetext encoding for Unicode. - * @param string $preset Preset allows to configure recognition quality and speed manually. You can quickly set up Preset by embedded presets: HighPerformance, NormalQuality, HighQuality, MaxBarCodes or you can manually configure separate options. Default value of Preset is NormalQuality. - * @param int $rect_x Set X of top left corner of area for recognition. - * @param int $rect_y Set Y of top left corner of area for recognition. - * @param int $rect_width Set Width of area for recognition. - * @param int $rect_height Set Height of area for recognition. - * @param bool $strip_fnc Value indicating whether FNC symbol strip must be done. - * @param int $timeout Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). Maximum value is 30_000 (1/2 minute). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout. - * @param int $median_smoothing_window_size Window size for median smoothing. Typical values are 3 or 4. Default value is 3. AllowMedianSmoothing must be set. - * @param bool $allow_median_smoothing Allows engine to enable median smoothing as additional scan. Mode helps to recognize noised barcodes. - * @param bool $allow_complex_background Allows engine to recognize color barcodes on color background as additional scan. Extremely slow mode. - * @param bool $allow_datamatrix_industrial_barcodes Allows engine for Datamatrix to recognize dashed industrial Datamatrix barcodes. Slow mode which helps only for dashed barcodes which consist from spots. - * @param bool $allow_decreased_image Allows engine to recognize decreased image as additional scan. Size for decreasing is selected by internal engine algorithms. Mode helps to recognize barcodes which are noised and blurred but captured with high resolution. - * @param bool $allow_detect_scan_gap Allows engine to use gap between scans to increase recognition speed. Mode can make recognition problems with low height barcodes. - * @param bool $allow_incorrect_barcodes Allows engine to recognize barcodes which has incorrect checksum or incorrect values. Mode can be used to recognize damaged barcodes with incorrect text. - * @param bool $allow_invert_image Allows engine to recognize inverse color image as additional scan. Mode can be used when barcode is white on black background. - * @param bool $allow_micro_white_spots_removing Allows engine for Postal barcodes to recognize slightly noised images. Mode helps to recognize slightly damaged Postal barcodes. - * @param bool $allow_one_d_fast_barcodes_detector Allows engine for 1D barcodes to quickly recognize high quality barcodes which fill almost whole image. Mode helps to quickly recognize generated barcodes from Internet. - * @param bool $allow_one_d_wiped_bars_restoration Allows engine for 1D barcodes to recognize barcodes with single wiped/glued bars in pattern. - * @param bool $allow_qr_micro_qr_restoration Allows engine for QR/MicroQR to recognize damaged MicroQR barcodes. - * @param bool $allow_regular_image Allows engine to recognize regular image without any restorations as main scan. Mode to recognize image as is. - * @param bool $allow_salt_and_pepper_filtering Allows engine to recognize barcodes with salt and pepper noise type. Mode can remove small noise with white and black dots. - * @param bool $allow_white_spots_removing Allows engine to recognize image without small white spots as additional scan. Mode helps to recognize noised image as well as median smoothing filtering. - * @param bool $check_more1_d_variants Allows engine to recognize 1D barcodes with checksum by checking more recognition variants. Default value: False. - * @param bool $fast_scan_only Allows engine for 1D barcodes to quickly recognize middle slice of an image and return result without using any time-consuming algorithms. Default value: False. - * @param bool $allow_additional_restorations Allows engine using additional image restorations to recognize corrupted barcodes. At this time, it is used only in MicroPdf417 barcode type. Default value: False. - * @param double $region_likelihood_threshold_percent Sets threshold for detected regions that may contain barcodes. Value 0.7 means that bottom 70% of possible regions are filtered out and not processed further. Region likelihood threshold must be between [0.05, 0.9] Use high values for clear images with few barcodes. Use low values for images with many barcodes or for noisy images. Low value may lead to a bigger recognition time. - * @param int[] $scan_window_sizes Scan window sizes in pixels. Allowed sizes are 10, 15, 20, 25, 30. Scanning with small window size takes more time and provides more accuracy but may fail in detecting very big barcodes. Combining of several window sizes can improve detection quality. - * @param double $similarity Similarity coefficient depends on how homogeneous barcodes are. Use high value for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] - * @param bool $skip_diagonal_search Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time. - * @param bool $read_tiny_barcodes Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False. - * @param string $australian_post_encoding_table Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. - * @param bool $ignore_ending_filling_patterns_for_c_table The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequence \"333\" of filling patterns is decoded as letter \"z\". - * @param string $url The image file url. - * @param \SplFileObject $image Image data - */ - public function __construct($type = null, $types = null, $checksum_validation = null, $detect_encoding = null, $preset = null, $rect_x = null, $rect_y = null, $rect_width = null, $rect_height = null, $strip_fnc = null, $timeout = null, $median_smoothing_window_size = null, $allow_median_smoothing = null, $allow_complex_background = null, $allow_datamatrix_industrial_barcodes = null, $allow_decreased_image = null, $allow_detect_scan_gap = null, $allow_incorrect_barcodes = null, $allow_invert_image = null, $allow_micro_white_spots_removing = null, $allow_one_d_fast_barcodes_detector = null, $allow_one_d_wiped_bars_restoration = null, $allow_qr_micro_qr_restoration = null, $allow_regular_image = null, $allow_salt_and_pepper_filtering = null, $allow_white_spots_removing = null, $check_more1_d_variants = null, $fast_scan_only = null, $allow_additional_restorations = null, $region_likelihood_threshold_percent = null, $scan_window_sizes = null, $similarity = null, $skip_diagonal_search = null, $read_tiny_barcodes = null, $australian_post_encoding_table = null, $ignore_ending_filling_patterns_for_c_table = null, $url = null, $image = null) - { - $this->type = $type; - $this->types = $types; - $this->checksum_validation = $checksum_validation; - $this->detect_encoding = $detect_encoding; - $this->preset = $preset; - $this->rect_x = $rect_x; - $this->rect_y = $rect_y; - $this->rect_width = $rect_width; - $this->rect_height = $rect_height; - $this->strip_fnc = $strip_fnc; - $this->timeout = $timeout; - $this->median_smoothing_window_size = $median_smoothing_window_size; - $this->allow_median_smoothing = $allow_median_smoothing; - $this->allow_complex_background = $allow_complex_background; - $this->allow_datamatrix_industrial_barcodes = $allow_datamatrix_industrial_barcodes; - $this->allow_decreased_image = $allow_decreased_image; - $this->allow_detect_scan_gap = $allow_detect_scan_gap; - $this->allow_incorrect_barcodes = $allow_incorrect_barcodes; - $this->allow_invert_image = $allow_invert_image; - $this->allow_micro_white_spots_removing = $allow_micro_white_spots_removing; - $this->allow_one_d_fast_barcodes_detector = $allow_one_d_fast_barcodes_detector; - $this->allow_one_d_wiped_bars_restoration = $allow_one_d_wiped_bars_restoration; - $this->allow_qr_micro_qr_restoration = $allow_qr_micro_qr_restoration; - $this->allow_regular_image = $allow_regular_image; - $this->allow_salt_and_pepper_filtering = $allow_salt_and_pepper_filtering; - $this->allow_white_spots_removing = $allow_white_spots_removing; - $this->check_more1_d_variants = $check_more1_d_variants; - $this->fast_scan_only = $fast_scan_only; - $this->allow_additional_restorations = $allow_additional_restorations; - $this->region_likelihood_threshold_percent = $region_likelihood_threshold_percent; - $this->scan_window_sizes = $scan_window_sizes; - $this->similarity = $similarity; - $this->skip_diagonal_search = $skip_diagonal_search; - $this->read_tiny_barcodes = $read_tiny_barcodes; - $this->australian_post_encoding_table = $australian_post_encoding_table; - $this->ignore_ending_filling_patterns_for_c_table = $ignore_ending_filling_patterns_for_c_table; - $this->url = $url; - $this->image = $image; - } - - /** - * The type of barcode to read. - */ - public $type; - - /** - * Multiple barcode types to read. - */ - public $types; - - /** - * Enable checksum validation during recognition for 1D barcodes. Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible. Checksum never used: Codabar Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN Checksum always used: Rest symbologies - */ - public $checksum_validation; - - /** - * A flag which force engine to detect codetext encoding for Unicode. - */ - public $detect_encoding; - - /** - * Preset allows to configure recognition quality and speed manually. You can quickly set up Preset by embedded presets: HighPerformance, NormalQuality, HighQuality, MaxBarCodes or you can manually configure separate options. Default value of Preset is NormalQuality. - */ - public $preset; - - /** - * Set X of top left corner of area for recognition. - */ - public $rect_x; - - /** - * Set Y of top left corner of area for recognition. - */ - public $rect_y; - - /** - * Set Width of area for recognition. - */ - public $rect_width; - - /** - * Set Height of area for recognition. - */ - public $rect_height; - - /** - * Value indicating whether FNC symbol strip must be done. - */ - public $strip_fnc; - - /** - * Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). Maximum value is 30_000 (1/2 minute). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout. - */ - public $timeout; - - /** - * Window size for median smoothing. Typical values are 3 or 4. Default value is 3. AllowMedianSmoothing must be set. - */ - public $median_smoothing_window_size; - - /** - * Allows engine to enable median smoothing as additional scan. Mode helps to recognize noised barcodes. - */ - public $allow_median_smoothing; - - /** - * Allows engine to recognize color barcodes on color background as additional scan. Extremely slow mode. - */ - public $allow_complex_background; - - /** - * Allows engine for Datamatrix to recognize dashed industrial Datamatrix barcodes. Slow mode which helps only for dashed barcodes which consist from spots. - */ - public $allow_datamatrix_industrial_barcodes; - - /** - * Allows engine to recognize decreased image as additional scan. Size for decreasing is selected by internal engine algorithms. Mode helps to recognize barcodes which are noised and blurred but captured with high resolution. - */ - public $allow_decreased_image; - - /** - * Allows engine to use gap between scans to increase recognition speed. Mode can make recognition problems with low height barcodes. - */ - public $allow_detect_scan_gap; - - /** - * Allows engine to recognize barcodes which has incorrect checksum or incorrect values. Mode can be used to recognize damaged barcodes with incorrect text. - */ - public $allow_incorrect_barcodes; - - /** - * Allows engine to recognize inverse color image as additional scan. Mode can be used when barcode is white on black background. - */ - public $allow_invert_image; - - /** - * Allows engine for Postal barcodes to recognize slightly noised images. Mode helps to recognize slightly damaged Postal barcodes. - */ - public $allow_micro_white_spots_removing; - - /** - * Allows engine for 1D barcodes to quickly recognize high quality barcodes which fill almost whole image. Mode helps to quickly recognize generated barcodes from Internet. - */ - public $allow_one_d_fast_barcodes_detector; - - /** - * Allows engine for 1D barcodes to recognize barcodes with single wiped/glued bars in pattern. - */ - public $allow_one_d_wiped_bars_restoration; - - /** - * Allows engine for QR/MicroQR to recognize damaged MicroQR barcodes. - */ - public $allow_qr_micro_qr_restoration; - - /** - * Allows engine to recognize regular image without any restorations as main scan. Mode to recognize image as is. - */ - public $allow_regular_image; - - /** - * Allows engine to recognize barcodes with salt and pepper noise type. Mode can remove small noise with white and black dots. - */ - public $allow_salt_and_pepper_filtering; - - /** - * Allows engine to recognize image without small white spots as additional scan. Mode helps to recognize noised image as well as median smoothing filtering. - */ - public $allow_white_spots_removing; - - /** - * Allows engine to recognize 1D barcodes with checksum by checking more recognition variants. Default value: False. - */ - public $check_more1_d_variants; - - /** - * Allows engine for 1D barcodes to quickly recognize middle slice of an image and return result without using any time-consuming algorithms. Default value: False. - */ - public $fast_scan_only; - - /** - * Allows engine using additional image restorations to recognize corrupted barcodes. At this time, it is used only in MicroPdf417 barcode type. Default value: False. - */ - public $allow_additional_restorations; - - /** - * Sets threshold for detected regions that may contain barcodes. Value 0.7 means that bottom 70% of possible regions are filtered out and not processed further. Region likelihood threshold must be between [0.05, 0.9] Use high values for clear images with few barcodes. Use low values for images with many barcodes or for noisy images. Low value may lead to a bigger recognition time. - */ - public $region_likelihood_threshold_percent; - - /** - * Scan window sizes in pixels. Allowed sizes are 10, 15, 20, 25, 30. Scanning with small window size takes more time and provides more accuracy but may fail in detecting very big barcodes. Combining of several window sizes can improve detection quality. - */ - public $scan_window_sizes; - - /** - * Similarity coefficient depends on how homogeneous barcodes are. Use high value for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] - */ - public $similarity; - - /** - * Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time. - */ - public $skip_diagonal_search; - - /** - * Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False. - */ - public $read_tiny_barcodes; - - /** - * Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. - */ - public $australian_post_encoding_table; - - /** - * The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequence \"333\" of filling patterns is decoded as letter \"z\". - */ - public $ignore_ending_filling_patterns_for_c_table; - - /** - * The image file url. - */ - public $url; - - /** - * Image data - */ - public $image; -} diff --git a/src/Aspose/BarCode/Requests/PostGenerateMultipleRequest.php b/src/Aspose/BarCode/Requests/PostGenerateMultipleRequest.php deleted file mode 100644 index 80dfd7c..0000000 --- a/src/Aspose/BarCode/Requests/PostGenerateMultipleRequest.php +++ /dev/null @@ -1,41 +0,0 @@ - - * Copyright (c) 2025 Aspose Pty Ltd - * - * -------------------------------------------------------------------------------------------------------------------- - */ - -declare(strict_types=1); - -namespace Aspose\BarCode\Requests; - -/** - * Request model for "postGenerateMultiple" operation. - */ -class PostGenerateMultipleRequest -{ - /** - * Initializes a new instance of the PostGenerateMultipleRequest class. - * - * @param \Aspose\BarCode\Model\GeneratorParamsList $generator_params_list List of barcodes - * @param string $format Format to return stream in - */ - public function __construct($generator_params_list, $format = null) - { - $this->generator_params_list = $generator_params_list; - $this->format = $format; - } - - /** - * List of barcodes - */ - public $generator_params_list; - - /** - * Format to return stream in - */ - public $format; -} diff --git a/src/Aspose/BarCode/Requests/PutBarcodeGenerateFileRequest.php b/src/Aspose/BarCode/Requests/PutBarcodeGenerateFileRequest.php deleted file mode 100644 index c9694bf..0000000 --- a/src/Aspose/BarCode/Requests/PutBarcodeGenerateFileRequest.php +++ /dev/null @@ -1,293 +0,0 @@ - - * Copyright (c) 2025 Aspose Pty Ltd - * - * -------------------------------------------------------------------------------------------------------------------- - */ - -declare(strict_types=1); - -namespace Aspose\BarCode\Requests; - -/** - * Request model for "putBarcodeGenerateFile" operation. - */ -class PutBarcodeGenerateFileRequest -{ - /** - * Initializes a new instance of the PutBarcodeGenerateFileRequest class. - * - * @param string $name The image file name. - * @param string $type Type of barcode to generate. - * @param string $text Text to encode. - * @param string $two_d_display_text Text that will be displayed instead of codetext in 2D barcodes. Used for: Aztec, Pdf417, DataMatrix, QR, MaxiCode, DotCode - * @param string $text_location Specify the displaying Text Location, set to CodeLocation.None to hide CodeText. Default value: CodeLocation.Below. - * @param string $text_alignment Text alignment. - * @param string $text_color Specify the displaying CodeText's Color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF - * @param bool $no_wrap Specify word wraps (line breaks) within text. Default value: false. - * @param double $resolution Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. - * @param double $resolution_x DEPRECATED: Use 'Resolution' instead. - * @param double $resolution_y DEPRECATED: Use 'Resolution' instead. - * @param double $dimension_x The smallest width of the unit of BarCode bars or spaces. Increase this will increase the whole barcode image width. Ignored if AutoSizeMode property is set to AutoSizeMode.Nearest or AutoSizeMode.Interpolation. - * @param double $text_space Space between the CodeText and the BarCode in Unit value. Default value: 2pt. Ignored for EAN8, EAN13, UPCE, UPCA, ISBN, ISMN, ISSN, UpcaGs1DatabarCoupon. - * @param string $units Common Units for all measuring in query. Default units: pixel. - * @param string $size_mode Specifies the different types of automatic sizing modes. Default value: AutoSizeMode.None. - * @param double $bar_height Height of the barcode in given units. Default units: pixel. - * @param double $image_height Height of the barcode image in given units. Default units: pixel. - * @param double $image_width Width of the barcode image in given units. Default units: pixel. - * @param double $rotation_angle BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0. - * @param string $back_color Background color of the barcode image. Default value: white. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF - * @param string $bar_color Bars color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF - * @param string $border_color Border color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF - * @param double $border_width Border width. Default value: 0. Ignored if Visible is set to false. - * @param string $border_dash_style Border dash style. Default value: BorderDashStyle.Solid. - * @param bool $border_visible Border visibility. If false than parameter Width is always ignored (0). Default value: false. - * @param string $enable_checksum Enable checksum during generation 1D barcodes. Default is treated as Yes for symbology which must contain checksum, as No where checksum only possible. Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN, Codabar Checksum always used: Rest symbology - * @param bool $enable_escape Indicates whether explains the character \"\\\" as an escape character in CodeText property. Used for Pdf417, DataMatrix, Code128 only If the EnableEscape is true, \"\\\" will be explained as a special escape character. Otherwise, \"\\\" acts as normal characters. Aspose.BarCode supports input decimal ascii code and mnemonic for ASCII control-code characters. For example, \\013 and \\\\CR stands for CR. - * @param bool $filled_bars Value indicating whether bars are filled. Only for 1D barcodes. Default value: true. - * @param bool $always_show_checksum Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes. - * @param double $wide_narrow_ratio Wide bars to Narrow bars ratio. Default value: 3, that is, wide bars are 3 times as wide as narrow bars. Used for ITF, PZN, PharmaCode, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, IATA2of5, VIN, DeutschePost, OPC, Code32, DataLogic2of5, PatchCode, Code39Extended, Code39Standard - * @param bool $validate_text Only for 1D barcodes. If codetext is incorrect and value set to true - exception will be thrown. Otherwise codetext will be corrected to match barcode's specification. Exception always will be thrown for: Databar symbology if codetext is incorrect. Exception always will not be thrown for: AustraliaPost, SingaporePost, Code39Extended, Code93Extended, Code16K, Code128 symbology if codetext is incorrect. - * @param string $supplement_data Supplement parameters. Used for Interleaved2of5, Standard2of5, EAN13, EAN8, UPCA, UPCE, ISBN, ISSN, ISMN. - * @param double $supplement_space Space between main the BarCode and supplement BarCode. - * @param double $bar_width_reduction Bars reduction value that is used to compensate ink spread while printing. - * @param bool $use_anti_alias Indicates whether is used anti-aliasing mode to render image. Anti-aliasing mode is applied to barcode and text drawing. - * @param string $storage Image's storage. - * @param string $folder Image's folder. - * @param string $format The image format. - */ - public function __construct($name, $type, $text, $two_d_display_text = null, $text_location = null, $text_alignment = null, $text_color = null, $no_wrap = null, $resolution = null, $resolution_x = null, $resolution_y = null, $dimension_x = null, $text_space = null, $units = null, $size_mode = null, $bar_height = null, $image_height = null, $image_width = null, $rotation_angle = null, $back_color = null, $bar_color = null, $border_color = null, $border_width = null, $border_dash_style = null, $border_visible = null, $enable_checksum = null, $enable_escape = null, $filled_bars = null, $always_show_checksum = null, $wide_narrow_ratio = null, $validate_text = null, $supplement_data = null, $supplement_space = null, $bar_width_reduction = null, $use_anti_alias = null, $storage = null, $folder = null, $format = null) - { - $this->name = $name; - $this->type = $type; - $this->text = $text; - $this->two_d_display_text = $two_d_display_text; - $this->text_location = $text_location; - $this->text_alignment = $text_alignment; - $this->text_color = $text_color; - $this->no_wrap = $no_wrap; - $this->resolution = $resolution; - $this->resolution_x = $resolution_x; - $this->resolution_y = $resolution_y; - $this->dimension_x = $dimension_x; - $this->text_space = $text_space; - $this->units = $units; - $this->size_mode = $size_mode; - $this->bar_height = $bar_height; - $this->image_height = $image_height; - $this->image_width = $image_width; - $this->rotation_angle = $rotation_angle; - $this->back_color = $back_color; - $this->bar_color = $bar_color; - $this->border_color = $border_color; - $this->border_width = $border_width; - $this->border_dash_style = $border_dash_style; - $this->border_visible = $border_visible; - $this->enable_checksum = $enable_checksum; - $this->enable_escape = $enable_escape; - $this->filled_bars = $filled_bars; - $this->always_show_checksum = $always_show_checksum; - $this->wide_narrow_ratio = $wide_narrow_ratio; - $this->validate_text = $validate_text; - $this->supplement_data = $supplement_data; - $this->supplement_space = $supplement_space; - $this->bar_width_reduction = $bar_width_reduction; - $this->use_anti_alias = $use_anti_alias; - $this->storage = $storage; - $this->folder = $folder; - $this->format = $format; - } - - /** - * The image file name. - */ - public $name; - - /** - * Type of barcode to generate. - */ - public $type; - - /** - * Text to encode. - */ - public $text; - - /** - * Text that will be displayed instead of codetext in 2D barcodes. Used for: Aztec, Pdf417, DataMatrix, QR, MaxiCode, DotCode - */ - public $two_d_display_text; - - /** - * Specify the displaying Text Location, set to CodeLocation.None to hide CodeText. Default value: CodeLocation.Below. - */ - public $text_location; - - /** - * Text alignment. - */ - public $text_alignment; - - /** - * Specify the displaying CodeText's Color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF - */ - public $text_color; - - /** - * Specify word wraps (line breaks) within text. Default value: false. - */ - public $no_wrap; - - /** - * Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. - */ - public $resolution; - - /** - * DEPRECATED: Use 'Resolution' instead. - */ - public $resolution_x; - - /** - * DEPRECATED: Use 'Resolution' instead. - */ - public $resolution_y; - - /** - * The smallest width of the unit of BarCode bars or spaces. Increase this will increase the whole barcode image width. Ignored if AutoSizeMode property is set to AutoSizeMode.Nearest or AutoSizeMode.Interpolation. - */ - public $dimension_x; - - /** - * Space between the CodeText and the BarCode in Unit value. Default value: 2pt. Ignored for EAN8, EAN13, UPCE, UPCA, ISBN, ISMN, ISSN, UpcaGs1DatabarCoupon. - */ - public $text_space; - - /** - * Common Units for all measuring in query. Default units: pixel. - */ - public $units; - - /** - * Specifies the different types of automatic sizing modes. Default value: AutoSizeMode.None. - */ - public $size_mode; - - /** - * Height of the barcode in given units. Default units: pixel. - */ - public $bar_height; - - /** - * Height of the barcode image in given units. Default units: pixel. - */ - public $image_height; - - /** - * Width of the barcode image in given units. Default units: pixel. - */ - public $image_width; - - /** - * BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0. - */ - public $rotation_angle; - - /** - * Background color of the barcode image. Default value: white. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF - */ - public $back_color; - - /** - * Bars color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF - */ - public $bar_color; - - /** - * Border color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF - */ - public $border_color; - - /** - * Border width. Default value: 0. Ignored if Visible is set to false. - */ - public $border_width; - - /** - * Border dash style. Default value: BorderDashStyle.Solid. - */ - public $border_dash_style; - - /** - * Border visibility. If false than parameter Width is always ignored (0). Default value: false. - */ - public $border_visible; - - /** - * Enable checksum during generation 1D barcodes. Default is treated as Yes for symbology which must contain checksum, as No where checksum only possible. Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN, Codabar Checksum always used: Rest symbology - */ - public $enable_checksum; - - /** - * Indicates whether explains the character \"\\\" as an escape character in CodeText property. Used for Pdf417, DataMatrix, Code128 only If the EnableEscape is true, \"\\\" will be explained as a special escape character. Otherwise, \"\\\" acts as normal characters. Aspose.BarCode supports input decimal ascii code and mnemonic for ASCII control-code characters. For example, \\013 and \\\\CR stands for CR. - */ - public $enable_escape; - - /** - * Value indicating whether bars are filled. Only for 1D barcodes. Default value: true. - */ - public $filled_bars; - - /** - * Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes. - */ - public $always_show_checksum; - - /** - * Wide bars to Narrow bars ratio. Default value: 3, that is, wide bars are 3 times as wide as narrow bars. Used for ITF, PZN, PharmaCode, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, IATA2of5, VIN, DeutschePost, OPC, Code32, DataLogic2of5, PatchCode, Code39Extended, Code39Standard - */ - public $wide_narrow_ratio; - - /** - * Only for 1D barcodes. If codetext is incorrect and value set to true - exception will be thrown. Otherwise codetext will be corrected to match barcode's specification. Exception always will be thrown for: Databar symbology if codetext is incorrect. Exception always will not be thrown for: AustraliaPost, SingaporePost, Code39Extended, Code93Extended, Code16K, Code128 symbology if codetext is incorrect. - */ - public $validate_text; - - /** - * Supplement parameters. Used for Interleaved2of5, Standard2of5, EAN13, EAN8, UPCA, UPCE, ISBN, ISSN, ISMN. - */ - public $supplement_data; - - /** - * Space between main the BarCode and supplement BarCode. - */ - public $supplement_space; - - /** - * Bars reduction value that is used to compensate ink spread while printing. - */ - public $bar_width_reduction; - - /** - * Indicates whether is used anti-aliasing mode to render image. Anti-aliasing mode is applied to barcode and text drawing. - */ - public $use_anti_alias; - - /** - * Image's storage. - */ - public $storage; - - /** - * Image's folder. - */ - public $folder; - - /** - * The image format. - */ - public $format; -} diff --git a/src/Aspose/BarCode/Requests/PutBarcodeRecognizeFromBodyRequest.php b/src/Aspose/BarCode/Requests/PutBarcodeRecognizeFromBodyRequest.php deleted file mode 100644 index d6096fd..0000000 --- a/src/Aspose/BarCode/Requests/PutBarcodeRecognizeFromBodyRequest.php +++ /dev/null @@ -1,62 +0,0 @@ - - * Copyright (c) 2025 Aspose Pty Ltd - * - * -------------------------------------------------------------------------------------------------------------------- - */ - -declare(strict_types=1); - -namespace Aspose\BarCode\Requests; - -/** - * Request model for "putBarcodeRecognizeFromBody" operation. - */ -class PutBarcodeRecognizeFromBodyRequest -{ - /** - * Initializes a new instance of the PutBarcodeRecognizeFromBodyRequest class. - * - * @param string $name The image file name. - * @param \Aspose\BarCode\Model\ReaderParams $reader_params BarcodeReader object with parameters. - * @param string $type - * @param string $storage The storage name - * @param string $folder The image folder. - */ - public function __construct($name, $reader_params, $type = null, $storage = null, $folder = null) - { - $this->name = $name; - $this->reader_params = $reader_params; - $this->type = $type; - $this->storage = $storage; - $this->folder = $folder; - } - - /** - * The image file name. - */ - public $name; - - /** - * BarcodeReader object with parameters. - */ - public $reader_params; - - /** - * Gets or sets type - */ - public $type; - - /** - * The storage name - */ - public $storage; - - /** - * The image folder. - */ - public $folder; -} diff --git a/src/Aspose/BarCode/Requests/PutGenerateMultipleRequest.php b/src/Aspose/BarCode/Requests/PutGenerateMultipleRequest.php deleted file mode 100644 index 032402b..0000000 --- a/src/Aspose/BarCode/Requests/PutGenerateMultipleRequest.php +++ /dev/null @@ -1,62 +0,0 @@ - - * Copyright (c) 2025 Aspose Pty Ltd - * - * -------------------------------------------------------------------------------------------------------------------- - */ - -declare(strict_types=1); - -namespace Aspose\BarCode\Requests; - -/** - * Request model for "putGenerateMultiple" operation. - */ -class PutGenerateMultipleRequest -{ - /** - * Initializes a new instance of the PutGenerateMultipleRequest class. - * - * @param string $name New filename - * @param \Aspose\BarCode\Model\GeneratorParamsList $generator_params_list List of barcodes - * @param string $format Format of file - * @param string $folder Folder to place file to - * @param string $storage The storage name - */ - public function __construct($name, $generator_params_list, $format = null, $folder = null, $storage = null) - { - $this->name = $name; - $this->generator_params_list = $generator_params_list; - $this->format = $format; - $this->folder = $folder; - $this->storage = $storage; - } - - /** - * New filename - */ - public $name; - - /** - * List of barcodes - */ - public $generator_params_list; - - /** - * Format of file - */ - public $format; - - /** - * Folder to place file to - */ - public $folder; - - /** - * The storage name - */ - public $storage; -} diff --git a/src/Aspose/BarCode/Requests/RecognizeBase64RequestWrapper.php b/src/Aspose/BarCode/Requests/RecognizeBase64RequestWrapper.php new file mode 100644 index 0000000..9095fd9 --- /dev/null +++ b/src/Aspose/BarCode/Requests/RecognizeBase64RequestWrapper.php @@ -0,0 +1,34 @@ + + * Copyright (c) 2025 Aspose Pty Ltd + * + * -------------------------------------------------------------------------------------------------------------------- + */ + +declare(strict_types=1); + +namespace Aspose\BarCode\Requests; + +/** + * Request model for "recognizeBase64" operation. + */ +class RecognizeBase64RequestWrapper +{ + /** + * Initializes a new instance of the RecognizeBase64RequestWrapper class. + * + * @param \Aspose\BarCode\Model\RecognizeBase64Request $recognize_base64_request Barcode recognition request + */ + public function __construct($recognize_base64_request) + { + $this->recognize_base64_request = $recognize_base64_request; + } + + /** + * Barcode recognition request + */ + public $recognize_base64_request; +} diff --git a/src/Aspose/BarCode/Requests/RecognizeMultipartRequestWrapper.php b/src/Aspose/BarCode/Requests/RecognizeMultipartRequestWrapper.php new file mode 100644 index 0000000..601bb2a --- /dev/null +++ b/src/Aspose/BarCode/Requests/RecognizeMultipartRequestWrapper.php @@ -0,0 +1,55 @@ + + * Copyright (c) 2025 Aspose Pty Ltd + * + * -------------------------------------------------------------------------------------------------------------------- + */ + +declare(strict_types=1); + +namespace Aspose\BarCode\Requests; + +/** + * Request model for "recognizeMultipart" operation. + */ +class RecognizeMultipartRequestWrapper +{ + /** + * Initializes a new instance of the RecognizeMultipartRequestWrapper class. + * + * @param \Aspose\BarCode\Model\DecodeBarcodeType $barcode_type + * @param \SplFileObject $file Barcode image file + * @param \Aspose\BarCode\Model\RecognitionMode $recognition_mode + * @param \Aspose\BarCode\Model\RecognitionImageKind $recognition_image_kind + */ + public function __construct($barcode_type, $file, $recognition_mode = null, $recognition_image_kind = null) + { + $this->barcode_type = $barcode_type; + $this->file = $file; + $this->recognition_mode = $recognition_mode; + $this->recognition_image_kind = $recognition_image_kind; + } + + /** + * Gets or sets barcode_type + */ + public $barcode_type; + + /** + * Barcode image file + */ + public $file; + + /** + * Gets or sets recognition_mode + */ + public $recognition_mode; + + /** + * Gets or sets recognition_image_kind + */ + public $recognition_image_kind; +} diff --git a/src/Aspose/BarCode/Requests/RecognizeRequestWrapper.php b/src/Aspose/BarCode/Requests/RecognizeRequestWrapper.php new file mode 100644 index 0000000..fd1e722 --- /dev/null +++ b/src/Aspose/BarCode/Requests/RecognizeRequestWrapper.php @@ -0,0 +1,55 @@ + + * Copyright (c) 2025 Aspose Pty Ltd + * + * -------------------------------------------------------------------------------------------------------------------- + */ + +declare(strict_types=1); + +namespace Aspose\BarCode\Requests; + +/** + * Request model for "recognize" operation. + */ +class RecognizeRequestWrapper +{ + /** + * Initializes a new instance of the RecognizeRequestWrapper class. + * + * @param \Aspose\BarCode\Model\DecodeBarcodeType $barcode_type Type of barcode to recognize + * @param string $file_url Url to barcode image + * @param \Aspose\BarCode\Model\RecognitionMode $recognition_mode Recognition mode + * @param \Aspose\BarCode\Model\RecognitionImageKind $recognition_image_kind Image kind for recognition + */ + public function __construct($barcode_type, $file_url, $recognition_mode = null, $recognition_image_kind = null) + { + $this->barcode_type = $barcode_type; + $this->file_url = $file_url; + $this->recognition_mode = $recognition_mode; + $this->recognition_image_kind = $recognition_image_kind; + } + + /** + * Type of barcode to recognize + */ + public $barcode_type; + + /** + * Url to barcode image + */ + public $file_url; + + /** + * Recognition mode + */ + public $recognition_mode; + + /** + * Image kind for recognition + */ + public $recognition_image_kind; +} diff --git a/src/Aspose/BarCode/Requests/ScanBarcodeRequest.php b/src/Aspose/BarCode/Requests/ScanBarcodeRequest.php deleted file mode 100644 index 88b7ad0..0000000 --- a/src/Aspose/BarCode/Requests/ScanBarcodeRequest.php +++ /dev/null @@ -1,55 +0,0 @@ - - * Copyright (c) 2025 Aspose Pty Ltd - * - * -------------------------------------------------------------------------------------------------------------------- - */ - -declare(strict_types=1); - -namespace Aspose\BarCode\Requests; - -/** - * Request model for "scanBarcode" operation. - */ -class ScanBarcodeRequest -{ - /** - * Initializes a new instance of the ScanBarcodeRequest class. - * - * @param \SplFileObject $image_file Image as file - * @param \Aspose\BarCode\Model\DecodeBarcodeType[] $decode_types Types of barcode to recognize - * @param int $timeout Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). Maximum value is 30_000 (1/2 minute). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout. - * @param string $checksum_validation Checksum validation setting. Default is ON. - */ - public function __construct($image_file, $decode_types = null, $timeout = null, $checksum_validation = null) - { - $this->image_file = $image_file; - $this->decode_types = $decode_types; - $this->timeout = $timeout; - $this->checksum_validation = $checksum_validation; - } - - /** - * Image as file - */ - public $image_file; - - /** - * Types of barcode to recognize - */ - public $decode_types; - - /** - * Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). Maximum value is 30_000 (1/2 minute). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout. - */ - public $timeout; - - /** - * Checksum validation setting. Default is ON. - */ - public $checksum_validation; -} diff --git a/src/Aspose/BarCode/Requests/ScanBase64RequestWrapper.php b/src/Aspose/BarCode/Requests/ScanBase64RequestWrapper.php new file mode 100644 index 0000000..d471df8 --- /dev/null +++ b/src/Aspose/BarCode/Requests/ScanBase64RequestWrapper.php @@ -0,0 +1,34 @@ + + * Copyright (c) 2025 Aspose Pty Ltd + * + * -------------------------------------------------------------------------------------------------------------------- + */ + +declare(strict_types=1); + +namespace Aspose\BarCode\Requests; + +/** + * Request model for "scanBase64" operation. + */ +class ScanBase64RequestWrapper +{ + /** + * Initializes a new instance of the ScanBase64RequestWrapper class. + * + * @param \Aspose\BarCode\Model\ScanBase64Request $scan_base64_request Barcode scan request + */ + public function __construct($scan_base64_request) + { + $this->scan_base64_request = $scan_base64_request; + } + + /** + * Barcode scan request + */ + public $scan_base64_request; +} diff --git a/src/Aspose/BarCode/Requests/GetDiscUsageRequest.php b/src/Aspose/BarCode/Requests/ScanMultipartRequestWrapper.php similarity index 52% rename from src/Aspose/BarCode/Requests/GetDiscUsageRequest.php rename to src/Aspose/BarCode/Requests/ScanMultipartRequestWrapper.php index c85e3fd..a0736ff 100644 --- a/src/Aspose/BarCode/Requests/GetDiscUsageRequest.php +++ b/src/Aspose/BarCode/Requests/ScanMultipartRequestWrapper.php @@ -2,7 +2,7 @@ /** * -------------------------------------------------------------------------------------------------------------------- - * + * * Copyright (c) 2025 Aspose Pty Ltd * * -------------------------------------------------------------------------------------------------------------------- @@ -13,22 +13,22 @@ namespace Aspose\BarCode\Requests; /** - * Request model for "getDiscUsage" operation. + * Request model for "scanMultipart" operation. */ -class GetDiscUsageRequest +class ScanMultipartRequestWrapper { /** - * Initializes a new instance of the GetDiscUsageRequest class. + * Initializes a new instance of the ScanMultipartRequestWrapper class. * - * @param string $storage_name Storage name + * @param \SplFileObject $file Barcode image file */ - public function __construct($storage_name = null) + public function __construct($file) { - $this->storage_name = $storage_name; + $this->file = $file; } /** - * Storage name + * Barcode image file */ - public $storage_name; + public $file; } diff --git a/src/Aspose/BarCode/Requests/StorageExistsRequest.php b/src/Aspose/BarCode/Requests/ScanRequestWrapper.php similarity index 52% rename from src/Aspose/BarCode/Requests/StorageExistsRequest.php rename to src/Aspose/BarCode/Requests/ScanRequestWrapper.php index 6ab0ebc..6dd4f89 100644 --- a/src/Aspose/BarCode/Requests/StorageExistsRequest.php +++ b/src/Aspose/BarCode/Requests/ScanRequestWrapper.php @@ -2,7 +2,7 @@ /** * -------------------------------------------------------------------------------------------------------------------- - * + * * Copyright (c) 2025 Aspose Pty Ltd * * -------------------------------------------------------------------------------------------------------------------- @@ -13,22 +13,22 @@ namespace Aspose\BarCode\Requests; /** - * Request model for "storageExists" operation. + * Request model for "scan" operation. */ -class StorageExistsRequest +class ScanRequestWrapper { /** - * Initializes a new instance of the StorageExistsRequest class. + * Initializes a new instance of the ScanRequestWrapper class. * - * @param string $storage_name Storage name + * @param string $file_url Url to barcode image */ - public function __construct($storage_name) + public function __construct($file_url) { - $this->storage_name = $storage_name; + $this->file_url = $file_url; } /** - * Storage name + * Url to barcode image */ - public $storage_name; + public $file_url; } diff --git a/src/Aspose/BarCode/Requests/UploadFileRequest.php b/src/Aspose/BarCode/Requests/UploadFileRequest.php deleted file mode 100644 index 9549390..0000000 --- a/src/Aspose/BarCode/Requests/UploadFileRequest.php +++ /dev/null @@ -1,48 +0,0 @@ - - * Copyright (c) 2025 Aspose Pty Ltd - * - * -------------------------------------------------------------------------------------------------------------------- - */ - -declare(strict_types=1); - -namespace Aspose\BarCode\Requests; - -/** - * Request model for "uploadFile" operation. - */ -class UploadFileRequest -{ - /** - * Initializes a new instance of the UploadFileRequest class. - * - * @param string $path Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext If the content is multipart and path does not contains the file name it tries to get them from filename parameter from Content-Disposition header. - * @param \SplFileObject $file File to upload - * @param string $storage_name Storage name - */ - public function __construct($path, $file, $storage_name = null) - { - $this->path = $path; - $this->file = $file; - $this->storage_name = $storage_name; - } - - /** - * Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext If the content is multipart and path does not contains the file name it tries to get them from filename parameter from Content-Disposition header. - */ - public $path; - - /** - * File to upload - */ - public $file; - - /** - * Storage name - */ - public $storage_name; -} diff --git a/src/Aspose/BarCode/ScanApi.php b/src/Aspose/BarCode/ScanApi.php new file mode 100644 index 0000000..5fc8884 --- /dev/null +++ b/src/Aspose/BarCode/ScanApi.php @@ -0,0 +1,947 @@ + + * Copyright (c) 2025 Aspose Pty Ltd + * + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * -------------------------------------------------------------------------------------------------------------------- + */ + +namespace Aspose\BarCode; + +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\GuzzleException; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use Aspose\BarCode\Requests; +use InvalidArgumentException; +use RuntimeException; + +/** + * Aspose.BarCode for Cloud API. + */ + +class ScanApi +{ + /** + * Stores client instance + * @var ClientInterface client for calling api + */ + protected $client; + + /** + * Stores configuration + * @var Configuration configuration info + */ + protected $config; + + /** + * Stores header selector + * HeaderSelector class for header selection + */ + protected $headerSelector; + + /** + * Initialize a new instance of Api + * @param ClientInterface|null $client client for calling api + * @param Configuration|null $config configuration info + * @param HeaderSelector|null $selector class for header selection + */ + public function __construct(ClientInterface $client = null, Configuration $config = null, HeaderSelector $selector = null) + { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * Gets the config + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation scan + * + * Scan barcode from file on server using GET requests with parameter in query string. + * + * @param Requests\ScanRequestWrapper $request is a request object for operation + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException + * @return \Aspose\BarCode\Model\BarcodeResponseList + */ + public function scan(Requests\ScanRequestWrapper $request) + { + try { + list($response) = $this->scanWithHttpInfo($request); + return $response; + } catch (RepeatRequestException $e) { + list($response) = $this->scanWithHttpInfo($request); + return $response; + } + } + + /** + * Operation scanWithHttpInfo + * + * Scan barcode from file on server using GET requests with parameter in query string. + * + * @param Requests\ScanRequestWrapper $request is a request object for operation + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException + * @return array of \Aspose\BarCode\Model\BarcodeResponseList, HTTP status code, HTTP response headers (array of strings) + */ + public function scanWithHttpInfo(Requests\ScanRequestWrapper $request) + { + $returnType = '\Aspose\BarCode\Model\BarcodeResponseList'; + $request = $this->ScanRequestWrapper($request); + + try { + $options = $this->_createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + if ($statusCode === 401) { + $this->_requestToken(); + throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); + } + + throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody()); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + if ($this->config->getDebug()) { + $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\BarcodeResponseList', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ApiErrorResponse', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ApiErrorResponse', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation scanAsync + * + * Scan barcode from file on server using GET requests with parameter in query string. + * + * @param Requests\ScanRequestWrapper $request is a request object for operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function scanAsync(Requests\ScanRequestWrapper $request) + { + return $this->scanAsyncWithHttpInfo($request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation scanAsyncWithHttpInfo + * + * Scan barcode from file on server using GET requests with parameter in query string. + * + * @param Requests\ScanRequestWrapper $request is a request object for operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function scanAsyncWithHttpInfo(Requests\ScanRequestWrapper $request) + { + $returnType = '\Aspose\BarCode\Model\BarcodeResponseList'; + $request = $this->ScanRequestWrapper($request); + + return $this->client + ->sendAsync($request, $this->_createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + if ($this->config->getDebug()) { + $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + + if ($exception instanceof RepeatRequestException) { + //$this->_refreshToken(); + throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); + } + + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'scan' + * + * @param Requests\ScanRequestWrapper $request is a request object for operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function ScanRequestWrapper(Requests\ScanRequestWrapper $request) + { + // verify the required parameter 'file_url' is set + if (!isset($request->file_url)) { + throw new InvalidArgumentException('Missing the required parameter $file_url when calling scan'); + } + + $resourcePath = '/barcode/scan'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + if (isset($request->file_url)) { + $queryParamName = lcfirst('fileUrl'); + $queryParamValue = is_bool($request->file_url) ? ($request->file_url ? 'true' : 'false') : $request->file_url; + if (strpos($resourcePath, '{' . $queryParamName . '}') !== false) { + $resourcePath = str_replace('{' . $queryParamName . '}', ObjectSerializer::toPathValue($queryParamValue), $resourcePath); + } else { + $queryParams[$queryParamName] = ObjectSerializer::toQueryValue($queryParamValue); + } + } + + $resourcePath = $this->_parseURL($resourcePath, $queryParams); + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json', 'application/xml'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'application/xml'], + [] + ); + } + + // for model (json/xml) + + if (!$this->config->getAccessToken()) { + $this->_requestToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['x-aspose-client'] = $this->config->getUserAgent(); + } + + $defaultHeaders['x-aspose-client-version'] = $this->config->getClientVersion(); + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $req = new Request( + 'GET', + $this->config->getHost() . $resourcePath, + $headers, + $httpBody + ); + if ($this->config->getDebug()) { + $this->_writeRequestLog('GET', $this->config->getHost() . $resourcePath, $headers, $httpBody); + } + + return $req; + } + + /** + * Operation scanBase64 + * + * Scan barcode from file in request body using POST requests with parameter in body in json or xml format. + * + * @param Requests\ScanBase64RequestWrapper $request is a request object for operation + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException + * @return \Aspose\BarCode\Model\BarcodeResponseList + */ + public function scanBase64(Requests\ScanBase64RequestWrapper $request) + { + try { + list($response) = $this->scanBase64WithHttpInfo($request); + return $response; + } catch (RepeatRequestException $e) { + list($response) = $this->scanBase64WithHttpInfo($request); + return $response; + } + } + + /** + * Operation scanBase64WithHttpInfo + * + * Scan barcode from file in request body using POST requests with parameter in body in json or xml format. + * + * @param Requests\ScanBase64RequestWrapper $request is a request object for operation + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException + * @return array of \Aspose\BarCode\Model\BarcodeResponseList, HTTP status code, HTTP response headers (array of strings) + */ + public function scanBase64WithHttpInfo(Requests\ScanBase64RequestWrapper $request) + { + $returnType = '\Aspose\BarCode\Model\BarcodeResponseList'; + $request = $this->ScanBase64RequestWrapper($request); + + try { + $options = $this->_createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + if ($statusCode === 401) { + $this->_requestToken(); + throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); + } + + throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody()); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + if ($this->config->getDebug()) { + $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\BarcodeResponseList', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ApiErrorResponse', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ApiErrorResponse', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation scanBase64Async + * + * Scan barcode from file in request body using POST requests with parameter in body in json or xml format. + * + * @param Requests\ScanBase64RequestWrapper $request is a request object for operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function scanBase64Async(Requests\ScanBase64RequestWrapper $request) + { + return $this->scanBase64AsyncWithHttpInfo($request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation scanBase64AsyncWithHttpInfo + * + * Scan barcode from file in request body using POST requests with parameter in body in json or xml format. + * + * @param Requests\ScanBase64RequestWrapper $request is a request object for operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function scanBase64AsyncWithHttpInfo(Requests\ScanBase64RequestWrapper $request) + { + $returnType = '\Aspose\BarCode\Model\BarcodeResponseList'; + $request = $this->ScanBase64RequestWrapper($request); + + return $this->client + ->sendAsync($request, $this->_createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + if ($this->config->getDebug()) { + $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + + if ($exception instanceof RepeatRequestException) { + //$this->_refreshToken(); + throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); + } + + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'scanBase64' + * + * @param Requests\ScanBase64RequestWrapper $request is a request object for operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function ScanBase64RequestWrapper(Requests\ScanBase64RequestWrapper $request) + { + // verify the required parameter 'scan_base64_request' is set + if (!isset($request->scan_base64_request)) { + throw new InvalidArgumentException('Missing the required parameter $scan_base64_request when calling scanBase64'); + } + + $resourcePath = '/barcode/scan-body'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + $resourcePath = $this->_parseURL($resourcePath, $queryParams); + + // body params + $_tempBody = null; + if (isset($request->scan_base64_request)) { + if (is_string($request->scan_base64_request)) { + $_tempBody = "\"" . $request->scan_base64_request . "\""; + } else { + $_tempBody = $request->scan_base64_request; + } + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json', 'application/xml'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'application/xml'], + ['application/json', 'application/xml'] + ); + } + + // for model (json/xml) + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + + if (!$this->config->getAccessToken()) { + $this->_requestToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['x-aspose-client'] = $this->config->getUserAgent(); + } + + $defaultHeaders['x-aspose-client-version'] = $this->config->getClientVersion(); + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $req = new Request( + 'POST', + $this->config->getHost() . $resourcePath, + $headers, + $httpBody + ); + if ($this->config->getDebug()) { + $this->_writeRequestLog('POST', $this->config->getHost() . $resourcePath, $headers, $httpBody); + } + + return $req; + } + + /** + * Operation scanMultipart + * + * Scan barcode from file in request body using POST requests with parameter in multipart form. + * + * @param Requests\ScanMultipartRequestWrapper $request is a request object for operation + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException + * @return \Aspose\BarCode\Model\BarcodeResponseList + */ + public function scanMultipart(Requests\ScanMultipartRequestWrapper $request) + { + try { + list($response) = $this->scanMultipartWithHttpInfo($request); + return $response; + } catch (RepeatRequestException $e) { + list($response) = $this->scanMultipartWithHttpInfo($request); + return $response; + } + } + + /** + * Operation scanMultipartWithHttpInfo + * + * Scan barcode from file in request body using POST requests with parameter in multipart form. + * + * @param Requests\ScanMultipartRequestWrapper $request is a request object for operation + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException + * @return array of \Aspose\BarCode\Model\BarcodeResponseList, HTTP status code, HTTP response headers (array of strings) + */ + public function scanMultipartWithHttpInfo(Requests\ScanMultipartRequestWrapper $request) + { + $returnType = '\Aspose\BarCode\Model\BarcodeResponseList'; + $request = $this->ScanMultipartRequestWrapper($request); + + try { + $options = $this->_createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + if ($statusCode === 401) { + $this->_requestToken(); + throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); + } + + throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody()); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + if ($this->config->getDebug()) { + $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\BarcodeResponseList', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ApiErrorResponse', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\BarCode\Model\ApiErrorResponse', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation scanMultipartAsync + * + * Scan barcode from file in request body using POST requests with parameter in multipart form. + * + * @param Requests\ScanMultipartRequestWrapper $request is a request object for operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function scanMultipartAsync(Requests\ScanMultipartRequestWrapper $request) + { + return $this->scanMultipartAsyncWithHttpInfo($request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation scanMultipartAsyncWithHttpInfo + * + * Scan barcode from file in request body using POST requests with parameter in multipart form. + * + * @param Requests\ScanMultipartRequestWrapper $request is a request object for operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function scanMultipartAsyncWithHttpInfo(Requests\ScanMultipartRequestWrapper $request) + { + $returnType = '\Aspose\BarCode\Model\BarcodeResponseList'; + $request = $this->ScanMultipartRequestWrapper($request); + + return $this->client + ->sendAsync($request, $this->_createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + if ($this->config->getDebug()) { + $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, [])); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + + if ($exception instanceof RepeatRequestException) { + //$this->_refreshToken(); + throw new RepeatRequestException('Request must be retried', $statusCode, $response->getHeaders(), $response->getBody()); + } + + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'scanMultipart' + * + * @param Requests\ScanMultipartRequestWrapper $request is a request object for operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function ScanMultipartRequestWrapper(Requests\ScanMultipartRequestWrapper $request) + { + // verify the required parameter 'file' is set + if (!isset($request->file)) { + throw new InvalidArgumentException('Missing the required parameter $file when calling scanMultipart'); + } + + $resourcePath = '/barcode/scan-multipart'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + $resourcePath = $this->_parseURL($resourcePath, $queryParams); + + $multipart = true; + // form params + $filename = ObjectSerializer::toFormValue($request->file); + $handle = fopen($filename, 'rb'); + $fsize = filesize($filename); + $contents = fread($handle, $fsize); + $formParams['file'][] = $contents; + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json', 'application/xml'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'application/xml'], + ['multipart/form-data'] + ); + } + + // for model (json/xml) + + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValues) { + foreach ($formParamValues as $formParamValue) { + $multipartFileName = str_contains($formParamName, 'file') ? $filename : ''; + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue, + 'filename' => $multipartFileName + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + + if (!$this->config->getAccessToken()) { + $this->_requestToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['x-aspose-client'] = $this->config->getUserAgent(); + } + + $defaultHeaders['x-aspose-client-version'] = $this->config->getClientVersion(); + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $req = new Request( + 'POST', + $this->config->getHost() . $resourcePath, + $headers, + $httpBody + ); + if ($this->config->getDebug()) { + $this->_writeRequestLog('POST', $this->config->getHost() . $resourcePath, $headers, $httpBody); + } + + return $req; + } + + /** + * Create http client option + * + * @throws RuntimeException on file opening failure + * @return array of http client options + */ + private function _createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + /** + * Executes response logging + */ + private function _writeResponseLog($statusCode, $headers, $body) + { + $logInfo = "\nResponse: $statusCode \n"; + echo $logInfo . $this->_writeHeadersAndBody($logInfo, $headers, $body); + } + + /** + * Executes request logging + */ + private function _writeRequestLog($method, $url, $headers, $body) + { + $logInfo = "\n$method: $url \n"; + echo $logInfo . $this->_writeHeadersAndBody($logInfo, $headers, $body); + } + + /** + * Executes header and boy formatting + */ + private function _writeHeadersAndBody($logInfo, $headers, $body) + { + foreach ($headers as $name => $value) { + $strValue = is_array($value) ? implode($value) : $value; + $logInfo .= $name . ': ' . $strValue . '\n'; + } + + return $logInfo .= 'Body: ' . $body . '\n'; + } + + /** + * Executes url parsing + */ + private function _parseURL($url, $queryParams) + { + // parse the url + $UrlToSign = trim($url, '/'); + $urlQuery = preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($queryParams)); + + $urlPartToSign = $this->config->getBasePath() . '/' . parse_url($UrlToSign, PHP_URL_HOST) . parse_url($UrlToSign, PHP_URL_PATH) . '?' . $urlQuery; + + return $urlPartToSign; + } + + /** + * Gets a request token from server + */ + private function _requestToken() + { + $requestUrl = $this->config->getAuthUrl(); + + $response = $this->client->request('POST', $requestUrl, [ + 'form_params' => [ + 'grant_type' => 'client_credentials', + 'client_id' => $this->config->getClientId(), + 'client_secret' => $this->config->getClientSecret(), + ] + ]); + $result = json_decode($response->getBody()->getContents(), true); + $this->config->setAccessToken($result['access_token']); + } +} diff --git a/testdata/Code128.jpeg b/testdata/Code128.jpeg new file mode 100644 index 0000000..4e7013c Binary files /dev/null and b/testdata/Code128.jpeg differ diff --git a/testdata/Code128.png b/testdata/Code128.png new file mode 100644 index 0000000..4e7013c Binary files /dev/null and b/testdata/Code128.png differ diff --git a/testdata/Code39.jpeg b/testdata/Code39.jpeg new file mode 100644 index 0000000..c5a4b3c Binary files /dev/null and b/testdata/Code39.jpeg differ diff --git a/testdata/Code39.png b/testdata/Code39.png new file mode 100644 index 0000000..1419490 Binary files /dev/null and b/testdata/Code39.png differ diff --git a/testdata/Pdf417.png b/testdata/Pdf417.png new file mode 100644 index 0000000..603813a Binary files /dev/null and b/testdata/Pdf417.png differ diff --git a/testdata/Pdf417.svg b/testdata/Pdf417.svg new file mode 100644 index 0000000..cc39c28 --- /dev/null +++ b/testdata/Pdf417.svg @@ -0,0 +1,493 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testdata/Qr.png b/testdata/Qr.png new file mode 100644 index 0000000..c04b484 Binary files /dev/null and b/testdata/Qr.png differ diff --git a/testdata/aztec.png b/testdata/aztec.png new file mode 100644 index 0000000..4ed7a80 Binary files /dev/null and b/testdata/aztec.png differ diff --git a/tests/BarcodeApiTest.php b/tests/BarcodeApiTest.php deleted file mode 100644 index fe24c98..0000000 --- a/tests/BarcodeApiTest.php +++ /dev/null @@ -1,316 +0,0 @@ -format = 'png'; - - $response = self::$api->GetBarCodeGenerate($request); - - $imageSize = $response->getSize(); - $this->assertGreaterThan(0, $imageSize); - } - - - /** - * Test case for getBarcodeRecognize - * - * Recognize barcode from a file on server. - */ - public function testGetBarcodeRecognize() - { - $fileApi = new FileApi(null, self::$config); - $path = self::$tempFolderPath . '/' . 'testGetBarcodeRecognize.png'; - $uploaded = $fileApi->uploadFile( - new UploadFileRequest( - $path, - new SplFileObject('./testdata/pdf417Sample.png') - ) - ); - $this->assertEmpty($uploaded->getErrors(), strval($uploaded)); - - $request = new GetBarcodeRecognizeRequest($uploaded->getUploaded()[0]); - $request->folder = self::$tempFolderPath; - $request->preset = PresetType::HighPerformance; - $request->types = [DecodeBarcodeType::Pdf417, DecodeBarcodeType::QR]; - - $response = self::$api->GetBarcoderecognize($request); - - $barcodes = $response->getBarcodes(); - $this->assertCount(1, $barcodes); - $this->assertEquals(DecodeBarcodeType::Pdf417, $barcodes[0]->getType()); - $this->assertEquals('Aspose.BarCode for Cloud Sample', $barcodes[0]->getBarcodeValue()); - } - - - /** - * Test case for postBarcodeRecognizeFromUrlOrContent - * - * Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image or encoded with base64. - */ - public function testPostBarcodeRecognizeFromUrlOrContent() - { - $request = new PostBarCodeRecognizeFromUrlorContentRequest(); - $request->image = new SplFileObject('./testdata/pdf417Sample.png'); - $request->preset = PresetType::HighPerformance; - $request->types = [DecodeBarcodeType::Pdf417, DecodeBarcodeType::QR]; - - $response = self::$api->PostBarCodeRecognizeFromUrlorContent($request); - - $barcodes = $response->getBarcodes(); - $this->assertCount(1, $barcodes); - $this->assertEquals(DecodeBarcodeType::Pdf417, $barcodes[0]->getType()); - $this->assertEquals('Aspose.BarCode for Cloud Sample', $barcodes[0]->getBarcodeValue()); - } - - - public function testPostBarcodeRecognizeFromUrlOrContentWithTimeout() - { - $request = new PostBarCodeRecognizeFromUrlorContentRequest(); - $request->image = new SplFileObject('./testdata/pdf417Sample.png'); - $request->timeout = 1; - - try { - self::$api->PostBarCodeRecognizeFromUrlorContent($request); - $this->fail("Exception was not thrown!"); - } catch (ApiException $e) { - $this->assertEquals(408, $e->getCode()); - } - } - - - /** - * Test case for postGenerateMultiple - * - * Generate multiple barcodes and return in response stream. - */ - public function testPostGenerateMultiple() - { - $request = new PostGenerateMultipleRequest( - new GeneratorParamsList([ - 'barcode_builders' => [ - new GeneratorParams([ - 'type_of_barcode' => EncodeBarcodeType::QR, - 'text' => 'Hello QR!', - ]), - new GeneratorParams([ - 'type_of_barcode' => EncodeBarcodeType::Code128, - 'text' => 'Hello Code128!', - ]), - ], - 'x_step' => 0, - 'y_step' => 0, - ]) - ); - - $response = self::$api->postGenerateMultiple($request); - - $this->assertGreaterThan(0, $response->getSize()); - } - - - /** - * Test case for putBarcodeGenerateFile - * - * Generate barcode and save on server (from query params or from file with json or xml content). - */ - public function testPutBarcodeGenerateFile() - { - $request = new PutBarcodeGenerateFileRequest( - 'testPutBarcodeGenerateFile.png', - EncodeBarcodeType::Code128, - 'Hello!' - ); - $request->folder = self::$tempFolderPath; - - $response = self::$api->putBarcodeGenerateFile($request); - - $this->assertGreaterThan(0, $response->getFileSize()); - $this->assertGreaterThan(0, $response->getImageWidth()); - $this->assertGreaterThan(0, $response->getImageHeight()); - } - - - /** - * Test case for putBarcodeRecognizeFromBody - * - * Recognition of a barcode from file on server with parameters in body. - */ - public function testPutBarcodeRecognizeFromBody() - { - // Upload test file - $fileApi = new FileApi(null, self::$config); - $path = self::$tempFolderPath . '/' . 'testGetBarcodeRecognize.png'; - $uploaded = $fileApi->uploadFile( - new UploadFileRequest( - $path, - new SplFileObject('./testdata/pdf417Sample.png') - ) - ); - $this->assertEmpty($uploaded->getErrors(), strval($uploaded)); - - // Arrange - $request = new PutBarcodeRecognizeFromBodyRequest( - $uploaded->getUploaded()[0], - new ReaderParams([ - 'types' => [DecodeBarcodeType::Pdf417, DecodeBarcodeType::QR], - 'preset' => PresetType::HighPerformance, - ]) - ); - $request->folder = self::$tempFolderPath; - - // Act - $response = self::$api->putBarcodeRecognizeFromBody($request); - - // Assert - $barcodes = $response->getBarcodes(); - $this->assertCount(1, $barcodes); - $this->assertEquals(DecodeBarcodeType::Pdf417, $barcodes[0]->getType()); - $this->assertEquals('Aspose.BarCode for Cloud Sample', $barcodes[0]->getBarcodeValue()); - } - - - /** - * Test case for putGenerateMultiple - * - * Generate image with multiple barcodes and put new file on server. - */ - public function testPutGenerateMultiple() - { - $request = new PutGenerateMultipleRequest( - 'testPutGenerateMultiple.png', - new GeneratorParamsList([ - 'barcode_builders' => [ - new GeneratorParams([ - 'type_of_barcode' => EncodeBarcodeType::QR, - 'text' => 'Hello QR!', - ]), - new GeneratorParams([ - 'type_of_barcode' => EncodeBarcodeType::Code128, - 'text' => 'Hello Code128!', - ]), - ], - 'x_step' => 0, - 'y_step' => 0, - ]) - ); - $request->folder = self::$tempFolderPath; - - $response = self::$api->putGenerateMultiple($request); - - $this->assertGreaterThan(0, $response->getFileSize()); - $this->assertGreaterThan(0, $response->getImageWidth()); - $this->assertGreaterThan(0, $response->getImageHeight()); - } - - - /** - * Test case for scan - * - * Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image or encoded with base64. - */ - public function testScan() - { - $image_file = new SplFileObject('./testdata/QR_and_Code128.png'); - $request = new ScanBarcodeRequest($image_file); - $request->decode_types = [DecodeBarcodeType::Code128, DecodeBarcodeType::QR]; - - $response = self::$api->scanBarcode($request); - - $barcodes = $response->getBarcodes(); - $this->assertCount(2, $barcodes); - - $this->assertEquals(DecodeBarcodeType::Code128, $barcodes[1]->getType()); - $this->assertEquals('Hello world!', $barcodes[1]->getBarcodeValue()); - - $this->assertEquals(DecodeBarcodeType::QR, $barcodes[0]->getType()); - $this->assertEquals('Hello world!', $barcodes[0]->getBarcodeValue()); - } -} diff --git a/tests/EndToEndTest.php b/tests/EndToEndTest.php index cb7bce8..dee5347 100644 --- a/tests/EndToEndTest.php +++ b/tests/EndToEndTest.php @@ -2,12 +2,14 @@ declare(strict_types=1); -use Aspose\BarCode\BarcodeApi; +use Aspose\BarCode\GenerateApi; +use Aspose\BarCode\ScanApi; use Aspose\BarCode\Model\DecodeBarcodeType; -use Aspose\BarCode\Model\PresetType; -use Aspose\BarCode\Requests\GetBarcodeGenerateRequest; -use Aspose\BarCode\Requests\PostBarcodeRecognizeFromUrlOrContentRequest; -use Aspose\BarCode\Requests\ScanBarcodeRequest; +use Aspose\BarCode\Model\EncodeBarcodeType; +use Aspose\BarCode\Model\EncodeDataType; +use Aspose\BarCode\Model\BarcodeImageFormat; +use Aspose\BarCode\Requests\GenerateRequestWrapper; +use Aspose\BarCode\Requests\ScanMultipartRequestWrapper; use PHPUnit\Framework\TestCase; require_once 'TestConfiguration.php'; @@ -18,24 +20,20 @@ final class EndToEndTest extends TestCase public function testGenerateAndRecognize(): void { $config = TestConfiguration::fromFileOrEnv(); - $api = new BarcodeApi(null, $config); + $genApi = new GenerateApi(null, $config); + $scanApi = new ScanApi(null, $config); // Generate + $genRequest = new GenerateRequestWrapper(EncodeBarcodeType::QR, 'PHP SDK Test'); + $genRequest->image_format = BarcodeImageFormat::Png; - $genRequest = new GetBarCodeGenerateRequest('QR', 'PHP SDK Test'); - $genRequest->format = 'png'; - - $genResponse = $api->GetBarCodeGenerate($genRequest); - - $imageSize = $genResponse->getSize(); - $this->assertGreaterThan(0, $imageSize); + $genResponse = $genApi->generate($genRequest); // Scan - $scanRequest = new ScanBarcodeRequest($genResponse); - $scanRequest->decode_types = [DecodeBarcodeType::QR, DecodeBarcodeType::DataMatrix]; + $scanRequest = new ScanMultipartRequestWrapper($genResponse); - $scanResponse = $api->ScanBarcode($scanRequest); + $scanResponse = $scanApi->scanMultipart($scanRequest); $this->assertNotEmpty($scanResponse); $this->assertEquals('QR', $scanResponse->getBarcodes()[0]->getType()); diff --git a/tests/ExceptionTest.php b/tests/ExceptionTest.php new file mode 100644 index 0000000..f354be8 --- /dev/null +++ b/tests/ExceptionTest.php @@ -0,0 +1,60 @@ +generate($request); + } catch (ApiException $e) { + $thrown = true; + $this->assertEquals(400, $e->getCode()); + $this->assertNotNull($e->getResponseObject()); + $this->assertEquals( + "Error: Field name: 'Data' errors: The Data field is required.", + $e->getResponseObject()->getError()->getMessage() + ); + } + + $this->assertTrue($thrown); + } +} diff --git a/tests/GenerateApiTest.php b/tests/GenerateApiTest.php new file mode 100644 index 0000000..7f5af73 --- /dev/null +++ b/tests/GenerateApiTest.php @@ -0,0 +1,125 @@ +image_format = BarcodeImageFormat::Png; + + $response = self::$api->generate($request); + + $imageSize = $response->getSize(); + $this->assertGreaterThan(0, $imageSize); + } + + + /** + * Test case for generateBody + * + */ + public function testbarcodeGenerateBodyPost() + { + $params = new GenerateParams(); + $params->setBarcodeType(EncodeBarcodeType::QR); + $params->setEncodeData(new EncodeData(["data" => "PHP Test"])); + $params->setBarcodeImageParams(new BarcodeImageParams(["image_format" => BarcodeImageFormat::Jpeg])); + $request = new GenerateBodyRequestWrapper($params); + + $response = self::$api->generateBody($request); + + $this->assertGreaterThan(0, $response->getSize()); + } + + + /** + * Test case for generateMultipart + * + */ + public function testbarcodeGenerateMultipartPost() + { + $request = new GenerateMultipartRequestWrapper( + EncodeBarcodeType::Code128, + 'PHP SDK Test' + ); + + + $response = self::$api->generateMultipart($request); + + + $this->assertGreaterThan(0, $response->getSize()); + } +} diff --git a/tests/RecognizeApiTest.php b/tests/RecognizeApiTest.php new file mode 100644 index 0000000..638bfff --- /dev/null +++ b/tests/RecognizeApiTest.php @@ -0,0 +1,102 @@ +recognize( + new RecognizeRequestWrapper( + DecodeBarcodeType::QR, + "https://products.aspose.app/barcode/scan/img/how-to/scan/step2.png", + RecognitionMode::Fast, + RecognitionImageKind::ClearImage + ) + ); + + $this->assertCount(1, $response->getBarcodes()); + $barcode = $response->getBarcodes()[0]; + $this->assertEquals(DecodeBarcodeType::QR, $barcode->getType()); + $this->assertEquals("http://en.m.wikipedia.org", $barcode->getBarcodeValue()); + } + + public function testBarcodeRecognizeBodyPost() + { + + $imageBytes = file_get_contents(self::$testDataFolderPath . 'pdf417Sample.png'); + $encodedString = base64_encode($imageBytes); + + $response = self::$api->recognizeBase64( + new RecognizeBase64RequestWrapper( + new RecognizeBase64Request([ + 'barcode_types' => [DecodeBarcodeType::Pdf417], + 'file_base64' => $encodedString, + ]) + ) + ); + + $this->assertNotNull($response->getBarcodes()); + $this->assertCount(1, $response->getBarcodes()); + $barcode = $response->getBarcodes()[0]; + $this->assertEquals(DecodeBarcodeType::Pdf417, $barcode->getType()); + $this->assertEquals("Aspose.BarCode for Cloud Sample", $barcode->getBarcodeValue()); + $this->assertGreaterThan(0, $barcode->getRegion()[0]->getX()); + $this->assertGreaterThan(0, $barcode->getRegion()[0]->getY()); + } + + public function testBarcodeRecognizeMultipartPost() + { + + $file = new SplFileObject(self::$testDataFolderPath . 'QR_and_Code128.png', 'rb'); + $response = self::$api->recognizeMultipart( + new RecognizeMultipartRequestWrapper(DecodeBarcodeType::Code128, $file) + ); + + $this->assertCount(1, $response->getBarcodes()); + $barcode = $response->getBarcodes()[0]; + $this->assertEquals(DecodeBarcodeType::Code128, $barcode->getType()); + $this->assertEquals('Hello world!', $barcode->getBarcodeValue()); + } +} diff --git a/tests/ScanApiTest.php b/tests/ScanApiTest.php new file mode 100644 index 0000000..ed5e8de --- /dev/null +++ b/tests/ScanApiTest.php @@ -0,0 +1,83 @@ +scanMultipart($scanRequest); + $this->assertNotEmpty($scanResponse); + + $this->assertEquals(DecodeBarcodeType::Pdf417, $scanResponse->getBarcodes()[0]->getType()); + $this->assertEquals('Aspose.BarCode for Cloud Sample', $scanResponse->getBarcodes()[0]->getBarcodeValue()); + } + + public function testBarcodeScanBodyPost(): void + { + $file = new SplFileObject(self::$testDataFolderPath . 'QR_and_Code128.png'); + $scanBase64request = new ScanBase64Request(["file_base64" => base64_encode($file->fread($file->getSize()))]); + $scanRequest = new ScanBase64RequestWrapper($scanBase64request); + + $scanResponse = self::$api->scanBase64($scanRequest); + $this->assertNotEmpty($scanResponse); + + $this->assertCount(2, $scanResponse->getBarcodes()); + $this->assertEquals(DecodeBarcodeType::QR, $scanResponse->getBarcodes()[0]->getType()); + $this->assertEquals('Hello world!', $scanResponse->getBarcodes()[0]->getBarcodeValue()); + + $this->assertEquals(DecodeBarcodeType::Code128, $scanResponse->getBarcodes()[1]->getType()); + $this->assertEquals('Hello world!', $scanResponse->getBarcodes()[1]->getBarcodeValue()); + } + + public function testBarcodeScanGet() + { + + $response = self::$api->scan(new ScanRequestWrapper("https://products.aspose.app/barcode/scan/img/how-to/scan/step2.png")); + + $this->assertCount(1, $response->getBarcodes()); + + $this->assertEquals(DecodeBarcodeType::QR, $response->getBarcodes()[0]->getType()); + $this->assertEquals("http://en.m.wikipedia.org", $response->getBarcodes()[0]->getBarcodeValue()); + } +} diff --git a/tests/ScanBarcodeTest.php b/tests/ScanBarcodeTest.php deleted file mode 100644 index 2036123..0000000 --- a/tests/ScanBarcodeTest.php +++ /dev/null @@ -1,76 +0,0 @@ -decode_types = [DecodeBarcodeType::Code39Extended]; - $request->checksum_validation = ChecksumValidation::Off; - - $response = self::$api->scanBarcode($request); - - $barcodes = $response->getBarcodes(); - $this->assertCount(1, $barcodes); - - $this->assertEquals(DecodeBarcodeType::Code39Extended, $barcodes[0]->getType()); - $this->assertEquals('8M93', $barcodes[0]->getBarcodeValue()); - } -}