cloudmersive-barcode-api-client 2.0.3 → 2.2.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 +4 -4
- data/README.md +11 -4
- data/docs/BarcodeAdvancedResultItem.md +9 -0
- data/docs/BarcodeAdvancedScanResult.md +11 -0
- data/docs/BarcodeQRResultItem.md +8 -0
- data/docs/BarcodeScanApi.md +116 -0
- data/docs/BarcodeScanQRAdvancedResult.md +11 -0
- data/docs/GenerateBarcodeApi.md +111 -10
- data/lib/cloudmersive-barcode-api-client/api/barcode_scan_api.rb +116 -0
- data/lib/cloudmersive-barcode-api-client/api/generate_barcode_api.rb +105 -0
- data/lib/cloudmersive-barcode-api-client/models/barcode_advanced_result_item.rb +196 -0
- data/lib/cloudmersive-barcode-api-client/models/barcode_advanced_scan_result.rb +218 -0
- data/lib/cloudmersive-barcode-api-client/models/barcode_qr_result_item.rb +186 -0
- data/lib/cloudmersive-barcode-api-client/models/barcode_scan_qr_advanced_result.rb +218 -0
- data/lib/cloudmersive-barcode-api-client/version.rb +1 -1
- data/lib/cloudmersive-barcode-api-client.rb +4 -0
- data/spec/api/barcode_scan_api_spec.rb +26 -0
- data/spec/api/generate_barcode_api_spec.rb +29 -0
- data/spec/models/barcode_advanced_result_item_spec.rb +47 -0
- data/spec/models/barcode_advanced_scan_result_spec.rb +59 -0
- data/spec/models/barcode_qr_result_item_spec.rb +41 -0
- data/spec/models/barcode_scan_qr_advanced_result_spec.rb +59 -0
- metadata +30 -18
|
@@ -23,6 +23,72 @@ module CloudmersiveBarcodeApiClient
|
|
|
23
23
|
# Validates and generate a EAN-13 barcode as a PNG file, a type of 1D barcode
|
|
24
24
|
# @param value Barcode value to generate from
|
|
25
25
|
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @option opts [Integer] :width Optional: width of the barcode in pixels. Minimum value of 10.
|
|
27
|
+
# @option opts [Integer] :height Optional: width of the barcode in pixels. Minimum value of 10.
|
|
28
|
+
# @option opts [BOOLEAN] :include_label Optional: show text label on the image of the barcode value, default is true.
|
|
29
|
+
# @return [String]
|
|
30
|
+
def generate_barcode_code128(value, opts = {})
|
|
31
|
+
data, _status_code, _headers = generate_barcode_code128_with_http_info(value, opts)
|
|
32
|
+
data
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Generate a EAN-13 code barcode as PNG file
|
|
36
|
+
# Validates and generate a EAN-13 barcode as a PNG file, a type of 1D barcode
|
|
37
|
+
# @param value Barcode value to generate from
|
|
38
|
+
# @param [Hash] opts the optional parameters
|
|
39
|
+
# @option opts [Integer] :width Optional: width of the barcode in pixels. Minimum value of 10.
|
|
40
|
+
# @option opts [Integer] :height Optional: width of the barcode in pixels. Minimum value of 10.
|
|
41
|
+
# @option opts [BOOLEAN] :include_label Optional: show text label on the image of the barcode value, default is true.
|
|
42
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
|
43
|
+
def generate_barcode_code128_with_http_info(value, opts = {})
|
|
44
|
+
if @api_client.config.debugging
|
|
45
|
+
@api_client.config.logger.debug 'Calling API: GenerateBarcodeApi.generate_barcode_code128 ...'
|
|
46
|
+
end
|
|
47
|
+
# verify the required parameter 'value' is set
|
|
48
|
+
if @api_client.config.client_side_validation && value.nil?
|
|
49
|
+
fail ArgumentError, "Missing the required parameter 'value' when calling GenerateBarcodeApi.generate_barcode_code128"
|
|
50
|
+
end
|
|
51
|
+
# resource path
|
|
52
|
+
local_var_path = '/barcode/generate/code-128'
|
|
53
|
+
|
|
54
|
+
# query parameters
|
|
55
|
+
query_params = {}
|
|
56
|
+
|
|
57
|
+
# header parameters
|
|
58
|
+
header_params = {}
|
|
59
|
+
# HTTP header 'Accept' (if needed)
|
|
60
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
|
61
|
+
# HTTP header 'Content-Type'
|
|
62
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
|
|
63
|
+
header_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
|
|
64
|
+
header_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
|
|
65
|
+
header_params[:'includeLabel'] = opts[:'include_label'] if !opts[:'include_label'].nil?
|
|
66
|
+
|
|
67
|
+
# form parameters
|
|
68
|
+
form_params = {}
|
|
69
|
+
|
|
70
|
+
# http body (model)
|
|
71
|
+
post_body = @api_client.object_to_http_body(value)
|
|
72
|
+
auth_names = ['Apikey']
|
|
73
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
74
|
+
:header_params => header_params,
|
|
75
|
+
:query_params => query_params,
|
|
76
|
+
:form_params => form_params,
|
|
77
|
+
:body => post_body,
|
|
78
|
+
:auth_names => auth_names,
|
|
79
|
+
:return_type => 'String')
|
|
80
|
+
if @api_client.config.debugging
|
|
81
|
+
@api_client.config.logger.debug "API called: GenerateBarcodeApi#generate_barcode_code128\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
82
|
+
end
|
|
83
|
+
return data, status_code, headers
|
|
84
|
+
end
|
|
85
|
+
# Generate a EAN-13 code barcode as PNG file
|
|
86
|
+
# Validates and generate a EAN-13 barcode as a PNG file, a type of 1D barcode
|
|
87
|
+
# @param value Barcode value to generate from
|
|
88
|
+
# @param [Hash] opts the optional parameters
|
|
89
|
+
# @option opts [Integer] :width Optional: width of the barcode in pixels. Minimum value of 10.
|
|
90
|
+
# @option opts [Integer] :height Optional: width of the barcode in pixels. Minimum value of 10.
|
|
91
|
+
# @option opts [BOOLEAN] :include_label Optional: show text label on the image of the barcode value, default is true.
|
|
26
92
|
# @return [String]
|
|
27
93
|
def generate_barcode_ean13(value, opts = {})
|
|
28
94
|
data, _status_code, _headers = generate_barcode_ean13_with_http_info(value, opts)
|
|
@@ -33,6 +99,9 @@ module CloudmersiveBarcodeApiClient
|
|
|
33
99
|
# Validates and generate a EAN-13 barcode as a PNG file, a type of 1D barcode
|
|
34
100
|
# @param value Barcode value to generate from
|
|
35
101
|
# @param [Hash] opts the optional parameters
|
|
102
|
+
# @option opts [Integer] :width Optional: width of the barcode in pixels. Minimum value of 10.
|
|
103
|
+
# @option opts [Integer] :height Optional: width of the barcode in pixels. Minimum value of 10.
|
|
104
|
+
# @option opts [BOOLEAN] :include_label Optional: show text label on the image of the barcode value, default is true.
|
|
36
105
|
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
|
37
106
|
def generate_barcode_ean13_with_http_info(value, opts = {})
|
|
38
107
|
if @api_client.config.debugging
|
|
@@ -54,6 +123,9 @@ module CloudmersiveBarcodeApiClient
|
|
|
54
123
|
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
|
55
124
|
# HTTP header 'Content-Type'
|
|
56
125
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
|
|
126
|
+
header_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
|
|
127
|
+
header_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
|
|
128
|
+
header_params[:'includeLabel'] = opts[:'include_label'] if !opts[:'include_label'].nil?
|
|
57
129
|
|
|
58
130
|
# form parameters
|
|
59
131
|
form_params = {}
|
|
@@ -77,6 +149,9 @@ module CloudmersiveBarcodeApiClient
|
|
|
77
149
|
# Validates and generate a EAN-8 barcode as a PNG file, a type of 1D barcode
|
|
78
150
|
# @param value Barcode value to generate from
|
|
79
151
|
# @param [Hash] opts the optional parameters
|
|
152
|
+
# @option opts [Integer] :width Optional: width of the barcode in pixels. Minimum value of 10.
|
|
153
|
+
# @option opts [Integer] :height Optional: width of the barcode in pixels. Minimum value of 10.
|
|
154
|
+
# @option opts [BOOLEAN] :include_label Optional: show text label on the image of the barcode value, default is true.
|
|
80
155
|
# @return [String]
|
|
81
156
|
def generate_barcode_ean8(value, opts = {})
|
|
82
157
|
data, _status_code, _headers = generate_barcode_ean8_with_http_info(value, opts)
|
|
@@ -87,6 +162,9 @@ module CloudmersiveBarcodeApiClient
|
|
|
87
162
|
# Validates and generate a EAN-8 barcode as a PNG file, a type of 1D barcode
|
|
88
163
|
# @param value Barcode value to generate from
|
|
89
164
|
# @param [Hash] opts the optional parameters
|
|
165
|
+
# @option opts [Integer] :width Optional: width of the barcode in pixels. Minimum value of 10.
|
|
166
|
+
# @option opts [Integer] :height Optional: width of the barcode in pixels. Minimum value of 10.
|
|
167
|
+
# @option opts [BOOLEAN] :include_label Optional: show text label on the image of the barcode value, default is true.
|
|
90
168
|
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
|
91
169
|
def generate_barcode_ean8_with_http_info(value, opts = {})
|
|
92
170
|
if @api_client.config.debugging
|
|
@@ -108,6 +186,9 @@ module CloudmersiveBarcodeApiClient
|
|
|
108
186
|
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
|
109
187
|
# HTTP header 'Content-Type'
|
|
110
188
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
|
|
189
|
+
header_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
|
|
190
|
+
header_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
|
|
191
|
+
header_params[:'includeLabel'] = opts[:'include_label'] if !opts[:'include_label'].nil?
|
|
111
192
|
|
|
112
193
|
# form parameters
|
|
113
194
|
form_params = {}
|
|
@@ -131,6 +212,8 @@ module CloudmersiveBarcodeApiClient
|
|
|
131
212
|
# Generate a QR code barcode as a PNG file, a type of 2D barcode which can encode free-form text information
|
|
132
213
|
# @param value QR code text to convert into the QR code barcode
|
|
133
214
|
# @param [Hash] opts the optional parameters
|
|
215
|
+
# @option opts [Integer] :width Optional: width of the barcode in pixels. Minimum value of 10.
|
|
216
|
+
# @option opts [Integer] :height Optional: width of the barcode in pixels. Minimum value of 10.
|
|
134
217
|
# @return [String]
|
|
135
218
|
def generate_barcode_qr_code(value, opts = {})
|
|
136
219
|
data, _status_code, _headers = generate_barcode_qr_code_with_http_info(value, opts)
|
|
@@ -141,6 +224,8 @@ module CloudmersiveBarcodeApiClient
|
|
|
141
224
|
# Generate a QR code barcode as a PNG file, a type of 2D barcode which can encode free-form text information
|
|
142
225
|
# @param value QR code text to convert into the QR code barcode
|
|
143
226
|
# @param [Hash] opts the optional parameters
|
|
227
|
+
# @option opts [Integer] :width Optional: width of the barcode in pixels. Minimum value of 10.
|
|
228
|
+
# @option opts [Integer] :height Optional: width of the barcode in pixels. Minimum value of 10.
|
|
144
229
|
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
|
145
230
|
def generate_barcode_qr_code_with_http_info(value, opts = {})
|
|
146
231
|
if @api_client.config.debugging
|
|
@@ -162,6 +247,8 @@ module CloudmersiveBarcodeApiClient
|
|
|
162
247
|
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
|
163
248
|
# HTTP header 'Content-Type'
|
|
164
249
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
|
|
250
|
+
header_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
|
|
251
|
+
header_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
|
|
165
252
|
|
|
166
253
|
# form parameters
|
|
167
254
|
form_params = {}
|
|
@@ -185,6 +272,9 @@ module CloudmersiveBarcodeApiClient
|
|
|
185
272
|
# Validate and generate a UPC-A barcode as a PNG file, a type of 1D barcode
|
|
186
273
|
# @param value UPC-A barcode value to generate from
|
|
187
274
|
# @param [Hash] opts the optional parameters
|
|
275
|
+
# @option opts [Integer] :width Optional: width of the barcode in pixels. Minimum value of 10.
|
|
276
|
+
# @option opts [Integer] :height Optional: width of the barcode in pixels. Minimum value of 10.
|
|
277
|
+
# @option opts [BOOLEAN] :include_label Optional: show text label on the image of the barcode value, default is true.
|
|
188
278
|
# @return [String]
|
|
189
279
|
def generate_barcode_upca(value, opts = {})
|
|
190
280
|
data, _status_code, _headers = generate_barcode_upca_with_http_info(value, opts)
|
|
@@ -195,6 +285,9 @@ module CloudmersiveBarcodeApiClient
|
|
|
195
285
|
# Validate and generate a UPC-A barcode as a PNG file, a type of 1D barcode
|
|
196
286
|
# @param value UPC-A barcode value to generate from
|
|
197
287
|
# @param [Hash] opts the optional parameters
|
|
288
|
+
# @option opts [Integer] :width Optional: width of the barcode in pixels. Minimum value of 10.
|
|
289
|
+
# @option opts [Integer] :height Optional: width of the barcode in pixels. Minimum value of 10.
|
|
290
|
+
# @option opts [BOOLEAN] :include_label Optional: show text label on the image of the barcode value, default is true.
|
|
198
291
|
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
|
199
292
|
def generate_barcode_upca_with_http_info(value, opts = {})
|
|
200
293
|
if @api_client.config.debugging
|
|
@@ -216,6 +309,9 @@ module CloudmersiveBarcodeApiClient
|
|
|
216
309
|
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
|
217
310
|
# HTTP header 'Content-Type'
|
|
218
311
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
|
|
312
|
+
header_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
|
|
313
|
+
header_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
|
|
314
|
+
header_params[:'includeLabel'] = opts[:'include_label'] if !opts[:'include_label'].nil?
|
|
219
315
|
|
|
220
316
|
# form parameters
|
|
221
317
|
form_params = {}
|
|
@@ -239,6 +335,9 @@ module CloudmersiveBarcodeApiClient
|
|
|
239
335
|
# Validates and generate a UPC-E barcode as a PNG file, a type of 1D barcode
|
|
240
336
|
# @param value UPC-E barcode value to generate from
|
|
241
337
|
# @param [Hash] opts the optional parameters
|
|
338
|
+
# @option opts [Integer] :width Optional: width of the barcode in pixels. Minimum value of 10.
|
|
339
|
+
# @option opts [Integer] :height Optional: width of the barcode in pixels. Minimum value of 10.
|
|
340
|
+
# @option opts [BOOLEAN] :include_label Optional: show text label on the image of the barcode value, default is true.
|
|
242
341
|
# @return [String]
|
|
243
342
|
def generate_barcode_upce(value, opts = {})
|
|
244
343
|
data, _status_code, _headers = generate_barcode_upce_with_http_info(value, opts)
|
|
@@ -249,6 +348,9 @@ module CloudmersiveBarcodeApiClient
|
|
|
249
348
|
# Validates and generate a UPC-E barcode as a PNG file, a type of 1D barcode
|
|
250
349
|
# @param value UPC-E barcode value to generate from
|
|
251
350
|
# @param [Hash] opts the optional parameters
|
|
351
|
+
# @option opts [Integer] :width Optional: width of the barcode in pixels. Minimum value of 10.
|
|
352
|
+
# @option opts [Integer] :height Optional: width of the barcode in pixels. Minimum value of 10.
|
|
353
|
+
# @option opts [BOOLEAN] :include_label Optional: show text label on the image of the barcode value, default is true.
|
|
252
354
|
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
|
253
355
|
def generate_barcode_upce_with_http_info(value, opts = {})
|
|
254
356
|
if @api_client.config.debugging
|
|
@@ -270,6 +372,9 @@ module CloudmersiveBarcodeApiClient
|
|
|
270
372
|
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
|
271
373
|
# HTTP header 'Content-Type'
|
|
272
374
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
|
|
375
|
+
header_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
|
|
376
|
+
header_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
|
|
377
|
+
header_params[:'includeLabel'] = opts[:'include_label'] if !opts[:'include_label'].nil?
|
|
273
378
|
|
|
274
379
|
# form parameters
|
|
275
380
|
form_params = {}
|
|
@@ -0,0 +1,196 @@
|
|
|
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
|
+
# Advanced barcode scan result instance
|
|
17
|
+
class BarcodeAdvancedResultItem
|
|
18
|
+
# The barcode text
|
|
19
|
+
attr_accessor :raw_text
|
|
20
|
+
|
|
21
|
+
# Type of the barcode; supported barcode types include AZTEC, CODABAR, CODE_39, CODE_93, CODE_128, DATA_MATRIX, EAN_8, EAN_13, ITF, MAXICODE, PDF_417, QR_CODE, RSS_14, RSS_EXPANDED, UPC_A, UPC_E, All_1D, UPC_EAN_EXTENSION, MSI, PLESSEY, IMB.
|
|
22
|
+
attr_accessor :barcode_type
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'raw_text' => :'RawText',
|
|
28
|
+
:'barcode_type' => :'BarcodeType'
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Attribute type mapping.
|
|
33
|
+
def self.swagger_types
|
|
34
|
+
{
|
|
35
|
+
:'raw_text' => :'String',
|
|
36
|
+
:'barcode_type' => :'String'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Initializes the object
|
|
41
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
42
|
+
def initialize(attributes = {})
|
|
43
|
+
return unless attributes.is_a?(Hash)
|
|
44
|
+
|
|
45
|
+
# convert string to symbol for hash key
|
|
46
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
47
|
+
|
|
48
|
+
if attributes.has_key?(:'RawText')
|
|
49
|
+
self.raw_text = attributes[:'RawText']
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
if attributes.has_key?(:'BarcodeType')
|
|
53
|
+
self.barcode_type = attributes[:'BarcodeType']
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
58
|
+
# @return Array for valid properties with the reasons
|
|
59
|
+
def list_invalid_properties
|
|
60
|
+
invalid_properties = Array.new
|
|
61
|
+
invalid_properties
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Check to see if the all the properties in the model are valid
|
|
65
|
+
# @return true if the model is valid
|
|
66
|
+
def valid?
|
|
67
|
+
true
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Checks equality by comparing each attribute.
|
|
71
|
+
# @param [Object] Object to be compared
|
|
72
|
+
def ==(o)
|
|
73
|
+
return true if self.equal?(o)
|
|
74
|
+
self.class == o.class &&
|
|
75
|
+
raw_text == o.raw_text &&
|
|
76
|
+
barcode_type == o.barcode_type
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# @see the `==` method
|
|
80
|
+
# @param [Object] Object to be compared
|
|
81
|
+
def eql?(o)
|
|
82
|
+
self == o
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Calculates hash code according to all attributes.
|
|
86
|
+
# @return [Fixnum] Hash code
|
|
87
|
+
def hash
|
|
88
|
+
[raw_text, barcode_type].hash
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Builds the object from hash
|
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
93
|
+
# @return [Object] Returns the model itself
|
|
94
|
+
def build_from_hash(attributes)
|
|
95
|
+
return nil unless attributes.is_a?(Hash)
|
|
96
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
97
|
+
if type =~ /\AArray<(.*)>/i
|
|
98
|
+
# check to ensure the input is an array given that the attribute
|
|
99
|
+
# is documented as an array but the input is not
|
|
100
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
101
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
102
|
+
end
|
|
103
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
104
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
105
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
self
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Deserializes the data based on type
|
|
112
|
+
# @param string type Data type
|
|
113
|
+
# @param string value Value to be deserialized
|
|
114
|
+
# @return [Object] Deserialized data
|
|
115
|
+
def _deserialize(type, value)
|
|
116
|
+
case type.to_sym
|
|
117
|
+
when :DateTime
|
|
118
|
+
DateTime.parse(value)
|
|
119
|
+
when :Date
|
|
120
|
+
Date.parse(value)
|
|
121
|
+
when :String
|
|
122
|
+
value.to_s
|
|
123
|
+
when :Integer
|
|
124
|
+
value.to_i
|
|
125
|
+
when :Float
|
|
126
|
+
value.to_f
|
|
127
|
+
when :BOOLEAN
|
|
128
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
129
|
+
true
|
|
130
|
+
else
|
|
131
|
+
false
|
|
132
|
+
end
|
|
133
|
+
when :Object
|
|
134
|
+
# generic object (usually a Hash), return directly
|
|
135
|
+
value
|
|
136
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
137
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
138
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
139
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
140
|
+
k_type = Regexp.last_match[:k_type]
|
|
141
|
+
v_type = Regexp.last_match[:v_type]
|
|
142
|
+
{}.tap do |hash|
|
|
143
|
+
value.each do |k, v|
|
|
144
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
else # model
|
|
148
|
+
temp_model = CloudmersiveBarcodeApiClient.const_get(type).new
|
|
149
|
+
temp_model.build_from_hash(value)
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Returns the string representation of the object
|
|
154
|
+
# @return [String] String presentation of the object
|
|
155
|
+
def to_s
|
|
156
|
+
to_hash.to_s
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
160
|
+
# @return [Hash] Returns the object in the form of hash
|
|
161
|
+
def to_body
|
|
162
|
+
to_hash
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Returns the object in the form of hash
|
|
166
|
+
# @return [Hash] Returns the object in the form of hash
|
|
167
|
+
def to_hash
|
|
168
|
+
hash = {}
|
|
169
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
170
|
+
value = self.send(attr)
|
|
171
|
+
next if value.nil?
|
|
172
|
+
hash[param] = _to_hash(value)
|
|
173
|
+
end
|
|
174
|
+
hash
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Outputs non-array value in the form of hash
|
|
178
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
179
|
+
# @param [Object] value Any valid value
|
|
180
|
+
# @return [Hash] Returns the value in the form of hash
|
|
181
|
+
def _to_hash(value)
|
|
182
|
+
if value.is_a?(Array)
|
|
183
|
+
value.compact.map { |v| _to_hash(v) }
|
|
184
|
+
elsif value.is_a?(Hash)
|
|
185
|
+
{}.tap do |hash|
|
|
186
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
187
|
+
end
|
|
188
|
+
elsif value.respond_to? :to_hash
|
|
189
|
+
value.to_hash
|
|
190
|
+
else
|
|
191
|
+
value
|
|
192
|
+
end
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
end
|
|
196
|
+
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 barcode scan
|
|
17
|
+
class BarcodeAdvancedScanResult
|
|
18
|
+
# True if the operation was successful, false otherwise
|
|
19
|
+
attr_accessor :successful
|
|
20
|
+
|
|
21
|
+
# Results of performing the 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<BarcodeAdvancedResultItem>',
|
|
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
|