cloudmersive-barcode-api-client 2.0.3 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1df161c3388127bcbce3a8f92a454ffb9b2a57fdb839addf9117c1bd0475a9a0
4
- data.tar.gz: 5651053e922dd3e01fa6da0004b89d487d35d02a1f01141491c0ed77329e9af4
3
+ metadata.gz: 6c515a0a77fa4552f5a44b872991d9e248ac8f3af693ddd170fcca72f38175bb
4
+ data.tar.gz: 6f184e777ebfa56d309fadac2fdaee799fcd197fffc2ab09667ab2451d0faf5f
5
5
  SHA512:
6
- metadata.gz: 1fed64a2e590f5e5244316843c97630d278c23d30ff2c9a0685280c95f278021bfc0414863fd9d800d284cecf932131d654e7659d8567597a000e977170663f7
7
- data.tar.gz: 9727e499f539e48c44daffaf4b708a948058a50a8395a9679c91a55473db09af57290b01da38fa775bb434be86d04b0b1812acbb1fcb1631379fb3ceb4f9d9ca
6
+ metadata.gz: 4fa79ca77a96ac67308d9875f418173f14876a1a6dd6b742005b26dc14c027195562a4cf2c82c4a6b28a4dbdb57f2d7b723de081151aae88ba675a840c0e0cf5
7
+ data.tar.gz: 445e3387c31c63fb85d45f74e94057e68c137806c891c15dac1c1bb237c61fb88148103108fda4b6479c0d1956776e60583e66e9e56c6039ed21eee0878ba758
data/README.md CHANGED
@@ -7,7 +7,7 @@ Barcode APIs let you generate barcode images, and recognize values from images o
7
7
  This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
8
 
9
9
  - API version: v1
10
- - Package version: 2.0.3
10
+ - Package version: 2.1.0
11
11
  - Build package: io.swagger.codegen.languages.RubyClientCodegen
12
12
 
13
13
  ## Installation
@@ -23,15 +23,15 @@ gem build cloudmersive-barcode-api-client.gemspec
23
23
  Then either install the gem locally:
24
24
 
25
25
  ```shell
26
- gem install ./cloudmersive-barcode-api-client-2.0.3.gem
26
+ gem install ./cloudmersive-barcode-api-client-2.1.0.gem
27
27
  ```
28
- (for development, run `gem install --dev ./cloudmersive-barcode-api-client-2.0.3.gem` to install the development dependencies)
28
+ (for development, run `gem install --dev ./cloudmersive-barcode-api-client-2.1.0.gem` to install the development dependencies)
29
29
 
30
30
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
31
31
 
32
32
  Finally add this to the Gemfile:
33
33
 
34
- gem 'cloudmersive-barcode-api-client', '~> 2.0.3'
34
+ gem 'cloudmersive-barcode-api-client', '~> 2.1.0'
35
35
 
36
36
  ### Install from Git
37
37
 
@@ -85,6 +85,7 @@ Class | Method | HTTP request | Description
85
85
  ------------ | ------------- | ------------- | -------------
86
86
  *CloudmersiveBarcodeApiClient::BarcodeLookupApi* | [**barcode_lookup_ean_lookup**](docs/BarcodeLookupApi.md#barcode_lookup_ean_lookup) | **POST** /barcode/lookup/ean | Lookup EAN barcode value, return product data
87
87
  *CloudmersiveBarcodeApiClient::BarcodeScanApi* | [**barcode_scan_image**](docs/BarcodeScanApi.md#barcode_scan_image) | **POST** /barcode/scan/image | Scan and recognize an image of a barcode
88
+ *CloudmersiveBarcodeApiClient::BarcodeScanApi* | [**barcode_scan_image_advanced_qr**](docs/BarcodeScanApi.md#barcode_scan_image_advanced_qr) | **POST** /barcode/scan/image/advanced/qr | Advanced AI scan and recognition of an image of one or more QR barcodes
88
89
  *CloudmersiveBarcodeApiClient::GenerateBarcodeApi* | [**generate_barcode_ean13**](docs/GenerateBarcodeApi.md#generate_barcode_ean13) | **POST** /barcode/generate/ean-13 | Generate a EAN-13 code barcode as PNG file
89
90
  *CloudmersiveBarcodeApiClient::GenerateBarcodeApi* | [**generate_barcode_ean8**](docs/GenerateBarcodeApi.md#generate_barcode_ean8) | **POST** /barcode/generate/ean-8 | Generate a EAN-8 code barcode as PNG file
90
91
  *CloudmersiveBarcodeApiClient::GenerateBarcodeApi* | [**generate_barcode_qr_code**](docs/GenerateBarcodeApi.md#generate_barcode_qr_code) | **POST** /barcode/generate/qrcode | Generate a QR code barcode as PNG file
@@ -95,6 +96,8 @@ Class | Method | HTTP request | Description
95
96
  ## Documentation for Models
96
97
 
97
98
  - [CloudmersiveBarcodeApiClient::BarcodeLookupResponse](docs/BarcodeLookupResponse.md)
99
+ - [CloudmersiveBarcodeApiClient::BarcodeQRResultItem](docs/BarcodeQRResultItem.md)
100
+ - [CloudmersiveBarcodeApiClient::BarcodeScanQRAdvancedResult](docs/BarcodeScanQRAdvancedResult.md)
98
101
  - [CloudmersiveBarcodeApiClient::BarcodeScanResult](docs/BarcodeScanResult.md)
99
102
  - [CloudmersiveBarcodeApiClient::ProductMatch](docs/ProductMatch.md)
100
103
 
@@ -0,0 +1,8 @@
1
+ # CloudmersiveBarcodeApiClient::BarcodeQRResultItem
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **raw_text** | **String** | The barcode text | [optional]
7
+
8
+
@@ -5,6 +5,7 @@ All URIs are relative to *https://api.cloudmersive.com*
5
5
  Method | HTTP request | Description
6
6
  ------------- | ------------- | -------------
7
7
  [**barcode_scan_image**](BarcodeScanApi.md#barcode_scan_image) | **POST** /barcode/scan/image | Scan and recognize an image of a barcode
8
+ [**barcode_scan_image_advanced_qr**](BarcodeScanApi.md#barcode_scan_image_advanced_qr) | **POST** /barcode/scan/image/advanced/qr | Advanced AI scan and recognition of an image of one or more QR barcodes
8
9
 
9
10
 
10
11
  # **barcode_scan_image**
@@ -61,3 +62,61 @@ Name | Type | Description | Notes
61
62
 
62
63
 
63
64
 
65
+ # **barcode_scan_image_advanced_qr**
66
+ > BarcodeScanQRAdvancedResult barcode_scan_image_advanced_qr(image_file, opts)
67
+
68
+ Advanced AI scan and recognition of an image of one or more QR barcodes
69
+
70
+ Scan an image or photo of a QR barcode and return the result. Uses AI deep learning to read blurry or low resultion QR barcodes. Supports PNG and JPEG input file formats.
71
+
72
+ ### Example
73
+ ```ruby
74
+ # load the gem
75
+ require 'cloudmersive-barcode-api-client'
76
+ # setup authorization
77
+ CloudmersiveBarcodeApiClient.configure do |config|
78
+ # Configure API key authorization: Apikey
79
+ config.api_key['Apikey'] = 'YOUR API KEY'
80
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
81
+ #config.api_key_prefix['Apikey'] = 'Bearer'
82
+ end
83
+
84
+ api_instance = CloudmersiveBarcodeApiClient::BarcodeScanApi.new
85
+
86
+ image_file = File.new('/path/to/file.txt') # File | Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
87
+
88
+ opts = {
89
+ preprocessing: 'preprocessing_example' # String | Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to 'None' if you do not want to use automatic image unrotation and enhancement.
90
+ }
91
+
92
+ begin
93
+ #Advanced AI scan and recognition of an image of one or more QR barcodes
94
+ result = api_instance.barcode_scan_image_advanced_qr(image_file, opts)
95
+ p result
96
+ rescue CloudmersiveBarcodeApiClient::ApiError => e
97
+ puts "Exception when calling BarcodeScanApi->barcode_scan_image_advanced_qr: #{e}"
98
+ end
99
+ ```
100
+
101
+ ### Parameters
102
+
103
+ Name | Type | Description | Notes
104
+ ------------- | ------------- | ------------- | -------------
105
+ **image_file** | **File**| Image file to perform the operation on. Common file formats such as PNG, JPEG are supported. |
106
+ **preprocessing** | **String**| Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to 'None' if you do not want to use automatic image unrotation and enhancement. | [optional]
107
+
108
+ ### Return type
109
+
110
+ [**BarcodeScanQRAdvancedResult**](BarcodeScanQRAdvancedResult.md)
111
+
112
+ ### Authorization
113
+
114
+ [Apikey](../README.md#Apikey)
115
+
116
+ ### HTTP request headers
117
+
118
+ - **Content-Type**: multipart/form-data
119
+ - **Accept**: application/json, text/json, application/xml, text/xml
120
+
121
+
122
+
@@ -0,0 +1,11 @@
1
+ # CloudmersiveBarcodeApiClient::BarcodeScanQRAdvancedResult
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **successful** | **BOOLEAN** | True if the operation was successful, false otherwise | [optional]
7
+ **result_barcodes** | [**Array<BarcodeQRResultItem>**](BarcodeQRResultItem.md) | Results of performing the QR barcode scan operation | [optional]
8
+ **barcode_count** | **Integer** | Number of barcodes read | [optional]
9
+ **error_message** | **String** | Error message if any | [optional]
10
+
11
+
@@ -74,5 +74,63 @@ module CloudmersiveBarcodeApiClient
74
74
  end
75
75
  return data, status_code, headers
76
76
  end
77
+ # Advanced AI scan and recognition of an image of one or more QR barcodes
78
+ # Scan an image or photo of a QR barcode and return the result. Uses AI deep learning to read blurry or low resultion QR barcodes. Supports PNG and JPEG input file formats.
79
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
80
+ # @param [Hash] opts the optional parameters
81
+ # @option opts [String] :preprocessing Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to 'None' if you do not want to use automatic image unrotation and enhancement.
82
+ # @return [BarcodeScanQRAdvancedResult]
83
+ def barcode_scan_image_advanced_qr(image_file, opts = {})
84
+ data, _status_code, _headers = barcode_scan_image_advanced_qr_with_http_info(image_file, opts)
85
+ data
86
+ end
87
+
88
+ # Advanced AI scan and recognition of an image of one or more QR barcodes
89
+ # Scan an image or photo of a QR barcode and return the result. Uses AI deep learning to read blurry or low resultion QR barcodes. Supports PNG and JPEG input file formats.
90
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
91
+ # @param [Hash] opts the optional parameters
92
+ # @option opts [String] :preprocessing Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to 'None' if you do not want to use automatic image unrotation and enhancement.
93
+ # @return [Array<(BarcodeScanQRAdvancedResult, Fixnum, Hash)>] BarcodeScanQRAdvancedResult data, response status code and response headers
94
+ def barcode_scan_image_advanced_qr_with_http_info(image_file, opts = {})
95
+ if @api_client.config.debugging
96
+ @api_client.config.logger.debug 'Calling API: BarcodeScanApi.barcode_scan_image_advanced_qr ...'
97
+ end
98
+ # verify the required parameter 'image_file' is set
99
+ if @api_client.config.client_side_validation && image_file.nil?
100
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling BarcodeScanApi.barcode_scan_image_advanced_qr"
101
+ end
102
+ # resource path
103
+ local_var_path = '/barcode/scan/image/advanced/qr'
104
+
105
+ # query parameters
106
+ query_params = {}
107
+
108
+ # header parameters
109
+ header_params = {}
110
+ # HTTP header 'Accept' (if needed)
111
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
112
+ # HTTP header 'Content-Type'
113
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
114
+ header_params[:'preprocessing'] = opts[:'preprocessing'] if !opts[:'preprocessing'].nil?
115
+
116
+ # form parameters
117
+ form_params = {}
118
+ form_params['imageFile'] = image_file
119
+
120
+ # http body (model)
121
+ post_body = nil
122
+ auth_names = ['Apikey']
123
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
124
+ :header_params => header_params,
125
+ :query_params => query_params,
126
+ :form_params => form_params,
127
+ :body => post_body,
128
+ :auth_names => auth_names,
129
+ :return_type => 'BarcodeScanQRAdvancedResult')
130
+ if @api_client.config.debugging
131
+ @api_client.config.logger.debug "API called: BarcodeScanApi#barcode_scan_image_advanced_qr\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
132
+ end
133
+ return data, status_code, headers
134
+ end
77
135
  end
78
136
  end
@@ -0,0 +1,185 @@
1
+ =begin
2
+ #barcodeapi
3
+
4
+ #Barcode APIs let you generate barcode images, and recognize values from images of barcodes.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveBarcodeApiClient
16
+ class BarcodeQRResultItem
17
+ # The barcode text
18
+ attr_accessor :raw_text
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'raw_text' => :'RawText'
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.swagger_types
29
+ {
30
+ :'raw_text' => :'String'
31
+ }
32
+ end
33
+
34
+ # Initializes the object
35
+ # @param [Hash] attributes Model attributes in the form of hash
36
+ def initialize(attributes = {})
37
+ return unless attributes.is_a?(Hash)
38
+
39
+ # convert string to symbol for hash key
40
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
41
+
42
+ if attributes.has_key?(:'RawText')
43
+ self.raw_text = attributes[:'RawText']
44
+ end
45
+ end
46
+
47
+ # Show invalid properties with the reasons. Usually used together with valid?
48
+ # @return Array for valid properties with the reasons
49
+ def list_invalid_properties
50
+ invalid_properties = Array.new
51
+ invalid_properties
52
+ end
53
+
54
+ # Check to see if the all the properties in the model are valid
55
+ # @return true if the model is valid
56
+ def valid?
57
+ true
58
+ end
59
+
60
+ # Checks equality by comparing each attribute.
61
+ # @param [Object] Object to be compared
62
+ def ==(o)
63
+ return true if self.equal?(o)
64
+ self.class == o.class &&
65
+ raw_text == o.raw_text
66
+ end
67
+
68
+ # @see the `==` method
69
+ # @param [Object] Object to be compared
70
+ def eql?(o)
71
+ self == o
72
+ end
73
+
74
+ # Calculates hash code according to all attributes.
75
+ # @return [Fixnum] Hash code
76
+ def hash
77
+ [raw_text].hash
78
+ end
79
+
80
+ # Builds the object from hash
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ # @return [Object] Returns the model itself
83
+ def build_from_hash(attributes)
84
+ return nil unless attributes.is_a?(Hash)
85
+ self.class.swagger_types.each_pair do |key, type|
86
+ if type =~ /\AArray<(.*)>/i
87
+ # check to ensure the input is an array given that the attribute
88
+ # is documented as an array but the input is not
89
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
90
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
91
+ end
92
+ elsif !attributes[self.class.attribute_map[key]].nil?
93
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
94
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
95
+ end
96
+
97
+ self
98
+ end
99
+
100
+ # Deserializes the data based on type
101
+ # @param string type Data type
102
+ # @param string value Value to be deserialized
103
+ # @return [Object] Deserialized data
104
+ def _deserialize(type, value)
105
+ case type.to_sym
106
+ when :DateTime
107
+ DateTime.parse(value)
108
+ when :Date
109
+ Date.parse(value)
110
+ when :String
111
+ value.to_s
112
+ when :Integer
113
+ value.to_i
114
+ when :Float
115
+ value.to_f
116
+ when :BOOLEAN
117
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
118
+ true
119
+ else
120
+ false
121
+ end
122
+ when :Object
123
+ # generic object (usually a Hash), return directly
124
+ value
125
+ when /\AArray<(?<inner_type>.+)>\z/
126
+ inner_type = Regexp.last_match[:inner_type]
127
+ value.map { |v| _deserialize(inner_type, v) }
128
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
129
+ k_type = Regexp.last_match[:k_type]
130
+ v_type = Regexp.last_match[:v_type]
131
+ {}.tap do |hash|
132
+ value.each do |k, v|
133
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
134
+ end
135
+ end
136
+ else # model
137
+ temp_model = CloudmersiveBarcodeApiClient.const_get(type).new
138
+ temp_model.build_from_hash(value)
139
+ end
140
+ end
141
+
142
+ # Returns the string representation of the object
143
+ # @return [String] String presentation of the object
144
+ def to_s
145
+ to_hash.to_s
146
+ end
147
+
148
+ # to_body is an alias to to_hash (backward compatibility)
149
+ # @return [Hash] Returns the object in the form of hash
150
+ def to_body
151
+ to_hash
152
+ end
153
+
154
+ # Returns the object in the form of hash
155
+ # @return [Hash] Returns the object in the form of hash
156
+ def to_hash
157
+ hash = {}
158
+ self.class.attribute_map.each_pair do |attr, param|
159
+ value = self.send(attr)
160
+ next if value.nil?
161
+ hash[param] = _to_hash(value)
162
+ end
163
+ hash
164
+ end
165
+
166
+ # Outputs non-array value in the form of hash
167
+ # For object, use to_hash. Otherwise, just return the value
168
+ # @param [Object] value Any valid value
169
+ # @return [Hash] Returns the value in the form of hash
170
+ def _to_hash(value)
171
+ if value.is_a?(Array)
172
+ value.compact.map { |v| _to_hash(v) }
173
+ elsif value.is_a?(Hash)
174
+ {}.tap do |hash|
175
+ value.each { |k, v| hash[k] = _to_hash(v) }
176
+ end
177
+ elsif value.respond_to? :to_hash
178
+ value.to_hash
179
+ else
180
+ value
181
+ end
182
+ end
183
+
184
+ end
185
+ end
@@ -0,0 +1,218 @@
1
+ =begin
2
+ #barcodeapi
3
+
4
+ #Barcode APIs let you generate barcode images, and recognize values from images of barcodes.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveBarcodeApiClient
16
+ # Result of the advanced QR barcode scan
17
+ class BarcodeScanQRAdvancedResult
18
+ # True if the operation was successful, false otherwise
19
+ attr_accessor :successful
20
+
21
+ # Results of performing the QR barcode scan operation
22
+ attr_accessor :result_barcodes
23
+
24
+ # Number of barcodes read
25
+ attr_accessor :barcode_count
26
+
27
+ # Error message if any
28
+ attr_accessor :error_message
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'successful' => :'Successful',
34
+ :'result_barcodes' => :'ResultBarcodes',
35
+ :'barcode_count' => :'BarcodeCount',
36
+ :'error_message' => :'ErrorMessage'
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.swagger_types
42
+ {
43
+ :'successful' => :'BOOLEAN',
44
+ :'result_barcodes' => :'Array<BarcodeQRResultItem>',
45
+ :'barcode_count' => :'Integer',
46
+ :'error_message' => :'String'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
57
+
58
+ if attributes.has_key?(:'Successful')
59
+ self.successful = attributes[:'Successful']
60
+ end
61
+
62
+ if attributes.has_key?(:'ResultBarcodes')
63
+ if (value = attributes[:'ResultBarcodes']).is_a?(Array)
64
+ self.result_barcodes = value
65
+ end
66
+ end
67
+
68
+ if attributes.has_key?(:'BarcodeCount')
69
+ self.barcode_count = attributes[:'BarcodeCount']
70
+ end
71
+
72
+ if attributes.has_key?(:'ErrorMessage')
73
+ self.error_message = attributes[:'ErrorMessage']
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ invalid_properties = Array.new
81
+ invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ true
88
+ end
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param [Object] Object to be compared
92
+ def ==(o)
93
+ return true if self.equal?(o)
94
+ self.class == o.class &&
95
+ successful == o.successful &&
96
+ result_barcodes == o.result_barcodes &&
97
+ barcode_count == o.barcode_count &&
98
+ error_message == o.error_message
99
+ end
100
+
101
+ # @see the `==` method
102
+ # @param [Object] Object to be compared
103
+ def eql?(o)
104
+ self == o
105
+ end
106
+
107
+ # Calculates hash code according to all attributes.
108
+ # @return [Fixnum] Hash code
109
+ def hash
110
+ [successful, result_barcodes, barcode_count, error_message].hash
111
+ end
112
+
113
+ # Builds the object from hash
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @return [Object] Returns the model itself
116
+ def build_from_hash(attributes)
117
+ return nil unless attributes.is_a?(Hash)
118
+ self.class.swagger_types.each_pair do |key, type|
119
+ if type =~ /\AArray<(.*)>/i
120
+ # check to ensure the input is an array given that the attribute
121
+ # is documented as an array but the input is not
122
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
123
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
124
+ end
125
+ elsif !attributes[self.class.attribute_map[key]].nil?
126
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
127
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
128
+ end
129
+
130
+ self
131
+ end
132
+
133
+ # Deserializes the data based on type
134
+ # @param string type Data type
135
+ # @param string value Value to be deserialized
136
+ # @return [Object] Deserialized data
137
+ def _deserialize(type, value)
138
+ case type.to_sym
139
+ when :DateTime
140
+ DateTime.parse(value)
141
+ when :Date
142
+ Date.parse(value)
143
+ when :String
144
+ value.to_s
145
+ when :Integer
146
+ value.to_i
147
+ when :Float
148
+ value.to_f
149
+ when :BOOLEAN
150
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
151
+ true
152
+ else
153
+ false
154
+ end
155
+ when :Object
156
+ # generic object (usually a Hash), return directly
157
+ value
158
+ when /\AArray<(?<inner_type>.+)>\z/
159
+ inner_type = Regexp.last_match[:inner_type]
160
+ value.map { |v| _deserialize(inner_type, v) }
161
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
162
+ k_type = Regexp.last_match[:k_type]
163
+ v_type = Regexp.last_match[:v_type]
164
+ {}.tap do |hash|
165
+ value.each do |k, v|
166
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
167
+ end
168
+ end
169
+ else # model
170
+ temp_model = CloudmersiveBarcodeApiClient.const_get(type).new
171
+ temp_model.build_from_hash(value)
172
+ end
173
+ end
174
+
175
+ # Returns the string representation of the object
176
+ # @return [String] String presentation of the object
177
+ def to_s
178
+ to_hash.to_s
179
+ end
180
+
181
+ # to_body is an alias to to_hash (backward compatibility)
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_body
184
+ to_hash
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = self.send(attr)
193
+ next if value.nil?
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ # Outputs non-array value in the form of hash
200
+ # For object, use to_hash. Otherwise, just return the value
201
+ # @param [Object] value Any valid value
202
+ # @return [Hash] Returns the value in the form of hash
203
+ def _to_hash(value)
204
+ if value.is_a?(Array)
205
+ value.compact.map { |v| _to_hash(v) }
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.each { |k, v| hash[k] = _to_hash(v) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash
212
+ else
213
+ value
214
+ end
215
+ end
216
+
217
+ end
218
+ end
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.14
11
11
  =end
12
12
 
13
13
  module CloudmersiveBarcodeApiClient
14
- VERSION = '2.0.3'
14
+ VERSION = '2.1.0'
15
15
  end
@@ -18,6 +18,8 @@ require 'cloudmersive-barcode-api-client/configuration'
18
18
 
19
19
  # Models
20
20
  require 'cloudmersive-barcode-api-client/models/barcode_lookup_response'
21
+ require 'cloudmersive-barcode-api-client/models/barcode_qr_result_item'
22
+ require 'cloudmersive-barcode-api-client/models/barcode_scan_qr_advanced_result'
21
23
  require 'cloudmersive-barcode-api-client/models/barcode_scan_result'
22
24
  require 'cloudmersive-barcode-api-client/models/product_match'
23
25
 
@@ -44,4 +44,17 @@ describe 'BarcodeScanApi' do
44
44
  end
45
45
  end
46
46
 
47
+ # unit tests for barcode_scan_image_advanced_qr
48
+ # Advanced AI scan and recognition of an image of one or more QR barcodes
49
+ # Scan an image or photo of a QR barcode and return the result. Uses AI deep learning to read blurry or low resultion QR barcodes. Supports PNG and JPEG input file formats.
50
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
51
+ # @param [Hash] opts the optional parameters
52
+ # @option opts [String] :preprocessing Optional, preprocessing mode, default is &#39;Auto&#39;. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to &#39;None&#39; if you do not want to use automatic image unrotation and enhancement.
53
+ # @return [BarcodeScanQRAdvancedResult]
54
+ describe 'barcode_scan_image_advanced_qr test' do
55
+ it 'should work' do
56
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
57
+ end
58
+ end
59
+
47
60
  end
@@ -0,0 +1,41 @@
1
+ =begin
2
+ #barcodeapi
3
+
4
+ #Barcode APIs let you generate barcode images, and recognize values from images of barcodes.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for CloudmersiveBarcodeApiClient::BarcodeQRResultItem
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'BarcodeQRResultItem' do
21
+ before do
22
+ # run before each test
23
+ @instance = CloudmersiveBarcodeApiClient::BarcodeQRResultItem.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of BarcodeQRResultItem' do
31
+ it 'should create an instance of BarcodeQRResultItem' do
32
+ expect(@instance).to be_instance_of(CloudmersiveBarcodeApiClient::BarcodeQRResultItem)
33
+ end
34
+ end
35
+ describe 'test attribute "raw_text"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ end
@@ -0,0 +1,59 @@
1
+ =begin
2
+ #barcodeapi
3
+
4
+ #Barcode APIs let you generate barcode images, and recognize values from images of barcodes.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for CloudmersiveBarcodeApiClient::BarcodeScanQRAdvancedResult
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'BarcodeScanQRAdvancedResult' do
21
+ before do
22
+ # run before each test
23
+ @instance = CloudmersiveBarcodeApiClient::BarcodeScanQRAdvancedResult.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of BarcodeScanQRAdvancedResult' do
31
+ it 'should create an instance of BarcodeScanQRAdvancedResult' do
32
+ expect(@instance).to be_instance_of(CloudmersiveBarcodeApiClient::BarcodeScanQRAdvancedResult)
33
+ end
34
+ end
35
+ describe 'test attribute "successful"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "result_barcodes"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ describe 'test attribute "barcode_count"' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
53
+ describe 'test attribute "error_message"' do
54
+ it 'should work' do
55
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
+ end
57
+ end
58
+
59
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudmersive-barcode-api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cloudmersive
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-15 00:00:00.000000000 Z
11
+ date: 2024-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -203,7 +203,9 @@ files:
203
203
  - "./cloudmersive-barcode-api-client.gemspec"
204
204
  - "./docs/BarcodeLookupApi.md"
205
205
  - "./docs/BarcodeLookupResponse.md"
206
+ - "./docs/BarcodeQRResultItem.md"
206
207
  - "./docs/BarcodeScanApi.md"
208
+ - "./docs/BarcodeScanQRAdvancedResult.md"
207
209
  - "./docs/BarcodeScanResult.md"
208
210
  - "./docs/GenerateBarcodeApi.md"
209
211
  - "./docs/ProductMatch.md"
@@ -216,6 +218,8 @@ files:
216
218
  - "./lib/cloudmersive-barcode-api-client/api_error.rb"
217
219
  - "./lib/cloudmersive-barcode-api-client/configuration.rb"
218
220
  - "./lib/cloudmersive-barcode-api-client/models/barcode_lookup_response.rb"
221
+ - "./lib/cloudmersive-barcode-api-client/models/barcode_qr_result_item.rb"
222
+ - "./lib/cloudmersive-barcode-api-client/models/barcode_scan_qr_advanced_result.rb"
219
223
  - "./lib/cloudmersive-barcode-api-client/models/barcode_scan_result.rb"
220
224
  - "./lib/cloudmersive-barcode-api-client/models/product_match.rb"
221
225
  - "./lib/cloudmersive-barcode-api-client/version.rb"
@@ -225,6 +229,8 @@ files:
225
229
  - "./spec/api_client_spec.rb"
226
230
  - "./spec/configuration_spec.rb"
227
231
  - "./spec/models/barcode_lookup_response_spec.rb"
232
+ - "./spec/models/barcode_qr_result_item_spec.rb"
233
+ - "./spec/models/barcode_scan_qr_advanced_result_spec.rb"
228
234
  - "./spec/models/barcode_scan_result_spec.rb"
229
235
  - "./spec/models/product_match_spec.rb"
230
236
  - "./spec/spec_helper.rb"