aspose_cells_cloud 22.4 → 22.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ea2e2f191a6270345967bd0eb15daf9ca4a62fc58a237187e6f2f2bd76dfaddd
4
- data.tar.gz: 005d92eaf768d1d318b23e3baa2da88b285c3a804ee8a95b4ca8c890e7eba799
3
+ metadata.gz: b0def74a407c4a24e80749a740b1450ec8acce19c13f7df26fc63ed56202ca79
4
+ data.tar.gz: 195f29b30be2e220a59c2c6a06265cbbf15c4829d402c6581adc48997e6718c9
5
5
  SHA512:
6
- metadata.gz: 99cb82511828de8a83125f5d78e463dcbed3dd6e7c3bce6e0f9168b16de25efcf5112f84fb8dcebc0e6b0e12fefe1b4274888ddd032990d407489dd1f5a498aa
7
- data.tar.gz: 68e6fae2f985f3d9df4c3884e6fb235f34f4ecfaa3b74b5cf75359170d96f13f479bfecb545fa614e9208f59efcf8e07d06d8b39156528df216900434508228b
6
+ metadata.gz: b6c72f78993e7dc818eaf05b3c5262b795f9097169a6be8219e71bc50e02c0f552774026361ccdb8f3d34f52242b88fa989c31d2e235a3e25378b05c2d3462a9
7
+ data.tar.gz: eb34ef8e5e47a996832a366de1eb1d3ca0cbb00fe04218b841966a4bac2b7449125753d7213ddb35fa70eb9c7291318ffe4f18ca42a34dee580e7300196240b8
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) ![Gem](https://img.shields.io/gem/v/aspose_cells_cloud) ![Gem](https://img.shields.io/gem/dt/aspose_cells_cloud) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-ruby)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-ruby/22.4)
1
+ ![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) ![Gem](https://img.shields.io/gem/v/aspose_cells_cloud) ![Gem](https://img.shields.io/gem/dt/aspose_cells_cloud) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-ruby)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-ruby/22.7)
2
2
 
3
3
 
4
4
  # Ruby SDK for Spreadsheet Processing in the Cloud
@@ -22,13 +22,10 @@ Ruby Cloud SDK wraps Aspose.Cells REST API so you could seamlessly integrate Mic
22
22
  - [Convert Excel files to popular formats](https://docs.aspose.cloud/cells/convert-excel-workbook-to-different-file-formats/).
23
23
 
24
24
 
25
- ## Feature & Enhancements in Version 22.4
26
-
27
- - Export API adds extended query parameters.
28
- - Convert API adds extended query parameters.
29
- - SaveAs API adds extended query parameters.
30
- - Get Workbook API adds extended query parameters.
25
+ ## Feature & Enhancements in Version 22.7
31
26
 
27
+ - Add 4 kinds of Save Option.
28
+ - Add the checkExcelRestriction parameter for multiple APIs.
32
29
 
33
30
  ## Read & Write Spreadsheet Formats
34
31
 
@@ -7353,7 +7353,80 @@ module AsposeCellsCloud
7353
7353
  end
7354
7354
  return data, status_code, headers
7355
7355
  end
7356
+ # Get chart area border info.
7357
+ #
7358
+ # @param name Workbook name.
7359
+ # @param sheet_name Worksheet name.
7360
+ # @param picture_index The picture index.
7361
+ # @param [Hash] opts the optional parameters
7362
+ # @option opts [String] :folder Workbook folder.
7363
+ # @option opts [String] :storage_name storage name.
7364
+ # @return [BarcodeResponseList]
7365
+ def cells_picture_get_extract_barcodes(name, sheet_name, picture_index, opts = {})
7366
+ data, _status_code, _headers = cells_picture_get_extract_barcodes_with_http_info(name, sheet_name, picture_index, opts)
7367
+ return data
7368
+ end
7369
+
7370
+ # Get chart area border info.
7371
+ #
7372
+ # @param name Workbook name.
7373
+ # @param sheet_name Worksheet name.
7374
+ # @param picture_index The picture index.
7375
+ # @param [Hash] opts the optional parameters
7376
+ # @option opts [String] :folder Workbook folder.
7377
+ # @option opts [String] :storage_name storage name.
7378
+ # @return [Array<(BarcodeResponseList, Fixnum, Hash)>] BarcodeResponseList data, response status code and response headers
7379
+ def cells_picture_get_extract_barcodes_with_http_info(name, sheet_name, picture_index, opts = {})
7380
+ if @api_client.config.debugging
7381
+ @api_client.config.logger.debug "Calling API: CellsApi.cells_picture_get_extract_barcodes ..."
7382
+ end
7383
+ @api_client.request_token_if_needed
7384
+ # verify the required parameter 'name' is set
7385
+ if @api_client.config.client_side_validation && name.nil?
7386
+ fail ArgumentError, "Missing the required parameter 'name' when calling CellsApi.cells_picture_get_extract_barcodes"
7387
+ end
7388
+ # verify the required parameter 'sheet_name' is set
7389
+ if @api_client.config.client_side_validation && sheet_name.nil?
7390
+ fail ArgumentError, "Missing the required parameter 'sheet_name' when calling CellsApi.cells_picture_get_extract_barcodes"
7391
+ end
7392
+ # verify the required parameter 'picture_index' is set
7393
+ if @api_client.config.client_side_validation && picture_index.nil?
7394
+ fail ArgumentError, "Missing the required parameter 'picture_index' when calling CellsApi.cells_picture_get_extract_barcodes"
7395
+ end
7396
+ # resource path
7397
+ local_var_path = "/cells/{name}/worksheets/{sheetName}/pictures/{pictureIndex}/recognize".sub('{' + 'name' + '}', name.to_s).sub('{' + 'sheetName' + '}', sheet_name.to_s).sub('{' + 'pictureIndex' + '}', picture_index.to_s)
7398
+
7399
+ # query parameters
7400
+ query_params = {}
7401
+ query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
7402
+ query_params[:'storageName'] = opts[:'storage_name'] if !opts[:'storage_name'].nil?
7403
+
7404
+ # header parameters
7405
+ header_params = {}
7406
+ # HTTP header 'Accept' (if needed)
7407
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
7408
+ # HTTP header 'Content-Type'
7409
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
7410
+
7411
+ # form parameters
7412
+ form_params = {}
7356
7413
 
7414
+ # http body (model)
7415
+ post_body = nil
7416
+ #auth_names = []
7417
+ auth_names = ['JWT']
7418
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
7419
+ :header_params => header_params,
7420
+ :query_params => query_params,
7421
+ :form_params => form_params,
7422
+ :body => post_body,
7423
+ :auth_names => auth_names,
7424
+ :return_type => 'BarcodeResponseList')
7425
+ if @api_client.config.debugging
7426
+ @api_client.config.logger.debug "API called: CellsApi#cells_picture_get_extract_barcodes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
7427
+ end
7428
+ return data, status_code, headers
7429
+ end
7357
7430
  # Delete a picture object in worksheet
7358
7431
  #
7359
7432
  # @param name The workbook name.
@@ -13316,6 +13389,7 @@ module AsposeCellsCloud
13316
13389
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
13317
13390
  query_params[:'storageName'] = opts[:'storage_name'] if !opts[:'storage_name'].nil?
13318
13391
  query_params[:'outStorageName'] = opts[:'out_storage_name'] if !opts[:'out_storage_name'].nil?
13392
+ query_params[:'checkExcelRestriction'] = opts[:'check_excel_restriction'] if !opts[:'check_excel_restriction'].nil?
13319
13393
  if opts[:'extendedQueryParameters']
13320
13394
  opts[:'extendedQueryParameters'].each do |key , value|
13321
13395
  query_params[key] = value
@@ -66,6 +66,7 @@ module AsposeCellsCloud
66
66
  # query parameters
67
67
  query_params = {}
68
68
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
69
+ query_params[:'checkExcelRestriction'] = opts[:'check_excel_restriction'] if !opts[:'check_excel_restriction'].nil?
69
70
 
70
71
  # header parameters
71
72
  header_params = {}
@@ -130,6 +131,7 @@ module AsposeCellsCloud
130
131
  # query parameters
131
132
  query_params = {}
132
133
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
134
+ query_params[:'checkExcelRestriction'] = opts[:'check_excel_restriction'] if !opts[:'check_excel_restriction'].nil?
133
135
 
134
136
  # header parameters
135
137
  header_params = {}
@@ -201,6 +203,7 @@ module AsposeCellsCloud
201
203
  query_params = {}
202
204
  query_params[:'datasource'] = datasource
203
205
  query_params[:'format'] = opts[:'format'] if !opts[:'format'].nil?
206
+ query_params[:'checkExcelRestriction'] = opts[:'check_excel_restriction'] if !opts[:'check_excel_restriction'].nil?
204
207
 
205
208
  # header parameters
206
209
  header_params = {}
@@ -269,7 +272,9 @@ module AsposeCellsCloud
269
272
  # query parameters
270
273
  query_params = {}
271
274
  query_params[:'objecttype'] = objecttype
272
-
275
+ query_params[:'sheetname'] = opts[:'sheetname'] if !opts[:'sheetname'].nil?
276
+ query_params[:'outFormat'] = opts[:'out_format'] if !opts[:'out_format'].nil?
277
+ query_params[:'checkExcelRestriction'] = opts[:'check_excel_restriction'] if !opts[:'check_excel_restriction'].nil?
273
278
  # header parameters
274
279
  header_params = {}
275
280
  # HTTP header 'Accept' (if needed)
@@ -344,6 +349,7 @@ module AsposeCellsCloud
344
349
  query_params = {}
345
350
  query_params[:'objectType'] = object_type
346
351
  query_params[:'format'] = format
352
+ query_params[:'checkExcelRestriction'] = opts[:'check_excel_restriction'] if !opts[:'check_excel_restriction'].nil?
347
353
  if opts[:'extendedQueryParameters']
348
354
  opts[:'extendedQueryParameters'].each do |key , value|
349
355
  query_params[key] = value
@@ -490,6 +496,7 @@ module AsposeCellsCloud
490
496
  query_params = {}
491
497
  query_params[:'format'] = opts[:'format'] if !opts[:'format'].nil?
492
498
  query_params[:'mergeToOneSheet'] = opts[:'merge_to_one_sheet'] if !opts[:'merge_to_one_sheet'].nil?
499
+ query_params[:'checkExcelRestriction'] = opts[:'check_excel_restriction'] if !opts[:'check_excel_restriction'].nil?
493
500
 
494
501
  # header parameters
495
502
  header_params = {}
@@ -557,6 +564,7 @@ module AsposeCellsCloud
557
564
 
558
565
  # query parameters
559
566
  query_params = {}
567
+ query_params[:'checkExcelRestriction'] = opts[:'check_excel_restriction'] if !opts[:'check_excel_restriction'].nil?
560
568
 
561
569
  # header parameters
562
570
  header_params = {}
@@ -705,6 +713,7 @@ module AsposeCellsCloud
705
713
  query_params[:'text'] = text
706
714
  query_params[:'password'] = opts[:'password'] if !opts[:'password'].nil?
707
715
  query_params[:'sheetname'] = opts[:'sheetname'] if !opts[:'sheetname'].nil?
716
+ query_params[:'checkExcelRestriction'] = opts[:'check_excel_restriction'] if !opts[:'check_excel_restriction'].nil?
708
717
 
709
718
  # header parameters
710
719
  header_params = {}
@@ -784,6 +793,7 @@ module AsposeCellsCloud
784
793
  query_params[:'password'] = opts[:'password'] if !opts[:'password'].nil?
785
794
  query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
786
795
  query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
796
+ query_params[:'checkExcelRestriction'] = opts[:'check_excel_restriction'] if !opts[:'check_excel_restriction'].nil?
787
797
 
788
798
  # header parameters
789
799
  header_params = {}
@@ -927,6 +937,7 @@ module AsposeCellsCloud
927
937
  query_params = {}
928
938
  query_params[:'text'] = text
929
939
  query_params[:'color'] = color
940
+ query_params[:'checkExcelRestriction'] = opts[:'check_excel_restriction'] if !opts[:'check_excel_restriction'].nil?
930
941
 
931
942
  # header parameters
932
943
  header_params = {}
@@ -996,6 +1007,7 @@ module AsposeCellsCloud
996
1007
  # query parameters
997
1008
  query_params = {}
998
1009
  query_params[:'compressLevel'] = compress_level
1010
+ query_params[:'checkExcelRestriction'] = opts[:'check_excel_restriction'] if !opts[:'check_excel_restriction'].nil?
999
1011
 
1000
1012
  # header parameters
1001
1013
  header_params = {}
@@ -1077,6 +1089,7 @@ module AsposeCellsCloud
1077
1089
  query_params[:'newtext'] = newtext
1078
1090
  query_params[:'password'] = opts[:'password'] if !opts[:'storagpassworde_name'].nil?
1079
1091
  query_params[:'sheetName'] = opts[:'sheet_name'] if !opts[:'sheet_name'].nil?
1092
+ query_params[:'checkExcelRestriction'] = opts[:'check_excel_restriction'] if !opts[:'check_excel_restriction'].nil?
1080
1093
  # header parameters
1081
1094
  header_params = {}
1082
1095
  # HTTP header 'Accept' (if needed)
@@ -1148,6 +1161,7 @@ module AsposeCellsCloud
1148
1161
  query_params = {}
1149
1162
  query_params[:'rotateType'] = rotate_type
1150
1163
  query_params[:'format'] = format
1164
+ query_params[:'checkExcelRestriction'] = opts[:'check_excel_restriction'] if !opts[:'check_excel_restriction'].nil?
1151
1165
  # header parameters
1152
1166
  header_params = {}
1153
1167
  # HTTP header 'Accept' (if needed)
@@ -116,7 +116,7 @@ module AsposeCellsCloud
116
116
  :params => query_params,
117
117
  :body => body
118
118
  }
119
- print query_params
119
+
120
120
  if [:post, :patch, :put, :delete].include?(http_method)
121
121
  req_body = build_request_body(header_params, form_params, opts[:body])
122
122
  req_opts.update :body => req_body
@@ -0,0 +1,215 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ Copyright (c) 2022 Aspose.Cells Cloud
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
+ SOFTWARE.
19
+ --------------------------------------------------------------------------------------------------------------------
20
+
21
+ =end
22
+
23
+ require 'date'
24
+
25
+ module AsposeCellsCloud
26
+
27
+ class BarcodeResponse
28
+ attr_accessor :barcode_value
29
+
30
+ attr_accessor :barcode_type
31
+
32
+ attr_accessor :checksum
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'barcode_value' => :'BarcodeValue',
38
+ :'barcode_type' => :'BarcodeType',
39
+ :'checksum' => :'Checksum'
40
+ }
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.swagger_types
45
+ {
46
+ :'barcode_value' => :'String',
47
+ :'barcode_type' => :'String',
48
+ :'checksum' => :'String'
49
+ }
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ return unless attributes.is_a?(Hash)
56
+
57
+ # convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
59
+
60
+ if attributes.has_key?(:'BarcodeValue')
61
+ self.barcode_value = attributes[:'BarcodeValue']
62
+ end
63
+
64
+ if attributes.has_key?(:'BarcodeType')
65
+ self.barcode_type = attributes[:'BarcodeType']
66
+ end
67
+
68
+ if attributes.has_key?(:'Checksum')
69
+ self.checksum = attributes[:'Checksum']
70
+ end
71
+
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properies with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = Array.new
78
+ return invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ return true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ barcode_value == o.barcode_value &&
93
+ barcode_type == o.barcode_type &&
94
+ checksum == o.checksum
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param [Object] Object to be compared
99
+ def eql?(o)
100
+ self == o
101
+ end
102
+
103
+ # Calculates hash code according to all attributes.
104
+ # @return [Fixnum] Hash code
105
+ def hash
106
+ [barcode_value, barcode_type, checksum, region].hash
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+ self.class.swagger_types.each_pair do |key, type|
115
+ if type =~ /\AArray<(.*)>/i
116
+ # check to ensure the input is an array given that the the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :DateTime
136
+ DateTime.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :BOOLEAN
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ temp_model = AsposeCellsCloud.const_get(type).new
167
+ temp_model.build_from_hash(value)
168
+ end
169
+ end
170
+
171
+ # Returns the string representation of the object
172
+ # @return [String] String presentation of the object
173
+ def to_s
174
+ to_hash.to_s
175
+ end
176
+
177
+ # to_body is an alias to to_hash (backward compatibility)
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_body
180
+ to_hash
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ next if value.nil?
190
+ hash[param] = _to_hash(value)
191
+ end
192
+ hash
193
+ end
194
+
195
+ # Outputs non-array value in the form of hash
196
+ # For object, use to_hash. Otherwise, just return the value
197
+ # @param [Object] value Any valid value
198
+ # @return [Hash] Returns the value in the form of hash
199
+ def _to_hash(value)
200
+ if value.is_a?(Array)
201
+ value.compact.map{ |v| _to_hash(v) }
202
+ elsif value.is_a?(Hash)
203
+ {}.tap do |hash|
204
+ value.each { |k, v| hash[k] = _to_hash(v) }
205
+ end
206
+ elsif value.respond_to? :to_hash
207
+ value.to_hash
208
+ else
209
+ value
210
+ end
211
+ end
212
+
213
+ end
214
+
215
+ end
@@ -0,0 +1,200 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ Copyright (c) 2022 Aspose.Cells Cloud
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
+ SOFTWARE.
19
+ --------------------------------------------------------------------------------------------------------------------
20
+
21
+ =end
22
+
23
+ require 'date'
24
+
25
+ module AsposeCellsCloud
26
+
27
+ class BarcodeResponseList
28
+ attr_accessor :barcodes
29
+
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'barcodes' => :'Barcodes'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ {
41
+ :'barcodes' => :'Array<BarcodeResponse>'
42
+ }
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ return unless attributes.is_a?(Hash)
49
+
50
+ # convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
52
+
53
+ if attributes.has_key?(:'Barcodes')
54
+ if (value = attributes[:'Barcodes']).is_a?(Array)
55
+ self.barcodes = value
56
+ end
57
+ end
58
+
59
+ end
60
+
61
+ # Show invalid properties with the reasons. Usually used together with valid?
62
+ # @return Array for valid properies with the reasons
63
+ def list_invalid_properties
64
+ invalid_properties = Array.new
65
+ return invalid_properties
66
+ end
67
+
68
+ # Check to see if the all the properties in the model are valid
69
+ # @return true if the model is valid
70
+ def valid?
71
+ return true
72
+ end
73
+
74
+ # Checks equality by comparing each attribute.
75
+ # @param [Object] Object to be compared
76
+ def ==(o)
77
+ return true if self.equal?(o)
78
+ self.class == o.class &&
79
+ barcodes == o.barcodes
80
+ end
81
+
82
+ # @see the `==` method
83
+ # @param [Object] Object to be compared
84
+ def eql?(o)
85
+ self == o
86
+ end
87
+
88
+ # Calculates hash code according to all attributes.
89
+ # @return [Fixnum] Hash code
90
+ def hash
91
+ [barcodes].hash
92
+ end
93
+
94
+ # Builds the object from hash
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ # @return [Object] Returns the model itself
97
+ def build_from_hash(attributes)
98
+ return nil unless attributes.is_a?(Hash)
99
+ self.class.swagger_types.each_pair do |key, type|
100
+ if type =~ /\AArray<(.*)>/i
101
+ # check to ensure the input is an array given that the the attribute
102
+ # is documented as an array but the input is not
103
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
104
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
105
+ end
106
+ elsif !attributes[self.class.attribute_map[key]].nil?
107
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
108
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
109
+ end
110
+
111
+ self
112
+ end
113
+
114
+ # Deserializes the data based on type
115
+ # @param string type Data type
116
+ # @param string value Value to be deserialized
117
+ # @return [Object] Deserialized data
118
+ def _deserialize(type, value)
119
+ case type.to_sym
120
+ when :DateTime
121
+ DateTime.parse(value)
122
+ when :Date
123
+ Date.parse(value)
124
+ when :String
125
+ value.to_s
126
+ when :Integer
127
+ value.to_i
128
+ when :Float
129
+ value.to_f
130
+ when :BOOLEAN
131
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
132
+ true
133
+ else
134
+ false
135
+ end
136
+ when :Object
137
+ # generic object (usually a Hash), return directly
138
+ value
139
+ when /\AArray<(?<inner_type>.+)>\z/
140
+ inner_type = Regexp.last_match[:inner_type]
141
+ value.map { |v| _deserialize(inner_type, v) }
142
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
143
+ k_type = Regexp.last_match[:k_type]
144
+ v_type = Regexp.last_match[:v_type]
145
+ {}.tap do |hash|
146
+ value.each do |k, v|
147
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
148
+ end
149
+ end
150
+ else # model
151
+ temp_model = AsposeCellsCloud.const_get(type).new
152
+ temp_model.build_from_hash(value)
153
+ end
154
+ end
155
+
156
+ # Returns the string representation of the object
157
+ # @return [String] String presentation of the object
158
+ def to_s
159
+ to_hash.to_s
160
+ end
161
+
162
+ # to_body is an alias to to_hash (backward compatibility)
163
+ # @return [Hash] Returns the object in the form of hash
164
+ def to_body
165
+ to_hash
166
+ end
167
+
168
+ # Returns the object in the form of hash
169
+ # @return [Hash] Returns the object in the form of hash
170
+ def to_hash
171
+ hash = {}
172
+ self.class.attribute_map.each_pair do |attr, param|
173
+ value = self.send(attr)
174
+ next if value.nil?
175
+ hash[param] = _to_hash(value)
176
+ end
177
+ hash
178
+ end
179
+
180
+ # Outputs non-array value in the form of hash
181
+ # For object, use to_hash. Otherwise, just return the value
182
+ # @param [Object] value Any valid value
183
+ # @return [Hash] Returns the value in the form of hash
184
+ def _to_hash(value)
185
+ if value.is_a?(Array)
186
+ value.compact.map{ |v| _to_hash(v) }
187
+ elsif value.is_a?(Hash)
188
+ {}.tap do |hash|
189
+ value.each { |k, v| hash[k] = _to_hash(v) }
190
+ end
191
+ elsif value.respond_to? :to_hash
192
+ value.to_hash
193
+ else
194
+ value
195
+ end
196
+ end
197
+
198
+ end
199
+
200
+ end