Class: AsposeBarcodeCloud::BarcodeApi

Inherits:
Object
  • Object
show all
Defined in:
lib/aspose_barcode_cloud/api/barcode_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = nil) ⇒ BarcodeApi

Returns a new instance of BarcodeApi.



7
8
9
# File 'lib/aspose_barcode_cloud/api/barcode_api.rb', line 7

def initialize(api_client = nil)
  @api_client = api_client || Configuration.api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



5
6
7
# File 'lib/aspose_barcode_cloud/api/barcode_api.rb', line 5

def api_client
  @api_client
end

Instance Method Details

#get_barcode_generate(opts = {}) ⇒ File

Generate barcode.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :text (String)

    The code text.

  • :type (String)

    Barcode type.

  • :format (String)

    Result format.

  • :resolution_x (Float)

    Horizontal resolution.

  • :resolution_y (Float)

    Vertical resolution.

  • :dimension_x (Float)

    Smallest width of barcode unit (bar or space).

  • :dimension_y (Float)

    Smallest height of barcode unit (for 2D barcodes).

  • :enable_checksum (String)

    Sets if checksum will be generated.

Returns:

  • (File)


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/aspose_barcode_cloud/api/barcode_api.rb', line 23

def get_barcode_generate(opts = {})
  if Configuration.debugging
    Configuration.logger.debug "Calling API: BarcodeApi#get_barcode_generate ..."
  end
  
  # resource path
  path = "/barcode/generate".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'text'] = opts[:'text'] if opts[:'text']
  query_params[:'type'] = opts[:'type'] if opts[:'type']
  query_params[:'format'] = opts[:'format'] if opts[:'format']
  query_params[:'resolutionX'] = opts[:'resolution_x'] if opts[:'resolution_x']
  query_params[:'resolutionY'] = opts[:'resolution_y'] if opts[:'resolution_y']
  query_params[:'dimensionX'] = opts[:'dimension_x'] if opts[:'dimension_x']
  query_params[:'dimensionY'] = opts[:'dimension_y'] if opts[:'dimension_y']
  query_params[:'enableChecksum'] = opts[:'enable_checksum'] if opts[:'enable_checksum']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = []
  result = @api_client.call_api(:GET, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'File')
  if Configuration.debugging
    Configuration.logger.debug "API called: BarcodeApi#get_barcode_generate. Result: #{result.inspect}"
  end
  return result
end

#get_barcode_recognize(name, opts = {}) ⇒ BarcodeResponseList

Recognize barcode from a file on server.

Parameters:

  • name

    The image name.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :type (String)

    The barcode type.

  • :checksum_validation (String)

    Checksum validation parameter.

  • :strip_fnc (BOOLEAN)

    Allows to strip FNC symbol in recognition results.

  • :rotation_angle (Integer)

    Allows to correct angle of barcode.

  • :barcodes_count (Integer)

    Count of barcodes to recognize.

  • :rect_x (Integer)

    Top left point X coordinate of System.Drawing.Rectangle to recognize barcode inside.

  • :rect_y (Integer)

    Top left point Y coordinate of System.Drawing.Rectangle to recognize barcode inside.

  • :rect_width (Integer)

    Width of System.Drawing.Rectangle to recognize barcode inside.

  • :rect_height (Integer)

    Height of System.Drawing.Rectangle to recognize barcode inside.

  • :storage (String)

    The image storage.

  • :folder (String)

    The image folder.

Returns:



358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
# File 'lib/aspose_barcode_cloud/api/barcode_api.rb', line 358

def get_barcode_recognize(name, opts = {})
  if Configuration.debugging
    Configuration.logger.debug "Calling API: BarcodeApi#get_barcode_recognize ..."
  end
  
  # verify the required parameter 'name' is set
  fail "Missing the required parameter 'name' when calling get_barcode_recognize" if name.nil?
  
  # resource path
  path = "/barcode/{name}/recognize".sub('{format}','json').sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  query_params[:'type'] = opts[:'type'] if opts[:'type']
  query_params[:'checksumValidation'] = opts[:'checksum_validation'] if opts[:'checksum_validation']
  query_params[:'stripFnc'] = opts[:'strip_fnc'] if opts[:'strip_fnc']
  query_params[:'rotationAngle'] = opts[:'rotation_angle'] if opts[:'rotation_angle']
  query_params[:'barcodesCount'] = opts[:'barcodes_count'] if opts[:'barcodes_count']
  query_params[:'rectX'] = opts[:'rect_x'] if opts[:'rect_x']
  query_params[:'rectY'] = opts[:'rect_y'] if opts[:'rect_y']
  query_params[:'rectWidth'] = opts[:'rect_width'] if opts[:'rect_width']
  query_params[:'rectHeight'] = opts[:'rect_height'] if opts[:'rect_height']
  query_params[:'storage'] = opts[:'storage'] if opts[:'storage']
  query_params[:'folder'] = opts[:'folder'] if opts[:'folder']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = []
  result = @api_client.call_api(:GET, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'BarcodeResponseList')
  if Configuration.debugging
    Configuration.logger.debug "API called: BarcodeApi#get_barcode_recognize. Result: #{result.inspect}"
  end
  return result
end

#post_barcode_recognize_from_urlor_content(opts = {}) ⇒ BarcodeResponseList

Recognize barcode from an url.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :type (String)

    Barcode type.

  • :checksum_validation (String)

    Checksum validation parameter.

  • :strip_fnc (BOOLEAN)

    Allows to strip FNC symbol in recognition results.

  • :rotation_angle (Integer)

    Recognition of rotated barcode. Possible angles are 90, 180, 270, default is 0

  • :url (String)

    The image file url.

  • :file (File)

Returns:



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/aspose_barcode_cloud/api/barcode_api.rb', line 137

def post_barcode_recognize_from_urlor_content(opts = {})
  if Configuration.debugging
    Configuration.logger.debug "Calling API: BarcodeApi#post_barcode_recognize_from_urlor_content ..."
  end
  
  # resource path
  path = "/barcode/recognize".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'type'] = opts[:'type'] if opts[:'type']
  query_params[:'checksumValidation'] = opts[:'checksum_validation'] if opts[:'checksum_validation']
  query_params[:'stripFnc'] = opts[:'strip_fnc'] if opts[:'strip_fnc']
  query_params[:'rotationAngle'] = opts[:'rotation_angle'] if opts[:'rotation_angle']
  query_params[:'url'] = opts[:'url'] if opts[:'url']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json', 'text/json', 'application/xml', 'text/xml', 'text/javascript']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['multipart/form-data']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}
  form_params["file"] = opts[:'file'] if opts[:'file']

  # http body (model)
  post_body = nil
  

  auth_names = []
  result = @api_client.call_api(:POST, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'BarcodeResponseList')
  if Configuration.debugging
    Configuration.logger.debug "API called: BarcodeApi#post_barcode_recognize_from_urlor_content. Result: #{result.inspect}"
  end
  return result
end

#post_generate_multiple(dto, opts = {}) ⇒ File

Generate multiple barcodes and return in response stream

Parameters:

  • dto

    List of barcodes

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :format (String)

    Format to return stream in

Returns:

  • (File)


80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/aspose_barcode_cloud/api/barcode_api.rb', line 80

def post_generate_multiple(dto, opts = {})
  if Configuration.debugging
    Configuration.logger.debug "Calling API: BarcodeApi#post_generate_multiple ..."
  end
  
  # verify the required parameter 'dto' is set
  fail "Missing the required parameter 'dto' when calling post_generate_multiple" if dto.nil?
  
  # resource path
  path = "/barcode/generateMultiple".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'format'] = opts[:'format'] if opts[:'format']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json', 'text/json', 'application/xml', 'text/xml', 'text/javascript', 'application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(dto)
  

  auth_names = []
  result = @api_client.call_api(:POST, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'File')
  if Configuration.debugging
    Configuration.logger.debug "API called: BarcodeApi#post_generate_multiple. Result: #{result.inspect}"
  end
  return result
end

#put_barcode_generate_file(name, opts = {}) ⇒ BaseResponse

Generate barcode and save on server.

Parameters:

  • name

    The image name.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :text (String)

    Barcode's text.

  • :type (String)

    The barcode type.

  • :format (String)

    The image format.

  • :resolution_x (Float)

    Horizontal resolution.

  • :resolution_y (Float)

    Vertical resolution.

  • :dimension_x (Float)

    Smallest width of barcode unit (bar or space).

  • :dimension_y (Float)

    Smallest height of barcode unit (for 2D barcodes).

  • :code_location (String)

    CodeLocation property of the barcode.

  • :gr_unit (String)

    Measurement of barcode properties.

  • :auto_size (String)

    Sets if barcode size will be updated automatically.

  • :bar_height (Float)

    Height of the bar.

  • :image_height (Float)

    Height of the image.

  • :image_width (Float)

    Width of the image.

  • :image_quality (String)

    Detepmines ImageQualityMode of the barcode image.

  • :rot_angle (Float)

    Angle of barcode orientation.

  • :top_margin (Float)

    Top margin.

  • :bottom_margin (Float)

    Bottom margin.

  • :left_margin (Float)

    Left margin.

  • :right_margin (Float)

    Right margin.

  • :enable_checksum (String)

    Sets if checksum will be generated.

  • :storage (String)

    Image's storage.

  • :folder (String)

    Image's folder.

  • :file (File)

Returns:



214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
# File 'lib/aspose_barcode_cloud/api/barcode_api.rb', line 214

def put_barcode_generate_file(name, opts = {})
  if Configuration.debugging
    Configuration.logger.debug "Calling API: BarcodeApi#put_barcode_generate_file ..."
  end
  
  # verify the required parameter 'name' is set
  fail "Missing the required parameter 'name' when calling put_barcode_generate_file" if name.nil?
  
  # resource path
  path = "/barcode/{name}/generate".sub('{format}','json').sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  query_params[:'text'] = opts[:'text'] if opts[:'text']
  query_params[:'type'] = opts[:'type'] if opts[:'type']
  query_params[:'format'] = opts[:'format'] if opts[:'format']
  query_params[:'resolutionX'] = opts[:'resolution_x'] if opts[:'resolution_x']
  query_params[:'resolutionY'] = opts[:'resolution_y'] if opts[:'resolution_y']
  query_params[:'dimensionX'] = opts[:'dimension_x'] if opts[:'dimension_x']
  query_params[:'dimensionY'] = opts[:'dimension_y'] if opts[:'dimension_y']
  query_params[:'codeLocation'] = opts[:'code_location'] if opts[:'code_location']
  query_params[:'grUnit'] = opts[:'gr_unit'] if opts[:'gr_unit']
  query_params[:'autoSize'] = opts[:'auto_size'] if opts[:'auto_size']
  query_params[:'barHeight'] = opts[:'bar_height'] if opts[:'bar_height']
  query_params[:'imageHeight'] = opts[:'image_height'] if opts[:'image_height']
  query_params[:'imageWidth'] = opts[:'image_width'] if opts[:'image_width']
  query_params[:'imageQuality'] = opts[:'image_quality'] if opts[:'image_quality']
  query_params[:'rotAngle'] = opts[:'rot_angle'] if opts[:'rot_angle']
  query_params[:'topMargin'] = opts[:'top_margin'] if opts[:'top_margin']
  query_params[:'bottomMargin'] = opts[:'bottom_margin'] if opts[:'bottom_margin']
  query_params[:'leftMargin'] = opts[:'left_margin'] if opts[:'left_margin']
  query_params[:'rightMargin'] = opts[:'right_margin'] if opts[:'right_margin']
  query_params[:'enableChecksum'] = opts[:'enable_checksum'] if opts[:'enable_checksum']
  query_params[:'storage'] = opts[:'storage'] if opts[:'storage']
  query_params[:'folder'] = opts[:'folder'] if opts[:'folder']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}
  form_params["file"] = opts[:'file'] if opts[:'file']

  # http body (model)
  post_body = nil
  

  auth_names = []
  result = @api_client.call_api(:PUT, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'BaseResponse')
  if Configuration.debugging
    Configuration.logger.debug "API called: BarcodeApi#put_barcode_generate_file. Result: #{result.inspect}"
  end
  return result
end

#put_barcode_recognize_from_body(name, barcode_reader, opts = {}) ⇒ BarcodeResponseList

Recognition of a barcode from file on server with parameters in body.

Parameters:

  • name

    The image name.

  • barcode_reader

    BarcodeReader object with parameters.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :type (String)

    The barcode type.

  • :folder (String)

    The image folder.

Returns:



423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
# File 'lib/aspose_barcode_cloud/api/barcode_api.rb', line 423

def put_barcode_recognize_from_body(name, barcode_reader, opts = {})
  if Configuration.debugging
    Configuration.logger.debug "Calling API: BarcodeApi#put_barcode_recognize_from_body ..."
  end
  
  # verify the required parameter 'name' is set
  fail "Missing the required parameter 'name' when calling put_barcode_recognize_from_body" if name.nil?
  
  # verify the required parameter 'barcode_reader' is set
  fail "Missing the required parameter 'barcode_reader' when calling put_barcode_recognize_from_body" if barcode_reader.nil?
  
  # resource path
  path = "/barcode/{name}/recognize".sub('{format}','json').sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  query_params[:'type'] = opts[:'type'] if opts[:'type']
  query_params[:'folder'] = opts[:'folder'] if opts[:'folder']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json', 'text/json', 'application/xml', 'text/xml', 'text/javascript']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json', 'text/json', 'application/xml', 'text/xml', 'text/javascript', 'application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(barcode_reader)
  

  auth_names = []
  result = @api_client.call_api(:PUT, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'BarcodeResponseList')
  if Configuration.debugging
    Configuration.logger.debug "API called: BarcodeApi#put_barcode_recognize_from_body. Result: #{result.inspect}"
  end
  return result
end

#put_generate_multiple(name, dto, opts = {}) ⇒ BaseResponse

Generate image with multiple barcodes and put new file on server

Parameters:

  • name

    New filename

  • dto

    List of barcodes

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :format (String)

    Format of file

  • :folder (String)

    Folder to place file to

Returns:



291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
# File 'lib/aspose_barcode_cloud/api/barcode_api.rb', line 291

def put_generate_multiple(name, dto, opts = {})
  if Configuration.debugging
    Configuration.logger.debug "Calling API: BarcodeApi#put_generate_multiple ..."
  end
  
  # verify the required parameter 'name' is set
  fail "Missing the required parameter 'name' when calling put_generate_multiple" if name.nil?
  
  # verify the required parameter 'dto' is set
  fail "Missing the required parameter 'dto' when calling put_generate_multiple" if dto.nil?
  
  # resource path
  path = "/barcode/{name}/generateMultiple".sub('{format}','json').sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  query_params[:'format'] = opts[:'format'] if opts[:'format']
  query_params[:'folder'] = opts[:'folder'] if opts[:'folder']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json', 'text/json', 'application/xml', 'text/xml', 'text/javascript']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json', 'text/json', 'application/xml', 'text/xml', 'text/javascript', 'application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(dto)
  

  auth_names = []
  result = @api_client.call_api(:PUT, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'BaseResponse')
  if Configuration.debugging
    Configuration.logger.debug "API called: BarcodeApi#put_generate_multiple. Result: #{result.inspect}"
  end
  return result
end