diff --git a/.gitignore b/.gitignore index dc235da..acad24c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /*.lock /vendor /nbproject/private +Configuration*.json +!Configuration.example.json diff --git a/README.md b/README.md index 0253bc2..9f34365 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,30 @@ -# Aspose.BarCode Cloud SDK for PHP -Aspose.BarCode for Cloud is a REST API for Linear, 2D and postal barcode generation and recognition in the cloud. API recognizes and generates barcode images in a variety of formats. Barcode REST API allows to specify barcode image attributes like image width, height, border style and output image format in order to customize the generation process. Developers can also specify the barcode type and text attributes such as text location and font styles in order to suit the application requirements. +# Aspose.BarCode Cloud SDK for PHP + +- API version: 3.0 +- Package version: 20.5 -This repository contains Aspose.BarCode Cloud SDK for PHP source code. +Aspose.BarCode for Cloud is a REST API for Linear, 2D and postal barcode generation and recognition in the cloud. API recognizes and generates barcode images in a variety of formats. Barcode REST API allows to specify barcode image attributes like image width, height, border style and output image format in order to customize the generation process. Developers can also specify the barcode type and text attributes such as text location and font styles in order to suit the application requirements. +This repository contains Aspose.BarCode Cloud SDK for PHP source code. To use these SDKs, you will need App SID and App Key which can be looked up at [Aspose Cloud Dashboard](https://dashboard.aspose.cloud/#/apps) (free registration in Aspose Cloud is required for this). -## How to use the SDK? +## How to use the SDK + You can either directly use it in your project via source code or get [Packagist distribution](https://packagist.org/packages/aspose/barcode-cloud-php) (recommended). ## Installation -## Via Composer: +### Via Composer + *barcode-cloud-php* is available on Packagist as the [`barcode-cloud-php`](https://packagist.org/packages/aspose/barcode-cloud-php) package. Run the following command: -```bash + +```sh composer require aspose/barcode-cloud-php ``` -To use the SDK, use Composer's [autoload](https://getcomposer.org/doc/00-intro.md#autoloading): +To use the SDK, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading): ```php require __DIR__ . '/vendor/autoload.php'; @@ -27,37 +33,128 @@ require __DIR__ . '/vendor/autoload.php'; ### Sample usage ```php -use Aspose\BarCode\Configuration; -use Aspose\BarCode\BarCodeApi; -use Aspose\BarCode\Requests\BarCodeGetBarCodeGenerateRequest; - +use Aspose\BarCode\{Configuration, BarcodeApi, Model\EncodeBarcodeType, Requests\GetBarcodeGenerateRequest}; $config = new Configuration(); -$config->setAppKey("your_key"); -$config->setAppSid("your_sid"); +$config->setAppKey('App Key from https://dashboard.aspose.cloud/#/apps'); +$config->setAppSid('App SID from https://dashboard.aspose.cloud/#/apps'); +// Or use Configuration.json file +//$config = Configuration::fromJson(file_get_contents('tests/Configuration.json')); -$request = new BarCodeGetBarCodeGenerateRequest(); -$request->type = "QR"; -$request->text = "PHP SDK Test"; -$request->format = "png"; +$request = new GetBarcodeGenerateRequest(EncodeBarcodeType::QR, 'PHP SDK Test'); +$request->format = 'png'; -$api = new BarCodeApi(null, $config); -$response = $api->BarCodeGetBarCodeGenerate($request); +$api = new BarcodeApi(null, $config); +$response = $api->GetBarCodeGenerate($request); $type = 'image/png'; $size = $response->getSize(); -header('Content-Type:'.$type); -header('Content-Length: ' . $size); +header("Content-Type: $type"); +header("Content-Length: $size"); echo $response->fread($size); ``` -# Licensing +## Licensing + All Aspose.BarCode for Cloud SDKs, helper scripts and templates are licensed under [MIT License](LICENSE). -# Resources -+ [**Website**](https://www.aspose.cloud) -+ [**Product Home**](https://products.aspose.cloud/barcode/cloud) -+ [**Documentation**](https://docs.aspose.cloud/display/barcodecloud/Home) -+ [**Free Support Forum**](https://forum.aspose.cloud/c/barcode) -+ [**Paid Support Helpdesk**](https://helpdesk.aspose.cloud/) -+ [**Blog**](https://blog.aspose.cloud/category/aspose-products/aspose-barcode-product-family/) +## Resources + +- [**Website**](https://www.aspose.cloud) +- [**Product Home**](https://products.aspose.cloud/barcode/cloud) +- [**Documentation**](https://docs.aspose.cloud/display/barcodecloud/Home) +- [**Free Support Forum**](https://forum.aspose.cloud/c/barcode) +- [**Paid Support Helpdesk**](https://helpdesk.aspose.cloud/) +- [**Blog**](https://blog.aspose.cloud/category/aspose-products/aspose-barcode-product-family/) + +## Documentation for API Endpoints + +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 or encoded with base64. +*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 +*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 + +## Documentation For Models + +- [AustralianPostParams](docs/Model/AustralianPostParams.md) +- [AutoSizeMode](docs/Model/AutoSizeMode.md) +- [AvailableGraphicsUnit](docs/Model/AvailableGraphicsUnit.md) +- [AztecParams](docs/Model/AztecParams.md) +- [AztecSymbolMode](docs/Model/AztecSymbolMode.md) +- [BarCodeErrorResponse](docs/Model/BarCodeErrorResponse.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) +- [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) +- [DecodeBarcodeType](docs/Model/DecodeBarcodeType.md) +- [DiscUsage](docs/Model/DiscUsage.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) +- [ITF14BorderType](docs/Model/ITF14BorderType.md) +- [ITFParams](docs/Model/ITFParams.md) +- [MaxiCodeParams](docs/Model/MaxiCodeParams.md) +- [ObjectExist](docs/Model/ObjectExist.md) +- [Padding](docs/Model/Padding.md) +- [Pdf417CompactionMode](docs/Model/Pdf417CompactionMode.md) +- [Pdf417ErrorLevel](docs/Model/Pdf417ErrorLevel.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) +- [RegionPoint](docs/Model/RegionPoint.md) +- [ResultImageInfo](docs/Model/ResultImageInfo.md) +- [StorageExist](docs/Model/StorageExist.md) +- [StorageFile](docs/Model/StorageFile.md) +- [TextAlignment](docs/Model/TextAlignment.md) +- [FileVersion](docs/Model/FileVersion.md) diff --git a/composer.json b/composer.json index 9e0d2c1..a55f9ca 100644 --- a/composer.json +++ b/composer.json @@ -12,11 +12,18 @@ } ], "require": { - "guzzlehttp/guzzle": "^6.2" + "guzzlehttp/guzzle": "^6.2", + "ext-json": "*" + }, + "require-dev": { + "phpunit/phpunit": ">=7.5.20" }, "autoload": { "psr-4": { - "Aspose\\": "src/" + "Aspose\\": "src/Aspose/" } + }, + "scripts": { + "test": "phpunit --testdox tests" } } diff --git a/docs/Api/BarcodeApi.md b/docs/Api/BarcodeApi.md new file mode 100644 index 0000000..c40991b --- /dev/null +++ b/docs/Api/BarcodeApi.md @@ -0,0 +1,654 @@ +# 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 or encoded with base64. +[**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 + + +# **getBarcodeGenerate** +> \SplFileObject getBarcodeGenerate($type, $text, $two_d_display_text, $text_location, $text_alignment, $text_color, $font_size_mode, $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, $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: Color.Black. +$font_size_mode = "font_size_mode_example"; // string | 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. +$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: Color.White. +$bar_color = "bar_color_example"; // string | Bars color. Default value: Color.Black. +$border_color = "border_color_example"; // string | Border color. Default value: Color.Black. +$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, SingapurePost, 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. +$format = "format_example"; // string | Result image format. + +try { + $result = $apiInstance->getBarcodeGenerate($type, $text, $two_d_display_text, $text_location, $text_alignment, $text_color, $font_size_mode, $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, $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: Color.Black. | [optional] + **font_size_mode** | **string**| 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] + **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: Color.White. | [optional] + **bar_color** | **string**| Bars color. Default value: Color.Black. | [optional] + **border_color** | **string**| Border color. Default value: Color.Black. | [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, SingapurePost, 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] + **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, $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, $region_likelihood_threshold_percent, $scan_window_sizes, $similarity, $skip_diagonal_search, $australian_post_encoding_table, $rectangle_region, $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. +$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 for area for recognition. +$rect_y = 56; // int | Set Y for 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. +$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. +$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 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. +$australian_post_encoding_table = "australian_post_encoding_table_example"; // string | Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. +$rectangle_region = "rectangle_region_example"; // string | +$storage = "storage_example"; // string | The image storage. +$folder = "folder_example"; // string | The image folder. + +try { + $result = $apiInstance->getBarcodeRecognize($name, $type, $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, $region_likelihood_threshold_percent, $scan_window_sizes, $similarity, $skip_diagonal_search, $australian_post_encoding_table, $rectangle_region, $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] + **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 for area for recognition. | [optional] + **rect_y** | **int**| Set Y for 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. | [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] + **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 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] + **australian_post_encoding_table** | **string**| Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. | [optional] + **rectangle_region** | **string**| | [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, $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, $region_likelihood_threshold_percent, $scan_window_sizes, $similarity, $skip_diagonal_search, $australian_post_encoding_table, $rectangle_region, $url, $image) + +Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image or encoded with base64. + +### 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. +$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 for area for recognition. +$rect_y = 56; // int | Set Y for 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. +$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. +$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 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. +$australian_post_encoding_table = "australian_post_encoding_table_example"; // string | Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. +$rectangle_region = "rectangle_region_example"; // string | +$url = "url_example"; // string | The image file url. +$image = "/path/to/file.txt"; // \SplFileObject | Image data + +try { + $result = $apiInstance->postBarcodeRecognizeFromUrlOrContent($type, $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, $region_likelihood_threshold_percent, $scan_window_sizes, $similarity, $skip_diagonal_search, $australian_post_encoding_table, $rectangle_region, $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] + **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 for area for recognition. | [optional] + **rect_y** | **int**| Set Y for 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. | [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] + **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 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] + **australian_post_encoding_table** | **string**| Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. | [optional] + **rectangle_region** | **string**| | [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**: 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, $font_size_mode, $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, $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: Color.Black. +$font_size_mode = "font_size_mode_example"; // string | 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. +$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: Color.White. +$bar_color = "bar_color_example"; // string | Bars color. Default value: Color.Black. +$border_color = "border_color_example"; // string | Border color. Default value: Color.Black. +$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, SingapurePost, 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. +$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, $font_size_mode, $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, $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: Color.Black. | [optional] + **font_size_mode** | **string**| 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] + **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: Color.White. | [optional] + **bar_color** | **string**| Bars color. Default value: Color.Black. | [optional] + **border_color** | **string**| Border color. Default value: Color.Black. | [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, SingapurePost, 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] + **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**: 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) + diff --git a/docs/Api/FileApi.md b/docs/Api/FileApi.md new file mode 100644 index 0000000..f8feb9d --- /dev/null +++ b/docs/Api/FileApi.md @@ -0,0 +1,293 @@ +# 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 new file mode 100644 index 0000000..506619a --- /dev/null +++ b/docs/Api/FolderApi.md @@ -0,0 +1,284 @@ +# 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/StorageApi.md b/docs/Api/StorageApi.md new file mode 100644 index 0000000..73d1458 --- /dev/null +++ b/docs/Api/StorageApi.md @@ -0,0 +1,222 @@ +# 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/AustralianPostParams.md b/docs/Model/AustralianPostParams.md new file mode 100644 index 0000000..10bbbbe --- /dev/null +++ b/docs/Model/AustralianPostParams.md @@ -0,0 +1,11 @@ +# AustralianPostParams + +## 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/AutoSizeMode.md b/docs/Model/AutoSizeMode.md new file mode 100644 index 0000000..8ee883e --- /dev/null +++ b/docs/Model/AutoSizeMode.md @@ -0,0 +1,9 @@ +# AutoSizeMode + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/AvailableGraphicsUnit.md new file mode 100644 index 0000000..b53782b --- /dev/null +++ b/docs/Model/AvailableGraphicsUnit.md @@ -0,0 +1,9 @@ +# AvailableGraphicsUnit + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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 new file mode 100644 index 0000000..273d354 --- /dev/null +++ b/docs/Model/AztecParams.md @@ -0,0 +1,13 @@ +# AztecParams + +## 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** | Sets the encoding of codetext. | [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/AztecSymbolMode.md new file mode 100644 index 0000000..7bdf107 --- /dev/null +++ b/docs/Model/AztecSymbolMode.md @@ -0,0 +1,9 @@ +# AztecSymbolMode + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/BarCodeErrorResponse.md b/docs/Model/BarCodeErrorResponse.md new file mode 100644 index 0000000..5e56274 --- /dev/null +++ b/docs/Model/BarCodeErrorResponse.md @@ -0,0 +1,10 @@ +# BarCodeErrorResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**\Aspose\BarCode\Model\Error**](Error.md) | 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/BarcodeResponse.md b/docs/Model/BarcodeResponse.md new file mode 100644 index 0000000..ce82149 --- /dev/null +++ b/docs/Model/BarcodeResponse.md @@ -0,0 +1,13 @@ +# BarcodeResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**barcode_value** | **string** | Barcode data. | [optional] +**type** | **string** | Type of the barcode. | [optional] +**region** | [**\Aspose\BarCode\Model\RegionPoint[]**](RegionPoint.md) | Region with barcode. | [optional] +**checksum** | **string** | Checksum of 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/BarcodeResponseList.md b/docs/Model/BarcodeResponseList.md new file mode 100644 index 0000000..e9b0fb6 --- /dev/null +++ b/docs/Model/BarcodeResponseList.md @@ -0,0 +1,10 @@ +# BarcodeResponseList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**barcodes** | [**\Aspose\BarCode\Model\BarcodeResponse[]**](BarcodeResponse.md) | List of barcodes which are present in image. | [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/BorderDashStyle.md b/docs/Model/BorderDashStyle.md new file mode 100644 index 0000000..7effdc9 --- /dev/null +++ b/docs/Model/BorderDashStyle.md @@ -0,0 +1,9 @@ +# BorderDashStyle + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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 new file mode 100644 index 0000000..fafcc67 --- /dev/null +++ b/docs/Model/CaptionParams.md @@ -0,0 +1,15 @@ +# CaptionParams + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**text** | **string** | Caption text. | [optional] +**alignment** | [**\Aspose\BarCode\Model\TextAlignment**](TextAlignment.md) | Text alignment. | [optional] +**color** | **string** | Text color. | [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] + +[[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 new file mode 100644 index 0000000..5dabfce --- /dev/null +++ b/docs/Model/ChecksumValidation.md @@ -0,0 +1,9 @@ +# ChecksumValidation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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 new file mode 100644 index 0000000..0e3d5ba --- /dev/null +++ b/docs/Model/CodabarChecksumMode.md @@ -0,0 +1,9 @@ +# CodabarChecksumMode + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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 new file mode 100644 index 0000000..e270f88 --- /dev/null +++ b/docs/Model/CodabarParams.md @@ -0,0 +1,12 @@ +# CodabarParams + +## 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 new file mode 100644 index 0000000..13abfdb --- /dev/null +++ b/docs/Model/CodabarSymbol.md @@ -0,0 +1,9 @@ +# CodabarSymbol + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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 new file mode 100644 index 0000000..52619e1 --- /dev/null +++ b/docs/Model/CodablockParams.md @@ -0,0 +1,12 @@ +# CodablockParams + +## 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/Code16KParams.md b/docs/Model/Code16KParams.md new file mode 100644 index 0000000..8b0424a --- /dev/null +++ b/docs/Model/Code16KParams.md @@ -0,0 +1,12 @@ +# Code16KParams + +## 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 new file mode 100644 index 0000000..af04d49 --- /dev/null +++ b/docs/Model/CodeLocation.md @@ -0,0 +1,9 @@ +# CodeLocation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/CouponParams.md b/docs/Model/CouponParams.md new file mode 100644 index 0000000..c32372f --- /dev/null +++ b/docs/Model/CouponParams.md @@ -0,0 +1,10 @@ +# CouponParams + +## 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 new file mode 100644 index 0000000..fe2ebe2 --- /dev/null +++ b/docs/Model/CustomerInformationInterpretingType.md @@ -0,0 +1,9 @@ +# CustomerInformationInterpretingType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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 new file mode 100644 index 0000000..983794c --- /dev/null +++ b/docs/Model/DataBarParams.md @@ -0,0 +1,12 @@ +# DataBarParams + +## 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] + +[[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 new file mode 100644 index 0000000..afc97d9 --- /dev/null +++ b/docs/Model/DataMatrixEccType.md @@ -0,0 +1,9 @@ +# DataMatrixEccType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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 new file mode 100644 index 0000000..5c84be4 --- /dev/null +++ b/docs/Model/DataMatrixEncodeMode.md @@ -0,0 +1,9 @@ +# DataMatrixEncodeMode + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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 new file mode 100644 index 0000000..467083b --- /dev/null +++ b/docs/Model/DataMatrixParams.md @@ -0,0 +1,15 @@ +# DataMatrixParams + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aspect_ratio** | **double** | Height/Width ratio of 2D BarCode module | [optional] +**text_encoding** | **string** | Encoding of codetext. | [optional] +**columns** | **int** | 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** | 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/DecodeBarcodeType.md b/docs/Model/DecodeBarcodeType.md new file mode 100644 index 0000000..630aeb3 --- /dev/null +++ b/docs/Model/DecodeBarcodeType.md @@ -0,0 +1,9 @@ +# DecodeBarcodeType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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 new file mode 100644 index 0000000..a9453b6 --- /dev/null +++ b/docs/Model/DiscUsage.md @@ -0,0 +1,11 @@ +# DiscUsage + +## 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/DotCodeParams.md b/docs/Model/DotCodeParams.md new file mode 100644 index 0000000..9a4be7f --- /dev/null +++ b/docs/Model/DotCodeParams.md @@ -0,0 +1,11 @@ +# DotCodeParams + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aspect_ratio** | **double** | Height/Width ratio of 2D BarCode module. | [optional] +**dot_code_mask** | **int** | Mask of Dotcode barcode. Default value: -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/ECIEncodings.md b/docs/Model/ECIEncodings.md new file mode 100644 index 0000000..813ef0c --- /dev/null +++ b/docs/Model/ECIEncodings.md @@ -0,0 +1,9 @@ +# ECIEncodings + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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 new file mode 100644 index 0000000..fb38a1a --- /dev/null +++ b/docs/Model/EnableChecksum.md @@ -0,0 +1,9 @@ +# EnableChecksum + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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 new file mode 100644 index 0000000..09154bf --- /dev/null +++ b/docs/Model/EncodeBarcodeType.md @@ -0,0 +1,9 @@ +# EncodeBarcodeType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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 new file mode 100644 index 0000000..618c5e8 --- /dev/null +++ b/docs/Model/Error.md @@ -0,0 +1,13 @@ +# 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 new file mode 100644 index 0000000..a7d7d29 --- /dev/null +++ b/docs/Model/ErrorDetails.md @@ -0,0 +1,11 @@ +# ErrorDetails + +## 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 new file mode 100644 index 0000000..6d71fc6 --- /dev/null +++ b/docs/Model/FileVersion.md @@ -0,0 +1,16 @@ +# 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/FileVersions.md b/docs/Model/FileVersions.md new file mode 100644 index 0000000..c69a808 --- /dev/null +++ b/docs/Model/FileVersions.md @@ -0,0 +1,10 @@ +# FileVersions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | [**\Aspose\BarCode\Model\FileVersion[]**](FileVersion.md) | File versions FileVersion. | [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/FilesList.md b/docs/Model/FilesList.md new file mode 100644 index 0000000..cb89bd3 --- /dev/null +++ b/docs/Model/FilesList.md @@ -0,0 +1,10 @@ +# FilesList + +## 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 new file mode 100644 index 0000000..a21773c --- /dev/null +++ b/docs/Model/FilesUploadResult.md @@ -0,0 +1,11 @@ +# FilesUploadResult + +## 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 new file mode 100644 index 0000000..f466ca8 --- /dev/null +++ b/docs/Model/FontMode.md @@ -0,0 +1,9 @@ +# FontMode + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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 new file mode 100644 index 0000000..0205ddf --- /dev/null +++ b/docs/Model/FontParams.md @@ -0,0 +1,12 @@ +# FontParams + +## 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 new file mode 100644 index 0000000..a7fad3d --- /dev/null +++ b/docs/Model/FontStyle.md @@ -0,0 +1,9 @@ +# FontStyle + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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 new file mode 100644 index 0000000..31265a6 --- /dev/null +++ b/docs/Model/GeneratorParams.md @@ -0,0 +1,59 @@ +# GeneratorParams + +## 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: Color.Black. | [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] +**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: Color.White. | [optional] +**bar_color** | **string** | Bars color. Default value: Color.Black. | [optional] +**border_color** | **string** | Border color. Default value: Color.Black. | [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, SingapurePost, 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] +**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] + +[[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 new file mode 100644 index 0000000..4141d34 --- /dev/null +++ b/docs/Model/GeneratorParamsList.md @@ -0,0 +1,12 @@ +# GeneratorParamsList + +## 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/ITF14BorderType.md b/docs/Model/ITF14BorderType.md new file mode 100644 index 0000000..3425f21 --- /dev/null +++ b/docs/Model/ITF14BorderType.md @@ -0,0 +1,9 @@ +# ITF14BorderType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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 new file mode 100644 index 0000000..a0afefb --- /dev/null +++ b/docs/Model/ITFParams.md @@ -0,0 +1,12 @@ +# ITFParams + +## 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/MaxiCodeParams.md b/docs/Model/MaxiCodeParams.md new file mode 100644 index 0000000..7edcfba --- /dev/null +++ b/docs/Model/MaxiCodeParams.md @@ -0,0 +1,11 @@ +# MaxiCodeParams + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aspect_ratio** | **double** | Height/Width ratio of 2D BarCode module. | [optional] +**encode_mode** | **int** | MaxiCode encode mode. | [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 new file mode 100644 index 0000000..5dc8b72 --- /dev/null +++ b/docs/Model/ObjectExist.md @@ -0,0 +1,11 @@ +# ObjectExist + +## 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 new file mode 100644 index 0000000..421e42d --- /dev/null +++ b/docs/Model/Padding.md @@ -0,0 +1,13 @@ +# Padding + +## 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/Pdf417CompactionMode.md b/docs/Model/Pdf417CompactionMode.md new file mode 100644 index 0000000..ae0c9fb --- /dev/null +++ b/docs/Model/Pdf417CompactionMode.md @@ -0,0 +1,9 @@ +# Pdf417CompactionMode + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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 new file mode 100644 index 0000000..8bb972d --- /dev/null +++ b/docs/Model/Pdf417ErrorLevel.md @@ -0,0 +1,9 @@ +# Pdf417ErrorLevel + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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 new file mode 100644 index 0000000..bb4faf0 --- /dev/null +++ b/docs/Model/Pdf417Params.md @@ -0,0 +1,19 @@ +# Pdf417Params + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aspect_ratio** | **double** | Height/Width ratio of 2D BarCode module. | [optional] +**text_encoding** | **string** | 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] + +[[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 new file mode 100644 index 0000000..5bafde8 --- /dev/null +++ b/docs/Model/PostalParams.md @@ -0,0 +1,10 @@ +# PostalParams + +## 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 new file mode 100644 index 0000000..e6ce630 --- /dev/null +++ b/docs/Model/PresetType.md @@ -0,0 +1,9 @@ +# PresetType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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 new file mode 100644 index 0000000..33b645d --- /dev/null +++ b/docs/Model/QREncodeMode.md @@ -0,0 +1,9 @@ +# QREncodeMode + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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 new file mode 100644 index 0000000..730dc07 --- /dev/null +++ b/docs/Model/QREncodeType.md @@ -0,0 +1,9 @@ +# QREncodeType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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 new file mode 100644 index 0000000..eb66c66 --- /dev/null +++ b/docs/Model/QRErrorLevel.md @@ -0,0 +1,9 @@ +# QRErrorLevel + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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 new file mode 100644 index 0000000..8cfd7a9 --- /dev/null +++ b/docs/Model/QRVersion.md @@ -0,0 +1,9 @@ +# QRVersion + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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 new file mode 100644 index 0000000..eb1f176 --- /dev/null +++ b/docs/Model/QrParams.md @@ -0,0 +1,16 @@ +# QrParams + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aspect_ratio** | **double** | Height/Width ratio of 2D BarCode module. | [optional] +**text_encoding** | **string** | 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] + +[[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 new file mode 100644 index 0000000..0c4e68a --- /dev/null +++ b/docs/Model/ReaderParams.md @@ -0,0 +1,39 @@ +# ReaderParams + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**\Aspose\BarCode\Model\DecodeBarcodeType**](DecodeBarcodeType.md) | The type of barcode 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 for area for recognition. | [optional] +**rect_y** | **int** | Set Y for 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. | [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] +**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 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] +**australian_post_encoding_table** | [**\Aspose\BarCode\Model\CustomerInformationInterpretingType**](CustomerInformationInterpretingType.md) | Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. | [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 new file mode 100644 index 0000000..0b6d7d3 --- /dev/null +++ b/docs/Model/RegionPoint.md @@ -0,0 +1,11 @@ +# RegionPoint + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**x** | **int** | X-coordinate | +**y** | **int** | Y-coordinate | + +[[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 new file mode 100644 index 0000000..3c47731 --- /dev/null +++ b/docs/Model/ResultImageInfo.md @@ -0,0 +1,12 @@ +# ResultImageInfo + +## 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/StorageExist.md new file mode 100644 index 0000000..0a7a6d0 --- /dev/null +++ b/docs/Model/StorageExist.md @@ -0,0 +1,10 @@ +# StorageExist + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**exists** | **bool** | Shows that the storage exists. | + +[[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 new file mode 100644 index 0000000..3230ebd --- /dev/null +++ b/docs/Model/StorageFile.md @@ -0,0 +1,14 @@ +# StorageFile + +## 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/TextAlignment.md b/docs/Model/TextAlignment.md new file mode 100644 index 0000000..e2119e8 --- /dev/null +++ b/docs/Model/TextAlignment.md @@ -0,0 +1,9 @@ +# TextAlignment + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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 f509c83..9386cf4 100644 --- a/index.php +++ b/index.php @@ -1,4 +1,4 @@ - @@ -11,10 +11,10 @@ * 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 @@ -28,26 +28,22 @@ require __DIR__ . '/vendor/autoload.php'; - -use Aspose\BarCode\Configuration; -use Aspose\BarCode\BarCodeApi; -use Aspose\BarCode\Requests\BarCodeGetBarCodeGenerateRequest; - +use Aspose\BarCode\{Configuration, BarcodeApi, Model\EncodeBarcodeType, Requests\GetBarcodeGenerateRequest}; $config = new Configuration(); -$config->setAppKey("your_key"); -$config->setAppSid("your_sid"); +$config->setAppKey('App Key from https://dashboard.aspose.cloud/#/apps'); +$config->setAppSid('App SID from https://dashboard.aspose.cloud/#/apps'); +// Or use Configuration.json file +//$config = Configuration::fromJson(file_get_contents('tests/Configuration.json')); -$request = new BarCodeGetBarCodeGenerateRequest(); -$request->type = "QR"; -$request->text = "PHP SDK Test"; -$request->format = "png"; +$request = new GetBarcodeGenerateRequest(EncodeBarcodeType::QR, 'PHP SDK Test'); +$request->format = 'png'; -$api = new BarCodeApi(null, $config); -$response = $api->BarCodeGetBarCodeGenerate($request); +$api = new BarcodeApi(null, $config); +$response = $api->GetBarCodeGenerate($request); $type = 'image/png'; $size = $response->getSize(); -header('Content-Type:'.$type); -header('Content-Length: ' . $size); +header("Content-Type: $type"); +header("Content-Length: $size"); echo $response->fread($size); diff --git a/nbproject/project.properties b/nbproject/project.properties deleted file mode 100644 index 273929c..0000000 --- a/nbproject/project.properties +++ /dev/null @@ -1,8 +0,0 @@ -auxiliary.org-netbeans-modules-php-phing.action_2e_build=build -include.path=${php.global.include.path} -php.version=PHP_70 -source.encoding=UTF-8 -src.dir=. -tags.asp=false -tags.short=false -web.root=. diff --git a/nbproject/project.xml b/nbproject/project.xml deleted file mode 100644 index a9c2185..0000000 --- a/nbproject/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - org.netbeans.modules.php.project - - - Aspose.BarCode.Cloud.Sdk - - - diff --git a/src/Aspose/BarCode/ApiException.php b/src/Aspose/BarCode/ApiException.php index e3f0c64..735848b 100644 --- a/src/Aspose/BarCode/ApiException.php +++ b/src/Aspose/BarCode/ApiException.php @@ -1,4 +1,4 @@ - @@ -11,10 +11,10 @@ * 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 @@ -25,6 +25,9 @@ * * -------------------------------------------------------------------------------------------------------------------- */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// namespace Aspose\BarCode; use \Exception; diff --git a/src/Aspose/BarCode/BarCodeApi.php b/src/Aspose/BarCode/BarCodeApi.php deleted file mode 100644 index ed3b407..0000000 --- a/src/Aspose/BarCode/BarCodeApi.php +++ /dev/null @@ -1,2594 +0,0 @@ - - * Copyright (c) 2018 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\RequestException; -use GuzzleHttp\Psr7\MultipartStream; -use GuzzleHttp\Psr7\Request; -use GuzzleHttp\RequestOptions; -use Aspose\BarCode\Requests; - -/* - * 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 WordsApi - * @param ClientInterface $client client for calling api - * @param Configuration $config configuration info - * @param HeaderSelector $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 barCodeGetBarCodeGenerate - * - * Generate barcode. - * - * @param Requests\BarCodeGetBarCodeGenerateRequest $request is a request object for operation - * - * @throws \Swagger\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \SplFileObject - */ - public function barCodeGetBarCodeGenerate(Requests\BarCodeGetBarCodeGenerateRequest $request) - { - try { - list($response) = $this->barCodeGetBarCodeGenerateWithHttpInfo($request); - return $response; - } - catch(RepeatRequestException $e) { - list($response) = $this->barCodeGetBarCodeGenerateWithHttpInfo($request); - return $response; - } - } - - /* - * Operation barCodeGetBarCodeGenerateWithHttpInfo - * - * Generate barcode. - * - * @param Requests\BarCodeGetBarCodeGenerateRequest $request is a request object for operation - * - * @throws \Swagger\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) - */ - public function barCodeGetBarCodeGenerateWithHttpInfo(Requests\BarCodeGetBarCodeGenerateRequest $request) - { - $returnType = '\SplFileObject'; - $request = $this->BarCodeGetBarCodeGenerateRequest($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->_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, $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 barCodeGetBarCodeGenerateAsync - * - * Generate barcode. - * - * @param Requests\BarCodeGetBarCodeGenerateRequest $request is a request object for operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function barCodeGetBarCodeGenerateAsync(Requests\BarCodeGetBarCodeGenerateRequest $request) - { - return $this->barCodeGetBarCodeGenerateAsyncWithHttpInfo($request) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /* - * Operation barCodeGetBarCodeGenerateAsyncWithHttpInfo - * - * Generate barcode. - * - * @param Requests\BarCodeGetBarCodeGenerateRequest $request is a request object for operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function barCodeGetBarCodeGenerateAsyncWithHttpInfo(Requests\BarCodeGetBarCodeGenerateRequest $request) - { - $returnType = '\SplFileObject'; - $request = $this->BarCodeGetBarCodeGenerateRequest($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 'barCodeGetBarCodeGenerate' - * - * @param Requests\BarCodeGetBarCodeGenerateRequest $request is a request object for operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function BarCodeGetBarCodeGenerateRequest(Requests\BarCodeGetBarCodeGenerateRequest $request) - { - - $resourcePath = '/barcode/generate'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ""; - $multipart = false; - - - // query params - if ($request->text !== null) { - $localName = lcfirst('text'); - $localValue = is_bool($request->text) ? ($request->text ? 'true' : 'false') : $request->text; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->type !== null) { - $localName = lcfirst('type'); - $localValue = is_bool($request->type) ? ($request->type ? 'true' : 'false') : $request->type; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->format !== null) { - $localName = lcfirst('format'); - $localValue = is_bool($request->format) ? ($request->format ? 'true' : 'false') : $request->format; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->resolution_x !== null) { - $localName = lcfirst('resolutionX'); - $localValue = is_bool($request->resolution_x) ? ($request->resolution_x ? 'true' : 'false') : $request->resolution_x; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->resolution_y !== null) { - $localName = lcfirst('resolutionY'); - $localValue = is_bool($request->resolution_y) ? ($request->resolution_y ? 'true' : 'false') : $request->resolution_y; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->dimension_x !== null) { - $localName = lcfirst('dimensionX'); - $localValue = is_bool($request->dimension_x) ? ($request->dimension_x ? 'true' : 'false') : $request->dimension_x; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->dimension_y !== null) { - $localName = lcfirst('dimensionY'); - $localValue = is_bool($request->dimension_y) ? ($request->dimension_y ? 'true' : 'false') : $request->dimension_y; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->enable_checksum !== null) { - $localName = lcfirst('enableChecksum'); - $localValue = is_bool($request->enable_checksum) ? ($request->enable_checksum ? 'true' : 'false') : $request->enable_checksum; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - - - $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 (isset($_tempBody)) { - // $_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); - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // 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["data"]; - } - } - - $this->_requestToken(); - - if ($this->config->getAccessToken() !== null) { - $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 barCodeGetBarCodeRecognize - * - * Recognize barcode from a file on server. - * - * @param Requests\BarCodeGetBarCodeRecognizeRequest $request is a request object for operation - * - * @throws \Swagger\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Swagger\Client\Model\BarCodeResponseList - */ - public function barCodeGetBarCodeRecognize(Requests\BarCodeGetBarCodeRecognizeRequest $request) - { - try { - list($response) = $this->barCodeGetBarCodeRecognizeWithHttpInfo($request); - return $response; - } - catch(RepeatRequestException $e) { - list($response) = $this->barCodeGetBarCodeRecognizeWithHttpInfo($request); - return $response; - } - } - - /* - * Operation barCodeGetBarCodeRecognizeWithHttpInfo - * - * Recognize barcode from a file on server. - * - * @param Requests\BarCodeGetBarCodeRecognizeRequest $request is a request object for operation - * - * @throws \Swagger\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \Swagger\Client\Model\BarCodeResponseList, HTTP status code, HTTP response headers (array of strings) - */ - public function barCodeGetBarCodeRecognizeWithHttpInfo(Requests\BarCodeGetBarCodeRecognizeRequest $request) - { - $returnType = '\Swagger\Client\Model\BarCodeResponseList'; - $request = $this->BarCodeGetBarCodeRecognizeRequest($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->_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, $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(), '\Swagger\Client\Model\BarCodeResponseList', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /* - * Operation barCodeGetBarCodeRecognizeAsync - * - * Recognize barcode from a file on server. - * - * @param Requests\BarCodeGetBarCodeRecognizeRequest $request is a request object for operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function barCodeGetBarCodeRecognizeAsync(Requests\BarCodeGetBarCodeRecognizeRequest $request) - { - return $this->barCodeGetBarCodeRecognizeAsyncWithHttpInfo($request) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /* - * Operation barCodeGetBarCodeRecognizeAsyncWithHttpInfo - * - * Recognize barcode from a file on server. - * - * @param Requests\BarCodeGetBarCodeRecognizeRequest $request is a request object for operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function barCodeGetBarCodeRecognizeAsyncWithHttpInfo(Requests\BarCodeGetBarCodeRecognizeRequest $request) - { - $returnType = '\Swagger\Client\Model\BarCodeResponseList'; - $request = $this->BarCodeGetBarCodeRecognizeRequest($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 'barCodeGetBarCodeRecognize' - * - * @param Requests\BarCodeGetBarCodeRecognizeRequest $request is a request object for operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function BarCodeGetBarCodeRecognizeRequest(Requests\BarCodeGetBarCodeRecognizeRequest $request) - { - // verify the required parameter 'name' is set - if ($request->name === null) { - throw new \InvalidArgumentException('Missing the required parameter $name when calling barCodeGetBarCodeRecognize'); - } - - $resourcePath = '/barcode/{name}/recognize'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ""; - $multipart = false; - - // path params - if ($request->name !== null) { - $localName = lcfirst('name'); - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->name), $resourcePath); - } - - // query params - if ($request->type !== null) { - $localName = lcfirst('type'); - $localValue = is_bool($request->type) ? ($request->type ? 'true' : 'false') : $request->type; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->checksum_validation !== null) { - $localName = lcfirst('checksumValidation'); - $localValue = is_bool($request->checksum_validation) ? ($request->checksum_validation ? 'true' : 'false') : $request->checksum_validation; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->strip_fnc !== null) { - $localName = lcfirst('stripFnc'); - $localValue = is_bool($request->strip_fnc) ? ($request->strip_fnc ? 'true' : 'false') : $request->strip_fnc; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->rotation_angle !== null) { - $localName = lcfirst('rotationAngle'); - $localValue = is_bool($request->rotation_angle) ? ($request->rotation_angle ? 'true' : 'false') : $request->rotation_angle; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->barcodes_count !== null) { - $localName = lcfirst('barcodesCount'); - $localValue = is_bool($request->barcodes_count) ? ($request->barcodes_count ? 'true' : 'false') : $request->barcodes_count; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->rect_x !== null) { - $localName = lcfirst('rectX'); - $localValue = is_bool($request->rect_x) ? ($request->rect_x ? 'true' : 'false') : $request->rect_x; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->rect_y !== null) { - $localName = lcfirst('rectY'); - $localValue = is_bool($request->rect_y) ? ($request->rect_y ? 'true' : 'false') : $request->rect_y; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->rect_width !== null) { - $localName = lcfirst('rectWidth'); - $localValue = is_bool($request->rect_width) ? ($request->rect_width ? 'true' : 'false') : $request->rect_width; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->rect_height !== null) { - $localName = lcfirst('rectHeight'); - $localValue = is_bool($request->rect_height) ? ($request->rect_height ? 'true' : 'false') : $request->rect_height; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->storage !== null) { - $localName = lcfirst('storage'); - $localValue = is_bool($request->storage) ? ($request->storage ? 'true' : 'false') : $request->storage; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->folder !== null) { - $localName = lcfirst('folder'); - $localValue = is_bool($request->folder) ? ($request->folder ? 'true' : 'false') : $request->folder; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - - - $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 (isset($_tempBody)) { - // $_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); - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // 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["data"]; - } - } - - $this->_requestToken(); - - if ($this->config->getAccessToken() !== null) { - $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 barCodePostBarCodeRecognizeFromUrlorContent - * - * Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image or encoded with base64. - * - * @param Requests\BarCodePostBarCodeRecognizeFromUrlorContentRequest $request is a request object for operation - * - * @throws \Swagger\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Swagger\Client\Model\BarCodeResponseList - */ - public function barCodePostBarCodeRecognizeFromUrlorContent(Requests\BarCodePostBarCodeRecognizeFromUrlorContentRequest $request) - { - try { - list($response) = $this->barCodePostBarCodeRecognizeFromUrlorContentWithHttpInfo($request); - return $response; - } - catch(RepeatRequestException $e) { - list($response) = $this->barCodePostBarCodeRecognizeFromUrlorContentWithHttpInfo($request); - return $response; - } - } - - /* - * Operation barCodePostBarCodeRecognizeFromUrlorContentWithHttpInfo - * - * Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image or encoded with base64. - * - * @param Requests\BarCodePostBarCodeRecognizeFromUrlorContentRequest $request is a request object for operation - * - * @throws \Swagger\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \Swagger\Client\Model\BarCodeResponseList, HTTP status code, HTTP response headers (array of strings) - */ - public function barCodePostBarCodeRecognizeFromUrlorContentWithHttpInfo(Requests\BarCodePostBarCodeRecognizeFromUrlorContentRequest $request) - { - $returnType = '\Swagger\Client\Model\BarCodeResponseList'; - $request = $this->BarCodePostBarCodeRecognizeFromUrlorContentRequest($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->_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, $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(), '\Swagger\Client\Model\BarCodeResponseList', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /* - * Operation barCodePostBarCodeRecognizeFromUrlorContentAsync - * - * Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image or encoded with base64. - * - * @param Requests\BarCodePostBarCodeRecognizeFromUrlorContentRequest $request is a request object for operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function barCodePostBarCodeRecognizeFromUrlorContentAsync(Requests\BarCodePostBarCodeRecognizeFromUrlorContentRequest $request) - { - return $this->barCodePostBarCodeRecognizeFromUrlorContentAsyncWithHttpInfo($request) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /* - * Operation barCodePostBarCodeRecognizeFromUrlorContentAsyncWithHttpInfo - * - * Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image or encoded with base64. - * - * @param Requests\BarCodePostBarCodeRecognizeFromUrlorContentRequest $request is a request object for operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function barCodePostBarCodeRecognizeFromUrlorContentAsyncWithHttpInfo(Requests\BarCodePostBarCodeRecognizeFromUrlorContentRequest $request) - { - $returnType = '\Swagger\Client\Model\BarCodeResponseList'; - $request = $this->BarCodePostBarCodeRecognizeFromUrlorContentRequest($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 'barCodePostBarCodeRecognizeFromUrlorContent' - * - * @param Requests\BarCodePostBarCodeRecognizeFromUrlorContentRequest $request is a request object for operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function BarCodePostBarCodeRecognizeFromUrlorContentRequest(Requests\BarCodePostBarCodeRecognizeFromUrlorContentRequest $request) - { - - $resourcePath = '/barcode/recognize'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ""; - $multipart = false; - - - // query params - if ($request->type !== null) { - $localName = lcfirst('type'); - $localValue = is_bool($request->type) ? ($request->type ? 'true' : 'false') : $request->type; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->checksum_validation !== null) { - $localName = lcfirst('checksumValidation'); - $localValue = is_bool($request->checksum_validation) ? ($request->checksum_validation ? 'true' : 'false') : $request->checksum_validation; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->strip_fnc !== null) { - $localName = lcfirst('stripFnc'); - $localValue = is_bool($request->strip_fnc) ? ($request->strip_fnc ? 'true' : 'false') : $request->strip_fnc; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->rotation_angle !== null) { - $localName = lcfirst('rotationAngle'); - $localValue = is_bool($request->rotation_angle) ? ($request->rotation_angle ? 'true' : 'false') : $request->rotation_angle; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->url !== null) { - $localName = lcfirst('url'); - $localValue = is_bool($request->url) ? ($request->url ? 'true' : 'false') : $request->url; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - - - $resourcePath = $this->_parseURL($resourcePath, $queryParams); - - // form params - if ($request->image_data !== null) { - $multipart = true; - $filename = ObjectSerializer::toFormValue($request->image_data); - $handle = fopen($filename, "rb"); - $fsize = filesize($filename); - $contents = fread($handle, $fsize); - $formParams['image_data'] = $contents; - } - // 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 (isset($_tempBody)) { - // $_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); - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // 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["data"]; - } - } - - $this->_requestToken(); - - if ($this->config->getAccessToken() !== null) { - $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 barCodePostGenerateMultiple - * - * Generate multiple barcodes and return in response stream - * - * @param Requests\BarCodePostGenerateMultipleRequest $request is a request object for operation - * - * @throws \Swagger\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \SplFileObject - */ - public function barCodePostGenerateMultiple(Requests\BarCodePostGenerateMultipleRequest $request) - { - try { - list($response) = $this->barCodePostGenerateMultipleWithHttpInfo($request); - return $response; - } - catch(RepeatRequestException $e) { - list($response) = $this->barCodePostGenerateMultipleWithHttpInfo($request); - return $response; - } - } - - /* - * Operation barCodePostGenerateMultipleWithHttpInfo - * - * Generate multiple barcodes and return in response stream - * - * @param Requests\BarCodePostGenerateMultipleRequest $request is a request object for operation - * - * @throws \Swagger\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) - */ - public function barCodePostGenerateMultipleWithHttpInfo(Requests\BarCodePostGenerateMultipleRequest $request) - { - $returnType = '\SplFileObject'; - $request = $this->BarCodePostGenerateMultipleRequest($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->_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, $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 barCodePostGenerateMultipleAsync - * - * Generate multiple barcodes and return in response stream - * - * @param Requests\BarCodePostGenerateMultipleRequest $request is a request object for operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function barCodePostGenerateMultipleAsync(Requests\BarCodePostGenerateMultipleRequest $request) - { - return $this->barCodePostGenerateMultipleAsyncWithHttpInfo($request) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /* - * Operation barCodePostGenerateMultipleAsyncWithHttpInfo - * - * Generate multiple barcodes and return in response stream - * - * @param Requests\BarCodePostGenerateMultipleRequest $request is a request object for operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function barCodePostGenerateMultipleAsyncWithHttpInfo(Requests\BarCodePostGenerateMultipleRequest $request) - { - $returnType = '\SplFileObject'; - $request = $this->BarCodePostGenerateMultipleRequest($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 'barCodePostGenerateMultiple' - * - * @param Requests\BarCodePostGenerateMultipleRequest $request is a request object for operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function BarCodePostGenerateMultipleRequest(Requests\BarCodePostGenerateMultipleRequest $request) - { - - $resourcePath = '/barcode/generateMultiple'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ""; - $multipart = false; - - - // query params - if ($request->format !== null) { - $localName = lcfirst('format'); - $localValue = is_bool($request->format) ? ($request->format ? 'true' : 'false') : $request->format; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - - - $resourcePath = $this->_parseURL($resourcePath, $queryParams); - - // body params - $_tempBody = null; - if (isset($request->dto)) { - if (is_string($request->dto)) { - $_tempBody = "\"" . $request->dto . "\""; - } else { - $_tempBody = $request->dto; - } - } - - if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['multipart/form-data'], - ['multipart/form-data'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_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); - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // 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["data"]; - } - } - - $this->_requestToken(); - - if ($this->config->getAccessToken() !== null) { - $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 barCodePutBarCodeGenerateFile - * - * Generate barcode and save on server. - * - * @param Requests\BarCodePutBarCodeGenerateFileRequest $request is a request object for operation - * - * @throws \Swagger\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Swagger\Client\Model\AsposeResponse - */ - public function barCodePutBarCodeGenerateFile(Requests\BarCodePutBarCodeGenerateFileRequest $request) - { - try { - list($response) = $this->barCodePutBarCodeGenerateFileWithHttpInfo($request); - return $response; - } - catch(RepeatRequestException $e) { - list($response) = $this->barCodePutBarCodeGenerateFileWithHttpInfo($request); - return $response; - } - } - - /* - * Operation barCodePutBarCodeGenerateFileWithHttpInfo - * - * Generate barcode and save on server. - * - * @param Requests\BarCodePutBarCodeGenerateFileRequest $request is a request object for operation - * - * @throws \Swagger\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \Swagger\Client\Model\AsposeResponse, HTTP status code, HTTP response headers (array of strings) - */ - public function barCodePutBarCodeGenerateFileWithHttpInfo(Requests\BarCodePutBarCodeGenerateFileRequest $request) - { - $returnType = '\Swagger\Client\Model\AsposeResponse'; - $request = $this->BarCodePutBarCodeGenerateFileRequest($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->_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, $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(), '\Swagger\Client\Model\AsposeResponse', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /* - * Operation barCodePutBarCodeGenerateFileAsync - * - * Generate barcode and save on server. - * - * @param Requests\BarCodePutBarCodeGenerateFileRequest $request is a request object for operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function barCodePutBarCodeGenerateFileAsync(Requests\BarCodePutBarCodeGenerateFileRequest $request) - { - return $this->barCodePutBarCodeGenerateFileAsyncWithHttpInfo($request) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /* - * Operation barCodePutBarCodeGenerateFileAsyncWithHttpInfo - * - * Generate barcode and save on server. - * - * @param Requests\BarCodePutBarCodeGenerateFileRequest $request is a request object for operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function barCodePutBarCodeGenerateFileAsyncWithHttpInfo(Requests\BarCodePutBarCodeGenerateFileRequest $request) - { - $returnType = '\Swagger\Client\Model\AsposeResponse'; - $request = $this->BarCodePutBarCodeGenerateFileRequest($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 'barCodePutBarCodeGenerateFile' - * - * @param Requests\BarCodePutBarCodeGenerateFileRequest $request is a request object for operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function BarCodePutBarCodeGenerateFileRequest(Requests\BarCodePutBarCodeGenerateFileRequest $request) - { - // verify the required parameter 'name' is set - if ($request->name === null) { - throw new \InvalidArgumentException('Missing the required parameter $name when calling barCodePutBarCodeGenerateFile'); - } - // verify the required parameter 'file' is set - if ($request->file === null) { - throw new \InvalidArgumentException('Missing the required parameter $file when calling barCodePutBarCodeGenerateFile'); - } - - $resourcePath = '/barcode/{name}/generate'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ""; - $multipart = false; - - // path params - if ($request->name !== null) { - $localName = lcfirst('name'); - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->name), $resourcePath); - } - - // query params - if ($request->text !== null) { - $localName = lcfirst('text'); - $localValue = is_bool($request->text) ? ($request->text ? 'true' : 'false') : $request->text; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->type !== null) { - $localName = lcfirst('type'); - $localValue = is_bool($request->type) ? ($request->type ? 'true' : 'false') : $request->type; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->format !== null) { - $localName = lcfirst('format'); - $localValue = is_bool($request->format) ? ($request->format ? 'true' : 'false') : $request->format; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->resolution_x !== null) { - $localName = lcfirst('resolutionX'); - $localValue = is_bool($request->resolution_x) ? ($request->resolution_x ? 'true' : 'false') : $request->resolution_x; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->resolution_y !== null) { - $localName = lcfirst('resolutionY'); - $localValue = is_bool($request->resolution_y) ? ($request->resolution_y ? 'true' : 'false') : $request->resolution_y; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->dimension_x !== null) { - $localName = lcfirst('dimensionX'); - $localValue = is_bool($request->dimension_x) ? ($request->dimension_x ? 'true' : 'false') : $request->dimension_x; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->dimension_y !== null) { - $localName = lcfirst('dimensionY'); - $localValue = is_bool($request->dimension_y) ? ($request->dimension_y ? 'true' : 'false') : $request->dimension_y; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->code_location !== null) { - $localName = lcfirst('codeLocation'); - $localValue = is_bool($request->code_location) ? ($request->code_location ? 'true' : 'false') : $request->code_location; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->gr_unit !== null) { - $localName = lcfirst('grUnit'); - $localValue = is_bool($request->gr_unit) ? ($request->gr_unit ? 'true' : 'false') : $request->gr_unit; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->auto_size !== null) { - $localName = lcfirst('autoSize'); - $localValue = is_bool($request->auto_size) ? ($request->auto_size ? 'true' : 'false') : $request->auto_size; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->bar_height !== null) { - $localName = lcfirst('barHeight'); - $localValue = is_bool($request->bar_height) ? ($request->bar_height ? 'true' : 'false') : $request->bar_height; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->image_height !== null) { - $localName = lcfirst('imageHeight'); - $localValue = is_bool($request->image_height) ? ($request->image_height ? 'true' : 'false') : $request->image_height; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->image_width !== null) { - $localName = lcfirst('imageWidth'); - $localValue = is_bool($request->image_width) ? ($request->image_width ? 'true' : 'false') : $request->image_width; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->image_quality !== null) { - $localName = lcfirst('imageQuality'); - $localValue = is_bool($request->image_quality) ? ($request->image_quality ? 'true' : 'false') : $request->image_quality; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->rot_angle !== null) { - $localName = lcfirst('rotAngle'); - $localValue = is_bool($request->rot_angle) ? ($request->rot_angle ? 'true' : 'false') : $request->rot_angle; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->top_margin !== null) { - $localName = lcfirst('topMargin'); - $localValue = is_bool($request->top_margin) ? ($request->top_margin ? 'true' : 'false') : $request->top_margin; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->bottom_margin !== null) { - $localName = lcfirst('bottomMargin'); - $localValue = is_bool($request->bottom_margin) ? ($request->bottom_margin ? 'true' : 'false') : $request->bottom_margin; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->left_margin !== null) { - $localName = lcfirst('leftMargin'); - $localValue = is_bool($request->left_margin) ? ($request->left_margin ? 'true' : 'false') : $request->left_margin; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->right_margin !== null) { - $localName = lcfirst('rightMargin'); - $localValue = is_bool($request->right_margin) ? ($request->right_margin ? 'true' : 'false') : $request->right_margin; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->enable_checksum !== null) { - $localName = lcfirst('enableChecksum'); - $localValue = is_bool($request->enable_checksum) ? ($request->enable_checksum ? 'true' : 'false') : $request->enable_checksum; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->storage !== null) { - $localName = lcfirst('storage'); - $localValue = is_bool($request->storage) ? ($request->storage ? 'true' : 'false') : $request->storage; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->folder !== null) { - $localName = lcfirst('folder'); - $localValue = is_bool($request->folder) ? ($request->folder ? 'true' : 'false') : $request->folder; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - - - $resourcePath = $this->_parseURL($resourcePath, $queryParams); - - // form params - if ($request->file !== null) { - $multipart = true; - $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'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['multipart/form-data'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_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); - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // 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["data"]; - } - } - - $this->_requestToken(); - - if ($this->config->getAccessToken() !== null) { - $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 barCodePutBarCodeRecognizeFromBody - * - * Recognition of a barcode from file on server with parameters in body. - * - * @param Requests\BarCodePutBarCodeRecognizeFromBodyRequest $request is a request object for operation - * - * @throws \Swagger\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Swagger\Client\Model\BarCodeResponseList - */ - public function barCodePutBarCodeRecognizeFromBody(Requests\BarCodePutBarCodeRecognizeFromBodyRequest $request) - { - try { - list($response) = $this->barCodePutBarCodeRecognizeFromBodyWithHttpInfo($request); - return $response; - } - catch(RepeatRequestException $e) { - list($response) = $this->barCodePutBarCodeRecognizeFromBodyWithHttpInfo($request); - return $response; - } - } - - /* - * Operation barCodePutBarCodeRecognizeFromBodyWithHttpInfo - * - * Recognition of a barcode from file on server with parameters in body. - * - * @param Requests\BarCodePutBarCodeRecognizeFromBodyRequest $request is a request object for operation - * - * @throws \Swagger\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \Swagger\Client\Model\BarCodeResponseList, HTTP status code, HTTP response headers (array of strings) - */ - public function barCodePutBarCodeRecognizeFromBodyWithHttpInfo(Requests\BarCodePutBarCodeRecognizeFromBodyRequest $request) - { - $returnType = '\Swagger\Client\Model\BarCodeResponseList'; - $request = $this->BarCodePutBarCodeRecognizeFromBodyRequest($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->_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, $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(), '\Swagger\Client\Model\BarCodeResponseList', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /* - * Operation barCodePutBarCodeRecognizeFromBodyAsync - * - * Recognition of a barcode from file on server with parameters in body. - * - * @param Requests\BarCodePutBarCodeRecognizeFromBodyRequest $request is a request object for operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function barCodePutBarCodeRecognizeFromBodyAsync(Requests\BarCodePutBarCodeRecognizeFromBodyRequest $request) - { - return $this->barCodePutBarCodeRecognizeFromBodyAsyncWithHttpInfo($request) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /* - * Operation barCodePutBarCodeRecognizeFromBodyAsyncWithHttpInfo - * - * Recognition of a barcode from file on server with parameters in body. - * - * @param Requests\BarCodePutBarCodeRecognizeFromBodyRequest $request is a request object for operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function barCodePutBarCodeRecognizeFromBodyAsyncWithHttpInfo(Requests\BarCodePutBarCodeRecognizeFromBodyRequest $request) - { - $returnType = '\Swagger\Client\Model\BarCodeResponseList'; - $request = $this->BarCodePutBarCodeRecognizeFromBodyRequest($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 'barCodePutBarCodeRecognizeFromBody' - * - * @param Requests\BarCodePutBarCodeRecognizeFromBodyRequest $request is a request object for operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function BarCodePutBarCodeRecognizeFromBodyRequest(Requests\BarCodePutBarCodeRecognizeFromBodyRequest $request) - { - // verify the required parameter 'name' is set - if ($request->name === null) { - throw new \InvalidArgumentException('Missing the required parameter $name when calling barCodePutBarCodeRecognizeFromBody'); - } - - $resourcePath = '/barcode/{name}/recognize'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ""; - $multipart = false; - - // path params - if ($request->name !== null) { - $localName = lcfirst('name'); - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->name), $resourcePath); - } - - // query params - if ($request->type !== null) { - $localName = lcfirst('type'); - $localValue = is_bool($request->type) ? ($request->type ? 'true' : 'false') : $request->type; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->folder !== null) { - $localName = lcfirst('folder'); - $localValue = is_bool($request->folder) ? ($request->folder ? 'true' : 'false') : $request->folder; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - - - $resourcePath = $this->_parseURL($resourcePath, $queryParams); - - // body params - $_tempBody = null; - if (isset($request->barcode_reader)) { - if (is_string($request->barcode_reader)) { - $_tempBody = "\"" . $request->barcode_reader . "\""; - } else { - $_tempBody = $request->barcode_reader; - } - } - - if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_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); - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // 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["data"]; - } - } - - $this->_requestToken(); - - if ($this->config->getAccessToken() !== null) { - $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 barCodePutGenerateMultiple - * - * Generate image with multiple barcodes and put new file on server - * - * @param Requests\BarCodePutGenerateMultipleRequest $request is a request object for operation - * - * @throws \Swagger\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Swagger\Client\Model\AsposeResponse - */ - public function barCodePutGenerateMultiple(Requests\BarCodePutGenerateMultipleRequest $request) - { - try { - list($response) = $this->barCodePutGenerateMultipleWithHttpInfo($request); - return $response; - } - catch(RepeatRequestException $e) { - list($response) = $this->barCodePutGenerateMultipleWithHttpInfo($request); - return $response; - } - } - - /* - * Operation barCodePutGenerateMultipleWithHttpInfo - * - * Generate image with multiple barcodes and put new file on server - * - * @param Requests\BarCodePutGenerateMultipleRequest $request is a request object for operation - * - * @throws \Swagger\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \Swagger\Client\Model\AsposeResponse, HTTP status code, HTTP response headers (array of strings) - */ - public function barCodePutGenerateMultipleWithHttpInfo(Requests\BarCodePutGenerateMultipleRequest $request) - { - $returnType = '\Swagger\Client\Model\AsposeResponse'; - $request = $this->BarCodePutGenerateMultipleRequest($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->_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, $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(), '\Swagger\Client\Model\AsposeResponse', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /* - * Operation barCodePutGenerateMultipleAsync - * - * Generate image with multiple barcodes and put new file on server - * - * @param Requests\BarCodePutGenerateMultipleRequest $request is a request object for operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function barCodePutGenerateMultipleAsync(Requests\BarCodePutGenerateMultipleRequest $request) - { - return $this->barCodePutGenerateMultipleAsyncWithHttpInfo($request) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /* - * Operation barCodePutGenerateMultipleAsyncWithHttpInfo - * - * Generate image with multiple barcodes and put new file on server - * - * @param Requests\BarCodePutGenerateMultipleRequest $request is a request object for operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function barCodePutGenerateMultipleAsyncWithHttpInfo(Requests\BarCodePutGenerateMultipleRequest $request) - { - $returnType = '\Swagger\Client\Model\AsposeResponse'; - $request = $this->BarCodePutGenerateMultipleRequest($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 'barCodePutGenerateMultiple' - * - * @param Requests\BarCodePutGenerateMultipleRequest $request is a request object for operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function BarCodePutGenerateMultipleRequest(Requests\BarCodePutGenerateMultipleRequest $request) - { - // verify the required parameter 'name' is set - if ($request->name === null) { - throw new \InvalidArgumentException('Missing the required parameter $name when calling barCodePutGenerateMultiple'); - } - - $resourcePath = '/barcode/{name}/generateMultiple'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ""; - $multipart = false; - - // path params - if ($request->name !== null) { - $localName = lcfirst('name'); - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->name), $resourcePath); - } - - // query params - if ($request->format !== null) { - $localName = lcfirst('format'); - $localValue = is_bool($request->format) ? ($request->format ? 'true' : 'false') : $request->format; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - // query params - if ($request->folder !== null) { - $localName = lcfirst('folder'); - $localValue = is_bool($request->folder) ? ($request->folder ? 'true' : 'false') : $request->folder; - if (strpos($resourcePath, '{' . $localName . '}') !== false) { - $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); - } else { - $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); - } - } - - - $resourcePath = $this->_parseURL($resourcePath, $queryParams); - - // body params - $_tempBody = null; - if (isset($request->dto)) { - if (is_string($request->dto)) { - $_tempBody = "\"" . $request->dto . "\""; - } else { - $_tempBody = $request->dto; - } - } - - if ($multipart) { - $headers= $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['multipart/form-data'], - ['multipart/form-data'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_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); - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // 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["data"]; - } - } - - $this->_requestToken(); - - if ($this->config->getAccessToken() !== null) { - $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 = http_build_query($queryParams); - - $urlPartToSign = parse_url($UrlToSign, PHP_URL_SCHEME) . '://' . $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->getHost() . "/oauth2/token"; - $postData = "grant_type=client_credentials" . "&client_id=" . $this->config->getAppSid() . "&client_secret=" . $this->config->getAppKey(); - $response = $this->client->send(new Request('POST', $requestUrl, [], $postData)); - $result = json_decode($response->getBody()->getContents(), true); - $this->config->setAccessToken($result["access_token"]); - $this->config->setRefreshToken($result["refresh_token"]); - } - - /* - * Refresh token - */ - private function _refreshToken() - { - $requestUrl = $this->config->getHost() . "/oauth2/token"; - $postData = "grant_type=refresh_token&refresh_token=" . $this->config->getRefreshToken(); - $response = $this->client->send(new Request('POST', $requestUrl, [], $postData)); - $result = json_decode($response->getBody()->getContents(), true); - $this->config->setAccessToken($result["access_token"]); - $this->config->setRefreshToken($result["refresh_token"]); - } -} \ No newline at end of file diff --git a/src/Aspose/BarCode/BarcodeApi.php b/src/Aspose/BarCode/BarcodeApi.php new file mode 100644 index 0000000..408a44b --- /dev/null +++ b/src/Aspose/BarCode/BarcodeApi.php @@ -0,0 +1,3481 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// +namespace Aspose\BarCode; + +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use Aspose\BarCode\Requests; + +/* + * 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 WordsApi + * @param ClientInterface $client client for calling api + * @param Configuration $config configuration info + * @param HeaderSelector $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 \Aspose\BarCode\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 \Aspose\BarCode\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\BarCodeErrorResponse', $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; + + + // query params + if (isset($request->type)) { + $localName = lcfirst('Type'); + $localValue = is_bool($request->type) ? ($request->type ? 'true' : 'false') : $request->type; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->text)) { + $localName = lcfirst('Text'); + $localValue = is_bool($request->text) ? ($request->text ? 'true' : 'false') : $request->text; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->two_d_display_text)) { + $localName = lcfirst('TwoDDisplayText'); + $localValue = is_bool($request->two_d_display_text) ? ($request->two_d_display_text ? 'true' : 'false') : $request->two_d_display_text; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->text_location)) { + $localName = lcfirst('TextLocation'); + $localValue = is_bool($request->text_location) ? ($request->text_location ? 'true' : 'false') : $request->text_location; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->text_alignment)) { + $localName = lcfirst('TextAlignment'); + $localValue = is_bool($request->text_alignment) ? ($request->text_alignment ? 'true' : 'false') : $request->text_alignment; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->text_color)) { + $localName = lcfirst('TextColor'); + $localValue = is_bool($request->text_color) ? ($request->text_color ? 'true' : 'false') : $request->text_color; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->font_size_mode)) { + $localName = lcfirst('FontSizeMode'); + $localValue = is_bool($request->font_size_mode) ? ($request->font_size_mode ? 'true' : 'false') : $request->font_size_mode; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->resolution)) { + $localName = lcfirst('Resolution'); + $localValue = is_bool($request->resolution) ? ($request->resolution ? 'true' : 'false') : $request->resolution; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->resolution_x)) { + $localName = lcfirst('ResolutionX'); + $localValue = is_bool($request->resolution_x) ? ($request->resolution_x ? 'true' : 'false') : $request->resolution_x; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->resolution_y)) { + $localName = lcfirst('ResolutionY'); + $localValue = is_bool($request->resolution_y) ? ($request->resolution_y ? 'true' : 'false') : $request->resolution_y; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->dimension_x)) { + $localName = lcfirst('DimensionX'); + $localValue = is_bool($request->dimension_x) ? ($request->dimension_x ? 'true' : 'false') : $request->dimension_x; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->text_space)) { + $localName = lcfirst('TextSpace'); + $localValue = is_bool($request->text_space) ? ($request->text_space ? 'true' : 'false') : $request->text_space; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->units)) { + $localName = lcfirst('Units'); + $localValue = is_bool($request->units) ? ($request->units ? 'true' : 'false') : $request->units; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->size_mode)) { + $localName = lcfirst('SizeMode'); + $localValue = is_bool($request->size_mode) ? ($request->size_mode ? 'true' : 'false') : $request->size_mode; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->bar_height)) { + $localName = lcfirst('BarHeight'); + $localValue = is_bool($request->bar_height) ? ($request->bar_height ? 'true' : 'false') : $request->bar_height; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->image_height)) { + $localName = lcfirst('ImageHeight'); + $localValue = is_bool($request->image_height) ? ($request->image_height ? 'true' : 'false') : $request->image_height; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->image_width)) { + $localName = lcfirst('ImageWidth'); + $localValue = is_bool($request->image_width) ? ($request->image_width ? 'true' : 'false') : $request->image_width; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->rotation_angle)) { + $localName = lcfirst('RotationAngle'); + $localValue = is_bool($request->rotation_angle) ? ($request->rotation_angle ? 'true' : 'false') : $request->rotation_angle; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->back_color)) { + $localName = lcfirst('BackColor'); + $localValue = is_bool($request->back_color) ? ($request->back_color ? 'true' : 'false') : $request->back_color; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->bar_color)) { + $localName = lcfirst('BarColor'); + $localValue = is_bool($request->bar_color) ? ($request->bar_color ? 'true' : 'false') : $request->bar_color; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->border_color)) { + $localName = lcfirst('BorderColor'); + $localValue = is_bool($request->border_color) ? ($request->border_color ? 'true' : 'false') : $request->border_color; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->border_width)) { + $localName = lcfirst('BorderWidth'); + $localValue = is_bool($request->border_width) ? ($request->border_width ? 'true' : 'false') : $request->border_width; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->border_dash_style)) { + $localName = lcfirst('BorderDashStyle'); + $localValue = is_bool($request->border_dash_style) ? ($request->border_dash_style ? 'true' : 'false') : $request->border_dash_style; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->border_visible)) { + $localName = lcfirst('BorderVisible'); + $localValue = is_bool($request->border_visible) ? ($request->border_visible ? 'true' : 'false') : $request->border_visible; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->enable_checksum)) { + $localName = lcfirst('EnableChecksum'); + $localValue = is_bool($request->enable_checksum) ? ($request->enable_checksum ? 'true' : 'false') : $request->enable_checksum; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->enable_escape)) { + $localName = lcfirst('EnableEscape'); + $localValue = is_bool($request->enable_escape) ? ($request->enable_escape ? 'true' : 'false') : $request->enable_escape; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->filled_bars)) { + $localName = lcfirst('FilledBars'); + $localValue = is_bool($request->filled_bars) ? ($request->filled_bars ? 'true' : 'false') : $request->filled_bars; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->always_show_checksum)) { + $localName = lcfirst('AlwaysShowChecksum'); + $localValue = is_bool($request->always_show_checksum) ? ($request->always_show_checksum ? 'true' : 'false') : $request->always_show_checksum; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->wide_narrow_ratio)) { + $localName = lcfirst('WideNarrowRatio'); + $localValue = is_bool($request->wide_narrow_ratio) ? ($request->wide_narrow_ratio ? 'true' : 'false') : $request->wide_narrow_ratio; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->validate_text)) { + $localName = lcfirst('ValidateText'); + $localValue = is_bool($request->validate_text) ? ($request->validate_text ? 'true' : 'false') : $request->validate_text; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->supplement_data)) { + $localName = lcfirst('SupplementData'); + $localValue = is_bool($request->supplement_data) ? ($request->supplement_data ? 'true' : 'false') : $request->supplement_data; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->supplement_space)) { + $localName = lcfirst('SupplementSpace'); + $localValue = is_bool($request->supplement_space) ? ($request->supplement_space ? 'true' : 'false') : $request->supplement_space; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->format)) { + $localName = lcfirst('format'); + $localValue = is_bool($request->format) ? ($request->format ? 'true' : 'false') : $request->format; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + + + $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 (isset($_tempBody)) { + // $_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); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } + } + + 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 \Aspose\BarCode\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 \Aspose\BarCode\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; + + // path params + if (isset($request->name)) { + $localName = lcfirst('name'); + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->name), $resourcePath); + } + + // query params + if (isset($request->type)) { + $localName = lcfirst('Type'); + $localValue = is_bool($request->type) ? ($request->type ? 'true' : 'false') : $request->type; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->checksum_validation)) { + $localName = lcfirst('ChecksumValidation'); + $localValue = is_bool($request->checksum_validation) ? ($request->checksum_validation ? 'true' : 'false') : $request->checksum_validation; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->detect_encoding)) { + $localName = lcfirst('DetectEncoding'); + $localValue = is_bool($request->detect_encoding) ? ($request->detect_encoding ? 'true' : 'false') : $request->detect_encoding; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->preset)) { + $localName = lcfirst('Preset'); + $localValue = is_bool($request->preset) ? ($request->preset ? 'true' : 'false') : $request->preset; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->rect_x)) { + $localName = lcfirst('RectX'); + $localValue = is_bool($request->rect_x) ? ($request->rect_x ? 'true' : 'false') : $request->rect_x; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->rect_y)) { + $localName = lcfirst('RectY'); + $localValue = is_bool($request->rect_y) ? ($request->rect_y ? 'true' : 'false') : $request->rect_y; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->rect_width)) { + $localName = lcfirst('RectWidth'); + $localValue = is_bool($request->rect_width) ? ($request->rect_width ? 'true' : 'false') : $request->rect_width; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->rect_height)) { + $localName = lcfirst('RectHeight'); + $localValue = is_bool($request->rect_height) ? ($request->rect_height ? 'true' : 'false') : $request->rect_height; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->strip_fnc)) { + $localName = lcfirst('StripFNC'); + $localValue = is_bool($request->strip_fnc) ? ($request->strip_fnc ? 'true' : 'false') : $request->strip_fnc; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->timeout)) { + $localName = lcfirst('Timeout'); + $localValue = is_bool($request->timeout) ? ($request->timeout ? 'true' : 'false') : $request->timeout; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->median_smoothing_window_size)) { + $localName = lcfirst('MedianSmoothingWindowSize'); + $localValue = is_bool($request->median_smoothing_window_size) ? ($request->median_smoothing_window_size ? 'true' : 'false') : $request->median_smoothing_window_size; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_median_smoothing)) { + $localName = lcfirst('AllowMedianSmoothing'); + $localValue = is_bool($request->allow_median_smoothing) ? ($request->allow_median_smoothing ? 'true' : 'false') : $request->allow_median_smoothing; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_complex_background)) { + $localName = lcfirst('AllowComplexBackground'); + $localValue = is_bool($request->allow_complex_background) ? ($request->allow_complex_background ? 'true' : 'false') : $request->allow_complex_background; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_datamatrix_industrial_barcodes)) { + $localName = lcfirst('AllowDatamatrixIndustrialBarcodes'); + $localValue = is_bool($request->allow_datamatrix_industrial_barcodes) ? ($request->allow_datamatrix_industrial_barcodes ? 'true' : 'false') : $request->allow_datamatrix_industrial_barcodes; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_decreased_image)) { + $localName = lcfirst('AllowDecreasedImage'); + $localValue = is_bool($request->allow_decreased_image) ? ($request->allow_decreased_image ? 'true' : 'false') : $request->allow_decreased_image; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_detect_scan_gap)) { + $localName = lcfirst('AllowDetectScanGap'); + $localValue = is_bool($request->allow_detect_scan_gap) ? ($request->allow_detect_scan_gap ? 'true' : 'false') : $request->allow_detect_scan_gap; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_incorrect_barcodes)) { + $localName = lcfirst('AllowIncorrectBarcodes'); + $localValue = is_bool($request->allow_incorrect_barcodes) ? ($request->allow_incorrect_barcodes ? 'true' : 'false') : $request->allow_incorrect_barcodes; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_invert_image)) { + $localName = lcfirst('AllowInvertImage'); + $localValue = is_bool($request->allow_invert_image) ? ($request->allow_invert_image ? 'true' : 'false') : $request->allow_invert_image; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_micro_white_spots_removing)) { + $localName = lcfirst('AllowMicroWhiteSpotsRemoving'); + $localValue = 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, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_one_d_fast_barcodes_detector)) { + $localName = lcfirst('AllowOneDFastBarcodesDetector'); + $localValue = 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, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_one_d_wiped_bars_restoration)) { + $localName = lcfirst('AllowOneDWipedBarsRestoration'); + $localValue = 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, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_qr_micro_qr_restoration)) { + $localName = lcfirst('AllowQRMicroQrRestoration'); + $localValue = 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, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_regular_image)) { + $localName = lcfirst('AllowRegularImage'); + $localValue = is_bool($request->allow_regular_image) ? ($request->allow_regular_image ? 'true' : 'false') : $request->allow_regular_image; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_salt_and_pepper_filtering)) { + $localName = lcfirst('AllowSaltAndPepperFiltering'); + $localValue = 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, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_white_spots_removing)) { + $localName = lcfirst('AllowWhiteSpotsRemoving'); + $localValue = is_bool($request->allow_white_spots_removing) ? ($request->allow_white_spots_removing ? 'true' : 'false') : $request->allow_white_spots_removing; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->region_likelihood_threshold_percent)) { + $localName = lcfirst('RegionLikelihoodThresholdPercent'); + $localValue = is_bool($request->region_likelihood_threshold_percent) ? ($request->region_likelihood_threshold_percent ? 'true' : 'false') : $request->region_likelihood_threshold_percent; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (is_array($request->scan_window_sizes)) { + $request->scan_window_sizes = ObjectSerializer::serializeCollection($request->scan_window_sizes, 'multi', true); + } + if (isset($request->scan_window_sizes)) { + $localName = lcfirst('ScanWindowSizes'); + $localValue = is_bool($request->scan_window_sizes) ? ($request->scan_window_sizes ? 'true' : 'false') : $request->scan_window_sizes; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->similarity)) { + $localName = lcfirst('Similarity'); + $localValue = is_bool($request->similarity) ? ($request->similarity ? 'true' : 'false') : $request->similarity; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->skip_diagonal_search)) { + $localName = lcfirst('SkipDiagonalSearch'); + $localValue = is_bool($request->skip_diagonal_search) ? ($request->skip_diagonal_search ? 'true' : 'false') : $request->skip_diagonal_search; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->australian_post_encoding_table)) { + $localName = lcfirst('AustralianPostEncodingTable'); + $localValue = is_bool($request->australian_post_encoding_table) ? ($request->australian_post_encoding_table ? 'true' : 'false') : $request->australian_post_encoding_table; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->rectangle_region)) { + $localName = lcfirst('RectangleRegion'); + $localValue = is_bool($request->rectangle_region) ? ($request->rectangle_region ? 'true' : 'false') : $request->rectangle_region; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->storage)) { + $localName = lcfirst('storage'); + $localValue = is_bool($request->storage) ? ($request->storage ? 'true' : 'false') : $request->storage; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->folder)) { + $localName = lcfirst('folder'); + $localValue = is_bool($request->folder) ? ($request->folder ? 'true' : 'false') : $request->folder; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + + + $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 (isset($_tempBody)) { + // $_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); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } + } + + 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 or encoded with base64. + * + * @param Requests\PostBarcodeRecognizeFromUrlOrContentRequest $request is a request object for operation + * + * @throws \Aspose\BarCode\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 or encoded with base64. + * + * @param Requests\PostBarcodeRecognizeFromUrlOrContentRequest $request is a request object for operation + * + * @throws \Aspose\BarCode\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 or encoded with base64. + * + * @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 or encoded with base64. + * + * @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; + + + // query params + if (isset($request->type)) { + $localName = lcfirst('Type'); + $localValue = is_bool($request->type) ? ($request->type ? 'true' : 'false') : $request->type; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->checksum_validation)) { + $localName = lcfirst('ChecksumValidation'); + $localValue = is_bool($request->checksum_validation) ? ($request->checksum_validation ? 'true' : 'false') : $request->checksum_validation; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->detect_encoding)) { + $localName = lcfirst('DetectEncoding'); + $localValue = is_bool($request->detect_encoding) ? ($request->detect_encoding ? 'true' : 'false') : $request->detect_encoding; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->preset)) { + $localName = lcfirst('Preset'); + $localValue = is_bool($request->preset) ? ($request->preset ? 'true' : 'false') : $request->preset; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->rect_x)) { + $localName = lcfirst('RectX'); + $localValue = is_bool($request->rect_x) ? ($request->rect_x ? 'true' : 'false') : $request->rect_x; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->rect_y)) { + $localName = lcfirst('RectY'); + $localValue = is_bool($request->rect_y) ? ($request->rect_y ? 'true' : 'false') : $request->rect_y; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->rect_width)) { + $localName = lcfirst('RectWidth'); + $localValue = is_bool($request->rect_width) ? ($request->rect_width ? 'true' : 'false') : $request->rect_width; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->rect_height)) { + $localName = lcfirst('RectHeight'); + $localValue = is_bool($request->rect_height) ? ($request->rect_height ? 'true' : 'false') : $request->rect_height; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->strip_fnc)) { + $localName = lcfirst('StripFNC'); + $localValue = is_bool($request->strip_fnc) ? ($request->strip_fnc ? 'true' : 'false') : $request->strip_fnc; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->timeout)) { + $localName = lcfirst('Timeout'); + $localValue = is_bool($request->timeout) ? ($request->timeout ? 'true' : 'false') : $request->timeout; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->median_smoothing_window_size)) { + $localName = lcfirst('MedianSmoothingWindowSize'); + $localValue = is_bool($request->median_smoothing_window_size) ? ($request->median_smoothing_window_size ? 'true' : 'false') : $request->median_smoothing_window_size; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_median_smoothing)) { + $localName = lcfirst('AllowMedianSmoothing'); + $localValue = is_bool($request->allow_median_smoothing) ? ($request->allow_median_smoothing ? 'true' : 'false') : $request->allow_median_smoothing; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_complex_background)) { + $localName = lcfirst('AllowComplexBackground'); + $localValue = is_bool($request->allow_complex_background) ? ($request->allow_complex_background ? 'true' : 'false') : $request->allow_complex_background; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_datamatrix_industrial_barcodes)) { + $localName = lcfirst('AllowDatamatrixIndustrialBarcodes'); + $localValue = is_bool($request->allow_datamatrix_industrial_barcodes) ? ($request->allow_datamatrix_industrial_barcodes ? 'true' : 'false') : $request->allow_datamatrix_industrial_barcodes; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_decreased_image)) { + $localName = lcfirst('AllowDecreasedImage'); + $localValue = is_bool($request->allow_decreased_image) ? ($request->allow_decreased_image ? 'true' : 'false') : $request->allow_decreased_image; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_detect_scan_gap)) { + $localName = lcfirst('AllowDetectScanGap'); + $localValue = is_bool($request->allow_detect_scan_gap) ? ($request->allow_detect_scan_gap ? 'true' : 'false') : $request->allow_detect_scan_gap; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_incorrect_barcodes)) { + $localName = lcfirst('AllowIncorrectBarcodes'); + $localValue = is_bool($request->allow_incorrect_barcodes) ? ($request->allow_incorrect_barcodes ? 'true' : 'false') : $request->allow_incorrect_barcodes; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_invert_image)) { + $localName = lcfirst('AllowInvertImage'); + $localValue = is_bool($request->allow_invert_image) ? ($request->allow_invert_image ? 'true' : 'false') : $request->allow_invert_image; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_micro_white_spots_removing)) { + $localName = lcfirst('AllowMicroWhiteSpotsRemoving'); + $localValue = 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, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_one_d_fast_barcodes_detector)) { + $localName = lcfirst('AllowOneDFastBarcodesDetector'); + $localValue = 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, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_one_d_wiped_bars_restoration)) { + $localName = lcfirst('AllowOneDWipedBarsRestoration'); + $localValue = 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, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_qr_micro_qr_restoration)) { + $localName = lcfirst('AllowQRMicroQrRestoration'); + $localValue = 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, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_regular_image)) { + $localName = lcfirst('AllowRegularImage'); + $localValue = is_bool($request->allow_regular_image) ? ($request->allow_regular_image ? 'true' : 'false') : $request->allow_regular_image; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_salt_and_pepper_filtering)) { + $localName = lcfirst('AllowSaltAndPepperFiltering'); + $localValue = 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, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->allow_white_spots_removing)) { + $localName = lcfirst('AllowWhiteSpotsRemoving'); + $localValue = is_bool($request->allow_white_spots_removing) ? ($request->allow_white_spots_removing ? 'true' : 'false') : $request->allow_white_spots_removing; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->region_likelihood_threshold_percent)) { + $localName = lcfirst('RegionLikelihoodThresholdPercent'); + $localValue = is_bool($request->region_likelihood_threshold_percent) ? ($request->region_likelihood_threshold_percent ? 'true' : 'false') : $request->region_likelihood_threshold_percent; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (is_array($request->scan_window_sizes)) { + $request->scan_window_sizes = ObjectSerializer::serializeCollection($request->scan_window_sizes, 'multi', true); + } + if (isset($request->scan_window_sizes)) { + $localName = lcfirst('ScanWindowSizes'); + $localValue = is_bool($request->scan_window_sizes) ? ($request->scan_window_sizes ? 'true' : 'false') : $request->scan_window_sizes; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->similarity)) { + $localName = lcfirst('Similarity'); + $localValue = is_bool($request->similarity) ? ($request->similarity ? 'true' : 'false') : $request->similarity; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->skip_diagonal_search)) { + $localName = lcfirst('SkipDiagonalSearch'); + $localValue = is_bool($request->skip_diagonal_search) ? ($request->skip_diagonal_search ? 'true' : 'false') : $request->skip_diagonal_search; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->australian_post_encoding_table)) { + $localName = lcfirst('AustralianPostEncodingTable'); + $localValue = is_bool($request->australian_post_encoding_table) ? ($request->australian_post_encoding_table ? 'true' : 'false') : $request->australian_post_encoding_table; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->rectangle_region)) { + $localName = lcfirst('RectangleRegion'); + $localValue = is_bool($request->rectangle_region) ? ($request->rectangle_region ? 'true' : 'false') : $request->rectangle_region; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->url)) { + $localName = lcfirst('url'); + $localValue = is_bool($request->url) ? ($request->url ? 'true' : 'false') : $request->url; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + + + $resourcePath = $this->_parseURL($resourcePath, $queryParams); + + // form params + if (isset($request->image)) { + //$multipart = true; + $filename = ObjectSerializer::toFormValue($request->image); + $handle = fopen($filename, 'rb'); + $fsize = filesize($filename); + $contents = fread($handle, $fsize); + $formParams['image'] = $contents; + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/octet-stream'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_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); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // 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']; + } + } + + 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 \Aspose\BarCode\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 \Aspose\BarCode\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; + + + // query params + if (isset($request->format)) { + $localName = lcfirst('format'); + $localValue = is_bool($request->format) ? ($request->format ? 'true' : 'false') : $request->format; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + + + $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) + if (isset($_tempBody)) { + // $_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); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } + } + + 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 \Aspose\BarCode\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 \Aspose\BarCode\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\BarCodeErrorResponse', $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; + + // path params + if (isset($request->name)) { + $localName = lcfirst('name'); + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->name), $resourcePath); + } + + // query params + if (isset($request->type)) { + $localName = lcfirst('Type'); + $localValue = is_bool($request->type) ? ($request->type ? 'true' : 'false') : $request->type; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->text)) { + $localName = lcfirst('Text'); + $localValue = is_bool($request->text) ? ($request->text ? 'true' : 'false') : $request->text; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->two_d_display_text)) { + $localName = lcfirst('TwoDDisplayText'); + $localValue = is_bool($request->two_d_display_text) ? ($request->two_d_display_text ? 'true' : 'false') : $request->two_d_display_text; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->text_location)) { + $localName = lcfirst('TextLocation'); + $localValue = is_bool($request->text_location) ? ($request->text_location ? 'true' : 'false') : $request->text_location; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->text_alignment)) { + $localName = lcfirst('TextAlignment'); + $localValue = is_bool($request->text_alignment) ? ($request->text_alignment ? 'true' : 'false') : $request->text_alignment; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->text_color)) { + $localName = lcfirst('TextColor'); + $localValue = is_bool($request->text_color) ? ($request->text_color ? 'true' : 'false') : $request->text_color; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->font_size_mode)) { + $localName = lcfirst('FontSizeMode'); + $localValue = is_bool($request->font_size_mode) ? ($request->font_size_mode ? 'true' : 'false') : $request->font_size_mode; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->resolution)) { + $localName = lcfirst('Resolution'); + $localValue = is_bool($request->resolution) ? ($request->resolution ? 'true' : 'false') : $request->resolution; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->resolution_x)) { + $localName = lcfirst('ResolutionX'); + $localValue = is_bool($request->resolution_x) ? ($request->resolution_x ? 'true' : 'false') : $request->resolution_x; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->resolution_y)) { + $localName = lcfirst('ResolutionY'); + $localValue = is_bool($request->resolution_y) ? ($request->resolution_y ? 'true' : 'false') : $request->resolution_y; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->dimension_x)) { + $localName = lcfirst('DimensionX'); + $localValue = is_bool($request->dimension_x) ? ($request->dimension_x ? 'true' : 'false') : $request->dimension_x; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->text_space)) { + $localName = lcfirst('TextSpace'); + $localValue = is_bool($request->text_space) ? ($request->text_space ? 'true' : 'false') : $request->text_space; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->units)) { + $localName = lcfirst('Units'); + $localValue = is_bool($request->units) ? ($request->units ? 'true' : 'false') : $request->units; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->size_mode)) { + $localName = lcfirst('SizeMode'); + $localValue = is_bool($request->size_mode) ? ($request->size_mode ? 'true' : 'false') : $request->size_mode; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->bar_height)) { + $localName = lcfirst('BarHeight'); + $localValue = is_bool($request->bar_height) ? ($request->bar_height ? 'true' : 'false') : $request->bar_height; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->image_height)) { + $localName = lcfirst('ImageHeight'); + $localValue = is_bool($request->image_height) ? ($request->image_height ? 'true' : 'false') : $request->image_height; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->image_width)) { + $localName = lcfirst('ImageWidth'); + $localValue = is_bool($request->image_width) ? ($request->image_width ? 'true' : 'false') : $request->image_width; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->rotation_angle)) { + $localName = lcfirst('RotationAngle'); + $localValue = is_bool($request->rotation_angle) ? ($request->rotation_angle ? 'true' : 'false') : $request->rotation_angle; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->back_color)) { + $localName = lcfirst('BackColor'); + $localValue = is_bool($request->back_color) ? ($request->back_color ? 'true' : 'false') : $request->back_color; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->bar_color)) { + $localName = lcfirst('BarColor'); + $localValue = is_bool($request->bar_color) ? ($request->bar_color ? 'true' : 'false') : $request->bar_color; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->border_color)) { + $localName = lcfirst('BorderColor'); + $localValue = is_bool($request->border_color) ? ($request->border_color ? 'true' : 'false') : $request->border_color; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->border_width)) { + $localName = lcfirst('BorderWidth'); + $localValue = is_bool($request->border_width) ? ($request->border_width ? 'true' : 'false') : $request->border_width; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->border_dash_style)) { + $localName = lcfirst('BorderDashStyle'); + $localValue = is_bool($request->border_dash_style) ? ($request->border_dash_style ? 'true' : 'false') : $request->border_dash_style; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->border_visible)) { + $localName = lcfirst('BorderVisible'); + $localValue = is_bool($request->border_visible) ? ($request->border_visible ? 'true' : 'false') : $request->border_visible; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->enable_checksum)) { + $localName = lcfirst('EnableChecksum'); + $localValue = is_bool($request->enable_checksum) ? ($request->enable_checksum ? 'true' : 'false') : $request->enable_checksum; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->enable_escape)) { + $localName = lcfirst('EnableEscape'); + $localValue = is_bool($request->enable_escape) ? ($request->enable_escape ? 'true' : 'false') : $request->enable_escape; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->filled_bars)) { + $localName = lcfirst('FilledBars'); + $localValue = is_bool($request->filled_bars) ? ($request->filled_bars ? 'true' : 'false') : $request->filled_bars; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->always_show_checksum)) { + $localName = lcfirst('AlwaysShowChecksum'); + $localValue = is_bool($request->always_show_checksum) ? ($request->always_show_checksum ? 'true' : 'false') : $request->always_show_checksum; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->wide_narrow_ratio)) { + $localName = lcfirst('WideNarrowRatio'); + $localValue = is_bool($request->wide_narrow_ratio) ? ($request->wide_narrow_ratio ? 'true' : 'false') : $request->wide_narrow_ratio; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->validate_text)) { + $localName = lcfirst('ValidateText'); + $localValue = is_bool($request->validate_text) ? ($request->validate_text ? 'true' : 'false') : $request->validate_text; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->supplement_data)) { + $localName = lcfirst('SupplementData'); + $localValue = is_bool($request->supplement_data) ? ($request->supplement_data ? 'true' : 'false') : $request->supplement_data; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->supplement_space)) { + $localName = lcfirst('SupplementSpace'); + $localValue = is_bool($request->supplement_space) ? ($request->supplement_space ? 'true' : 'false') : $request->supplement_space; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->storage)) { + $localName = lcfirst('storage'); + $localValue = is_bool($request->storage) ? ($request->storage ? 'true' : 'false') : $request->storage; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->folder)) { + $localName = lcfirst('folder'); + $localValue = is_bool($request->folder) ? ($request->folder ? 'true' : 'false') : $request->folder; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->format)) { + $localName = lcfirst('format'); + $localValue = is_bool($request->format) ? ($request->format ? 'true' : 'false') : $request->format; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + + + $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', 'application/xml'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_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); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } + } + + 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 \Aspose\BarCode\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 \Aspose\BarCode\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; + + // path params + if (isset($request->name)) { + $localName = lcfirst('name'); + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->name), $resourcePath); + } + + // query params + if (isset($request->type)) { + $localName = lcfirst('type'); + $localValue = is_bool($request->type) ? ($request->type ? 'true' : 'false') : $request->type; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->storage)) { + $localName = lcfirst('storage'); + $localValue = is_bool($request->storage) ? ($request->storage ? 'true' : 'false') : $request->storage; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->folder)) { + $localName = lcfirst('folder'); + $localValue = is_bool($request->folder) ? ($request->folder ? 'true' : 'false') : $request->folder; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + + + $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) + if (isset($_tempBody)) { + // $_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); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } + } + + 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 \Aspose\BarCode\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 \Aspose\BarCode\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\BarCodeErrorResponse', $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; + + // path params + if (isset($request->name)) { + $localName = lcfirst('name'); + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->name), $resourcePath); + } + + // query params + if (isset($request->format)) { + $localName = lcfirst('format'); + $localValue = is_bool($request->format) ? ($request->format ? 'true' : 'false') : $request->format; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->folder)) { + $localName = lcfirst('folder'); + $localValue = is_bool($request->folder) ? ($request->folder ? 'true' : 'false') : $request->folder; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->storage)) { + $localName = lcfirst('storage'); + $localValue = is_bool($request->storage) ? ($request->storage ? 'true' : 'false') : $request->storage; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + + + $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) + if (isset($_tempBody)) { + // $_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); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } + } + + 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 = 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->getHost() . '/connect/token'; + + $response = $this->client->request('POST', $requestUrl, [ + 'form_params' => [ + 'grant_type' => 'client_credentials', + 'client_id' => $this->config->getAppSid(), + 'client_secret' => $this->config->getAppKey(), + ] + ]); + $result = json_decode($response->getBody()->getContents(), true); + $this->config->setAccessToken($result['access_token']); + } +} \ No newline at end of file diff --git a/src/Aspose/BarCode/Configuration.php b/src/Aspose/BarCode/Configuration.php index 10d1c1f..e07f2ac 100644 --- a/src/Aspose/BarCode/Configuration.php +++ b/src/Aspose/BarCode/Configuration.php @@ -1,4 +1,4 @@ - @@ -11,10 +11,10 @@ * 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 @@ -25,89 +25,69 @@ * * -------------------------------------------------------------------------------------------------------------------- */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// namespace Aspose\BarCode; +use JsonSerializable; + /* * Represents a set of configuration settings */ -class Configuration + +class Configuration implements JsonSerializable { private static $_defaultConfiguration; /* - * Associate array to store API key(s) - * - * @var string[] - */ - protected $apiKeys = []; - - /* - * AppKey for API + * Version of Aspose.BarCode Cloud API * - */ - protected $appKey = ''; - - /* - * AppSid for API * @var string */ - protected $appSid = ''; + protected $clientVersion = '20.5'; /* - * Associate array to store API prefix (e.g. Bearer) - * - * @var string[] - */ - protected $apiKeyPrefixes = []; - - /* - * Access token for OAuth - * - * @var string - */ - protected $accessToken = ''; - - /* - * Refresh token for OAuth + * AppKey for API * * @var string */ - protected $refreshToken = ''; + protected $appKey = null; /* - * Username for HTTP basic authentication + * AppSid for API * * @var string */ - protected $username = ''; + protected $appSid = null; /* - * Password for HTTP basic authentication + * Access token for OAuth * * @var string */ - protected $password = ''; + protected $accessToken = null; /* * The host * * @var string */ - protected $host = 'https://api.aspose.com'; - + protected $host = 'https://api.aspose.cloud'; + /* * Version of API to use, possible values are v1, v1.1, v2, v3 * default value is v1 * @var string */ - protected $base_path = "v1"; + protected $base_path = '/v3.0'; /* - * User agent of the HTTP request, set to "PHP-Swagger" by default + * User agent of the HTTP request, set to 'php sdk' by default * * @var string */ - protected $userAgent = "php sdk"; + protected $userAgent = 'php sdk'; /* * Debug switch (default set to false) @@ -129,12 +109,6 @@ class Configuration * @var string */ protected $tempFolderPath; - - /* - * Version of Aspose.BarCode Cloud API - * - */ - protected $clientVersion = '18.3'; /* * Constructor @@ -143,7 +117,7 @@ public function __construct() { $this->tempFolderPath = sys_get_temp_dir(); } - + /* * Gets client version * @@ -153,20 +127,6 @@ public function getClientVersion() return $this->clientVersion; } - /* - * Sets API key - * - * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * @param string $key API key or token - * - * @return $this - */ - public function setApiKey($apiKeyIdentifier, $key) - { - $this->apiKeys[$apiKeyIdentifier] = $key; - return $this; - } - /* * Sets AppSid * @@ -179,7 +139,7 @@ public function setAppSid($appSid) $this->appSid = $appSid; return $this; } - + /* * Gets AppSid * @return $appSid @@ -188,7 +148,7 @@ public function getAppSid() { return $this->appSid; } - + /* * Sets AppKey * @@ -201,7 +161,7 @@ public function setAppKey($appKey) $this->appKey = $appKey; return $this; } - + /* * Gets AppKey * @return $appKey @@ -211,44 +171,6 @@ public function getAppKey() return $this->appKey; } - /* - * Gets API key - * - * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * - * @return string API key or token - */ - public function getApiKey($apiKeyIdentifier) - { - return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; - } - - /* - * Sets the prefix for API key (e.g. Bearer) - * - * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * @param string $prefix API key prefix, e.g. Bearer - * - * @return $this - */ - public function setApiKeyPrefix($apiKeyIdentifier, $prefix) - { - $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; - return $this; - } - - /* - * Gets API key prefix - * - * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * - * @return string - */ - public function getApiKeyPrefix($apiKeyIdentifier) - { - return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; - } - /* * Sets the access token for OAuth * @@ -271,75 +193,6 @@ public function getAccessToken() { return $this->accessToken; } - - /* - * Sets the refresh token for OAuth - * - * @param string $refreshToken Token for OAuth - * - * @return $this - */ - public function setRefreshToken($refreshToken) - { - $this->refreshToken = $refreshToken; - return $this; - } - - /* - * Gets the refresh token for OAuth - * - * @return string refresh token for OAuth - */ - public function getRefreshToken() - { - return $this->refreshToken; - } - - /* - * Sets the username for HTTP basic authentication - * - * @param string $username Username for HTTP basic authentication - * - * @return $this - */ - public function setUsername($username) - { - $this->username = $username; - return $this; - } - - /* - * Gets the username for HTTP basic authentication - * - * @return string Username for HTTP basic authentication - */ - public function getUsername() - { - return $this->username; - } - - /* - * Sets the password for HTTP basic authentication - * - * @param string $password Password for HTTP basic authentication - * - * @return $this - */ - public function setPassword($password) - { - $this->password = $password; - return $this; - } - - /* - * Gets the password for HTTP basic authentication - * - * @return string Password for HTTP basic authentication - */ - public function getPassword() - { - return $this->password; - } /* * Sets the host @@ -363,19 +216,6 @@ public function getHost() { return $this->host; } - - /* - * Sets the base_path - * - * @param string $base_path api version - * - * @return $this - */ - public function setBasePath($base_path) - { - $this->base_path = $base_path; - return $this; - } /* * Gets the base_path @@ -499,7 +339,7 @@ public static function getDefaultConfiguration() } /* - * Sets the detault configuration instance + * Sets the default configuration instance * * @param Configuration $config An instance of the Configuration Object * @@ -517,37 +357,41 @@ public static function setDefaultConfiguration(Configuration $config) */ public static function toDebugReport() { - $report = 'PHP SDK (Swagger\Client) Debug Report:' . PHP_EOL; + $report = 'PHP SDK (Aspose\BarCode) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' OpenAPI Spec Version: 1' . PHP_EOL; + $report .= ' OpenAPI Spec Version: 3.0' . PHP_EOL; + $report .= ' SDK Package Version: 20.5' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; } /* - * Get API key (with prefix if set) - * - * @param string $apiKeyIdentifier name of apikey - * - * @return string API key with the prefix + * implements JsonSerializable */ - public function getApiKeyWithPrefix($apiKeyIdentifier) + public function jsonSerialize() { - $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); - $apiKey = $this->getApiKey($apiKeyIdentifier); + return [ + 'AppKey' => $this->appKey, + 'AppSid' => $this->appSid, + 'Host' => $this->host, + 'AccessToken' => $this->accessToken, + 'Debug' => $this->debug, + ]; + } - if ($apiKey === null) { - return null; - } + public static function fromJson(string $jsonString): Configuration + { + $values = \json_decode($jsonString, true); - if ($prefix === null) { - $keyWithPrefix = $apiKey; - } else { - $keyWithPrefix = $prefix . ' ' . $apiKey; - } + $config = new Configuration(); + if (isset($values['AppKey'])) $config->setAppKey($values['AppKey']); + if (isset($values['AppSid'])) $config->setAppSid($values['AppSid']); + if (isset($values['Host'])) $config->setHost($values['Host']); + if (isset($values['AccessToken'])) $config->setAccessToken($values['AccessToken']); + if (isset($values['Debug'])) $config->setDebug($values['Debug']); - return $keyWithPrefix; + return $config; } } diff --git a/src/Aspose/BarCode/FileApi.php b/src/Aspose/BarCode/FileApi.php new file mode 100644 index 0000000..ae72802 --- /dev/null +++ b/src/Aspose/BarCode/FileApi.php @@ -0,0 +1,1525 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// +namespace Aspose\BarCode; + +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use Aspose\BarCode\Requests; + +/* + * Aspose.BarCode for Cloud API. + */ + +class FileApi +{ + /* + * 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 WordsApi + * @param ClientInterface $client client for calling api + * @param Configuration $config configuration info + * @param HeaderSelector $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 copyFile + * + * Copy file + * + * @param Requests\CopyFileRequest $request is a request object for operation + * + * @throws \Aspose\BarCode\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function copyFile(Requests\CopyFileRequest $request) + { + try { + $this->copyFileWithHttpInfo($request); + } catch (RepeatRequestException $e) { + $this->copyFileWithHttpInfo($request); + } + } + + /* + * Operation copyFileWithHttpInfo + * + * Copy file + * + * @param Requests\CopyFileRequest $request is a request object for operation + * + * @throws \Aspose\BarCode\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function copyFileWithHttpInfo(Requests\CopyFileRequest $request) + { + $returnType = ''; + $request = $this->CopyFileRequest($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 copyFileAsync + * + * Copy file + * + * @param Requests\CopyFileRequest $request is a request object for operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function copyFileAsync(Requests\CopyFileRequest $request) + { + return $this->copyFileAsyncWithHttpInfo($request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /* + * Operation copyFileAsyncWithHttpInfo + * + * Copy file + * + * @param Requests\CopyFileRequest $request is a request object for operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function copyFileAsyncWithHttpInfo(Requests\CopyFileRequest $request) + { + $returnType = ''; + $request = $this->CopyFileRequest($request); + + return $this->client + ->sendAsync($request, $this->_createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + 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 'copyFile' + * + * @param Requests\CopyFileRequest $request is a request object for operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function CopyFileRequest(Requests\CopyFileRequest $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 'dest_path' is set + if (!isset($request->dest_path)) { + throw new \InvalidArgumentException('Missing the required parameter $dest_path when calling copyFile'); + } + + $resourcePath = '/barcode/storage/file/copy/{srcPath}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if (isset($request->src_path)) { + $localName = lcfirst('srcPath'); + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->src_path), $resourcePath); + } + + // query params + if (isset($request->dest_path)) { + $localName = lcfirst('destPath'); + $localValue = is_bool($request->dest_path) ? ($request->dest_path ? 'true' : 'false') : $request->dest_path; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->src_storage_name)) { + $localName = lcfirst('srcStorageName'); + $localValue = is_bool($request->src_storage_name) ? ($request->src_storage_name ? 'true' : 'false') : $request->src_storage_name; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->dest_storage_name)) { + $localName = lcfirst('destStorageName'); + $localValue = is_bool($request->dest_storage_name) ? ($request->dest_storage_name ? 'true' : 'false') : $request->dest_storage_name; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->version_id)) { + $localName = lcfirst('versionId'); + $localValue = is_bool($request->version_id) ? ($request->version_id ? 'true' : 'false') : $request->version_id; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + + + $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 (isset($_tempBody)) { + // $_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); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } + } + + 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 \Aspose\BarCode\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 \Aspose\BarCode\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); + } + + $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 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) use ($returnType) { + 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'); + } + + $resourcePath = '/barcode/storage/file/{path}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if (isset($request->path)) { + $localName = lcfirst('path'); + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->path), $resourcePath); + } + + // query params + if (isset($request->storage_name)) { + $localName = lcfirst('storageName'); + $localValue = is_bool($request->storage_name) ? ($request->storage_name ? 'true' : 'false') : $request->storage_name; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->version_id)) { + $localName = lcfirst('versionId'); + $localValue = is_bool($request->version_id) ? ($request->version_id ? 'true' : 'false') : $request->version_id; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + + + $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 (isset($_tempBody)) { + // $_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); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } + } + + 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 downloadFile + * + * Download file + * + * @param Requests\DownloadFileRequest $request is a request object for operation + * + * @throws \Aspose\BarCode\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SplFileObject + */ + public function downloadFile(Requests\DownloadFileRequest $request) + { + try { + list($response) = $this->downloadFileWithHttpInfo($request); + return $response; + } catch (RepeatRequestException $e) { + list($response) = $this->downloadFileWithHttpInfo($request); + return $response; + } + } + + /* + * Operation downloadFileWithHttpInfo + * + * Download file + * + * @param Requests\DownloadFileRequest $request is a request object for operation + * + * @throws \Aspose\BarCode\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) + { + $returnType = '\SplFileObject'; + $request = $this->DownloadFileRequest($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 downloadFileAsync + * + * Download file + * + * @param Requests\DownloadFileRequest $request is a request object for operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function downloadFileAsync(Requests\DownloadFileRequest $request) + { + return $this->downloadFileAsyncWithHttpInfo($request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /* + * Operation downloadFileAsyncWithHttpInfo + * + * Download file + * + * @param Requests\DownloadFileRequest $request is a request object for operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function downloadFileAsyncWithHttpInfo(Requests\DownloadFileRequest $request) + { + $returnType = '\SplFileObject'; + $request = $this->DownloadFileRequest($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 'downloadFile' + * + * @param Requests\DownloadFileRequest $request is a request object for operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function DownloadFileRequest(Requests\DownloadFileRequest $request) + { + // verify the required parameter 'path' is set + if (!isset($request->path)) { + throw new \InvalidArgumentException('Missing the required parameter $path when calling downloadFile'); + } + + $resourcePath = '/barcode/storage/file/{path}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if (isset($request->path)) { + $localName = lcfirst('path'); + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->path), $resourcePath); + } + + // query params + if (isset($request->storage_name)) { + $localName = lcfirst('storageName'); + $localValue = is_bool($request->storage_name) ? ($request->storage_name ? 'true' : 'false') : $request->storage_name; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->version_id)) { + $localName = lcfirst('versionId'); + $localValue = is_bool($request->version_id) ? ($request->version_id ? 'true' : 'false') : $request->version_id; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + + + $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 (isset($_tempBody)) { + // $_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); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } + } + + 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 \Aspose\BarCode\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 \Aspose\BarCode\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) use ($returnType) { + 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; + + // path params + if (isset($request->src_path)) { + $localName = lcfirst('srcPath'); + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->src_path), $resourcePath); + } + + // query params + if (isset($request->dest_path)) { + $localName = lcfirst('destPath'); + $localValue = is_bool($request->dest_path) ? ($request->dest_path ? 'true' : 'false') : $request->dest_path; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->src_storage_name)) { + $localName = lcfirst('srcStorageName'); + $localValue = is_bool($request->src_storage_name) ? ($request->src_storage_name ? 'true' : 'false') : $request->src_storage_name; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->dest_storage_name)) { + $localName = lcfirst('destStorageName'); + $localValue = is_bool($request->dest_storage_name) ? ($request->dest_storage_name ? 'true' : 'false') : $request->dest_storage_name; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->version_id)) { + $localName = lcfirst('versionId'); + $localValue = is_bool($request->version_id) ? ($request->version_id ? 'true' : 'false') : $request->version_id; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + + + $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 (isset($_tempBody)) { + // $_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); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } + } + + 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 uploadFile + * + * Upload file + * + * @param Requests\UploadFileRequest $request is a request object for operation + * + * @throws \Aspose\BarCode\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Aspose\BarCode\Model\FilesUploadResult + */ + public function uploadFile(Requests\UploadFileRequest $request) + { + try { + list($response) = $this->uploadFileWithHttpInfo($request); + return $response; + } catch (RepeatRequestException $e) { + list($response) = $this->uploadFileWithHttpInfo($request); + return $response; + } + } + + /* + * Operation uploadFileWithHttpInfo + * + * Upload file + * + * @param Requests\UploadFileRequest $request is a request object for operation + * + * @throws \Aspose\BarCode\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Aspose\BarCode\Model\FilesUploadResult, HTTP status code, HTTP response headers (array of strings) + */ + public function uploadFileWithHttpInfo(Requests\UploadFileRequest $request) + { + $returnType = '\Aspose\BarCode\Model\FilesUploadResult'; + $request = $this->UploadFileRequest($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\FilesUploadResult', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /* + * Operation uploadFileAsync + * + * Upload file + * + * @param Requests\UploadFileRequest $request is a request object for operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function uploadFileAsync(Requests\UploadFileRequest $request) + { + return $this->uploadFileAsyncWithHttpInfo($request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /* + * Operation uploadFileAsyncWithHttpInfo + * + * Upload file + * + * @param Requests\UploadFileRequest $request is a request object for operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function uploadFileAsyncWithHttpInfo(Requests\UploadFileRequest $request) + { + $returnType = '\Aspose\BarCode\Model\FilesUploadResult'; + $request = $this->UploadFileRequest($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 'uploadFile' + * + * @param Requests\UploadFileRequest $request is a request object for operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function UploadFileRequest(Requests\UploadFileRequest $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 'file' is set + if (!isset($request->file)) { + throw new \InvalidArgumentException('Missing the required parameter $file when calling uploadFile'); + } + + $resourcePath = '/barcode/storage/file/{path}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if (isset($request->path)) { + $localName = lcfirst('path'); + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->path), $resourcePath); + } + + // query params + if (isset($request->storage_name)) { + $localName = lcfirst('storageName'); + $localValue = is_bool($request->storage_name) ? ($request->storage_name ? 'true' : 'false') : $request->storage_name; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + + + $resourcePath = $this->_parseURL($resourcePath, $queryParams); + + // form params + if (isset($request->file)) { + //$multipart = true; + $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'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['multipart/form-data'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_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); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // 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']; + } + } + + 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 = 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->getHost() . '/connect/token'; + + $response = $this->client->request('POST', $requestUrl, [ + 'form_params' => [ + 'grant_type' => 'client_credentials', + 'client_id' => $this->config->getAppSid(), + 'client_secret' => $this->config->getAppKey(), + ] + ]); + $result = json_decode($response->getBody()->getContents(), true); + $this->config->setAccessToken($result['access_token']); + } +} \ No newline at end of file diff --git a/src/Aspose/BarCode/FolderApi.php b/src/Aspose/BarCode/FolderApi.php new file mode 100644 index 0000000..4a73264 --- /dev/null +++ b/src/Aspose/BarCode/FolderApi.php @@ -0,0 +1,1437 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// +namespace Aspose\BarCode; + +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use Aspose\BarCode\Requests; + +/* + * 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 WordsApi + * @param ClientInterface $client client for calling api + * @param Configuration $config configuration info + * @param HeaderSelector $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 \Aspose\BarCode\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 \Aspose\BarCode\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) use ($returnType) { + 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; + + // path params + if (isset($request->src_path)) { + $localName = lcfirst('srcPath'); + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->src_path), $resourcePath); + } + + // query params + if (isset($request->dest_path)) { + $localName = lcfirst('destPath'); + $localValue = is_bool($request->dest_path) ? ($request->dest_path ? 'true' : 'false') : $request->dest_path; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->src_storage_name)) { + $localName = lcfirst('srcStorageName'); + $localValue = is_bool($request->src_storage_name) ? ($request->src_storage_name ? 'true' : 'false') : $request->src_storage_name; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->dest_storage_name)) { + $localName = lcfirst('destStorageName'); + $localValue = is_bool($request->dest_storage_name) ? ($request->dest_storage_name ? 'true' : 'false') : $request->dest_storage_name; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + + + $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 (isset($_tempBody)) { + // $_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); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } + } + + 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 \Aspose\BarCode\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 \Aspose\BarCode\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) use ($returnType) { + 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; + + // path params + if (isset($request->path)) { + $localName = lcfirst('path'); + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->path), $resourcePath); + } + + // query params + if (isset($request->storage_name)) { + $localName = lcfirst('storageName'); + $localValue = is_bool($request->storage_name) ? ($request->storage_name ? 'true' : 'false') : $request->storage_name; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + + + $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 (isset($_tempBody)) { + // $_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); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } + } + + 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 \Aspose\BarCode\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 \Aspose\BarCode\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) use ($returnType) { + 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; + + // path params + if (isset($request->path)) { + $localName = lcfirst('path'); + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->path), $resourcePath); + } + + // query params + if (isset($request->storage_name)) { + $localName = lcfirst('storageName'); + $localValue = is_bool($request->storage_name) ? ($request->storage_name ? 'true' : 'false') : $request->storage_name; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->recursive)) { + $localName = lcfirst('recursive'); + $localValue = is_bool($request->recursive) ? ($request->recursive ? 'true' : 'false') : $request->recursive; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + + + $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 (isset($_tempBody)) { + // $_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); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } + } + + 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 \Aspose\BarCode\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 \Aspose\BarCode\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; + + // path params + if (isset($request->path)) { + $localName = lcfirst('path'); + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->path), $resourcePath); + } + + // query params + if (isset($request->storage_name)) { + $localName = lcfirst('storageName'); + $localValue = is_bool($request->storage_name) ? ($request->storage_name ? 'true' : 'false') : $request->storage_name; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + + + $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 (isset($_tempBody)) { + // $_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); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } + } + + 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 \Aspose\BarCode\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 \Aspose\BarCode\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) use ($returnType) { + 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; + + // path params + if (isset($request->src_path)) { + $localName = lcfirst('srcPath'); + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->src_path), $resourcePath); + } + + // query params + if (isset($request->dest_path)) { + $localName = lcfirst('destPath'); + $localValue = is_bool($request->dest_path) ? ($request->dest_path ? 'true' : 'false') : $request->dest_path; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->src_storage_name)) { + $localName = lcfirst('srcStorageName'); + $localValue = is_bool($request->src_storage_name) ? ($request->src_storage_name ? 'true' : 'false') : $request->src_storage_name; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->dest_storage_name)) { + $localName = lcfirst('destStorageName'); + $localValue = is_bool($request->dest_storage_name) ? ($request->dest_storage_name ? 'true' : 'false') : $request->dest_storage_name; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + + + $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 (isset($_tempBody)) { + // $_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); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } + } + + 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 = 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->getHost() . '/connect/token'; + + $response = $this->client->request('POST', $requestUrl, [ + 'form_params' => [ + 'grant_type' => 'client_credentials', + 'client_id' => $this->config->getAppSid(), + 'client_secret' => $this->config->getAppKey(), + ] + ]); + $result = json_decode($response->getBody()->getContents(), true); + $this->config->setAccessToken($result['access_token']); + } +} \ No newline at end of file diff --git a/src/Aspose/BarCode/HeaderSelector.php b/src/Aspose/BarCode/HeaderSelector.php index ec56af7..357c291 100644 --- a/src/Aspose/BarCode/HeaderSelector.php +++ b/src/Aspose/BarCode/HeaderSelector.php @@ -1,4 +1,4 @@ - @@ -11,10 +11,10 @@ * 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 @@ -25,6 +25,9 @@ * * -------------------------------------------------------------------------------------------------------------------- */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// namespace Aspose\BarCode; use \Exception; @@ -39,7 +42,7 @@ class HeaderSelector * Selects headers for request * @param string[] $accept type of header * @param string[] $contentTypes types of content - * @return array + * @return array */ public function selectHeaders($accept, $contentTypes) { diff --git a/src/Aspose/BarCode/Model/AustralianPostParams.php b/src/Aspose/BarCode/Model/AustralianPostParams.php new file mode 100644 index 0000000..34e2345 --- /dev/null +++ b/src/Aspose/BarCode/Model/AustralianPostParams.php @@ -0,0 +1,334 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * AustralianPostParams + * + * @description AustralianPost barcode parameters. + */ +class AustralianPostParams implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "AustralianPostParams"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'encoding_table' => '\Aspose\BarCode\Model\CustomerInformationInterpretingType', + 'short_bar_height' => 'double' + ]; + + /* + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $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) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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 new file mode 100644 index 0000000..5d1cec1 --- /dev/null +++ b/src/Aspose/BarCode/Model/AutoSizeMode.php @@ -0,0 +1,62 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; +use Aspose\BarCode\ObjectSerializer; + +/* + * AutoSizeMode + * + * @description + */ +class AutoSizeMode +{ + + /// + /// Enum value None + /// + const None = "None"; + + /// + /// Enum value Nearest + /// + const Nearest = "Nearest"; + + /// + /// Enum value Interpolation + /// + const Interpolation = "Interpolation"; + +} + diff --git a/src/Aspose/BarCode/Model/GraphicsUnit.php b/src/Aspose/BarCode/Model/AvailableGraphicsUnit.php similarity index 76% rename from src/Aspose/BarCode/Model/GraphicsUnit.php rename to src/Aspose/BarCode/Model/AvailableGraphicsUnit.php index c464ec9..f9f8bc8 100644 --- a/src/Aspose/BarCode/Model/GraphicsUnit.php +++ b/src/Aspose/BarCode/Model/AvailableGraphicsUnit.php @@ -1,7 +1,7 @@ - + * * Copyright (c) 2018 Aspose Pty Ltd * * @@ -11,10 +11,10 @@ * 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 @@ -28,52 +28,40 @@ /* * */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// -namespace Aspose\BarCode; +namespace Aspose\BarCode\Model; use Aspose\BarCode\ObjectSerializer; /* - * GraphicsUnit + * AvailableGraphicsUnit * - * @description + * @description Subset of GraphicsUnit. */ -class GraphicsUnit +class AvailableGraphicsUnit { - /// - /// Enum value World - /// - const World_ = "World"; - - /// - /// Enum value Display - /// - const Display_ = "Display"; - /// /// Enum value Pixel /// - const Pixel_ = "Pixel"; + const Pixel = "Pixel"; /// /// Enum value Point /// - const Point_ = "Point"; + const Point = "Point"; /// /// Enum value Inch /// - const Inch_ = "Inch"; - - /// - /// Enum value Document - /// - const Document_ = "Document"; + const Inch = "Inch"; /// /// Enum value Millimeter /// - const Millimeter_ = "Millimeter"; + const Millimeter = "Millimeter"; } diff --git a/src/Aspose/BarCode/Model/AztecParams.php b/src/Aspose/BarCode/Model/AztecParams.php new file mode 100644 index 0000000..e465f4a --- /dev/null +++ b/src/Aspose/BarCode/Model/AztecParams.php @@ -0,0 +1,394 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * AztecParams + * + * @description Aztec parameters. + */ +class AztecParams implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "AztecParams"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'aspect_ratio' => 'double', + 'error_level' => 'int', + 'symbol_mode' => '\Aspose\BarCode\Model\AztecSymbolMode', + 'text_encoding' => 'string' + ]; + + /* + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'aspect_ratio' => 'double', + 'error_level' => 'int32', + 'symbol_mode' => null, + 'text_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', + 'error_level' => 'ErrorLevel', + 'symbol_mode' => 'SymbolMode', + 'text_encoding' => 'TextEncoding' + ]; + + /* + * 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' + ]; + + /* + * 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' + ]; + + /* + * 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; + } + + /* + * 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 Sets the encoding of codetext. + * + * @return $this + */ + public function setTextEncoding($text_encoding) + { + $this->container['text_encoding'] = $text_encoding; + + return $this; + } + /* + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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/RecognitionMode.php b/src/Aspose/BarCode/Model/AztecSymbolMode.php similarity index 77% rename from src/Aspose/BarCode/Model/RecognitionMode.php rename to src/Aspose/BarCode/Model/AztecSymbolMode.php index 783657c..22cfabe 100644 --- a/src/Aspose/BarCode/Model/RecognitionMode.php +++ b/src/Aspose/BarCode/Model/AztecSymbolMode.php @@ -1,7 +1,7 @@ - + * * Copyright (c) 2018 Aspose Pty Ltd * * @@ -11,10 +11,10 @@ * 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 @@ -28,37 +28,40 @@ /* * */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// -namespace Aspose\BarCode; +namespace Aspose\BarCode\Model; use Aspose\BarCode\ObjectSerializer; /* - * RecognitionMode + * AztecSymbolMode * - * @description Represents the usage of recognition modes + * @description */ -class RecognitionMode +class AztecSymbolMode { /// - /// Enum value MaxPerformance + /// Enum value Auto /// - const MaxPerformance_ = "MaxPerformance"; + const Auto = "Auto"; /// - /// Enum value MaxBarCodes + /// Enum value Compact /// - const MaxBarCodes_ = "MaxBarCodes"; + const Compact = "Compact"; /// - /// Enum value MaxQuality + /// Enum value FullRange /// - const MaxQuality_ = "MaxQuality"; + const FullRange = "FullRange"; /// - /// Enum value ManualHints + /// Enum value Rune /// - const ManualHints_ = "ManualHints"; + const Rune = "Rune"; } diff --git a/src/Aspose/BarCode/Model/BarCodeBuilder.php b/src/Aspose/BarCode/Model/BarCodeBuilder.php deleted file mode 100644 index e016d78..0000000 --- a/src/Aspose/BarCode/Model/BarCodeBuilder.php +++ /dev/null @@ -1,877 +0,0 @@ - - * Copyright (c) 2018 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 \ArrayAccess; -use Aspose\BarCode\ObjectSerializer; - -/* - * BarCodeBuilder - * - * @description Represents BarCodeBuilder. - */ -class BarCodeBuilder implements ArrayAccess -{ - const DISCRIMINATOR = null; - - /* - * The original name of the model. - * - * @var string - */ - protected static $swaggerModelName = "BarCodeBuilder"; - - /* - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerTypes = [ - 'type_of_bar_code' => '\Swagger\Client\Model\BarCodeType', - 'text' => 'string', - 'resolution' => '\Swagger\Client\Model\Resolution', - 'dimension_x' => 'double', - 'dimension_y' => 'double', - 'code_location' => '\Swagger\Client\Model\CodeLocation', - 'graphics_unit' => '\Swagger\Client\Model\GraphicsUnit', - 'auto_size' => 'bool', - 'bar_height' => 'double', - 'image_height' => 'double', - 'image_width' => 'double', - 'image_quality' => '\Swagger\Client\Model\ImageQualityMode', - 'rotation_angle' => 'double', - 'margins' => '\Swagger\Client\Model\Margins', - 'back_color' => 'string', - 'fore_color' => 'string', - 'code_text_color' => 'string', - 'border_color' => 'string', - 'border_visible' => 'bool', - 'enable_checksum' => '\Swagger\Client\Model\EnableChecksum' - ]; - - /* - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'type_of_bar_code' => null, - 'text' => null, - 'resolution' => null, - 'dimension_x' => 'double', - 'dimension_y' => 'double', - 'code_location' => null, - 'graphics_unit' => null, - 'auto_size' => null, - 'bar_height' => 'double', - 'image_height' => 'double', - 'image_width' => 'double', - 'image_quality' => null, - 'rotation_angle' => 'double', - 'margins' => null, - 'back_color' => null, - 'fore_color' => null, - 'code_text_color' => null, - 'border_color' => null, - 'border_visible' => null, - 'enable_checksum' => 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_bar_code' => 'TypeOfBarCode', - 'text' => 'Text', - 'resolution' => 'Resolution', - 'dimension_x' => 'DimensionX', - 'dimension_y' => 'DimensionY', - 'code_location' => 'CodeLocation', - 'graphics_unit' => 'GraphicsUnit', - 'auto_size' => 'AutoSize', - 'bar_height' => 'BarHeight', - 'image_height' => 'ImageHeight', - 'image_width' => 'ImageWidth', - 'image_quality' => 'ImageQuality', - 'rotation_angle' => 'RotationAngle', - 'margins' => 'Margins', - 'back_color' => 'BackColor', - 'fore_color' => 'ForeColor', - 'code_text_color' => 'CodeTextColor', - 'border_color' => 'BorderColor', - 'border_visible' => 'BorderVisible', - 'enable_checksum' => 'EnableChecksum' - ]; - - /* - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'type_of_bar_code' => 'setTypeOfBarCode', - 'text' => 'setText', - 'resolution' => 'setResolution', - 'dimension_x' => 'setDimensionX', - 'dimension_y' => 'setDimensionY', - 'code_location' => 'setCodeLocation', - 'graphics_unit' => 'setGraphicsUnit', - 'auto_size' => 'setAutoSize', - 'bar_height' => 'setBarHeight', - 'image_height' => 'setImageHeight', - 'image_width' => 'setImageWidth', - 'image_quality' => 'setImageQuality', - 'rotation_angle' => 'setRotationAngle', - 'margins' => 'setMargins', - 'back_color' => 'setBackColor', - 'fore_color' => 'setForeColor', - 'code_text_color' => 'setCodeTextColor', - 'border_color' => 'setBorderColor', - 'border_visible' => 'setBorderVisible', - 'enable_checksum' => 'setEnableChecksum' - ]; - - /* - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'type_of_bar_code' => 'getTypeOfBarCode', - 'text' => 'getText', - 'resolution' => 'getResolution', - 'dimension_x' => 'getDimensionX', - 'dimension_y' => 'getDimensionY', - 'code_location' => 'getCodeLocation', - 'graphics_unit' => 'getGraphicsUnit', - 'auto_size' => 'getAutoSize', - 'bar_height' => 'getBarHeight', - 'image_height' => 'getImageHeight', - 'image_width' => 'getImageWidth', - 'image_quality' => 'getImageQuality', - 'rotation_angle' => 'getRotationAngle', - 'margins' => 'getMargins', - 'back_color' => 'getBackColor', - 'fore_color' => 'getForeColor', - 'code_text_color' => 'getCodeTextColor', - 'border_color' => 'getBorderColor', - 'border_visible' => 'getBorderVisible', - 'enable_checksum' => 'getEnableChecksum' - ]; - - /* - * 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_bar_code'] = isset($data['type_of_bar_code']) ? $data['type_of_bar_code'] : null; - $this->container['text'] = isset($data['text']) ? $data['text'] : null; - $this->container['resolution'] = isset($data['resolution']) ? $data['resolution'] : null; - $this->container['dimension_x'] = isset($data['dimension_x']) ? $data['dimension_x'] : null; - $this->container['dimension_y'] = isset($data['dimension_y']) ? $data['dimension_y'] : null; - $this->container['code_location'] = isset($data['code_location']) ? $data['code_location'] : null; - $this->container['graphics_unit'] = isset($data['graphics_unit']) ? $data['graphics_unit'] : null; - $this->container['auto_size'] = isset($data['auto_size']) ? $data['auto_size'] : 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['image_quality'] = isset($data['image_quality']) ? $data['image_quality'] : null; - $this->container['rotation_angle'] = isset($data['rotation_angle']) ? $data['rotation_angle'] : null; - $this->container['margins'] = isset($data['margins']) ? $data['margins'] : null; - $this->container['back_color'] = isset($data['back_color']) ? $data['back_color'] : null; - $this->container['fore_color'] = isset($data['fore_color']) ? $data['fore_color'] : null; - $this->container['code_text_color'] = isset($data['code_text_color']) ? $data['code_text_color'] : null; - $this->container['border_color'] = isset($data['border_color']) ? $data['border_color'] : 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; - } - - /* - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['type_of_bar_code'] === null) { - $invalidProperties[] = "'type_of_bar_code' 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_bar_code'] === null) { - return false; - } - return true; - } - - - /* - * Gets type_of_bar_code - * - * @return \Swagger\Client\Model\BarCodeType - */ - public function getTypeOfBarCode() - { - return $this->container['type_of_bar_code']; - } - - /* - * Sets type_of_bar_code - * - * @param \Swagger\Client\Model\BarCodeType $type_of_bar_code Gets or sets type of barcode to generate. - * - * @return $this - */ - public function setTypeOfBarCode($type_of_bar_code) - { - $this->container['type_of_bar_code'] = $type_of_bar_code; - - return $this; - } - - /* - * Gets text - * - * @return string - */ - public function getText() - { - return $this->container['text']; - } - - /* - * Sets text - * - * @param string $text Gets or sets text to encode. - * - * @return $this - */ - public function setText($text) - { - $this->container['text'] = $text; - - return $this; - } - - /* - * Gets resolution - * - * @return \Swagger\Client\Model\Resolution - */ - public function getResolution() - { - return $this->container['resolution']; - } - - /* - * Sets resolution - * - * @param \Swagger\Client\Model\Resolution $resolution Gets or sets parameters.> - * - * @return $this - */ - public function setResolution($resolution) - { - $this->container['resolution'] = $resolution; - - return $this; - } - - /* - * Gets dimension_x - * - * @return double - */ - public function getDimensionX() - { - return $this->container['dimension_x']; - } - - /* - * Sets dimension_x - * - * @param double $dimension_x Gets or sets smallest width unit of barcode. - * - * @return $this - */ - public function setDimensionX($dimension_x) - { - $this->container['dimension_x'] = $dimension_x; - - return $this; - } - - /* - * Gets dimension_y - * - * @return double - */ - public function getDimensionY() - { - return $this->container['dimension_y']; - } - - /* - * Sets dimension_y - * - * @param double $dimension_y Gets or sets smallest height unit of barcode. - * - * @return $this - */ - public function setDimensionY($dimension_y) - { - $this->container['dimension_y'] = $dimension_y; - - return $this; - } - - /* - * Gets code_location - * - * @return \Swagger\Client\Model\CodeLocation - */ - public function getCodeLocation() - { - return $this->container['code_location']; - } - - /* - * Sets code_location - * - * @param \Swagger\Client\Model\CodeLocation $code_location Gets or sets of barcode. - * - * @return $this - */ - public function setCodeLocation($code_location) - { - $this->container['code_location'] = $code_location; - - return $this; - } - - /* - * Gets graphics_unit - * - * @return \Swagger\Client\Model\GraphicsUnit - */ - public function getGraphicsUnit() - { - return $this->container['graphics_unit']; - } - - /* - * Sets graphics_unit - * - * @param \Swagger\Client\Model\GraphicsUnit $graphics_unit Gets or sets for barcode dimension parameers. - * - * @return $this - */ - public function setGraphicsUnit($graphics_unit) - { - $this->container['graphics_unit'] = $graphics_unit; - - return $this; - } - - /* - * Gets auto_size - * - * @return bool - */ - public function getAutoSize() - { - return $this->container['auto_size']; - } - - /* - * Sets auto_size - * - * @param bool $auto_size Gets or sets a value indicating whether size of barcode changes automatically. - * - * @return $this - */ - public function setAutoSize($auto_size) - { - $this->container['auto_size'] = $auto_size; - - return $this; - } - - /* - * Gets bar_height - * - * @return double - */ - public function getBarHeight() - { - return $this->container['bar_height']; - } - - /* - * Sets bar_height - * - * @param double $bar_height Gets or sets height of the barcode. - * - * @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 Gets or sets height of the barcode image. - * - * @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 Gets or sets width of the barcode image. - * - * @return $this - */ - public function setImageWidth($image_width) - { - $this->container['image_width'] = $image_width; - - return $this; - } - - /* - * Gets image_quality - * - * @return \Swagger\Client\Model\ImageQualityMode - */ - public function getImageQuality() - { - return $this->container['image_quality']; - } - - /* - * Sets image_quality - * - * @param \Swagger\Client\Model\ImageQualityMode $image_quality Gets or sets of the image. - * - * @return $this - */ - public function setImageQuality($image_quality) - { - $this->container['image_quality'] = $image_quality; - - return $this; - } - - /* - * Gets rotation_angle - * - * @return double - */ - public function getRotationAngle() - { - return $this->container['rotation_angle']; - } - - /* - * Sets rotation_angle - * - * @param double $rotation_angle Gets or sets angle of barcode orientation. - * - * @return $this - */ - public function setRotationAngle($rotation_angle) - { - $this->container['rotation_angle'] = $rotation_angle; - - return $this; - } - - /* - * Gets margins - * - * @return \Swagger\Client\Model\Margins - */ - public function getMargins() - { - return $this->container['margins']; - } - - /* - * Sets margins - * - * @param \Swagger\Client\Model\Margins $margins Gets or sets around barcode. - * - * @return $this - */ - public function setMargins($margins) - { - $this->container['margins'] = $margins; - - return $this; - } - - /* - * Gets back_color - * - * @return string - */ - public function getBackColor() - { - return $this->container['back_color']; - } - - /* - * Sets back_color - * - * @param string $back_color Gets or sets background color. - * - * @return $this - */ - public function setBackColor($back_color) - { - $this->container['back_color'] = $back_color; - - return $this; - } - - /* - * Gets fore_color - * - * @return string - */ - public function getForeColor() - { - return $this->container['fore_color']; - } - - /* - * Sets fore_color - * - * @param string $fore_color Gets or sets foreground color. - * - * @return $this - */ - public function setForeColor($fore_color) - { - $this->container['fore_color'] = $fore_color; - - return $this; - } - - /* - * Gets code_text_color - * - * @return string - */ - public function getCodeTextColor() - { - return $this->container['code_text_color']; - } - - /* - * Sets code_text_color - * - * @param string $code_text_color Gets or sets color of the code text. - * - * @return $this - */ - public function setCodeTextColor($code_text_color) - { - $this->container['code_text_color'] = $code_text_color; - - return $this; - } - - /* - * Gets border_color - * - * @return string - */ - public function getBorderColor() - { - return $this->container['border_color']; - } - - /* - * Sets border_color - * - * @param string $border_color Gets or sets color of the border. - * - * @return $this - */ - public function setBorderColor($border_color) - { - $this->container['border_color'] = $border_color; - - return $this; - } - - /* - * Gets border_visible - * - * @return bool - */ - public function getBorderVisible() - { - return $this->container['border_visible']; - } - - /* - * Sets border_visible - * - * @param bool $border_visible Gets or sets a value indicating whether border is visible. - * - * @return $this - */ - public function setBorderVisible($border_visible) - { - $this->container['border_visible'] = $border_visible; - - return $this; - } - - /* - * Gets enable_checksum - * - * @return \Swagger\Client\Model\EnableChecksum - */ - public function getEnableChecksum() - { - return $this->container['enable_checksum']; - } - - /* - * Sets enable_checksum - * - * @param \Swagger\Client\Model\EnableChecksum $enable_checksum Gets or sets a value indicating whether checksum is enabled. - * - * @return $this - */ - public function setEnableChecksum($enable_checksum) - { - $this->container['enable_checksum'] = $enable_checksum; - - return $this; - } - /* - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /* - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $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) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /* - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - 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/ValueType.php b/src/Aspose/BarCode/Model/BarCodeErrorResponse.php similarity index 84% rename from src/Aspose/BarCode/Model/ValueType.php rename to src/Aspose/BarCode/Model/BarCodeErrorResponse.php index a3c8d33..e525ac9 100644 --- a/src/Aspose/BarCode/Model/ValueType.php +++ b/src/Aspose/BarCode/Model/BarCodeErrorResponse.php @@ -1,7 +1,7 @@ - + * * Copyright (c) 2018 Aspose Pty Ltd * * @@ -11,10 +11,10 @@ * 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 @@ -28,26 +28,30 @@ /* * */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// -namespace Aspose\BarCode; +namespace Aspose\BarCode\Model; use \ArrayAccess; use Aspose\BarCode\ObjectSerializer; /* - * ValueType + * BarCodeErrorResponse * + * @description BarCodeErrorResponse */ -class ValueType implements ArrayAccess +class BarCodeErrorResponse implements ArrayAccess { - const DISCRIMINATOR = 'Type'; + const DISCRIMINATOR = null; /* * The original name of the model. * * @var string */ - protected static $swaggerModelName = "ValueType"; + protected static $swaggerModelName = "BarCodeErrorResponse"; /* * Array of property to type mappings. Used for (de)serialization @@ -55,7 +59,7 @@ class ValueType implements ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - + 'error' => '\Aspose\BarCode\Model\Error' ]; /* @@ -64,7 +68,7 @@ class ValueType implements ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - + 'error' => null ]; /* @@ -94,7 +98,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - + 'error' => 'Error' ]; /* @@ -103,7 +107,7 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - + 'error' => 'setError' ]; /* @@ -112,7 +116,7 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - + 'error' => 'getError' ]; /* @@ -175,10 +179,7 @@ public function getModelName() */ public function __construct(array $data = null) { - - // Initialize discriminator property with the model name. - $discriminator = array_search('Type', self::$attributeMap); - $this->container[$discriminator] = static::$swaggerModelName; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /* @@ -205,6 +206,30 @@ public function valid() return true; } + + /* + * Gets error + * + * @return \Aspose\BarCode\Model\Error + */ + public function getError() + { + return $this->container['error']; + } + + /* + * Sets error + * + * @param \Aspose\BarCode\Model\Error $error Error + * + * @return $this + */ + public function setError($error) + { + $this->container['error'] = $error; + + return $this; + } /* * Returns true if offset exists. False otherwise. * diff --git a/src/Aspose/BarCode/Model/BarCodeResponse.php b/src/Aspose/BarCode/Model/BarCodeResponse.php index 45b23aa..61bd191 100644 --- a/src/Aspose/BarCode/Model/BarCodeResponse.php +++ b/src/Aspose/BarCode/Model/BarCodeResponse.php @@ -1,7 +1,7 @@ - + * * Copyright (c) 2018 Aspose Pty Ltd * * @@ -11,10 +11,10 @@ * 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 @@ -28,18 +28,21 @@ /* * */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// -namespace Aspose\BarCode; +namespace Aspose\BarCode\Model; use \ArrayAccess; use Aspose\BarCode\ObjectSerializer; /* - * BarCodeResponse + * BarcodeResponse * * @description Represents information about barcode. */ -class BarCodeResponse implements ArrayAccess +class BarcodeResponse implements ArrayAccess { const DISCRIMINATOR = null; @@ -48,7 +51,7 @@ class BarCodeResponse implements ArrayAccess * * @var string */ - protected static $swaggerModelName = "BarCodeResponse"; + protected static $swaggerModelName = "BarcodeResponse"; /* * Array of property to type mappings. Used for (de)serialization @@ -56,9 +59,9 @@ class BarCodeResponse implements ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'bar_code_value' => 'string', - 'bar_code_type' => 'string', - 'region' => '\Swagger\Client\Model\Point[]', + 'barcode_value' => 'string', + 'type' => 'string', + 'region' => '\Aspose\BarCode\Model\RegionPoint[]', 'checksum' => 'string' ]; @@ -68,8 +71,8 @@ class BarCodeResponse implements ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'bar_code_value' => null, - 'bar_code_type' => null, + 'barcode_value' => null, + 'type' => null, 'region' => null, 'checksum' => null ]; @@ -101,8 +104,8 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'bar_code_value' => 'BarCodeValue', - 'bar_code_type' => 'BarCodeType', + 'barcode_value' => 'BarcodeValue', + 'type' => 'Type', 'region' => 'Region', 'checksum' => 'Checksum' ]; @@ -113,8 +116,8 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'bar_code_value' => 'setBarCodeValue', - 'bar_code_type' => 'setBarCodeType', + 'barcode_value' => 'setBarcodeValue', + 'type' => 'setType', 'region' => 'setRegion', 'checksum' => 'setChecksum' ]; @@ -125,8 +128,8 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'bar_code_value' => 'getBarCodeValue', - 'bar_code_type' => 'getBarCodeType', + 'barcode_value' => 'getBarcodeValue', + 'type' => 'getType', 'region' => 'getRegion', 'checksum' => 'getChecksum' ]; @@ -191,8 +194,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['bar_code_value'] = isset($data['bar_code_value']) ? $data['bar_code_value'] : null; - $this->container['bar_code_type'] = isset($data['bar_code_type']) ? $data['bar_code_type'] : null; + $this->container['barcode_value'] = isset($data['barcode_value']) ? $data['barcode_value'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; $this->container['region'] = isset($data['region']) ? $data['region'] : null; $this->container['checksum'] = isset($data['checksum']) ? $data['checksum'] : null; } @@ -223,49 +226,49 @@ public function valid() /* - * Gets bar_code_value + * Gets barcode_value * * @return string */ - public function getBarCodeValue() + public function getBarcodeValue() { - return $this->container['bar_code_value']; + return $this->container['barcode_value']; } /* - * Sets bar_code_value + * Sets barcode_value * - * @param string $bar_code_value Gets or sets barcode data. + * @param string $barcode_value Barcode data. * * @return $this */ - public function setBarCodeValue($bar_code_value) + public function setBarcodeValue($barcode_value) { - $this->container['bar_code_value'] = $bar_code_value; + $this->container['barcode_value'] = $barcode_value; return $this; } /* - * Gets bar_code_type + * Gets type * * @return string */ - public function getBarCodeType() + public function getType() { - return $this->container['bar_code_type']; + return $this->container['type']; } /* - * Sets bar_code_type + * Sets type * - * @param string $bar_code_type Gets or sets type of the barcode. + * @param string $type Type of the barcode. * * @return $this */ - public function setBarCodeType($bar_code_type) + public function setType($type) { - $this->container['bar_code_type'] = $bar_code_type; + $this->container['type'] = $type; return $this; } @@ -273,7 +276,7 @@ public function setBarCodeType($bar_code_type) /* * Gets region * - * @return \Swagger\Client\Model\Point[] + * @return \Aspose\BarCode\Model\RegionPoint[] */ public function getRegion() { @@ -283,7 +286,7 @@ public function getRegion() /* * Sets region * - * @param \Swagger\Client\Model\Point[] $region Gets or sets region with barcode. + * @param \Aspose\BarCode\Model\RegionPoint[] $region Region with barcode. * * @return $this */ @@ -307,7 +310,7 @@ public function getChecksum() /* * Sets checksum * - * @param string $checksum Gets or sets checksum of barcode. + * @param string $checksum Checksum of barcode. * * @return $this */ diff --git a/src/Aspose/BarCode/Model/BarCodeResponseList.php b/src/Aspose/BarCode/Model/BarCodeResponseList.php index 226bfe0..56ed803 100644 --- a/src/Aspose/BarCode/Model/BarCodeResponseList.php +++ b/src/Aspose/BarCode/Model/BarCodeResponseList.php @@ -1,7 +1,7 @@ - + * * Copyright (c) 2018 Aspose Pty Ltd * * @@ -11,10 +11,10 @@ * 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 @@ -28,16 +28,21 @@ /* * */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; -namespace Aspose\BarCode; +use \ArrayAccess; use Aspose\BarCode\ObjectSerializer; /* - * BarCodeResponseList + * BarcodeResponseList * * @description Represents information about barcode list. */ -class BarCodeResponseList extends AsposeResponse +class BarcodeResponseList implements ArrayAccess { const DISCRIMINATOR = null; @@ -46,7 +51,7 @@ class BarCodeResponseList extends AsposeResponse * * @var string */ - protected static $swaggerModelName = "BarCodeResponseList"; + protected static $swaggerModelName = "BarcodeResponseList"; /* * Array of property to type mappings. Used for (de)serialization @@ -54,7 +59,7 @@ class BarCodeResponseList extends AsposeResponse * @var string[] */ protected static $swaggerTypes = [ - 'bar_codes' => '\Swagger\Client\Model\BarCodeResponse[]' + 'barcodes' => '\Aspose\BarCode\Model\BarcodeResponse[]' ]; /* @@ -63,7 +68,7 @@ class BarCodeResponseList extends AsposeResponse * @var string[] */ protected static $swaggerFormats = [ - 'bar_codes' => null + 'barcodes' => null ]; /* @@ -73,7 +78,7 @@ class BarCodeResponseList extends AsposeResponse */ public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); + return self::$swaggerTypes; } /* @@ -83,7 +88,7 @@ public static function swaggerTypes() */ public static function swaggerFormats() { - return self::$swaggerFormats + parent::swaggerFormats(); + return self::$swaggerFormats; } /* @@ -93,7 +98,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'bar_codes' => 'BarCodes' + 'barcodes' => 'Barcodes' ]; /* @@ -102,7 +107,7 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'bar_codes' => 'setBarCodes' + 'barcodes' => 'setBarcodes' ]; /* @@ -111,7 +116,7 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'bar_codes' => 'getBarCodes' + 'barcodes' => 'getBarcodes' ]; /* @@ -122,7 +127,7 @@ public static function swaggerFormats() */ public static function attributeMap() { - return parent::attributeMap() + self::$attributeMap; + return self::$attributeMap; } /* @@ -132,7 +137,7 @@ public static function attributeMap() */ public static function setters() { - return parent::setters() + self::$setters; + return self::$setters; } /* @@ -142,7 +147,7 @@ public static function setters() */ public static function getters() { - return parent::getters() + self::$getters; + return self::$getters; } /* @@ -159,6 +164,12 @@ public function getModelName() + /* + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; /* * Constructor @@ -168,9 +179,7 @@ public function getModelName() */ public function __construct(array $data = null) { - parent::__construct($data); - - $this->container['bar_codes'] = isset($data['bar_codes']) ? $data['bar_codes'] : null; + $this->container['barcodes'] = isset($data['barcodes']) ? $data['barcodes'] : null; } /* @@ -180,7 +189,7 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalidProperties = parent::listInvalidProperties(); + $invalidProperties = []; return $invalidProperties; } @@ -193,34 +202,31 @@ public function listInvalidProperties() */ public function valid() { - if (!parent::valid()) { - return false; - } return true; } /* - * Gets bar_codes + * Gets barcodes * - * @return \Swagger\Client\Model\BarCodeResponse[] + * @return \Aspose\BarCode\Model\BarcodeResponse[] */ - public function getBarCodes() + public function getBarcodes() { - return $this->container['bar_codes']; + return $this->container['barcodes']; } /* - * Sets bar_codes + * Sets barcodes * - * @param \Swagger\Client\Model\BarCodeResponse[] $bar_codes List of barcodes which are present in image. + * @param \Aspose\BarCode\Model\BarcodeResponse[] $barcodes List of barcodes which are present in image. * * @return $this */ - public function setBarCodes($bar_codes) + public function setBarcodes($barcodes) { - $this->container['bar_codes'] = $bar_codes; + $this->container['barcodes'] = $barcodes; return $this; } diff --git a/src/Aspose/BarCode/Model/BorderDashStyle.php b/src/Aspose/BarCode/Model/BorderDashStyle.php new file mode 100644 index 0000000..21a04cd --- /dev/null +++ b/src/Aspose/BarCode/Model/BorderDashStyle.php @@ -0,0 +1,72 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; +use Aspose\BarCode\ObjectSerializer; + +/* + * BorderDashStyle + * + * @description + */ +class BorderDashStyle +{ + + /// + /// Enum value Solid + /// + const Solid = "Solid"; + + /// + /// Enum value Dash + /// + const Dash = "Dash"; + + /// + /// Enum value Dot + /// + const Dot = "Dot"; + + /// + /// Enum value DashDot + /// + const DashDot = "DashDot"; + + /// + /// Enum value DashDotDot + /// + const DashDotDot = "DashDotDot"; + +} + diff --git a/src/Aspose/BarCode/Model/CaptionParams.php b/src/Aspose/BarCode/Model/CaptionParams.php new file mode 100644 index 0000000..fe3db78 --- /dev/null +++ b/src/Aspose/BarCode/Model/CaptionParams.php @@ -0,0 +1,454 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * CaptionParams + * + * @description Caption + */ +class CaptionParams implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "CaptionParams"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'text' => 'string', + 'alignment' => '\Aspose\BarCode\Model\TextAlignment', + 'color' => 'string', + 'visible' => 'bool', + 'font' => '\Aspose\BarCode\Model\FontParams', + 'padding' => '\Aspose\BarCode\Model\Padding' + ]; + + /* + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'text' => null, + 'alignment' => null, + 'color' => null, + 'visible' => null, + 'font' => null, + 'padding' => 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' + ]; + + /* + * 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' + ]; + + /* + * 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' + ]; + + /* + * 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; + } + + /* + * 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. + * + * @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; + } + /* + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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 index cc9987e..3879434 100644 --- a/src/Aspose/BarCode/Model/ChecksumValidation.php +++ b/src/Aspose/BarCode/Model/ChecksumValidation.php @@ -1,4 +1,4 @@ - @@ -11,10 +11,10 @@ * 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 @@ -28,14 +28,17 @@ /* * */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// -namespace Aspose\BarCode; +namespace Aspose\BarCode\Model; use Aspose\BarCode\ObjectSerializer; /* * ChecksumValidation * - * @description Represents checksum validation property. + * @description */ class ChecksumValidation { @@ -43,17 +46,17 @@ class ChecksumValidation /// /// Enum value Default /// - const Default_ = "Default"; + const Default = "Default"; /// /// Enum value On /// - const On_ = "On"; + const On = "On"; /// /// Enum value Off /// - const Off_ = "Off"; + const Off = "Off"; } diff --git a/src/Aspose/BarCode/Model/CodabarChecksumMode.php b/src/Aspose/BarCode/Model/CodabarChecksumMode.php new file mode 100644 index 0000000..abba22d --- /dev/null +++ b/src/Aspose/BarCode/Model/CodabarChecksumMode.php @@ -0,0 +1,57 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; +use Aspose\BarCode\ObjectSerializer; + +/* + * CodabarChecksumMode + * + * @description + */ +class CodabarChecksumMode +{ + + /// + /// Enum value Mod10 + /// + const Mod10 = "Mod10"; + + /// + /// Enum value Mod16 + /// + const Mod16 = "Mod16"; + +} + diff --git a/src/Aspose/BarCode/Model/CodabarParams.php b/src/Aspose/BarCode/Model/CodabarParams.php new file mode 100644 index 0000000..6f1167a --- /dev/null +++ b/src/Aspose/BarCode/Model/CodabarParams.php @@ -0,0 +1,364 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * CodabarParams + * + * @description Codabar parameters. + */ +class CodabarParams implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "CodabarParams"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'checksum_mode' => '\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[] + */ + protected static $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) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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 new file mode 100644 index 0000000..8536f0f --- /dev/null +++ b/src/Aspose/BarCode/Model/CodabarSymbol.php @@ -0,0 +1,67 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; +use Aspose\BarCode\ObjectSerializer; + +/* + * CodabarSymbol + * + * @description + */ +class CodabarSymbol +{ + + /// + /// Enum value A + /// + const A = "A"; + + /// + /// Enum value B + /// + const B = "B"; + + /// + /// Enum value C + /// + const C = "C"; + + /// + /// Enum value D + /// + const D = "D"; + +} + diff --git a/src/Aspose/BarCode/Model/CodablockParams.php b/src/Aspose/BarCode/Model/CodablockParams.php new file mode 100644 index 0000000..f42fa02 --- /dev/null +++ b/src/Aspose/BarCode/Model/CodablockParams.php @@ -0,0 +1,364 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * CodablockParams + * + * @description Codablock parameters. + */ +class CodablockParams implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "CodablockParams"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'aspect_ratio' => 'double', + 'columns' => 'int', + 'rows' => 'int' + ]; + + /* + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $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) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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 new file mode 100644 index 0000000..b39e5e1 --- /dev/null +++ b/src/Aspose/BarCode/Model/Code16KParams.php @@ -0,0 +1,364 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * Code16KParams + * + * @description Code16K parameters. + */ +class Code16KParams implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "Code16KParams"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'aspect_ratio' => 'double', + 'quiet_zone_left_coef' => 'int', + 'quiet_zone_right_coef' => 'int' + ]; + + /* + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $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) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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 5a93ea1..8a3b68c 100644 --- a/src/Aspose/BarCode/Model/CodeLocation.php +++ b/src/Aspose/BarCode/Model/CodeLocation.php @@ -1,4 +1,4 @@ - @@ -11,10 +11,10 @@ * 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 @@ -28,32 +28,35 @@ /* * */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// -namespace Aspose\BarCode; +namespace Aspose\BarCode\Model; use Aspose\BarCode\ObjectSerializer; /* * CodeLocation * - * @description Represents states of code location. + * @description */ class CodeLocation { /// - /// Enum value Above + /// Enum value Below /// - const Above_ = "Above"; + const Below = "Below"; /// - /// Enum value Below + /// Enum value Above /// - const Below_ = "Below"; + const Above = "Above"; /// /// Enum value None /// - const None_ = "None"; + const None = "None"; } diff --git a/src/Aspose/BarCode/Model/CouponParams.php b/src/Aspose/BarCode/Model/CouponParams.php new file mode 100644 index 0000000..7a415c8 --- /dev/null +++ b/src/Aspose/BarCode/Model/CouponParams.php @@ -0,0 +1,304 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * CouponParams + * + * @description Coupon parameters. Used for UpcaGs1DatabarCoupon, UpcaGs1Code128Coupon. + */ +class CouponParams implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "CouponParams"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'supplement_space' => 'double' + ]; + + /* + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $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) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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 new file mode 100644 index 0000000..6c951b6 --- /dev/null +++ b/src/Aspose/BarCode/Model/CustomerInformationInterpretingType.php @@ -0,0 +1,62 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; +use Aspose\BarCode\ObjectSerializer; + +/* + * CustomerInformationInterpretingType + * + * @description + */ +class CustomerInformationInterpretingType +{ + + /// + /// Enum value CTable + /// + const CTable = "CTable"; + + /// + /// Enum value NTable + /// + const NTable = "NTable"; + + /// + /// Enum value Other + /// + const Other = "Other"; + +} + diff --git a/src/Aspose/BarCode/Model/DataBarParams.php b/src/Aspose/BarCode/Model/DataBarParams.php new file mode 100644 index 0000000..bf6d58c --- /dev/null +++ b/src/Aspose/BarCode/Model/DataBarParams.php @@ -0,0 +1,364 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * DataBarParams + * + * @description Databar parameters. + */ +class DataBarParams implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "DataBarParams"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'aspect_ratio' => 'double', + 'columns' => 'int', + 'rows' => 'int' + ]; + + /* + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $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. 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; + } + /* + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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 new file mode 100644 index 0000000..6083803 --- /dev/null +++ b/src/Aspose/BarCode/Model/DataMatrixEccType.php @@ -0,0 +1,82 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; +use Aspose\BarCode\ObjectSerializer; + +/* + * DataMatrixEccType + * + * @description + */ +class DataMatrixEccType +{ + + /// + /// Enum value EccAuto + /// + const EccAuto = "EccAuto"; + + /// + /// Enum value Ecc000 + /// + const Ecc000 = "Ecc000"; + + /// + /// Enum value Ecc050 + /// + const Ecc050 = "Ecc050"; + + /// + /// Enum value Ecc080 + /// + const Ecc080 = "Ecc080"; + + /// + /// Enum value Ecc100 + /// + const Ecc100 = "Ecc100"; + + /// + /// Enum value Ecc140 + /// + const Ecc140 = "Ecc140"; + + /// + /// Enum value Ecc200 + /// + const Ecc200 = "Ecc200"; + +} + diff --git a/src/Aspose/BarCode/Model/DataMatrixEncodeMode.php b/src/Aspose/BarCode/Model/DataMatrixEncodeMode.php new file mode 100644 index 0000000..dbd7e7b --- /dev/null +++ b/src/Aspose/BarCode/Model/DataMatrixEncodeMode.php @@ -0,0 +1,77 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; +use Aspose\BarCode\ObjectSerializer; + +/* + * DataMatrixEncodeMode + * + * @description + */ +class DataMatrixEncodeMode +{ + + /// + /// Enum value Auto + /// + const Auto = "Auto"; + + /// + /// Enum value ASCII + /// + const ASCII = "ASCII"; + + /// + /// Enum value Full + /// + const Full = "Full"; + + /// + /// Enum value Custom + /// + const Custom = "Custom"; + + /// + /// Enum value C40 + /// + const C40 = "C40"; + + /// + /// Enum value Text + /// + const Text = "Text"; + +} + diff --git a/src/Aspose/BarCode/Model/BarCodeReader.php b/src/Aspose/BarCode/Model/DataMatrixParams.php similarity index 59% rename from src/Aspose/BarCode/Model/BarCodeReader.php rename to src/Aspose/BarCode/Model/DataMatrixParams.php index f9aabc5..fd36505 100644 --- a/src/Aspose/BarCode/Model/BarCodeReader.php +++ b/src/Aspose/BarCode/Model/DataMatrixParams.php @@ -1,7 +1,7 @@ - + * * Copyright (c) 2018 Aspose Pty Ltd * * @@ -11,10 +11,10 @@ * 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 @@ -28,18 +28,21 @@ /* * */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// -namespace Aspose\BarCode; +namespace Aspose\BarCode\Model; use \ArrayAccess; use Aspose\BarCode\ObjectSerializer; /* - * BarCodeReader + * DataMatrixParams * - * @description Represents BarCodeReader object. + * @description DataMatrix parameters. */ -class BarCodeReader implements ArrayAccess +class DataMatrixParams implements ArrayAccess { const DISCRIMINATOR = null; @@ -48,7 +51,7 @@ class BarCodeReader implements ArrayAccess * * @var string */ - protected static $swaggerModelName = "BarCodeReader"; + protected static $swaggerModelName = "DataMatrixParams"; /* * Array of property to type mappings. Used for (de)serialization @@ -56,12 +59,12 @@ class BarCodeReader implements ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'checksum_validation' => '\Swagger\Client\Model\ChecksumValidation', - 'strip_fnc' => 'bool', - 'bar_codes_count' => 'int', - 'rotation_angle' => 'int', - 'recognition_mode' => '\Swagger\Client\Model\RecognitionMode', - 'manual_hints' => '\Swagger\Client\Model\ManualHints' + 'aspect_ratio' => 'double', + 'text_encoding' => 'string', + 'columns' => 'int', + 'data_matrix_ecc' => '\Aspose\BarCode\Model\DataMatrixEccType', + 'data_matrix_encode_mode' => '\Aspose\BarCode\Model\DataMatrixEncodeMode', + 'rows' => 'int' ]; /* @@ -70,12 +73,12 @@ class BarCodeReader implements ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'checksum_validation' => null, - 'strip_fnc' => null, - 'bar_codes_count' => 'int32', - 'rotation_angle' => 'int32', - 'recognition_mode' => null, - 'manual_hints' => null + 'aspect_ratio' => 'double', + 'text_encoding' => null, + 'columns' => 'int32', + 'data_matrix_ecc' => null, + 'data_matrix_encode_mode' => null, + 'rows' => 'int32' ]; /* @@ -105,12 +108,12 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'checksum_validation' => 'ChecksumValidation', - 'strip_fnc' => 'StripFNC', - 'bar_codes_count' => 'BarCodesCount', - 'rotation_angle' => 'RotationAngle', - 'recognition_mode' => 'RecognitionMode', - 'manual_hints' => 'ManualHints' + 'aspect_ratio' => 'AspectRatio', + 'text_encoding' => 'TextEncoding', + 'columns' => 'Columns', + 'data_matrix_ecc' => 'DataMatrixEcc', + 'data_matrix_encode_mode' => 'DataMatrixEncodeMode', + 'rows' => 'Rows' ]; /* @@ -119,12 +122,12 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'checksum_validation' => 'setChecksumValidation', - 'strip_fnc' => 'setStripFnc', - 'bar_codes_count' => 'setBarCodesCount', - 'rotation_angle' => 'setRotationAngle', - 'recognition_mode' => 'setRecognitionMode', - 'manual_hints' => 'setManualHints' + 'aspect_ratio' => 'setAspectRatio', + 'text_encoding' => 'setTextEncoding', + 'columns' => 'setColumns', + 'data_matrix_ecc' => 'setDataMatrixEcc', + 'data_matrix_encode_mode' => 'setDataMatrixEncodeMode', + 'rows' => 'setRows' ]; /* @@ -133,12 +136,12 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'checksum_validation' => 'getChecksumValidation', - 'strip_fnc' => 'getStripFnc', - 'bar_codes_count' => 'getBarCodesCount', - 'rotation_angle' => 'getRotationAngle', - 'recognition_mode' => 'getRecognitionMode', - 'manual_hints' => 'getManualHints' + 'aspect_ratio' => 'getAspectRatio', + 'text_encoding' => 'getTextEncoding', + 'columns' => 'getColumns', + 'data_matrix_ecc' => 'getDataMatrixEcc', + 'data_matrix_encode_mode' => 'getDataMatrixEncodeMode', + 'rows' => 'getRows' ]; /* @@ -201,12 +204,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['checksum_validation'] = isset($data['checksum_validation']) ? $data['checksum_validation'] : null; - $this->container['strip_fnc'] = isset($data['strip_fnc']) ? $data['strip_fnc'] : null; - $this->container['bar_codes_count'] = isset($data['bar_codes_count']) ? $data['bar_codes_count'] : null; - $this->container['rotation_angle'] = isset($data['rotation_angle']) ? $data['rotation_angle'] : null; - $this->container['recognition_mode'] = isset($data['recognition_mode']) ? $data['recognition_mode'] : null; - $this->container['manual_hints'] = isset($data['manual_hints']) ? $data['manual_hints'] : 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; } /* @@ -235,145 +238,145 @@ public function valid() /* - * Gets checksum_validation + * Gets aspect_ratio * - * @return \Swagger\Client\Model\ChecksumValidation + * @return double */ - public function getChecksumValidation() + public function getAspectRatio() { - return $this->container['checksum_validation']; + return $this->container['aspect_ratio']; } /* - * Sets checksum_validation + * Sets aspect_ratio * - * @param \Swagger\Client\Model\ChecksumValidation $checksum_validation Gets or sets ChecksumValidation property. + * @param double $aspect_ratio Height/Width ratio of 2D BarCode module * * @return $this */ - public function setChecksumValidation($checksum_validation) + public function setAspectRatio($aspect_ratio) { - $this->container['checksum_validation'] = $checksum_validation; + $this->container['aspect_ratio'] = $aspect_ratio; return $this; } /* - * Gets strip_fnc + * Gets text_encoding * - * @return bool + * @return string */ - public function getStripFnc() + public function getTextEncoding() { - return $this->container['strip_fnc']; + return $this->container['text_encoding']; } /* - * Sets strip_fnc + * Sets text_encoding * - * @param bool $strip_fnc Gets or sets a value indicating whether FNC symbol strip must be done. + * @param string $text_encoding Encoding of codetext. * * @return $this */ - public function setStripFnc($strip_fnc) + public function setTextEncoding($text_encoding) { - $this->container['strip_fnc'] = $strip_fnc; + $this->container['text_encoding'] = $text_encoding; return $this; } /* - * Gets bar_codes_count + * Gets columns * * @return int */ - public function getBarCodesCount() + public function getColumns() { - return $this->container['bar_codes_count']; + return $this->container['columns']; } /* - * Sets bar_codes_count + * Sets columns * - * @param int $bar_codes_count Gets or sets count of barcodes to recognize. + * @param int $columns Columns count. * * @return $this */ - public function setBarCodesCount($bar_codes_count) + public function setColumns($columns) { - $this->container['bar_codes_count'] = $bar_codes_count; + $this->container['columns'] = $columns; return $this; } /* - * Gets rotation_angle + * Gets data_matrix_ecc * - * @return int + * @return \Aspose\BarCode\Model\DataMatrixEccType */ - public function getRotationAngle() + public function getDataMatrixEcc() { - return $this->container['rotation_angle']; + return $this->container['data_matrix_ecc']; } /* - * Sets rotation_angle + * Sets data_matrix_ecc * - * @param int $rotation_angle Gets or sets rotation correction angle. + * @param \Aspose\BarCode\Model\DataMatrixEccType $data_matrix_ecc Datamatrix ECC type. Default value: DataMatrixEccType.Ecc200. * * @return $this */ - public function setRotationAngle($rotation_angle) + public function setDataMatrixEcc($data_matrix_ecc) { - $this->container['rotation_angle'] = $rotation_angle; + $this->container['data_matrix_ecc'] = $data_matrix_ecc; return $this; } /* - * Gets recognition_mode + * Gets data_matrix_encode_mode * - * @return \Swagger\Client\Model\RecognitionMode + * @return \Aspose\BarCode\Model\DataMatrixEncodeMode */ - public function getRecognitionMode() + public function getDataMatrixEncodeMode() { - return $this->container['recognition_mode']; + return $this->container['data_matrix_encode_mode']; } /* - * Sets recognition_mode + * Sets data_matrix_encode_mode * - * @param \Swagger\Client\Model\RecognitionMode $recognition_mode Gets or sets recognition mode. + * @param \Aspose\BarCode\Model\DataMatrixEncodeMode $data_matrix_encode_mode Encode mode of Datamatrix barcode. Default value: DataMatrixEncodeMode.Auto. * * @return $this */ - public function setRecognitionMode($recognition_mode) + public function setDataMatrixEncodeMode($data_matrix_encode_mode) { - $this->container['recognition_mode'] = $recognition_mode; + $this->container['data_matrix_encode_mode'] = $data_matrix_encode_mode; return $this; } /* - * Gets manual_hints + * Gets rows * - * @return \Swagger\Client\Model\ManualHints + * @return int */ - public function getManualHints() + public function getRows() { - return $this->container['manual_hints']; + return $this->container['rows']; } /* - * Sets manual_hints + * Sets rows * - * @param \Swagger\Client\Model\ManualHints $manual_hints Gets or sets manual hints. + * @param int $rows Rows count. * * @return $this */ - public function setManualHints($manual_hints) + public function setRows($rows) { - $this->container['manual_hints'] = $manual_hints; + $this->container['rows'] = $rows; return $this; } diff --git a/src/Aspose/BarCode/Model/BarCodeType.php b/src/Aspose/BarCode/Model/DecodeBarcodeType.php similarity index 66% rename from src/Aspose/BarCode/Model/BarCodeType.php rename to src/Aspose/BarCode/Model/DecodeBarcodeType.php index 3fca122..41a0942 100644 --- a/src/Aspose/BarCode/Model/BarCodeType.php +++ b/src/Aspose/BarCode/Model/DecodeBarcodeType.php @@ -1,7 +1,7 @@ - + * * Copyright (c) 2018 Aspose Pty Ltd * * @@ -11,10 +11,10 @@ * 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 @@ -28,357 +28,355 @@ /* * */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// -namespace Aspose\BarCode; +namespace Aspose\BarCode\Model; use Aspose\BarCode\ObjectSerializer; /* - * BarCodeType + * DecodeBarcodeType * - * @description Supported types of barcode for generation. + * @description See DecodeType */ -class BarCodeType +class DecodeBarcodeType { /// - /// Enum value AustraliaPost + /// Enum value all /// - const AustraliaPost_ = "AustraliaPost"; + const all = "all"; /// - /// Enum value AustralianPosteParcel + /// Enum value AustraliaPost /// - const AustralianPosteParcel_ = "AustralianPosteParcel"; + const AustraliaPost = "AustraliaPost"; /// /// Enum value Aztec /// - const Aztec_ = "Aztec"; + const Aztec = "Aztec"; /// - /// Enum value BooklandEAN + /// Enum value ISBN /// - const BooklandEAN_ = "BooklandEAN"; + const ISBN = "ISBN"; /// /// Enum value Codabar /// - const Codabar_ = "Codabar"; + const Codabar = "Codabar"; /// /// Enum value Code11 /// - const Code11_ = "Code11"; - - /// - /// Enum value Code16K - /// - const Code16K_ = "Code16K"; + const Code11 = "Code11"; /// /// Enum value Code128 /// - const Code128_ = "Code128"; + const Code128 = "Code128"; /// - /// Enum value CodablockF + /// Enum value GS1Code128 /// - const CodablockF_ = "CodablockF"; + const GS1Code128 = "GS1Code128"; /// /// Enum value Code39Extended /// - const Code39Extended_ = "Code39Extended"; + const Code39Extended = "Code39Extended"; /// /// Enum value Code39Standard /// - const Code39Standard_ = "Code39Standard"; + const Code39Standard = "Code39Standard"; /// /// Enum value Code93Extended /// - const Code93Extended_ = "Code93Extended"; + const Code93Extended = "Code93Extended"; /// /// Enum value Code93Standard /// - const Code93Standard_ = "Code93Standard"; - - /// - /// Enum value CompactPdf417 - /// - const CompactPdf417_ = "CompactPdf417"; + const Code93Standard = "Code93Standard"; /// - /// Enum value DatabarOmniDirectional + /// Enum value DataMatrix /// - const DatabarOmniDirectional_ = "DatabarOmniDirectional"; + const DataMatrix = "DataMatrix"; /// - /// Enum value DatabarTruncated + /// Enum value DeutschePostIdentcode /// - const DatabarTruncated_ = "DatabarTruncated"; + const DeutschePostIdentcode = "DeutschePostIdentcode"; /// - /// Enum value DatabarLimited + /// Enum value DeutschePostLeitcode /// - const DatabarLimited_ = "DatabarLimited"; + const DeutschePostLeitcode = "DeutschePostLeitcode"; /// - /// Enum value DatabarExpanded + /// Enum value EAN13 /// - const DatabarExpanded_ = "DatabarExpanded"; + const EAN13 = "EAN13"; /// - /// Enum value DatabarExpandedStacked + /// Enum value EAN14 /// - const DatabarExpandedStacked_ = "DatabarExpandedStacked"; + const EAN14 = "EAN14"; /// - /// Enum value DatabarStacked + /// Enum value EAN8 /// - const DatabarStacked_ = "DatabarStacked"; + const EAN8 = "EAN8"; /// - /// Enum value DatabarStackedOmniDirectional + /// Enum value IATA2of5 /// - const DatabarStackedOmniDirectional_ = "DatabarStackedOmniDirectional"; + const IATA2of5 = "IATA2of5"; /// - /// Enum value DataMatrix + /// Enum value Interleaved2of5 /// - const DataMatrix_ = "DataMatrix"; + const Interleaved2of5 = "Interleaved2of5"; /// - /// Enum value DeutschePostIdentcode + /// Enum value ISSN /// - const DeutschePostIdentcode_ = "DeutschePostIdentcode"; + const ISSN = "ISSN"; /// - /// Enum value DeutschePostLeitcode + /// Enum value ISMN /// - const DeutschePostLeitcode_ = "DeutschePostLeitcode"; + const ISMN = "ISMN"; /// - /// Enum value EAN128 + /// Enum value ItalianPost25 /// - const EAN128_ = "EAN128"; + const ItalianPost25 = "ItalianPost25"; /// - /// Enum value EAN13 + /// Enum value ITF14 /// - const EAN13_ = "EAN13"; + const ITF14 = "ITF14"; /// - /// Enum value EAN14 + /// Enum value ITF6 /// - const EAN14_ = "EAN14"; + const ITF6 = "ITF6"; /// - /// Enum value EAN8 + /// Enum value MacroPdf417 /// - const EAN8_ = "EAN8"; + const MacroPdf417 = "MacroPdf417"; /// - /// Enum value GS1Code128 + /// Enum value Matrix2of5 /// - const GS1Code128_ = "GS1Code128"; + const Matrix2of5 = "Matrix2of5"; /// - /// Enum value GS1CodablockF + /// Enum value MSI /// - const GS1CodablockF_ = "GS1CodablockF"; + const MSI = "MSI"; /// - /// Enum value GS1DataMatrix + /// Enum value OneCode /// - const GS1DataMatrix_ = "GS1DataMatrix"; + const OneCode = "OneCode"; /// - /// Enum value GS1QR + /// Enum value OPC /// - const GS1QR_ = "GS1QR"; + const OPC = "OPC"; /// - /// Enum value IATA2of5 + /// Enum value PatchCode /// - const IATA2of5_ = "IATA2of5"; + const PatchCode = "PatchCode"; /// - /// Enum value ISBN + /// Enum value Pdf417 /// - const ISBN_ = "ISBN"; + const Pdf417 = "Pdf417"; /// - /// Enum value ISMN + /// Enum value MicroPdf417 /// - const ISMN_ = "ISMN"; + const MicroPdf417 = "MicroPdf417"; /// - /// Enum value ISSN + /// Enum value Planet /// - const ISSN_ = "ISSN"; + const Planet = "Planet"; /// - /// Enum value ITF14 + /// Enum value Postnet /// - const ITF14_ = "ITF14"; + const Postnet = "Postnet"; /// - /// Enum value ITF6 + /// Enum value PZN /// - const ITF6_ = "ITF6"; + const PZN = "PZN"; /// - /// Enum value Interleaved2of5 + /// Enum value QR /// - const Interleaved2of5_ = "Interleaved2of5"; + const QR = "QR"; /// - /// Enum value ItalianPost25 + /// Enum value MicroQR /// - const ItalianPost25_ = "ItalianPost25"; + const MicroQR = "MicroQR"; /// - /// Enum value MaxiCode + /// Enum value RM4SCC /// - const MaxiCode_ = "MaxiCode"; + const RM4SCC = "RM4SCC"; /// - /// Enum value MSI + /// Enum value SCC14 /// - const MSI_ = "MSI"; + const SCC14 = "SCC14"; /// - /// Enum value MicroPdf417 + /// Enum value SSCC18 /// - const MicroPdf417_ = "MicroPdf417"; + const SSCC18 = "SSCC18"; /// - /// Enum value MacroPdf417 + /// Enum value Standard2of5 /// - const MacroPdf417_ = "MacroPdf417"; + const Standard2of5 = "Standard2of5"; /// - /// Enum value Matrix2of5 + /// Enum value Supplement /// - const Matrix2of5_ = "Matrix2of5"; + const Supplement = "Supplement"; /// - /// Enum value MicroQR + /// Enum value UPCA /// - const MicroQR_ = "MicroQR"; + const UPCA = "UPCA"; /// - /// Enum value OPC + /// Enum value UPCE /// - const OPC_ = "OPC"; + const UPCE = "UPCE"; /// - /// Enum value OneCode + /// Enum value VIN /// - const OneCode_ = "OneCode"; + const VIN = "VIN"; /// - /// Enum value PZN + /// Enum value Pharmacode /// - const PZN_ = "PZN"; + const Pharmacode = "Pharmacode"; /// - /// Enum value PatchCode + /// Enum value GS1DataMatrix /// - const PatchCode_ = "PatchCode"; + const GS1DataMatrix = "GS1DataMatrix"; /// - /// Enum value Pharmacode + /// Enum value DatabarOmniDirectional /// - const Pharmacode_ = "Pharmacode"; + const DatabarOmniDirectional = "DatabarOmniDirectional"; /// - /// Enum value Pdf417 + /// Enum value DatabarTruncated /// - const Pdf417_ = "Pdf417"; + const DatabarTruncated = "DatabarTruncated"; /// - /// Enum value Planet + /// Enum value DatabarLimited /// - const Planet_ = "Planet"; + const DatabarLimited = "DatabarLimited"; /// - /// Enum value Postnet + /// Enum value DatabarExpanded /// - const Postnet_ = "Postnet"; + const DatabarExpanded = "DatabarExpanded"; /// - /// Enum value QR + /// Enum value SwissPostParcel /// - const QR_ = "QR"; + const SwissPostParcel = "SwissPostParcel"; /// - /// Enum value RM4SCC + /// Enum value AustralianPosteParcel /// - const RM4SCC_ = "RM4SCC"; + const AustralianPosteParcel = "AustralianPosteParcel"; /// - /// Enum value SingaporePost + /// Enum value Code16K /// - const SingaporePost_ = "SingaporePost"; + const Code16K = "Code16K"; /// - /// Enum value SCC14 + /// Enum value DatabarStackedOmniDirectional /// - const SCC14_ = "SCC14"; + const DatabarStackedOmniDirectional = "DatabarStackedOmniDirectional"; /// - /// Enum value SSCC18 + /// Enum value DatabarStacked /// - const SSCC18_ = "SSCC18"; + const DatabarStacked = "DatabarStacked"; /// - /// Enum value Standard2of5 + /// Enum value DatabarExpandedStacked /// - const Standard2of5_ = "Standard2of5"; + const DatabarExpandedStacked = "DatabarExpandedStacked"; /// - /// Enum value SwissPostParcel + /// Enum value CompactPdf417 /// - const SwissPostParcel_ = "SwissPostParcel"; + const CompactPdf417 = "CompactPdf417"; /// - /// Enum value UPCA + /// Enum value GS1QR /// - const UPCA_ = "UPCA"; + const GS1QR = "GS1QR"; /// - /// Enum value UPCE + /// Enum value MaxiCode /// - const UPCE_ = "UPCE"; + const MaxiCode = "MaxiCode"; /// - /// Enum value VIN + /// Enum value MicrE13B /// - const VIN_ = "VIN"; + const MicrE13B = "MicrE13B"; /// /// Enum value Code32 /// - const Code32_ = "Code32"; + const Code32 = "Code32"; /// - /// Enum value Datalogic2of5 + /// Enum value DataLogic2of5 /// - const Datalogic2of5_ = "Datalogic2of5"; + const DataLogic2of5 = "DataLogic2of5"; /// /// Enum value DotCode /// - const DotCode_ = "DotCode"; + const DotCode = "DotCode"; /// /// Enum value DutchKIX /// - const DutchKIX_ = "DutchKIX"; + const DutchKIX = "DutchKIX"; + + /// + /// Enum value CodablockF + /// + const CodablockF = "CodablockF"; } diff --git a/src/Aspose/BarCode/Model/Resolution.php b/src/Aspose/BarCode/Model/DiscUsage.php similarity index 77% rename from src/Aspose/BarCode/Model/Resolution.php rename to src/Aspose/BarCode/Model/DiscUsage.php index ad8eca3..27b5397 100644 --- a/src/Aspose/BarCode/Model/Resolution.php +++ b/src/Aspose/BarCode/Model/DiscUsage.php @@ -1,7 +1,7 @@ - + * * Copyright (c) 2018 Aspose Pty Ltd * * @@ -11,10 +11,10 @@ * 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 @@ -28,18 +28,21 @@ /* * */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// -namespace Aspose\BarCode; +namespace Aspose\BarCode\Model; use \ArrayAccess; use Aspose\BarCode\ObjectSerializer; /* - * Resolution + * DiscUsage * - * @description Represents resolutions of barcode. + * @description Class for disc space information. */ -class Resolution implements ArrayAccess +class DiscUsage implements ArrayAccess { const DISCRIMINATOR = null; @@ -48,7 +51,7 @@ class Resolution implements ArrayAccess * * @var string */ - protected static $swaggerModelName = "Resolution"; + protected static $swaggerModelName = "DiscUsage"; /* * Array of property to type mappings. Used for (de)serialization @@ -56,8 +59,8 @@ class Resolution implements ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'resolution_x' => 'double', - 'resolution_y' => 'double' + 'used_size' => 'int', + 'total_size' => 'int' ]; /* @@ -66,8 +69,8 @@ class Resolution implements ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'resolution_x' => 'double', - 'resolution_y' => 'double' + 'used_size' => 'int64', + 'total_size' => 'int64' ]; /* @@ -97,8 +100,8 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'resolution_x' => 'ResolutionX', - 'resolution_y' => 'ResolutionY' + 'used_size' => 'UsedSize', + 'total_size' => 'TotalSize' ]; /* @@ -107,8 +110,8 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'resolution_x' => 'setResolutionX', - 'resolution_y' => 'setResolutionY' + 'used_size' => 'setUsedSize', + 'total_size' => 'setTotalSize' ]; /* @@ -117,8 +120,8 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'resolution_x' => 'getResolutionX', - 'resolution_y' => 'getResolutionY' + 'used_size' => 'getUsedSize', + 'total_size' => 'getTotalSize' ]; /* @@ -181,8 +184,8 @@ public function getModelName() */ public function __construct(array $data = 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['used_size'] = isset($data['used_size']) ? $data['used_size'] : null; + $this->container['total_size'] = isset($data['total_size']) ? $data['total_size'] : null; } /* @@ -194,11 +197,11 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['resolution_x'] === null) { - $invalidProperties[] = "'resolution_x' can't be null"; + if ($this->container['used_size'] === null) { + $invalidProperties[] = "'used_size' can't be null"; } - if ($this->container['resolution_y'] === null) { - $invalidProperties[] = "'resolution_y' can't be null"; + if ($this->container['total_size'] === null) { + $invalidProperties[] = "'total_size' can't be null"; } return $invalidProperties; } @@ -212,10 +215,10 @@ public function listInvalidProperties() public function valid() { - if ($this->container['resolution_x'] === null) { + if ($this->container['used_size'] === null) { return false; } - if ($this->container['resolution_y'] === null) { + if ($this->container['total_size'] === null) { return false; } return true; @@ -223,49 +226,49 @@ public function valid() /* - * Gets resolution_x + * Gets used_size * - * @return double + * @return int */ - public function getResolutionX() + public function getUsedSize() { - return $this->container['resolution_x']; + return $this->container['used_size']; } /* - * Sets resolution_x + * Sets used_size * - * @param double $resolution_x Gets or sets resolution along X axis. + * @param int $used_size Application used disc space. * * @return $this */ - public function setResolutionX($resolution_x) + public function setUsedSize($used_size) { - $this->container['resolution_x'] = $resolution_x; + $this->container['used_size'] = $used_size; return $this; } /* - * Gets resolution_y + * Gets total_size * - * @return double + * @return int */ - public function getResolutionY() + public function getTotalSize() { - return $this->container['resolution_y']; + return $this->container['total_size']; } /* - * Sets resolution_y + * Sets total_size * - * @param double $resolution_y Gets or sets resolution along Y axis. + * @param int $total_size Total disc space. * * @return $this */ - public function setResolutionY($resolution_y) + public function setTotalSize($total_size) { - $this->container['resolution_y'] = $resolution_y; + $this->container['total_size'] = $total_size; return $this; } diff --git a/src/Aspose/BarCode/Model/DotCodeParams.php b/src/Aspose/BarCode/Model/DotCodeParams.php new file mode 100644 index 0000000..1d99605 --- /dev/null +++ b/src/Aspose/BarCode/Model/DotCodeParams.php @@ -0,0 +1,334 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * DotCodeParams + * + * @description DotCode parameters. + */ +class DotCodeParams implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "DotCodeParams"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'aspect_ratio' => 'double', + 'dot_code_mask' => 'int' + ]; + + /* + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'aspect_ratio' => 'double', + 'dot_code_mask' => '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', + 'dot_code_mask' => 'DotCodeMask' + ]; + + /* + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'aspect_ratio' => 'setAspectRatio', + 'dot_code_mask' => 'setDotCodeMask' + ]; + + /* + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'aspect_ratio' => 'getAspectRatio', + 'dot_code_mask' => 'getDotCodeMask' + ]; + + /* + * 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['dot_code_mask'] = isset($data['dot_code_mask']) ? $data['dot_code_mask'] : 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 dot_code_mask + * + * @return int + */ + public function getDotCodeMask() + { + return $this->container['dot_code_mask']; + } + + /* + * Sets dot_code_mask + * + * @param int $dot_code_mask Mask of Dotcode barcode. Default value: -1. + * + * @return $this + */ + public function setDotCodeMask($dot_code_mask) + { + $this->container['dot_code_mask'] = $dot_code_mask; + + return $this; + } + /* + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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 new file mode 100644 index 0000000..94fb6a1 --- /dev/null +++ b/src/Aspose/BarCode/Model/ECIEncodings.php @@ -0,0 +1,177 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; +use Aspose\BarCode\ObjectSerializer; + +/* + * ECIEncodings + * + * @description + */ +class ECIEncodings +{ + + /// + /// Enum value ISO_8859_1 + /// + const ISO_8859_1 = "ISO_8859_1"; + + /// + /// Enum value ISO_8859_2 + /// + const ISO_8859_2 = "ISO_8859_2"; + + /// + /// Enum value ISO_8859_3 + /// + const ISO_8859_3 = "ISO_8859_3"; + + /// + /// Enum value ISO_8859_4 + /// + const ISO_8859_4 = "ISO_8859_4"; + + /// + /// Enum value ISO_8859_5 + /// + const ISO_8859_5 = "ISO_8859_5"; + + /// + /// Enum value ISO_8859_6 + /// + const ISO_8859_6 = "ISO_8859_6"; + + /// + /// Enum value ISO_8859_7 + /// + const ISO_8859_7 = "ISO_8859_7"; + + /// + /// Enum value ISO_8859_8 + /// + const ISO_8859_8 = "ISO_8859_8"; + + /// + /// Enum value ISO_8859_9 + /// + const ISO_8859_9 = "ISO_8859_9"; + + /// + /// Enum value ISO_8859_10 + /// + const ISO_8859_10 = "ISO_8859_10"; + + /// + /// Enum value ISO_8859_11 + /// + const ISO_8859_11 = "ISO_8859_11"; + + /// + /// Enum value ISO_8859_13 + /// + const ISO_8859_13 = "ISO_8859_13"; + + /// + /// Enum value ISO_8859_14 + /// + const ISO_8859_14 = "ISO_8859_14"; + + /// + /// Enum value ISO_8859_15 + /// + const ISO_8859_15 = "ISO_8859_15"; + + /// + /// Enum value ISO_8859_16 + /// + const ISO_8859_16 = "ISO_8859_16"; + + /// + /// Enum value Shift_JIS + /// + const Shift_JIS = "Shift_JIS"; + + /// + /// Enum value Win1250 + /// + const Win1250 = "Win1250"; + + /// + /// Enum value Win1251 + /// + const Win1251 = "Win1251"; + + /// + /// Enum value Win1252 + /// + const Win1252 = "Win1252"; + + /// + /// Enum value Win1256 + /// + const Win1256 = "Win1256"; + + /// + /// Enum value UTF16BE + /// + const UTF16BE = "UTF16BE"; + + /// + /// Enum value UTF8 + /// + const UTF8 = "UTF8"; + + /// + /// Enum value US_ASCII + /// + const US_ASCII = "US_ASCII"; + + /// + /// Enum value Big5 + /// + const Big5 = "Big5"; + + /// + /// Enum value GB18030 + /// + const GB18030 = "GB18030"; + + /// + /// Enum value EUC_KR + /// + const EUC_KR = "EUC_KR"; + +} + diff --git a/src/Aspose/BarCode/Model/EnableChecksum.php b/src/Aspose/BarCode/Model/EnableChecksum.php index 7931242..fcc35a5 100644 --- a/src/Aspose/BarCode/Model/EnableChecksum.php +++ b/src/Aspose/BarCode/Model/EnableChecksum.php @@ -1,4 +1,4 @@ - @@ -11,10 +11,10 @@ * 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 @@ -28,14 +28,17 @@ /* * */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// -namespace Aspose\BarCode; +namespace Aspose\BarCode\Model; use Aspose\BarCode\ObjectSerializer; /* * EnableChecksum * - * @description Represents checksum property. + * @description */ class EnableChecksum { @@ -43,17 +46,17 @@ class EnableChecksum /// /// Enum value Default /// - const Default_ = "Default"; + const Default = "Default"; /// /// Enum value Yes /// - const Yes_ = "Yes"; + const Yes = "Yes"; /// /// Enum value No /// - const No_ = "No"; + const No = "No"; } diff --git a/src/Aspose/BarCode/Model/EncodeBarcodeType.php b/src/Aspose/BarCode/Model/EncodeBarcodeType.php new file mode 100644 index 0000000..b445b2f --- /dev/null +++ b/src/Aspose/BarCode/Model/EncodeBarcodeType.php @@ -0,0 +1,377 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; +use Aspose\BarCode\ObjectSerializer; + +/* + * EncodeBarcodeType + * + * @description See EncodeTypes + */ +class EncodeBarcodeType +{ + + /// + /// Enum value Codabar + /// + const Codabar = "Codabar"; + + /// + /// Enum value Code11 + /// + const Code11 = "Code11"; + + /// + /// Enum value Code39Standard + /// + const Code39Standard = "Code39Standard"; + + /// + /// Enum value Code39Extended + /// + const Code39Extended = "Code39Extended"; + + /// + /// Enum value Code93Standard + /// + const Code93Standard = "Code93Standard"; + + /// + /// Enum value Code93Extended + /// + const Code93Extended = "Code93Extended"; + + /// + /// Enum value Code128 + /// + const Code128 = "Code128"; + + /// + /// Enum value GS1Code128 + /// + const GS1Code128 = "GS1Code128"; + + /// + /// Enum value EAN8 + /// + const EAN8 = "EAN8"; + + /// + /// Enum value EAN13 + /// + const EAN13 = "EAN13"; + + /// + /// Enum value EAN14 + /// + const EAN14 = "EAN14"; + + /// + /// Enum value SCC14 + /// + const SCC14 = "SCC14"; + + /// + /// Enum value SSCC18 + /// + const SSCC18 = "SSCC18"; + + /// + /// Enum value UPCA + /// + const UPCA = "UPCA"; + + /// + /// Enum value UPCE + /// + const UPCE = "UPCE"; + + /// + /// Enum value ISBN + /// + const ISBN = "ISBN"; + + /// + /// Enum value ISSN + /// + const ISSN = "ISSN"; + + /// + /// Enum value ISMN + /// + const ISMN = "ISMN"; + + /// + /// Enum value Standard2of5 + /// + const Standard2of5 = "Standard2of5"; + + /// + /// Enum value Interleaved2of5 + /// + const Interleaved2of5 = "Interleaved2of5"; + + /// + /// Enum value Matrix2of5 + /// + const Matrix2of5 = "Matrix2of5"; + + /// + /// Enum value ItalianPost25 + /// + const ItalianPost25 = "ItalianPost25"; + + /// + /// Enum value IATA2of5 + /// + const IATA2of5 = "IATA2of5"; + + /// + /// Enum value ITF14 + /// + const ITF14 = "ITF14"; + + /// + /// Enum value ITF6 + /// + const ITF6 = "ITF6"; + + /// + /// Enum value MSI + /// + const MSI = "MSI"; + + /// + /// Enum value VIN + /// + const VIN = "VIN"; + + /// + /// Enum value DeutschePostIdentcode + /// + const DeutschePostIdentcode = "DeutschePostIdentcode"; + + /// + /// Enum value DeutschePostLeitcode + /// + const DeutschePostLeitcode = "DeutschePostLeitcode"; + + /// + /// Enum value OPC + /// + const OPC = "OPC"; + + /// + /// Enum value PZN + /// + const PZN = "PZN"; + + /// + /// Enum value Code16K + /// + const Code16K = "Code16K"; + + /// + /// Enum value Pharmacode + /// + const Pharmacode = "Pharmacode"; + + /// + /// Enum value DataMatrix + /// + const DataMatrix = "DataMatrix"; + + /// + /// Enum value QR + /// + const QR = "QR"; + + /// + /// Enum value Aztec + /// + const Aztec = "Aztec"; + + /// + /// Enum value Pdf417 + /// + const Pdf417 = "Pdf417"; + + /// + /// Enum value MacroPdf417 + /// + const MacroPdf417 = "MacroPdf417"; + + /// + /// Enum value AustraliaPost + /// + const AustraliaPost = "AustraliaPost"; + + /// + /// Enum value Postnet + /// + const Postnet = "Postnet"; + + /// + /// Enum value Planet + /// + const Planet = "Planet"; + + /// + /// Enum value OneCode + /// + const OneCode = "OneCode"; + + /// + /// Enum value RM4SCC + /// + const RM4SCC = "RM4SCC"; + + /// + /// Enum value DatabarOmniDirectional + /// + const DatabarOmniDirectional = "DatabarOmniDirectional"; + + /// + /// Enum value DatabarTruncated + /// + const DatabarTruncated = "DatabarTruncated"; + + /// + /// Enum value DatabarLimited + /// + const DatabarLimited = "DatabarLimited"; + + /// + /// Enum value DatabarExpanded + /// + const DatabarExpanded = "DatabarExpanded"; + + /// + /// Enum value SingaporePost + /// + const SingaporePost = "SingaporePost"; + + /// + /// Enum value GS1DataMatrix + /// + const GS1DataMatrix = "GS1DataMatrix"; + + /// + /// Enum value AustralianPosteParcel + /// + const AustralianPosteParcel = "AustralianPosteParcel"; + + /// + /// Enum value SwissPostParcel + /// + const SwissPostParcel = "SwissPostParcel"; + + /// + /// Enum value PatchCode + /// + const PatchCode = "PatchCode"; + + /// + /// Enum value DatabarExpandedStacked + /// + const DatabarExpandedStacked = "DatabarExpandedStacked"; + + /// + /// Enum value DatabarStacked + /// + const DatabarStacked = "DatabarStacked"; + + /// + /// Enum value DatabarStackedOmniDirectional + /// + const DatabarStackedOmniDirectional = "DatabarStackedOmniDirectional"; + + /// + /// Enum value MicroPdf417 + /// + const MicroPdf417 = "MicroPdf417"; + + /// + /// Enum value GS1QR + /// + const GS1QR = "GS1QR"; + + /// + /// Enum value MaxiCode + /// + const MaxiCode = "MaxiCode"; + + /// + /// Enum value Code32 + /// + const Code32 = "Code32"; + + /// + /// Enum value DataLogic2of5 + /// + const DataLogic2of5 = "DataLogic2of5"; + + /// + /// Enum value DotCode + /// + const DotCode = "DotCode"; + + /// + /// Enum value DutchKIX + /// + const DutchKIX = "DutchKIX"; + + /// + /// Enum value UpcaGs1Code128Coupon + /// + const UpcaGs1Code128Coupon = "UpcaGs1Code128Coupon"; + + /// + /// Enum value UpcaGs1DatabarCoupon + /// + const UpcaGs1DatabarCoupon = "UpcaGs1DatabarCoupon"; + + /// + /// Enum value CodablockF + /// + const CodablockF = "CodablockF"; + + /// + /// Enum value GS1CodablockF + /// + const GS1CodablockF = "GS1CodablockF"; + +} + diff --git a/src/Aspose/BarCode/Model/Error.php b/src/Aspose/BarCode/Model/Error.php new file mode 100644 index 0000000..95117da --- /dev/null +++ b/src/Aspose/BarCode/Model/Error.php @@ -0,0 +1,394 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * Error + * + * @description Error + */ +class Error implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "Error"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'code' => 'string', + 'message' => 'string', + 'description' => 'string', + 'inner_error' => '\Aspose\BarCode\Model\ErrorDetails' + ]; + + /* + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $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) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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/AsposeResponse.php b/src/Aspose/BarCode/Model/ErrorDetails.php similarity index 78% rename from src/Aspose/BarCode/Model/AsposeResponse.php rename to src/Aspose/BarCode/Model/ErrorDetails.php index bad8625..9e07646 100644 --- a/src/Aspose/BarCode/Model/AsposeResponse.php +++ b/src/Aspose/BarCode/Model/ErrorDetails.php @@ -1,7 +1,7 @@ - + * * Copyright (c) 2018 Aspose Pty Ltd * * @@ -11,10 +11,10 @@ * 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 @@ -28,27 +28,30 @@ /* * */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// -namespace Aspose\BarCode; +namespace Aspose\BarCode\Model; use \ArrayAccess; use Aspose\BarCode\ObjectSerializer; /* - * AsposeResponse + * ErrorDetails * - * @description Represents the basic response class from Aspose for Cloud. + * @description The error details */ -class AsposeResponse implements ArrayAccess +class ErrorDetails implements ArrayAccess { - const DISCRIMINATOR = 'Type'; + const DISCRIMINATOR = null; /* * The original name of the model. * * @var string */ - protected static $swaggerModelName = "AsposeResponse"; + protected static $swaggerModelName = "ErrorDetails"; /* * Array of property to type mappings. Used for (de)serialization @@ -56,8 +59,8 @@ class AsposeResponse implements ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'code' => '\Swagger\Client\Model\HttpStatusCode', - 'status' => 'string' + 'request_id' => 'string', + 'date' => '\DateTime' ]; /* @@ -66,8 +69,8 @@ class AsposeResponse implements ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'code' => null, - 'status' => null + 'request_id' => null, + 'date' => 'date-time' ]; /* @@ -97,8 +100,8 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'code' => 'Code', - 'status' => 'Status' + 'request_id' => 'RequestId', + 'date' => 'Date' ]; /* @@ -107,8 +110,8 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'code' => 'setCode', - 'status' => 'setStatus' + 'request_id' => 'setRequestId', + 'date' => 'setDate' ]; /* @@ -117,8 +120,8 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'code' => 'getCode', - 'status' => 'getStatus' + 'request_id' => 'getRequestId', + 'date' => 'getDate' ]; /* @@ -181,12 +184,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['code'] = isset($data['code']) ? $data['code'] : null; - $this->container['status'] = isset($data['status']) ? $data['status'] : null; - - // Initialize discriminator property with the model name. - $discriminator = array_search('Type', self::$attributeMap); - $this->container[$discriminator] = static::$swaggerModelName; + $this->container['request_id'] = isset($data['request_id']) ? $data['request_id'] : null; + $this->container['date'] = isset($data['date']) ? $data['date'] : null; } /* @@ -198,8 +197,8 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; + if ($this->container['date'] === null) { + $invalidProperties[] = "'date' can't be null"; } return $invalidProperties; } @@ -213,7 +212,7 @@ public function listInvalidProperties() public function valid() { - if ($this->container['code'] === null) { + if ($this->container['date'] === null) { return false; } return true; @@ -221,49 +220,49 @@ public function valid() /* - * Gets code + * Gets request_id * - * @return \Swagger\Client\Model\HttpStatusCode + * @return string */ - public function getCode() + public function getRequestId() { - return $this->container['code']; + return $this->container['request_id']; } /* - * Sets code + * Sets request_id * - * @param \Swagger\Client\Model\HttpStatusCode $code code + * @param string $request_id The request id * * @return $this */ - public function setCode($code) + public function setRequestId($request_id) { - $this->container['code'] = $code; + $this->container['request_id'] = $request_id; return $this; } /* - * Gets status + * Gets date * - * @return string + * @return \DateTime */ - public function getStatus() + public function getDate() { - return $this->container['status']; + return $this->container['date']; } /* - * Sets status + * Sets date * - * @param string $status status + * @param \DateTime $date Date * * @return $this */ - public function setStatus($status) + public function setDate($date) { - $this->container['status'] = $status; + $this->container['date'] = $date; return $this; } diff --git a/src/Aspose/BarCode/Model/FileVersion.php b/src/Aspose/BarCode/Model/FileVersion.php new file mode 100644 index 0000000..3e1454b --- /dev/null +++ b/src/Aspose/BarCode/Model/FileVersion.php @@ -0,0 +1,501 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * FileVersion + * + */ +class FileVersion implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "FileVersion"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'name' => '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[] + */ + protected static $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) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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 new file mode 100644 index 0000000..057bde2 --- /dev/null +++ b/src/Aspose/BarCode/Model/FileVersions.php @@ -0,0 +1,304 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * FileVersions + * + * @description File versions FileVersion. + */ +class FileVersions implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "FileVersions"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'value' => '\Aspose\BarCode\Model\FileVersion[]' + ]; + + /* + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $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) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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 new file mode 100644 index 0000000..5835a83 --- /dev/null +++ b/src/Aspose/BarCode/Model/FilesList.php @@ -0,0 +1,304 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * FilesList + * + * @description Files list + */ +class FilesList implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "FilesList"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'value' => '\Aspose\BarCode\Model\StorageFile[]' + ]; + + /* + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $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) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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 new file mode 100644 index 0000000..c3a55e1 --- /dev/null +++ b/src/Aspose/BarCode/Model/FilesUploadResult.php @@ -0,0 +1,334 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * FilesUploadResult + * + * @description File upload result + */ +class FilesUploadResult implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "FilesUploadResult"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'uploaded' => 'string[]', + 'errors' => '\Aspose\BarCode\Model\Error[]' + ]; + + /* + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $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) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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/ImageQualityMode.php b/src/Aspose/BarCode/Model/FontMode.php similarity index 82% rename from src/Aspose/BarCode/Model/ImageQualityMode.php rename to src/Aspose/BarCode/Model/FontMode.php index 7e216b7..0d5c025 100644 --- a/src/Aspose/BarCode/Model/ImageQualityMode.php +++ b/src/Aspose/BarCode/Model/FontMode.php @@ -1,7 +1,7 @@ - + * * Copyright (c) 2018 Aspose Pty Ltd * * @@ -11,10 +11,10 @@ * 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 @@ -28,27 +28,30 @@ /* * */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// -namespace Aspose\BarCode; +namespace Aspose\BarCode\Model; use Aspose\BarCode\ObjectSerializer; /* - * ImageQualityMode + * FontMode * - * @description Represents type of image quality. + * @description */ -class ImageQualityMode +class FontMode { /// - /// Enum value Default + /// Enum value Auto /// - const Default_ = "Default"; + const Auto = "Auto"; /// - /// Enum value AntiAlias + /// Enum value Manual /// - const AntiAlias_ = "AntiAlias"; + const Manual = "Manual"; } diff --git a/src/Aspose/BarCode/Model/FontParams.php b/src/Aspose/BarCode/Model/FontParams.php new file mode 100644 index 0000000..b1fcf2a --- /dev/null +++ b/src/Aspose/BarCode/Model/FontParams.php @@ -0,0 +1,364 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * FontParams + * + * @description Font. + */ +class FontParams implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "FontParams"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'family' => 'string', + 'size' => 'double', + 'style' => '\Aspose\BarCode\Model\FontStyle' + ]; + + /* + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $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) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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 new file mode 100644 index 0000000..bd944aa --- /dev/null +++ b/src/Aspose/BarCode/Model/FontStyle.php @@ -0,0 +1,72 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; +use Aspose\BarCode\ObjectSerializer; + +/* + * FontStyle + * + * @description + */ +class FontStyle +{ + + /// + /// Enum value Regular + /// + const Regular = "Regular"; + + /// + /// Enum value Bold + /// + const Bold = "Bold"; + + /// + /// Enum value Italic + /// + const Italic = "Italic"; + + /// + /// Enum value Underline + /// + const Underline = "Underline"; + + /// + /// Enum value Strikeout + /// + const Strikeout = "Strikeout"; + +} + diff --git a/src/Aspose/BarCode/Model/GeneratorParams.php b/src/Aspose/BarCode/Model/GeneratorParams.php new file mode 100644 index 0000000..a14967a --- /dev/null +++ b/src/Aspose/BarCode/Model/GeneratorParams.php @@ -0,0 +1,1786 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * GeneratorParams + * + * @description Represents extended BarcodeGenerator params. + */ +class GeneratorParams implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "GeneratorParams"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'type_of_barcode' => '\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', + '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', + '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' + ]; + + /* + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $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, + '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', + '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 + ]; + + /* + * 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', + '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', + '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' + ]; + + /* + * 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', + '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', + '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' + ]; + + /* + * 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', + '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', + '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' + ]; + + /* + * 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['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['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; + } + + /* + * 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: Color.Black. + * + * @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 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) + { + $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) + { + $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: Color.White. + * + * @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: Color.Black. + * + * @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: Color.Black. + * + * @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, SingapurePost, 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 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; + } + /* + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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/BarCodeBuildersList.php b/src/Aspose/BarCode/Model/GeneratorParamsList.php similarity index 86% rename from src/Aspose/BarCode/Model/BarCodeBuildersList.php rename to src/Aspose/BarCode/Model/GeneratorParamsList.php index 9ed7a77..4bd01f7 100644 --- a/src/Aspose/BarCode/Model/BarCodeBuildersList.php +++ b/src/Aspose/BarCode/Model/GeneratorParamsList.php @@ -1,7 +1,7 @@ - + * * Copyright (c) 2018 Aspose Pty Ltd * * @@ -11,10 +11,10 @@ * 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 @@ -28,18 +28,21 @@ /* * */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// -namespace Aspose\BarCode; +namespace Aspose\BarCode\Model; use \ArrayAccess; use Aspose\BarCode\ObjectSerializer; /* - * BarCodeBuildersList + * GeneratorParamsList * - * @description Represents list of barcode builders + * @description Represents list of barcode generators */ -class BarCodeBuildersList implements ArrayAccess +class GeneratorParamsList implements ArrayAccess { const DISCRIMINATOR = null; @@ -48,7 +51,7 @@ class BarCodeBuildersList implements ArrayAccess * * @var string */ - protected static $swaggerModelName = "BarCodeBuildersList"; + protected static $swaggerModelName = "GeneratorParamsList"; /* * Array of property to type mappings. Used for (de)serialization @@ -56,7 +59,7 @@ class BarCodeBuildersList implements ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'bar_code_builders' => '\Swagger\Client\Model\BarCodeBuilder[]', + 'barcode_builders' => '\Aspose\BarCode\Model\GeneratorParams[]', 'x_step' => 'int', 'y_step' => 'int' ]; @@ -67,7 +70,7 @@ class BarCodeBuildersList implements ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'bar_code_builders' => null, + 'barcode_builders' => null, 'x_step' => 'int32', 'y_step' => 'int32' ]; @@ -99,7 +102,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'bar_code_builders' => 'BarCodeBuilders', + 'barcode_builders' => 'BarcodeBuilders', 'x_step' => 'XStep', 'y_step' => 'YStep' ]; @@ -110,7 +113,7 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'bar_code_builders' => 'setBarCodeBuilders', + 'barcode_builders' => 'setBarcodeBuilders', 'x_step' => 'setXStep', 'y_step' => 'setYStep' ]; @@ -121,7 +124,7 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'bar_code_builders' => 'getBarCodeBuilders', + 'barcode_builders' => 'getBarcodeBuilders', 'x_step' => 'getXStep', 'y_step' => 'getYStep' ]; @@ -186,7 +189,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['bar_code_builders'] = isset($data['bar_code_builders']) ? $data['bar_code_builders'] : 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; } @@ -229,25 +232,25 @@ public function valid() /* - * Gets bar_code_builders + * Gets barcode_builders * - * @return \Swagger\Client\Model\BarCodeBuilder[] + * @return \Aspose\BarCode\Model\GeneratorParams[] */ - public function getBarCodeBuilders() + public function getBarcodeBuilders() { - return $this->container['bar_code_builders']; + return $this->container['barcode_builders']; } /* - * Sets bar_code_builders + * Sets barcode_builders * - * @param \Swagger\Client\Model\BarCodeBuilder[] $bar_code_builders List of barcode builders + * @param \Aspose\BarCode\Model\GeneratorParams[] $barcode_builders List of barcode generators * * @return $this */ - public function setBarCodeBuilders($bar_code_builders) + public function setBarcodeBuilders($barcode_builders) { - $this->container['bar_code_builders'] = $bar_code_builders; + $this->container['barcode_builders'] = $barcode_builders; return $this; } diff --git a/src/Aspose/BarCode/Model/HttpStatusCode.php b/src/Aspose/BarCode/Model/HttpStatusCode.php deleted file mode 100644 index 4de701f..0000000 --- a/src/Aspose/BarCode/Model/HttpStatusCode.php +++ /dev/null @@ -1,279 +0,0 @@ - - * Copyright (c) 2018 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 Aspose\BarCode\ObjectSerializer; - -/* - * HttpStatusCode - * - * @description - */ -class HttpStatusCode -{ - - /// - /// Enum value Continue - /// - const Continue_ = "Continue"; - - /// - /// Enum value SwitchingProtocols - /// - const SwitchingProtocols_ = "SwitchingProtocols"; - - /// - /// Enum value OK - /// - const OK_ = "OK"; - - /// - /// Enum value Created - /// - const Created_ = "Created"; - - /// - /// Enum value Accepted - /// - const Accepted_ = "Accepted"; - - /// - /// Enum value NonAuthoritativeInformation - /// - const NonAuthoritativeInformation_ = "NonAuthoritativeInformation"; - - /// - /// Enum value NoContent - /// - const NoContent_ = "NoContent"; - - /// - /// Enum value ResetContent - /// - const ResetContent_ = "ResetContent"; - - /// - /// Enum value PartialContent - /// - const PartialContent_ = "PartialContent"; - - /// - /// Enum value MultipleChoices - /// - const MultipleChoices_ = "MultipleChoices"; - - /// - /// Enum value Ambiguous - /// - const Ambiguous_ = "Ambiguous"; - - /// - /// Enum value MovedPermanently - /// - const MovedPermanently_ = "MovedPermanently"; - - /// - /// Enum value Moved - /// - const Moved_ = "Moved"; - - /// - /// Enum value Found - /// - const Found_ = "Found"; - - /// - /// Enum value Redirect - /// - const Redirect_ = "Redirect"; - - /// - /// Enum value SeeOther - /// - const SeeOther_ = "SeeOther"; - - /// - /// Enum value RedirectMethod - /// - const RedirectMethod_ = "RedirectMethod"; - - /// - /// Enum value NotModified - /// - const NotModified_ = "NotModified"; - - /// - /// Enum value UseProxy - /// - const UseProxy_ = "UseProxy"; - - /// - /// Enum value Unused - /// - const Unused_ = "Unused"; - - /// - /// Enum value TemporaryRedirect - /// - const TemporaryRedirect_ = "TemporaryRedirect"; - - /// - /// Enum value RedirectKeepVerb - /// - const RedirectKeepVerb_ = "RedirectKeepVerb"; - - /// - /// Enum value BadRequest - /// - const BadRequest_ = "BadRequest"; - - /// - /// Enum value Unauthorized - /// - const Unauthorized_ = "Unauthorized"; - - /// - /// Enum value PaymentRequired - /// - const PaymentRequired_ = "PaymentRequired"; - - /// - /// Enum value Forbidden - /// - const Forbidden_ = "Forbidden"; - - /// - /// Enum value NotFound - /// - const NotFound_ = "NotFound"; - - /// - /// Enum value MethodNotAllowed - /// - const MethodNotAllowed_ = "MethodNotAllowed"; - - /// - /// Enum value NotAcceptable - /// - const NotAcceptable_ = "NotAcceptable"; - - /// - /// Enum value ProxyAuthenticationRequired - /// - const ProxyAuthenticationRequired_ = "ProxyAuthenticationRequired"; - - /// - /// Enum value RequestTimeout - /// - const RequestTimeout_ = "RequestTimeout"; - - /// - /// Enum value Conflict - /// - const Conflict_ = "Conflict"; - - /// - /// Enum value Gone - /// - const Gone_ = "Gone"; - - /// - /// Enum value LengthRequired - /// - const LengthRequired_ = "LengthRequired"; - - /// - /// Enum value PreconditionFailed - /// - const PreconditionFailed_ = "PreconditionFailed"; - - /// - /// Enum value RequestEntityTooLarge - /// - const RequestEntityTooLarge_ = "RequestEntityTooLarge"; - - /// - /// Enum value RequestUriTooLong - /// - const RequestUriTooLong_ = "RequestUriTooLong"; - - /// - /// Enum value UnsupportedMediaType - /// - const UnsupportedMediaType_ = "UnsupportedMediaType"; - - /// - /// Enum value RequestedRangeNotSatisfiable - /// - const RequestedRangeNotSatisfiable_ = "RequestedRangeNotSatisfiable"; - - /// - /// Enum value ExpectationFailed - /// - const ExpectationFailed_ = "ExpectationFailed"; - - /// - /// Enum value UpgradeRequired - /// - const UpgradeRequired_ = "UpgradeRequired"; - - /// - /// Enum value InternalServerError - /// - const InternalServerError_ = "InternalServerError"; - - /// - /// Enum value NotImplemented - /// - const NotImplemented_ = "NotImplemented"; - - /// - /// Enum value BadGateway - /// - const BadGateway_ = "BadGateway"; - - /// - /// Enum value ServiceUnavailable - /// - const ServiceUnavailable_ = "ServiceUnavailable"; - - /// - /// Enum value GatewayTimeout - /// - const GatewayTimeout_ = "GatewayTimeout"; - - /// - /// Enum value HttpVersionNotSupported - /// - const HttpVersionNotSupported_ = "HttpVersionNotSupported"; - -} - diff --git a/src/Aspose/BarCode/Model/ITF14BorderType.php b/src/Aspose/BarCode/Model/ITF14BorderType.php new file mode 100644 index 0000000..500ff65 --- /dev/null +++ b/src/Aspose/BarCode/Model/ITF14BorderType.php @@ -0,0 +1,72 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; +use Aspose\BarCode\ObjectSerializer; + +/* + * ITF14BorderType + * + * @description + */ +class ITF14BorderType +{ + + /// + /// Enum value None + /// + const None = "None"; + + /// + /// Enum value Frame + /// + const Frame = "Frame"; + + /// + /// Enum value Bar + /// + const Bar = "Bar"; + + /// + /// Enum value FrameOut + /// + const FrameOut = "FrameOut"; + + /// + /// Enum value BarOut + /// + const BarOut = "BarOut"; + +} + diff --git a/src/Aspose/BarCode/Model/ITFParams.php b/src/Aspose/BarCode/Model/ITFParams.php new file mode 100644 index 0000000..cb34cfc --- /dev/null +++ b/src/Aspose/BarCode/Model/ITFParams.php @@ -0,0 +1,364 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * ITFParams + * + * @description ITF parameters. + */ +class ITFParams implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "ITFParams"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'border_thickness' => 'double', + 'border_type' => '\Aspose\BarCode\Model\ITF14BorderType', + 'quiet_zone_coef' => 'int' + ]; + + /* + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $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) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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/MaxiCodeParams.php b/src/Aspose/BarCode/Model/MaxiCodeParams.php new file mode 100644 index 0000000..e11f5a0 --- /dev/null +++ b/src/Aspose/BarCode/Model/MaxiCodeParams.php @@ -0,0 +1,334 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * MaxiCodeParams + * + * @description MaxiCode parameters. + */ +class MaxiCodeParams implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "MaxiCodeParams"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'aspect_ratio' => 'double', + 'encode_mode' => 'int' + ]; + + /* + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'aspect_ratio' => 'double', + 'encode_mode' => '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', + 'encode_mode' => 'EncodeMode' + ]; + + /* + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'aspect_ratio' => 'setAspectRatio', + 'encode_mode' => 'setEncodeMode' + ]; + + /* + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'aspect_ratio' => 'getAspectRatio', + '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['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 encode_mode + * + * @return int + */ + public function getEncodeMode() + { + return $this->container['encode_mode']; + } + + /* + * Sets encode_mode + * + * @param int $encode_mode MaxiCode encode mode. + * + * @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) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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 6ee1ea8..5f22749 100644 --- a/src/Aspose/BarCode/Model/ModelInterface.php +++ b/src/Aspose/BarCode/Model/ModelInterface.php @@ -5,20 +5,20 @@ * PHP version 5 * * @category Class - * @package Swagger\Client\Model + * @package Aspose\BarCode\Model * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ /** - * Aspose.BarCode for Cloud API Reference + * Aspose.Barcode Cloud API Reference * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * OpenAPI spec version: 1 + * OpenAPI spec version: 3.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.13 */ /** @@ -27,12 +27,12 @@ * Do not edit the class manually. */ -namespace Swagger\Client\Model; +namespace Aspose\BarCode\Model; /** * Interface abstracting model access. * - * @package Swagger\Client\Model + * @package Aspose\BarCode\Model * @author Swagger Codegen team */ interface ModelInterface diff --git a/src/Aspose/BarCode/Model/ObjectExist.php b/src/Aspose/BarCode/Model/ObjectExist.php new file mode 100644 index 0000000..0001a21 --- /dev/null +++ b/src/Aspose/BarCode/Model/ObjectExist.php @@ -0,0 +1,346 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * ObjectExist + * + * @description Object exists + */ +class ObjectExist implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "ObjectExist"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'exists' => 'bool', + 'is_folder' => 'bool' + ]; + + /* + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $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) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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/Margins.php b/src/Aspose/BarCode/Model/Padding.php similarity index 86% rename from src/Aspose/BarCode/Model/Margins.php rename to src/Aspose/BarCode/Model/Padding.php index cd6eb43..e897eb5 100644 --- a/src/Aspose/BarCode/Model/Margins.php +++ b/src/Aspose/BarCode/Model/Padding.php @@ -1,7 +1,7 @@ - + * * Copyright (c) 2018 Aspose Pty Ltd * * @@ -11,10 +11,10 @@ * 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 @@ -28,18 +28,21 @@ /* * */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// -namespace Aspose\BarCode; +namespace Aspose\BarCode\Model; use \ArrayAccess; use Aspose\BarCode\ObjectSerializer; /* - * Margins + * Padding * - * @description Represents margins around barcode. + * @description Padding around barcode. */ -class Margins implements ArrayAccess +class Padding implements ArrayAccess { const DISCRIMINATOR = null; @@ -48,7 +51,7 @@ class Margins implements ArrayAccess * * @var string */ - protected static $swaggerModelName = "Margins"; + protected static $swaggerModelName = "Padding"; /* * Array of property to type mappings. Used for (de)serialization @@ -206,18 +209,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['left'] === null) { - $invalidProperties[] = "'left' can't be null"; - } - if ($this->container['right'] === null) { - $invalidProperties[] = "'right' can't be null"; - } - if ($this->container['top'] === null) { - $invalidProperties[] = "'top' can't be null"; - } - if ($this->container['bottom'] === null) { - $invalidProperties[] = "'bottom' can't be null"; - } return $invalidProperties; } @@ -230,18 +221,6 @@ public function listInvalidProperties() public function valid() { - if ($this->container['left'] === null) { - return false; - } - if ($this->container['right'] === null) { - return false; - } - if ($this->container['top'] === null) { - return false; - } - if ($this->container['bottom'] === null) { - return false; - } return true; } @@ -259,7 +238,7 @@ public function getLeft() /* * Sets left * - * @param double $left Gets or sets left margin. + * @param double $left Left padding. * * @return $this */ @@ -283,7 +262,7 @@ public function getRight() /* * Sets right * - * @param double $right Gets or sets Right margin. + * @param double $right Right padding. * * @return $this */ @@ -307,7 +286,7 @@ public function getTop() /* * Sets top * - * @param double $top Gets or sets top margin. + * @param double $top Top padding. * * @return $this */ @@ -331,7 +310,7 @@ public function getBottom() /* * Sets bottom * - * @param double $bottom Gets or sets bottom margin. + * @param double $bottom Bottom padding. * * @return $this */ diff --git a/src/Aspose/BarCode/Model/Pdf417CompactionMode.php b/src/Aspose/BarCode/Model/Pdf417CompactionMode.php new file mode 100644 index 0000000..5a28e69 --- /dev/null +++ b/src/Aspose/BarCode/Model/Pdf417CompactionMode.php @@ -0,0 +1,67 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; +use Aspose\BarCode\ObjectSerializer; + +/* + * Pdf417CompactionMode + * + * @description + */ +class Pdf417CompactionMode +{ + + /// + /// Enum value Auto + /// + const Auto = "Auto"; + + /// + /// Enum value Text + /// + const Text = "Text"; + + /// + /// Enum value Numeric + /// + const Numeric = "Numeric"; + + /// + /// Enum value Binary + /// + const Binary = "Binary"; + +} + diff --git a/src/Aspose/BarCode/Model/ManualHints.php b/src/Aspose/BarCode/Model/Pdf417ErrorLevel.php similarity index 67% rename from src/Aspose/BarCode/Model/ManualHints.php rename to src/Aspose/BarCode/Model/Pdf417ErrorLevel.php index 0c242e0..44c8d2c 100644 --- a/src/Aspose/BarCode/Model/ManualHints.php +++ b/src/Aspose/BarCode/Model/Pdf417ErrorLevel.php @@ -1,7 +1,7 @@ - + * * Copyright (c) 2018 Aspose Pty Ltd * * @@ -11,10 +11,10 @@ * 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 @@ -28,62 +28,65 @@ /* * */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// -namespace Aspose\BarCode; +namespace Aspose\BarCode\Model; use Aspose\BarCode\ObjectSerializer; /* - * ManualHints + * Pdf417ErrorLevel * - * @description Represents the usage of manual hints. + * @description */ -class ManualHints +class Pdf417ErrorLevel { /// - /// Enum value None + /// Enum value Level0 /// - const None_ = "None"; + const Level0 = "Level0"; /// - /// Enum value InvertImage + /// Enum value Level1 /// - const InvertImage_ = "InvertImage"; + const Level1 = "Level1"; /// - /// Enum value IncorrectBarCodes + /// Enum value Level2 /// - const IncorrectBarCodes_ = "IncorrectBarCodes"; + const Level2 = "Level2"; /// - /// Enum value ComplexBackground + /// Enum value Level3 /// - const ComplexBackground_ = "ComplexBackground"; + const Level3 = "Level3"; /// - /// Enum value MedianSmoothing + /// Enum value Level4 /// - const MedianSmoothing_ = "MedianSmoothing"; + const Level4 = "Level4"; /// - /// Enum value SpecialFormOfCells + /// Enum value Level5 /// - const SpecialFormOfCells_ = "SpecialFormOfCells"; + const Level5 = "Level5"; /// - /// Enum value UseRegular + /// Enum value Level6 /// - const UseRegular_ = "UseRegular"; + const Level6 = "Level6"; /// - /// Enum value UseRestoration + /// Enum value Level7 /// - const UseRestoration_ = "UseRestoration"; + const Level7 = "Level7"; /// - /// Enum value SkipRotatedBarCodes + /// Enum value Level8 /// - const SkipRotatedBarCodes_ = "SkipRotatedBarCodes"; + const Level8 = "Level8"; } diff --git a/src/Aspose/BarCode/Model/Pdf417Params.php b/src/Aspose/BarCode/Model/Pdf417Params.php new file mode 100644 index 0000000..cfe713a --- /dev/null +++ b/src/Aspose/BarCode/Model/Pdf417Params.php @@ -0,0 +1,574 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * Pdf417Params + * + * @description PDF417 parameters. + */ +class Pdf417Params implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "Pdf417Params"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'aspect_ratio' => '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' + ]; + + /* + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $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 + ]; + + /* + * 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' + ]; + + /* + * 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' + ]; + + /* + * 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' + ]; + + /* + * 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; + } + + /* + * 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 Encoding of codetext. + * + * @return $this + */ + public function setTextEncoding($text_encoding) + { + $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; + } + /* + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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 new file mode 100644 index 0000000..e8a2345 --- /dev/null +++ b/src/Aspose/BarCode/Model/PostalParams.php @@ -0,0 +1,304 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * PostalParams + * + * @description Postal parameters. Used for Postnet, Planet. + */ +class PostalParams implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "PostalParams"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'short_bar_height' => 'double' + ]; + + /* + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $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) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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 new file mode 100644 index 0000000..cbdd158 --- /dev/null +++ b/src/Aspose/BarCode/Model/PresetType.php @@ -0,0 +1,77 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; +use Aspose\BarCode\ObjectSerializer; + +/* + * PresetType + * + * @description See QualitySettings allows to configure recognition quality and speed manually. + */ +class PresetType +{ + + /// + /// Enum value HighPerformance + /// + const HighPerformance = "HighPerformance"; + + /// + /// Enum value NormalQuality + /// + const NormalQuality = "NormalQuality"; + + /// + /// Enum value HighQualityDetection + /// + const HighQualityDetection = "HighQualityDetection"; + + /// + /// Enum value MaxQualityDetection + /// + const MaxQualityDetection = "MaxQualityDetection"; + + /// + /// Enum value HighQuality + /// + const HighQuality = "HighQuality"; + + /// + /// Enum value MaxBarCodes + /// + const MaxBarCodes = "MaxBarCodes"; + +} + diff --git a/src/Aspose/BarCode/Model/QREncodeMode.php b/src/Aspose/BarCode/Model/QREncodeMode.php new file mode 100644 index 0000000..4bbfe36 --- /dev/null +++ b/src/Aspose/BarCode/Model/QREncodeMode.php @@ -0,0 +1,77 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; +use Aspose\BarCode\ObjectSerializer; + +/* + * QREncodeMode + * + * @description + */ +class QREncodeMode +{ + + /// + /// Enum value Auto + /// + const Auto = "Auto"; + + /// + /// Enum value Bytes + /// + const Bytes = "Bytes"; + + /// + /// Enum value Utf8BOM + /// + const Utf8BOM = "Utf8BOM"; + + /// + /// Enum value Utf16BEBOM + /// + const Utf16BEBOM = "Utf16BEBOM"; + + /// + /// Enum value ECIEncoding + /// + const ECIEncoding = "ECIEncoding"; + + /// + /// Enum value ExtendedCodetext + /// + const ExtendedCodetext = "ExtendedCodetext"; + +} + diff --git a/src/Aspose/BarCode/Model/QREncodeType.php b/src/Aspose/BarCode/Model/QREncodeType.php new file mode 100644 index 0000000..34844b7 --- /dev/null +++ b/src/Aspose/BarCode/Model/QREncodeType.php @@ -0,0 +1,62 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; +use Aspose\BarCode\ObjectSerializer; + +/* + * QREncodeType + * + * @description + */ +class QREncodeType +{ + + /// + /// Enum value Auto + /// + const Auto = "Auto"; + + /// + /// Enum value ForceQR + /// + const ForceQR = "ForceQR"; + + /// + /// Enum value ForceMicroQR + /// + const ForceMicroQR = "ForceMicroQR"; + +} + diff --git a/src/Aspose/BarCode/Model/QRErrorLevel.php b/src/Aspose/BarCode/Model/QRErrorLevel.php new file mode 100644 index 0000000..78a3584 --- /dev/null +++ b/src/Aspose/BarCode/Model/QRErrorLevel.php @@ -0,0 +1,67 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; +use Aspose\BarCode\ObjectSerializer; + +/* + * QRErrorLevel + * + * @description + */ +class QRErrorLevel +{ + + /// + /// Enum value LevelL + /// + const LevelL = "LevelL"; + + /// + /// Enum value LevelM + /// + const LevelM = "LevelM"; + + /// + /// Enum value LevelQ + /// + const LevelQ = "LevelQ"; + + /// + /// Enum value LevelH + /// + const LevelH = "LevelH"; + +} + diff --git a/src/Aspose/BarCode/Model/QRVersion.php b/src/Aspose/BarCode/Model/QRVersion.php new file mode 100644 index 0000000..1f5ced8 --- /dev/null +++ b/src/Aspose/BarCode/Model/QRVersion.php @@ -0,0 +1,272 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; +use Aspose\BarCode\ObjectSerializer; + +/* + * QRVersion + * + * @description + */ +class QRVersion +{ + + /// + /// Enum value Auto + /// + const Auto = "Auto"; + + /// + /// Enum value Version01 + /// + const Version01 = "Version01"; + + /// + /// Enum value Version02 + /// + const Version02 = "Version02"; + + /// + /// Enum value Version03 + /// + const Version03 = "Version03"; + + /// + /// Enum value Version04 + /// + const Version04 = "Version04"; + + /// + /// Enum value Version05 + /// + const Version05 = "Version05"; + + /// + /// Enum value Version06 + /// + const Version06 = "Version06"; + + /// + /// Enum value Version07 + /// + const Version07 = "Version07"; + + /// + /// Enum value Version08 + /// + const Version08 = "Version08"; + + /// + /// Enum value Version09 + /// + const Version09 = "Version09"; + + /// + /// Enum value Version10 + /// + const Version10 = "Version10"; + + /// + /// Enum value Version11 + /// + const Version11 = "Version11"; + + /// + /// Enum value Version12 + /// + const Version12 = "Version12"; + + /// + /// Enum value Version13 + /// + const Version13 = "Version13"; + + /// + /// Enum value Version14 + /// + const Version14 = "Version14"; + + /// + /// Enum value Version15 + /// + const Version15 = "Version15"; + + /// + /// Enum value Version16 + /// + const Version16 = "Version16"; + + /// + /// Enum value Version17 + /// + const Version17 = "Version17"; + + /// + /// Enum value Version18 + /// + const Version18 = "Version18"; + + /// + /// Enum value Version19 + /// + const Version19 = "Version19"; + + /// + /// Enum value Version20 + /// + const Version20 = "Version20"; + + /// + /// Enum value Version21 + /// + const Version21 = "Version21"; + + /// + /// Enum value Version22 + /// + const Version22 = "Version22"; + + /// + /// Enum value Version23 + /// + const Version23 = "Version23"; + + /// + /// Enum value Version24 + /// + const Version24 = "Version24"; + + /// + /// Enum value Version25 + /// + const Version25 = "Version25"; + + /// + /// Enum value Version26 + /// + const Version26 = "Version26"; + + /// + /// Enum value Version27 + /// + const Version27 = "Version27"; + + /// + /// Enum value Version28 + /// + const Version28 = "Version28"; + + /// + /// Enum value Version29 + /// + const Version29 = "Version29"; + + /// + /// Enum value Version30 + /// + const Version30 = "Version30"; + + /// + /// Enum value Version31 + /// + const Version31 = "Version31"; + + /// + /// Enum value Version32 + /// + const Version32 = "Version32"; + + /// + /// Enum value Version33 + /// + const Version33 = "Version33"; + + /// + /// Enum value Version34 + /// + const Version34 = "Version34"; + + /// + /// Enum value Version35 + /// + const Version35 = "Version35"; + + /// + /// Enum value Version36 + /// + const Version36 = "Version36"; + + /// + /// Enum value Version37 + /// + const Version37 = "Version37"; + + /// + /// Enum value Version38 + /// + const Version38 = "Version38"; + + /// + /// Enum value Version39 + /// + const Version39 = "Version39"; + + /// + /// Enum value Version40 + /// + const Version40 = "Version40"; + + /// + /// Enum value VersionM1 + /// + const VersionM1 = "VersionM1"; + + /// + /// Enum value VersionM2 + /// + const VersionM2 = "VersionM2"; + + /// + /// Enum value VersionM3 + /// + const VersionM3 = "VersionM3"; + + /// + /// Enum value VersionM4 + /// + const VersionM4 = "VersionM4"; + +} + diff --git a/src/Aspose/BarCode/Model/QrParams.php b/src/Aspose/BarCode/Model/QrParams.php new file mode 100644 index 0000000..a84356b --- /dev/null +++ b/src/Aspose/BarCode/Model/QrParams.php @@ -0,0 +1,484 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * QrParams + * + * @description QR parameters. + */ +class QrParams implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "QrParams"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'aspect_ratio' => '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' + ]; + + /* + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'aspect_ratio' => 'double', + 'text_encoding' => null, + 'encode_type' => null, + 'eci_encoding' => null, + 'encode_mode' => null, + 'error_level' => 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', + 'encode_type' => 'EncodeType', + 'eci_encoding' => 'ECIEncoding', + 'encode_mode' => 'EncodeMode', + 'error_level' => 'ErrorLevel', + 'version' => 'Version' + ]; + + /* + * 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' + ]; + + /* + * 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' + ]; + + /* + * 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; + } + + /* + * 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 Encoding of codetext. + * + * @return $this + */ + public function setTextEncoding($text_encoding) + { + $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; + } + /* + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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 new file mode 100644 index 0000000..9f08015 --- /dev/null +++ b/src/Aspose/BarCode/Model/ReaderParams.php @@ -0,0 +1,1174 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * ReaderParams + * + * @description Represents BarcodeReader object. + */ +class ReaderParams implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "ReaderParams"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'type' => '\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', + 'region_likelihood_threshold_percent' => 'double', + 'scan_window_sizes' => 'int[]', + 'similarity' => 'double', + 'skip_diagonal_search' => 'bool', + 'australian_post_encoding_table' => '\Aspose\BarCode\Model\CustomerInformationInterpretingType' + ]; + + /* + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'type' => 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, + 'region_likelihood_threshold_percent' => 'double', + 'scan_window_sizes' => 'int32', + 'similarity' => 'double', + 'skip_diagonal_search' => null, + 'australian_post_encoding_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', + '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', + 'region_likelihood_threshold_percent' => 'RegionLikelihoodThresholdPercent', + 'scan_window_sizes' => 'ScanWindowSizes', + 'similarity' => 'Similarity', + 'skip_diagonal_search' => 'SkipDiagonalSearch', + 'australian_post_encoding_table' => 'AustralianPostEncodingTable' + ]; + + /* + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + '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', + 'region_likelihood_threshold_percent' => 'setRegionLikelihoodThresholdPercent', + 'scan_window_sizes' => 'setScanWindowSizes', + 'similarity' => 'setSimilarity', + 'skip_diagonal_search' => 'setSkipDiagonalSearch', + 'australian_post_encoding_table' => 'setAustralianPostEncodingTable' + ]; + + /* + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + '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', + 'region_likelihood_threshold_percent' => 'getRegionLikelihoodThresholdPercent', + 'scan_window_sizes' => 'getScanWindowSizes', + 'similarity' => 'getSimilarity', + 'skip_diagonal_search' => 'getSkipDiagonalSearch', + 'australian_post_encoding_table' => 'getAustralianPostEncodingTable' + ]; + + /* + * 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['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['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['australian_post_encoding_table'] = isset($data['australian_post_encoding_table']) ? $data['australian_post_encoding_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 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 for 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 for 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. + * + * @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 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 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 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; + } + /* + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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/Point.php b/src/Aspose/BarCode/Model/RegionPoint.php similarity index 84% rename from src/Aspose/BarCode/Model/Point.php rename to src/Aspose/BarCode/Model/RegionPoint.php index c20b951..e48e0b7 100644 --- a/src/Aspose/BarCode/Model/Point.php +++ b/src/Aspose/BarCode/Model/RegionPoint.php @@ -1,7 +1,7 @@ - + * * Copyright (c) 2018 Aspose Pty Ltd * * @@ -11,10 +11,10 @@ * 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 @@ -28,15 +28,21 @@ /* * */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// -namespace Aspose\BarCode; +namespace Aspose\BarCode\Model; + +use \ArrayAccess; use Aspose\BarCode\ObjectSerializer; /* - * Point + * RegionPoint * + * @description Wrapper around Drawing.Point for proper specification. */ -class Point extends ValueType +class RegionPoint implements ArrayAccess { const DISCRIMINATOR = null; @@ -45,7 +51,7 @@ class Point extends ValueType * * @var string */ - protected static $swaggerModelName = "Point"; + protected static $swaggerModelName = "RegionPoint"; /* * Array of property to type mappings. Used for (de)serialization @@ -53,7 +59,6 @@ class Point extends ValueType * @var string[] */ protected static $swaggerTypes = [ - 'is_empty' => 'bool', 'x' => 'int', 'y' => 'int' ]; @@ -64,7 +69,6 @@ class Point extends ValueType * @var string[] */ protected static $swaggerFormats = [ - 'is_empty' => null, 'x' => 'int32', 'y' => 'int32' ]; @@ -76,7 +80,7 @@ class Point extends ValueType */ public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); + return self::$swaggerTypes; } /* @@ -86,7 +90,7 @@ public static function swaggerTypes() */ public static function swaggerFormats() { - return self::$swaggerFormats + parent::swaggerFormats(); + return self::$swaggerFormats; } /* @@ -96,7 +100,6 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'is_empty' => 'IsEmpty', 'x' => 'X', 'y' => 'Y' ]; @@ -107,7 +110,6 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'is_empty' => 'setIsEmpty', 'x' => 'setX', 'y' => 'setY' ]; @@ -118,7 +120,6 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'is_empty' => 'getIsEmpty', 'x' => 'getX', 'y' => 'getY' ]; @@ -131,7 +132,7 @@ public static function swaggerFormats() */ public static function attributeMap() { - return parent::attributeMap() + self::$attributeMap; + return self::$attributeMap; } /* @@ -141,7 +142,7 @@ public static function attributeMap() */ public static function setters() { - return parent::setters() + self::$setters; + return self::$setters; } /* @@ -151,7 +152,7 @@ public static function setters() */ public static function getters() { - return parent::getters() + self::$getters; + return self::$getters; } /* @@ -168,6 +169,12 @@ public function getModelName() + /* + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; /* * Constructor @@ -177,9 +184,6 @@ public function getModelName() */ public function __construct(array $data = null) { - parent::__construct($data); - - $this->container['is_empty'] = isset($data['is_empty']) ? $data['is_empty'] : null; $this->container['x'] = isset($data['x']) ? $data['x'] : null; $this->container['y'] = isset($data['y']) ? $data['y'] : null; } @@ -191,8 +195,14 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalidProperties = parent::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; } @@ -204,38 +214,17 @@ public function listInvalidProperties() */ public function valid() { - if (!parent::valid()) { + + if ($this->container['x'] === null) { + return false; + } + if ($this->container['y'] === null) { return false; } - return true; } - /* - * Gets is_empty - * - * @return bool - */ - public function getIsEmpty() - { - return $this->container['is_empty']; - } - - /* - * Sets is_empty - * - * @param bool $is_empty is_empty - * - * @return $this - */ - public function setIsEmpty($is_empty) - { - $this->container['is_empty'] = $is_empty; - - return $this; - } - /* * Gets x * @@ -249,7 +238,7 @@ public function getX() /* * Sets x * - * @param int $x x + * @param int $x X-coordinate * * @return $this */ @@ -273,7 +262,7 @@ public function getY() /* * Sets y * - * @param int $y y + * @param int $y Y-coordinate * * @return $this */ diff --git a/src/Aspose/BarCode/Model/ResultImageInfo.php b/src/Aspose/BarCode/Model/ResultImageInfo.php new file mode 100644 index 0000000..c87bdc7 --- /dev/null +++ b/src/Aspose/BarCode/Model/ResultImageInfo.php @@ -0,0 +1,370 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * ResultImageInfo + * + * @description Created image info. + */ +class ResultImageInfo implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "ResultImageInfo"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'file_size' => 'int', + 'image_width' => 'int', + 'image_height' => 'int' + ]; + + /* + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $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) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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/StorageExist.php b/src/Aspose/BarCode/Model/StorageExist.php new file mode 100644 index 0000000..1ce7b26 --- /dev/null +++ b/src/Aspose/BarCode/Model/StorageExist.php @@ -0,0 +1,310 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * StorageExist + * + * @description Storage exists + */ +class StorageExist implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "StorageExist"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'exists' => 'bool' + ]; + + /* + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $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) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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/StorageFile.php b/src/Aspose/BarCode/Model/StorageFile.php new file mode 100644 index 0000000..8881d93 --- /dev/null +++ b/src/Aspose/BarCode/Model/StorageFile.php @@ -0,0 +1,436 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; + +use \ArrayAccess; +use Aspose\BarCode\ObjectSerializer; + +/* + * StorageFile + * + * @description File or folder information + */ +class StorageFile implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /* + * The original name of the model. + * + * @var string + */ + protected static $swaggerModelName = "StorageFile"; + + /* + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerTypes = [ + 'name' => 'string', + 'is_folder' => 'bool', + 'modified_date' => '\DateTime', + 'size' => 'int', + 'path' => 'string' + ]; + + /* + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'is_folder' => null, + 'modified_date' => 'date-time', + 'size' => 'int64', + 'path' => 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' + ]; + + /* + * 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' + ]; + + /* + * 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' + ]; + + /* + * 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; + } + + /* + * 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"; + } + 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; + } + 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; + } + /* + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /* + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /* + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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 new file mode 100644 index 0000000..2c2bbbf --- /dev/null +++ b/src/Aspose/BarCode/Model/TextAlignment.php @@ -0,0 +1,62 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +/* + * + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +namespace Aspose\BarCode\Model; +use Aspose\BarCode\ObjectSerializer; + +/* + * TextAlignment + * + * @description + */ +class TextAlignment +{ + + /// + /// Enum value Left + /// + const Left = "Left"; + + /// + /// Enum value Center + /// + const Center = "Center"; + + /// + /// Enum value Right + /// + const Right = "Right"; + +} + diff --git a/src/Aspose/BarCode/ObjectSerializer.php b/src/Aspose/BarCode/ObjectSerializer.php index 6135198..3768e54 100644 --- a/src/Aspose/BarCode/ObjectSerializer.php +++ b/src/Aspose/BarCode/ObjectSerializer.php @@ -1,4 +1,4 @@ - @@ -11,10 +11,10 @@ * 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 @@ -25,6 +25,9 @@ * * -------------------------------------------------------------------------------------------------------------------- */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// namespace Aspose\BarCode; /* @@ -168,12 +171,19 @@ public static function toFormValue($value) */ public static function toString($value) { - if (date(\DATE_ATOM, preg_match("/^[1-9][0-9]*$/", $value)[0]) instanceof \DateTime) { // datetime in ISO8601 format - $datetime = preg_match("/^[1-9][0-9]*$/", $value)[0]; - return date(\DATE_ATOM, $datetime); - } else { + $maybeDateStr = preg_match("/^[1-9][0-9]*$/", $value)[0]; + + if (!isset($maybeDateStr)) { return $value; } + + $maybeDateTime = date(\DATE_ATOM, $maybeDateStr); + + if ($maybeDateTime instanceof \DateTime) { // datetime in ISO8601 format + return $maybeDateTime; + } + + return $value; } /* @@ -257,7 +267,7 @@ public static function deserialize($data, $class, $httpHeaders = null) settype($data, $class); return $data; } elseif ($class === '\SplFileObject') { - // \Psr\Http\Message\StreamInterface $data + // \Psr\Http\Message\StreamInterface $data // determine file name if (array_key_exists('Content-Disposition', $httpHeaders) @@ -285,7 +295,7 @@ public static function deserialize($data, $class, $httpHeaders = null) // 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})) { - $subclass = '\Swagger\Client\Model\\' . $data->{$discriminator}; + $subclass = '\Aspose\BarCode\Model\\' . $data->{$discriminator}; if (is_subclass_of($subclass, $class)) { $class = $subclass; } @@ -294,11 +304,12 @@ public static function deserialize($data, $class, $httpHeaders = null) foreach ($instance::swaggerTypes() as $property => $type) { $propertySetter = $instance::setters()[$property]; - if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { + $key = lcfirst($instance::attributeMap()[$property]); + if (!isset($propertySetter) || !isset($data->{$key})) { continue; } - $propertyValue = $data->{$instance::attributeMap()[$property]}; + $propertyValue = $data->{$key}; if (isset($propertyValue)) { $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); } diff --git a/src/Aspose/BarCode/RepeatRequestException.php b/src/Aspose/BarCode/RepeatRequestException.php new file mode 100644 index 0000000..3bd0d1a --- /dev/null +++ b/src/Aspose/BarCode/RepeatRequestException.php @@ -0,0 +1,10 @@ + - * Copyright (c) 2018 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\Requests; - -/* - * Request model for "barCodeGetBarCodeGenerate" operation. - */ -class BarCodeGetBarCodeGenerateRequest -{ - /* - * Initializes a new instance of the BarCodeGetBarCodeGenerateRequest class. - * - * @param string $text The code text. - * @param string $type BarCode type. - * @param string $format Result format. - * @param double $resolution_x Horizontal resolution. - * @param double $resolution_y Vertical resolution. - * @param double $dimension_x Smallest width of barcode unit (bar or space). - * @param double $dimension_y Smallest height of barcode unit (for 2D barcodes). - * @param string $enable_checksum Sets if checksum will be generated. - */ - public function __construct($text = null, $type = null, $format = null, $resolution_x = null, $resolution_y = null, $dimension_x = null, $dimension_y = null, $enable_checksum = null) - { - $this->text = $text; - $this->type = $type; - $this->format = $format; - $this->resolution_x = $resolution_x; - $this->resolution_y = $resolution_y; - $this->dimension_x = $dimension_x; - $this->dimension_y = $dimension_y; - $this->enable_checksum = $enable_checksum; - } - - /* - * The code text. - */ - public $text; - - /* - * BarCode type. - */ - public $type; - - /* - * Result format. - */ - public $format; - - /* - * Horizontal resolution. - */ - public $resolution_x; - - /* - * Vertical resolution. - */ - public $resolution_y; - - /* - * Smallest width of barcode unit (bar or space). - */ - public $dimension_x; - - /* - * Smallest height of barcode unit (for 2D barcodes). - */ - public $dimension_y; - - /* - * Sets if checksum will be generated. - */ - public $enable_checksum; -} \ No newline at end of file diff --git a/src/Aspose/BarCode/Requests/BarCodeGetBarCodeRecognizeRequest.php b/src/Aspose/BarCode/Requests/BarCodeGetBarCodeRecognizeRequest.php deleted file mode 100644 index 97fcad6..0000000 --- a/src/Aspose/BarCode/Requests/BarCodeGetBarCodeRecognizeRequest.php +++ /dev/null @@ -1,127 +0,0 @@ - - * Copyright (c) 2018 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\Requests; - -/* - * Request model for "barCodeGetBarCodeRecognize" operation. - */ -class BarCodeGetBarCodeRecognizeRequest -{ - /* - * Initializes a new instance of the BarCodeGetBarCodeRecognizeRequest class. - * - * @param string $name The image name. - * @param string $type The barcode type. - * @param string $checksum_validation Checksum validation parameter. - * @param bool $strip_fnc Allows to strip FNC symbol in recognition results. - * @param int $rotation_angle Allows to correct angle of barcode. - * @param int $barcodes_count Count of barcodes to recognize. - * @param int $rect_x Top left point X coordinate of to recognize barcode inside. - * @param int $rect_y Top left point Y coordinate of to recognize barcode inside. - * @param int $rect_width Width of to recognize barcode inside. - * @param int $rect_height Height of to recognize barcode inside. - * @param string $storage The image storage. - * @param string $folder The image folder. - */ - public function __construct($name, $type = null, $checksum_validation = null, $strip_fnc = null, $rotation_angle = null, $barcodes_count = null, $rect_x = null, $rect_y = null, $rect_width = null, $rect_height = null, $storage = null, $folder = null) - { - $this->name = $name; - $this->type = $type; - $this->checksum_validation = $checksum_validation; - $this->strip_fnc = $strip_fnc; - $this->rotation_angle = $rotation_angle; - $this->barcodes_count = $barcodes_count; - $this->rect_x = $rect_x; - $this->rect_y = $rect_y; - $this->rect_width = $rect_width; - $this->rect_height = $rect_height; - $this->storage = $storage; - $this->folder = $folder; - } - - /* - * The image name. - */ - public $name; - - /* - * The barcode type. - */ - public $type; - - /* - * Checksum validation parameter. - */ - public $checksum_validation; - - /* - * Allows to strip FNC symbol in recognition results. - */ - public $strip_fnc; - - /* - * Allows to correct angle of barcode. - */ - public $rotation_angle; - - /* - * Count of barcodes to recognize. - */ - public $barcodes_count; - - /* - * Top left point X coordinate of to recognize barcode inside. - */ - public $rect_x; - - /* - * Top left point Y coordinate of to recognize barcode inside. - */ - public $rect_y; - - /* - * Width of to recognize barcode inside. - */ - public $rect_width; - - /* - * Height of to recognize barcode inside. - */ - public $rect_height; - - /* - * The image storage. - */ - public $storage; - - /* - * The image folder. - */ - public $folder; -} \ No newline at end of file diff --git a/src/Aspose/BarCode/Requests/BarCodePostBarCodeRecognizeFromUrlorContentRequest.php b/src/Aspose/BarCode/Requests/BarCodePostBarCodeRecognizeFromUrlorContentRequest.php deleted file mode 100644 index 3c2d1df..0000000 --- a/src/Aspose/BarCode/Requests/BarCodePostBarCodeRecognizeFromUrlorContentRequest.php +++ /dev/null @@ -1,85 +0,0 @@ - - * Copyright (c) 2018 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\Requests; - -/* - * Request model for "barCodePostBarCodeRecognizeFromUrlorContent" operation. - */ -class BarCodePostBarCodeRecognizeFromUrlorContentRequest -{ - /* - * Initializes a new instance of the BarCodePostBarCodeRecognizeFromUrlorContentRequest class. - * - * @param string $type BarCode type. - * @param string $checksum_validation Checksum validation parameter. - * @param bool $strip_fnc Allows to strip FNC symbol in recognition results. - * @param int $rotation_angle Recognition of rotated barcode. Possible angles are 90, 180, 270, default is 0 - * @param string $url The image file url. - * @param \SplFileObject $image_data Image data with image - */ - public function __construct($type = null, $checksum_validation = null, $strip_fnc = null, $rotation_angle = null, $url = null, $image_data = null) - { - $this->type = $type; - $this->checksum_validation = $checksum_validation; - $this->strip_fnc = $strip_fnc; - $this->rotation_angle = $rotation_angle; - $this->url = $url; - $this->image_data = $image_data; - } - - /* - * BarCode type. - */ - public $type; - - /* - * Checksum validation parameter. - */ - public $checksum_validation; - - /* - * Allows to strip FNC symbol in recognition results. - */ - public $strip_fnc; - - /* - * Recognition of rotated barcode. Possible angles are 90, 180, 270, default is 0 - */ - public $rotation_angle; - - /* - * The image file url. - */ - public $url; - - /* - * Image data with image - */ - public $image_data; -} \ No newline at end of file diff --git a/src/Aspose/BarCode/Requests/BarCodePutBarCodeGenerateFileRequest.php b/src/Aspose/BarCode/Requests/BarCodePutBarCodeGenerateFileRequest.php deleted file mode 100644 index 8c13657..0000000 --- a/src/Aspose/BarCode/Requests/BarCodePutBarCodeGenerateFileRequest.php +++ /dev/null @@ -1,211 +0,0 @@ - - * Copyright (c) 2018 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\Requests; - -/* - * Request model for "barCodePutBarCodeGenerateFile" operation. - */ -class BarCodePutBarCodeGenerateFileRequest -{ - /* - * Initializes a new instance of the BarCodePutBarCodeGenerateFileRequest class. - * - * @param string $name The image name. - * @param \SplFileObject $file File to upload - * @param string $text BarCode's text. - * @param string $type The barcode type. - * @param string $format The image format. - * @param double $resolution_x Horizontal resolution. - * @param double $resolution_y Vertical resolution. - * @param double $dimension_x Smallest width of barcode unit (bar or space). - * @param double $dimension_y Smallest height of barcode unit (for 2D barcodes). - * @param string $code_location property of the barcode. - * @param string $gr_unit Measurement of barcode properties. - * @param string $auto_size Sets if barcode size will be updated automatically. - * @param double $bar_height Height of the bar. - * @param double $image_height Height of the image. - * @param double $image_width Width of the image. - * @param string $image_quality Detepmines of the barcode image. - * @param double $rot_angle Angle of barcode orientation. - * @param double $top_margin Top margin. - * @param double $bottom_margin Bottom margin. - * @param double $left_margin Left margin. - * @param double $right_margin Right margin. - * @param string $enable_checksum Sets if checksum will be generated. - * @param string $storage Image's storage. - * @param string $folder Image's folder. - */ - public function __construct($name, $file, $text = null, $type = null, $format = null, $resolution_x = null, $resolution_y = null, $dimension_x = null, $dimension_y = null, $code_location = null, $gr_unit = null, $auto_size = null, $bar_height = null, $image_height = null, $image_width = null, $image_quality = null, $rot_angle = null, $top_margin = null, $bottom_margin = null, $left_margin = null, $right_margin = null, $enable_checksum = null, $storage = null, $folder = null) - { - $this->name = $name; - $this->file = $file; - $this->text = $text; - $this->type = $type; - $this->format = $format; - $this->resolution_x = $resolution_x; - $this->resolution_y = $resolution_y; - $this->dimension_x = $dimension_x; - $this->dimension_y = $dimension_y; - $this->code_location = $code_location; - $this->gr_unit = $gr_unit; - $this->auto_size = $auto_size; - $this->bar_height = $bar_height; - $this->image_height = $image_height; - $this->image_width = $image_width; - $this->image_quality = $image_quality; - $this->rot_angle = $rot_angle; - $this->top_margin = $top_margin; - $this->bottom_margin = $bottom_margin; - $this->left_margin = $left_margin; - $this->right_margin = $right_margin; - $this->enable_checksum = $enable_checksum; - $this->storage = $storage; - $this->folder = $folder; - } - - /* - * The image name. - */ - public $name; - - /* - * File to upload - */ - public $file; - - /* - * BarCode's text. - */ - public $text; - - /* - * The barcode type. - */ - public $type; - - /* - * The image format. - */ - public $format; - - /* - * Horizontal resolution. - */ - public $resolution_x; - - /* - * Vertical resolution. - */ - public $resolution_y; - - /* - * Smallest width of barcode unit (bar or space). - */ - public $dimension_x; - - /* - * Smallest height of barcode unit (for 2D barcodes). - */ - public $dimension_y; - - /* - * property of the barcode. - */ - public $code_location; - - /* - * Measurement of barcode properties. - */ - public $gr_unit; - - /* - * Sets if barcode size will be updated automatically. - */ - public $auto_size; - - /* - * Height of the bar. - */ - public $bar_height; - - /* - * Height of the image. - */ - public $image_height; - - /* - * Width of the image. - */ - public $image_width; - - /* - * Detepmines of the barcode image. - */ - public $image_quality; - - /* - * Angle of barcode orientation. - */ - public $rot_angle; - - /* - * Top margin. - */ - public $top_margin; - - /* - * Bottom margin. - */ - public $bottom_margin; - - /* - * Left margin. - */ - public $left_margin; - - /* - * Right margin. - */ - public $right_margin; - - /* - * Sets if checksum will be generated. - */ - public $enable_checksum; - - /* - * Image's storage. - */ - public $storage; - - /* - * Image's folder. - */ - public $folder; -} \ No newline at end of file diff --git a/src/Aspose/BarCode/Requests/CopyFileRequest.php b/src/Aspose/BarCode/Requests/CopyFileRequest.php new file mode 100644 index 0000000..4088e4e --- /dev/null +++ b/src/Aspose/BarCode/Requests/CopyFileRequest.php @@ -0,0 +1,84 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +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; +} \ No newline at end of file diff --git a/src/Aspose/BarCode/Requests/CopyFolderRequest.php b/src/Aspose/BarCode/Requests/CopyFolderRequest.php new file mode 100644 index 0000000..4371b8b --- /dev/null +++ b/src/Aspose/BarCode/Requests/CopyFolderRequest.php @@ -0,0 +1,77 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +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; +} \ No newline at end of file diff --git a/src/Aspose/BarCode/Requests/CreateFolderRequest.php b/src/Aspose/BarCode/Requests/CreateFolderRequest.php new file mode 100644 index 0000000..1c04e37 --- /dev/null +++ b/src/Aspose/BarCode/Requests/CreateFolderRequest.php @@ -0,0 +1,63 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +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; +} \ No newline at end of file diff --git a/src/Aspose/BarCode/Requests/DeleteFileRequest.php b/src/Aspose/BarCode/Requests/DeleteFileRequest.php new file mode 100644 index 0000000..6b6cc2b --- /dev/null +++ b/src/Aspose/BarCode/Requests/DeleteFileRequest.php @@ -0,0 +1,70 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +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; +} \ No newline at end of file diff --git a/src/Aspose/BarCode/Requests/DeleteFolderRequest.php b/src/Aspose/BarCode/Requests/DeleteFolderRequest.php new file mode 100644 index 0000000..3761436 --- /dev/null +++ b/src/Aspose/BarCode/Requests/DeleteFolderRequest.php @@ -0,0 +1,70 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +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; +} \ No newline at end of file diff --git a/src/Aspose/BarCode/Requests/DownloadFileRequest.php b/src/Aspose/BarCode/Requests/DownloadFileRequest.php new file mode 100644 index 0000000..8cfd044 --- /dev/null +++ b/src/Aspose/BarCode/Requests/DownloadFileRequest.php @@ -0,0 +1,70 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +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; +} \ No newline at end of file diff --git a/src/Aspose/BarCode/Requests/GetBarcodeGenerateRequest.php b/src/Aspose/BarCode/Requests/GetBarcodeGenerateRequest.php new file mode 100644 index 0000000..2c7020c --- /dev/null +++ b/src/Aspose/BarCode/Requests/GetBarcodeGenerateRequest.php @@ -0,0 +1,280 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +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: Color.Black. + * @param string $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. + * @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: Color.White. + * @param string $bar_color Bars color. Default value: Color.Black. + * @param string $border_color Border color. Default value: Color.Black. + * @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, SingapurePost, 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 string $format Result image format. + */ + public function __construct($type, $text, $two_d_display_text = null, $text_location = null, $text_alignment = null, $text_color = null, $font_size_mode = 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, $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->font_size_mode = $font_size_mode; + $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->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: Color.Black. + */ + public $text_color; + + /* + * 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. + */ + public $font_size_mode; + + /* + * 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: Color.White. + */ + public $back_color; + + /* + * Bars color. Default value: Color.Black. + */ + public $bar_color; + + /* + * Border color. Default value: Color.Black. + */ + 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, SingapurePost, 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; + + /* + * Result image format. + */ + public $format; +} \ No newline at end of file diff --git a/src/Aspose/BarCode/Requests/GetBarcodeRecognizeRequest.php b/src/Aspose/BarCode/Requests/GetBarcodeRecognizeRequest.php new file mode 100644 index 0000000..5e5f6d8 --- /dev/null +++ b/src/Aspose/BarCode/Requests/GetBarcodeRecognizeRequest.php @@ -0,0 +1,287 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +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 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 for area for recognition. + * @param int $rect_y Set Y for 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. + * @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 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 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 string $australian_post_encoding_table Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. + * @param string $rectangle_region + * @param string $storage The image storage. + * @param string $folder The image folder. + */ + public function __construct($name, $type = 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, $region_likelihood_threshold_percent = null, $scan_window_sizes = null, $similarity = null, $skip_diagonal_search = null, $australian_post_encoding_table = null, $rectangle_region = null, $storage = null, $folder = null) + { + $this->name = $name; + $this->type = $type; + $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->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->australian_post_encoding_table = $australian_post_encoding_table; + $this->rectangle_region = $rectangle_region; + $this->storage = $storage; + $this->folder = $folder; + } + + /* + * The image file name. + */ + public $name; + + /* + * The type of barcode to read. + */ + public $type; + + /* + * 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 for area for recognition. + */ + public $rect_x; + + /* + * Set Y for 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. + */ + 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; + + /* + * 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 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; + + /* + * Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. + */ + public $australian_post_encoding_table; + + /* + * Gets or sets rectangle_region + */ + public $rectangle_region; + + /* + * The image storage. + */ + public $storage; + + /* + * The image folder. + */ + public $folder; +} \ No newline at end of file diff --git a/src/Aspose/BarCode/Requests/GetDiscUsageRequest.php b/src/Aspose/BarCode/Requests/GetDiscUsageRequest.php new file mode 100644 index 0000000..5550422 --- /dev/null +++ b/src/Aspose/BarCode/Requests/GetDiscUsageRequest.php @@ -0,0 +1,56 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +declare(strict_types=1); + +namespace Aspose\BarCode\Requests; + +/* + * Request model for "getDiscUsage" operation. + */ +class GetDiscUsageRequest +{ + /* + * Initializes a new instance of the GetDiscUsageRequest class. + * + * @param string $storage_name Storage name + */ + public function __construct($storage_name = null) + { + $this->storage_name = $storage_name; + } + + /* + * Storage name + */ + public $storage_name; +} \ No newline at end of file diff --git a/src/Aspose/BarCode/Requests/GetFileVersionsRequest.php b/src/Aspose/BarCode/Requests/GetFileVersionsRequest.php new file mode 100644 index 0000000..3fd82d8 --- /dev/null +++ b/src/Aspose/BarCode/Requests/GetFileVersionsRequest.php @@ -0,0 +1,63 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +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; +} \ No newline at end of file diff --git a/src/Aspose/BarCode/Requests/GetFilesListRequest.php b/src/Aspose/BarCode/Requests/GetFilesListRequest.php new file mode 100644 index 0000000..d2db370 --- /dev/null +++ b/src/Aspose/BarCode/Requests/GetFilesListRequest.php @@ -0,0 +1,63 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +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; +} \ No newline at end of file diff --git a/src/Aspose/BarCode/Requests/MoveFileRequest.php b/src/Aspose/BarCode/Requests/MoveFileRequest.php new file mode 100644 index 0000000..e202af7 --- /dev/null +++ b/src/Aspose/BarCode/Requests/MoveFileRequest.php @@ -0,0 +1,84 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +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; +} \ No newline at end of file diff --git a/src/Aspose/BarCode/Requests/MoveFolderRequest.php b/src/Aspose/BarCode/Requests/MoveFolderRequest.php new file mode 100644 index 0000000..f4b5c14 --- /dev/null +++ b/src/Aspose/BarCode/Requests/MoveFolderRequest.php @@ -0,0 +1,78 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +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 new file mode 100644 index 0000000..ad8033e --- /dev/null +++ b/src/Aspose/BarCode/Requests/ObjectExistsRequest.php @@ -0,0 +1,70 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +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; +} \ No newline at end of file diff --git a/src/Aspose/BarCode/Requests/PostBarcodeRecognizeFromUrlOrContentRequest.php b/src/Aspose/BarCode/Requests/PostBarcodeRecognizeFromUrlOrContentRequest.php new file mode 100644 index 0000000..c51e442 --- /dev/null +++ b/src/Aspose/BarCode/Requests/PostBarcodeRecognizeFromUrlOrContentRequest.php @@ -0,0 +1,280 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +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 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 for area for recognition. + * @param int $rect_y Set Y for 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. + * @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 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 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 string $australian_post_encoding_table Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. + * @param string $rectangle_region + * @param string $url The image file url. + * @param \SplFileObject $image Image data + */ + public function __construct($type = 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, $region_likelihood_threshold_percent = null, $scan_window_sizes = null, $similarity = null, $skip_diagonal_search = null, $australian_post_encoding_table = null, $rectangle_region = null, $url = null, $image = null) + { + $this->type = $type; + $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->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->australian_post_encoding_table = $australian_post_encoding_table; + $this->rectangle_region = $rectangle_region; + $this->url = $url; + $this->image = $image; + } + + /* + * The type of barcode to read. + */ + public $type; + + /* + * 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 for area for recognition. + */ + public $rect_x; + + /* + * Set Y for 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. + */ + 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; + + /* + * 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 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; + + /* + * Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. + */ + public $australian_post_encoding_table; + + /* + * Gets or sets rectangle_region + */ + public $rectangle_region; + + /* + * The image file url. + */ + public $url; + + /* + * Image data + */ + public $image; +} \ No newline at end of file diff --git a/src/Aspose/BarCode/Requests/BarCodePostGenerateMultipleRequest.php b/src/Aspose/BarCode/Requests/PostGenerateMultipleRequest.php similarity index 71% rename from src/Aspose/BarCode/Requests/BarCodePostGenerateMultipleRequest.php rename to src/Aspose/BarCode/Requests/PostGenerateMultipleRequest.php index a12e440..fb0007f 100644 --- a/src/Aspose/BarCode/Requests/BarCodePostGenerateMultipleRequest.php +++ b/src/Aspose/BarCode/Requests/PostGenerateMultipleRequest.php @@ -2,7 +2,7 @@ /* * -------------------------------------------------------------------------------------------------------------------- - * + * * Copyright (c) 2018 Aspose Pty Ltd * * @@ -12,10 +12,10 @@ * 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 @@ -26,30 +26,36 @@ * * -------------------------------------------------------------------------------------------------------------------- */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +declare(strict_types=1); + namespace Aspose\BarCode\Requests; /* - * Request model for "barCodePostGenerateMultiple" operation. + * Request model for "postGenerateMultiple" operation. */ -class BarCodePostGenerateMultipleRequest +class PostGenerateMultipleRequest { /* - * Initializes a new instance of the BarCodePostGenerateMultipleRequest class. - * - * @param \Swagger\Client\Model\BarCodeBuildersList $dto List of barcodes + * 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($dto = null, $format = null) + public function __construct($generator_params_list, $format = null) { - $this->dto = $dto; + $this->generator_params_list = $generator_params_list; $this->format = $format; } /* * List of barcodes */ - public $dto; - + public $generator_params_list; + /* * Format to return stream in */ diff --git a/src/Aspose/BarCode/Requests/PutBarcodeGenerateFileRequest.php b/src/Aspose/BarCode/Requests/PutBarcodeGenerateFileRequest.php new file mode 100644 index 0000000..64161f7 --- /dev/null +++ b/src/Aspose/BarCode/Requests/PutBarcodeGenerateFileRequest.php @@ -0,0 +1,301 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +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: Color.Black. + * @param string $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. + * @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: Color.White. + * @param string $bar_color Bars color. Default value: Color.Black. + * @param string $border_color Border color. Default value: Color.Black. + * @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, SingapurePost, 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 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, $font_size_mode = 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, $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->font_size_mode = $font_size_mode; + $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->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: Color.Black. + */ + public $text_color; + + /* + * 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. + */ + public $font_size_mode; + + /* + * 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: Color.White. + */ + public $back_color; + + /* + * Bars color. Default value: Color.Black. + */ + public $bar_color; + + /* + * Border color. Default value: Color.Black. + */ + 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, SingapurePost, 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; + + /* + * Image's storage. + */ + public $storage; + + /* + * Image's folder. + */ + public $folder; + + /* + * The image format. + */ + public $format; +} \ No newline at end of file diff --git a/src/Aspose/BarCode/Requests/BarCodePutBarCodeRecognizeFromBodyRequest.php b/src/Aspose/BarCode/Requests/PutBarcodeRecognizeFromBodyRequest.php similarity index 62% rename from src/Aspose/BarCode/Requests/BarCodePutBarCodeRecognizeFromBodyRequest.php rename to src/Aspose/BarCode/Requests/PutBarcodeRecognizeFromBodyRequest.php index 10e6a2d..2fd9d2e 100644 --- a/src/Aspose/BarCode/Requests/BarCodePutBarCodeRecognizeFromBodyRequest.php +++ b/src/Aspose/BarCode/Requests/PutBarcodeRecognizeFromBodyRequest.php @@ -2,7 +2,7 @@ /* * -------------------------------------------------------------------------------------------------------------------- - * + * * Copyright (c) 2018 Aspose Pty Ltd * * @@ -12,10 +12,10 @@ * 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 @@ -26,44 +26,57 @@ * * -------------------------------------------------------------------------------------------------------------------- */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +declare(strict_types=1); + namespace Aspose\BarCode\Requests; /* - * Request model for "barCodePutBarCodeRecognizeFromBody" operation. + * Request model for "putBarcodeRecognizeFromBody" operation. */ -class BarCodePutBarCodeRecognizeFromBodyRequest +class PutBarcodeRecognizeFromBodyRequest { /* - * Initializes a new instance of the BarCodePutBarCodeRecognizeFromBodyRequest class. - * - * @param string $name The image name. - * @param \Swagger\Client\Model\BarCodeReader $barcode_reader BarCodeReader object with parameters. - * @param string $type The barcode type. + * 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, $barcode_reader = null, $type = null, $folder = null) + public function __construct($name, $reader_params, $type = null, $storage = null, $folder = null) { $this->name = $name; - $this->barcode_reader = $barcode_reader; + $this->reader_params = $reader_params; $this->type = $type; + $this->storage = $storage; $this->folder = $folder; } /* - * The image name. + * The image file name. */ public $name; - + /* - * BarCodeReader object with parameters. + * BarcodeReader object with parameters. */ - public $barcode_reader; - + public $reader_params; + /* - * The barcode type. + * Gets or sets type */ public $type; - + + /* + * The storage name + */ + public $storage; + /* * The image folder. */ diff --git a/src/Aspose/BarCode/Requests/BarCodePutGenerateMultipleRequest.php b/src/Aspose/BarCode/Requests/PutGenerateMultipleRequest.php similarity index 70% rename from src/Aspose/BarCode/Requests/BarCodePutGenerateMultipleRequest.php rename to src/Aspose/BarCode/Requests/PutGenerateMultipleRequest.php index 4388df8..db0c82f 100644 --- a/src/Aspose/BarCode/Requests/BarCodePutGenerateMultipleRequest.php +++ b/src/Aspose/BarCode/Requests/PutGenerateMultipleRequest.php @@ -2,7 +2,7 @@ /* * -------------------------------------------------------------------------------------------------------------------- - * + * * Copyright (c) 2018 Aspose Pty Ltd * * @@ -12,10 +12,10 @@ * 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 @@ -26,46 +26,60 @@ * * -------------------------------------------------------------------------------------------------------------------- */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +declare(strict_types=1); + namespace Aspose\BarCode\Requests; /* - * Request model for "barCodePutGenerateMultiple" operation. + * Request model for "putGenerateMultiple" operation. */ -class BarCodePutGenerateMultipleRequest +class PutGenerateMultipleRequest { /* - * Initializes a new instance of the BarCodePutGenerateMultipleRequest class. - * + * Initializes a new instance of the PutGenerateMultipleRequest class. + * * @param string $name New filename - * @param \Swagger\Client\Model\BarCodeBuildersList $dto List of barcodes + * @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, $dto = null, $format = null, $folder = null) + public function __construct($name, $generator_params_list, $format = null, $folder = null, $storage = null) { $this->name = $name; - $this->dto = $dto; + $this->generator_params_list = $generator_params_list; $this->format = $format; $this->folder = $folder; + $this->storage = $storage; } /* * New filename */ public $name; - + /* * List of barcodes */ - public $dto; - + 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/StorageExistsRequest.php b/src/Aspose/BarCode/Requests/StorageExistsRequest.php new file mode 100644 index 0000000..6bebc2d --- /dev/null +++ b/src/Aspose/BarCode/Requests/StorageExistsRequest.php @@ -0,0 +1,57 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +declare(strict_types=1); + +namespace Aspose\BarCode\Requests; + +/* + * Request model for "storageExists" operation. + */ +class StorageExistsRequest +{ + /* + * Initializes a new instance of the StorageExistsRequest class. + * + * @param string $storage_name Storage name + */ + public function __construct($storage_name) + { + $this->storage_name = $storage_name; + } + + /* + * Storage name + */ + public $storage_name; +} + diff --git a/src/Aspose/BarCode/Requests/UploadFileRequest.php b/src/Aspose/BarCode/Requests/UploadFileRequest.php new file mode 100644 index 0000000..8e01d9d --- /dev/null +++ b/src/Aspose/BarCode/Requests/UploadFileRequest.php @@ -0,0 +1,71 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// + +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/StorageApi.php b/src/Aspose/BarCode/StorageApi.php new file mode 100644 index 0000000..8574c2b --- /dev/null +++ b/src/Aspose/BarCode/StorageApi.php @@ -0,0 +1,1262 @@ + + * Copyright (c) 2018 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. + * + * -------------------------------------------------------------------------------------------------------------------- + */ +// +// This source code was auto-generated by AsposeBarcodeCloudCodegen. +// +namespace Aspose\BarCode; + +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use Aspose\BarCode\Requests; + +/* + * Aspose.BarCode for Cloud API. + */ + +class StorageApi +{ + /* + * 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 WordsApi + * @param ClientInterface $client client for calling api + * @param Configuration $config configuration info + * @param HeaderSelector $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 getDiscUsage + * + * Get disc usage + * + * @param Requests\GetDiscUsageRequest $request is a request object for operation + * + * @throws \Aspose\BarCode\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Aspose\BarCode\Model\DiscUsage + */ + public function getDiscUsage(Requests\GetDiscUsageRequest $request) + { + try { + list($response) = $this->getDiscUsageWithHttpInfo($request); + return $response; + } catch (RepeatRequestException $e) { + list($response) = $this->getDiscUsageWithHttpInfo($request); + return $response; + } + } + + /* + * Operation getDiscUsageWithHttpInfo + * + * Get disc usage + * + * @param Requests\GetDiscUsageRequest $request is a request object for operation + * + * @throws \Aspose\BarCode\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Aspose\BarCode\Model\DiscUsage, HTTP status code, HTTP response headers (array of strings) + */ + public function getDiscUsageWithHttpInfo(Requests\GetDiscUsageRequest $request) + { + $returnType = '\Aspose\BarCode\Model\DiscUsage'; + $request = $this->GetDiscUsageRequest($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\DiscUsage', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /* + * Operation getDiscUsageAsync + * + * Get disc usage + * + * @param Requests\GetDiscUsageRequest $request is a request object for operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDiscUsageAsync(Requests\GetDiscUsageRequest $request) + { + return $this->getDiscUsageAsyncWithHttpInfo($request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /* + * Operation getDiscUsageAsyncWithHttpInfo + * + * Get disc usage + * + * @param Requests\GetDiscUsageRequest $request is a request object for operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDiscUsageAsyncWithHttpInfo(Requests\GetDiscUsageRequest $request) + { + $returnType = '\Aspose\BarCode\Model\DiscUsage'; + $request = $this->GetDiscUsageRequest($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 'getDiscUsage' + * + * @param Requests\GetDiscUsageRequest $request is a request object for operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function GetDiscUsageRequest(Requests\GetDiscUsageRequest $request) + { + + $resourcePath = '/barcode/storage/disc'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // query params + if (isset($request->storage_name)) { + $localName = lcfirst('storageName'); + $localValue = is_bool($request->storage_name) ? ($request->storage_name ? 'true' : 'false') : $request->storage_name; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + + + $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 (isset($_tempBody)) { + // $_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); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } + } + + 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 \Aspose\BarCode\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 \Aspose\BarCode\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 + } 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; + } + 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; + + // path params + if (isset($request->path)) { + $localName = lcfirst('path'); + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->path), $resourcePath); + } + + // query params + if (isset($request->storage_name)) { + $localName = lcfirst('storageName'); + $localValue = is_bool($request->storage_name) ? ($request->storage_name ? 'true' : 'false') : $request->storage_name; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + + + $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 (isset($_tempBody)) { + // $_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); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } + } + + 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 objectExists + * + * Check if file or folder exists + * + * @param Requests\ObjectExistsRequest $request is a request object for operation + * + * @throws \Aspose\BarCode\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Aspose\BarCode\Model\ObjectExist + */ + public function objectExists(Requests\ObjectExistsRequest $request) + { + try { + list($response) = $this->objectExistsWithHttpInfo($request); + return $response; + } catch (RepeatRequestException $e) { + list($response) = $this->objectExistsWithHttpInfo($request); + return $response; + } + } + + /* + * Operation objectExistsWithHttpInfo + * + * Check if file or folder exists + * + * @param Requests\ObjectExistsRequest $request is a request object for operation + * + * @throws \Aspose\BarCode\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Aspose\BarCode\Model\ObjectExist, HTTP status code, HTTP response headers (array of strings) + */ + public function objectExistsWithHttpInfo(Requests\ObjectExistsRequest $request) + { + $returnType = '\Aspose\BarCode\Model\ObjectExist'; + $request = $this->ObjectExistsRequest($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\ObjectExist', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /* + * Operation objectExistsAsync + * + * Check if file or folder exists + * + * @param Requests\ObjectExistsRequest $request is a request object for operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function objectExistsAsync(Requests\ObjectExistsRequest $request) + { + return $this->objectExistsAsyncWithHttpInfo($request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /* + * Operation objectExistsAsyncWithHttpInfo + * + * Check if file or folder exists + * + * @param Requests\ObjectExistsRequest $request is a request object for operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function objectExistsAsyncWithHttpInfo(Requests\ObjectExistsRequest $request) + { + $returnType = '\Aspose\BarCode\Model\ObjectExist'; + $request = $this->ObjectExistsRequest($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 'objectExists' + * + * @param Requests\ObjectExistsRequest $request is a request object for operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function ObjectExistsRequest(Requests\ObjectExistsRequest $request) + { + // verify the required parameter 'path' is set + if (!isset($request->path)) { + throw new \InvalidArgumentException('Missing the required parameter $path when calling objectExists'); + } + + $resourcePath = '/barcode/storage/exist/{path}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if (isset($request->path)) { + $localName = lcfirst('path'); + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->path), $resourcePath); + } + + // query params + if (isset($request->storage_name)) { + $localName = lcfirst('storageName'); + $localValue = is_bool($request->storage_name) ? ($request->storage_name ? 'true' : 'false') : $request->storage_name; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + // query params + if (isset($request->version_id)) { + $localName = lcfirst('versionId'); + $localValue = is_bool($request->version_id) ? ($request->version_id ? 'true' : 'false') : $request->version_id; + if (strpos($resourcePath, '{' . $localName . '}') !== false) { + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath); + } else { + $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue); + } + } + + + $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 (isset($_tempBody)) { + // $_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); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } + } + + 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 storageExists + * + * Check if storage exists + * + * @param Requests\StorageExistsRequest $request is a request object for operation + * + * @throws \Aspose\BarCode\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Aspose\BarCode\Model\StorageExist + */ + public function storageExists(Requests\StorageExistsRequest $request) + { + try { + list($response) = $this->storageExistsWithHttpInfo($request); + return $response; + } catch (RepeatRequestException $e) { + list($response) = $this->storageExistsWithHttpInfo($request); + return $response; + } + } + + /* + * Operation storageExistsWithHttpInfo + * + * Check if storage exists + * + * @param Requests\StorageExistsRequest $request is a request object for operation + * + * @throws \Aspose\BarCode\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Aspose\BarCode\Model\StorageExist, HTTP status code, HTTP response headers (array of strings) + */ + public function storageExistsWithHttpInfo(Requests\StorageExistsRequest $request) + { + $returnType = '\Aspose\BarCode\Model\StorageExist'; + $request = $this->StorageExistsRequest($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\StorageExist', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /* + * Operation storageExistsAsync + * + * Check if storage exists + * + * @param Requests\StorageExistsRequest $request is a request object for operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function storageExistsAsync(Requests\StorageExistsRequest $request) + { + return $this->storageExistsAsyncWithHttpInfo($request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /* + * Operation storageExistsAsyncWithHttpInfo + * + * Check if storage exists + * + * @param Requests\StorageExistsRequest $request is a request object for operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function storageExistsAsyncWithHttpInfo(Requests\StorageExistsRequest $request) + { + $returnType = '\Aspose\BarCode\Model\StorageExist'; + $request = $this->StorageExistsRequest($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 'storageExists' + * + * @param Requests\StorageExistsRequest $request is a request object for operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function StorageExistsRequest(Requests\StorageExistsRequest $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'); + } + + $resourcePath = '/barcode/storage/{storageName}/exist'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if (isset($request->storage_name)) { + $localName = lcfirst('storageName'); + $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($request->storage_name), $resourcePath); + } + + + + $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 (isset($_tempBody)) { + // $_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); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } + } + + 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; + } + + /* + * 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 = 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->getHost() . '/connect/token'; + + $response = $this->client->request('POST', $requestUrl, [ + 'form_params' => [ + 'grant_type' => 'client_credentials', + 'client_id' => $this->config->getAppSid(), + 'client_secret' => $this->config->getAppKey(), + ] + ]); + $result = json_decode($response->getBody()->getContents(), true); + $this->config->setAccessToken($result['access_token']); + } +} \ No newline at end of file diff --git a/testdata/pdf417Sample.png b/testdata/pdf417Sample.png new file mode 100644 index 0000000..f6c6639 Binary files /dev/null and b/testdata/pdf417Sample.png differ diff --git a/tests/BarcodeApiTest.php b/tests/BarcodeApiTest.php new file mode 100644 index 0000000..21d29ed --- /dev/null +++ b/tests/BarcodeApiTest.php @@ -0,0 +1,270 @@ +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()); + + $request = new GetBarcodeRecognizeRequest($uploaded->getUploaded()[0]); + $request->folder = self::$tempFolderPath; + + $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; + + $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()); + } + + /** + * 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()); + + // Arrange + $request = new PutBarcodeRecognizeFromBodyRequest( + $uploaded->getUploaded()[0], + new ReaderParams([ + 'type' => DecodeBarcodeType::Pdf417, + '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()); + } +} diff --git a/tests/Configuration.example.json b/tests/Configuration.example.json new file mode 100644 index 0000000..26abccc --- /dev/null +++ b/tests/Configuration.example.json @@ -0,0 +1,4 @@ +{ + "AppKey": "App Key from https://dashboard.aspose.cloud/#/apps", + "AppSid": "App SID from https://dashboard.aspose.cloud/#/apps" +} diff --git a/tests/ConfigurationTest.php b/tests/ConfigurationTest.php new file mode 100644 index 0000000..c4e5186 --- /dev/null +++ b/tests/ConfigurationTest.php @@ -0,0 +1,65 @@ +setAppKey('api key'); + $config->setAppSid('app sid'); + $config->setHost('https://api-qa.aspose.cloud'); + $config->setAccessToken('access token'); + + $json = json_encode($config, JSON_PRETTY_PRINT); + + $this->assertEquals( + '{ + "AppKey": "api key", + "AppSid": "app sid", + "Host": "https:\\/\\/api-qa.aspose.cloud", + "AccessToken": "access token", + "Debug": false +}', + $json + ); + } + + public function testConfigurationFromJson(): void + { + $config = new Configuration(); + $config->setAppKey('api key'); + $config->setAppSid('app sid'); + $config->setHost('https://api-qa.aspose.cloud'); + $config->setAccessToken('access token'); + $json = json_encode($config, JSON_PRETTY_PRINT); + + $deserialized = Configuration::fromJson($json); + + $this->assertEquals($config, $deserialized); + } + + public function testConfigurationFromFile(): void + { + $json = file_get_contents('Configuration.example.json', true); + + $config = Configuration::fromJson($json); + + $this->assertEquals('App Key from https://dashboard.aspose.cloud/#/apps', $config->getAppKey()); + $this->assertEquals('App SID from https://dashboard.aspose.cloud/#/apps', $config->getAppSid()); + $this->assertEquals('https://api.aspose.cloud', $config->getHost()); + } + + public function testConfigurationUserAgent(): void + { + $config = new Configuration(); + + $config->setUserAgent('My sample app'); + + $this->assertEquals('My sample app', $config->getUserAgent()); + } +} diff --git a/tests/EndToEndTest.php b/tests/EndToEndTest.php new file mode 100644 index 0000000..b0eb51a --- /dev/null +++ b/tests/EndToEndTest.php @@ -0,0 +1,42 @@ +format = 'png'; + + $genResponse = $api->GetBarCodeGenerate($genRequest); + + $imageSize = $genResponse->getSize(); + $this->assertGreaterThan(0, $imageSize); + + // Recognize + + $recognizeRequest = new PostBarCodeRecognizeFromUrlorContentRequest(); + $recognizeRequest->image = $genResponse; + $recognizeRequest->preset = PresetType::HighPerformance; + + $recognizeResponse = $api->PostBarCodeRecognizeFromUrlorContent($recognizeRequest); + $this->assertNotEmpty($recognizeResponse); + + $this->assertEquals('QR', $recognizeResponse->getBarcodes()[0]->getType()); + $this->assertEquals('PHP SDK Test', $recognizeResponse->getBarcodes()[0]->getBarcodeValue()); + } +}