nodeum_sdk 1.86.0 → 1.87.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.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +32 -4
  3. data/docs/ByDateFacet.md +4 -4
  4. data/docs/ByMetadataBucket.md +17 -0
  5. data/docs/ByMetadataBucketAllOf.md +17 -0
  6. data/docs/ByMetadataFacet.md +17 -0
  7. data/docs/ByMetadataFacetAllOf.md +17 -0
  8. data/docs/ByMetadataKeyBucket.md +17 -0
  9. data/docs/ByMetadataKeyBucketAllOf.md +17 -0
  10. data/docs/ByMetadataKeyBuckets.md +17 -0
  11. data/docs/ByMetadataValueBuckets.md +17 -0
  12. data/docs/ByPrimaryStorageFacet.md +4 -4
  13. data/docs/ByPrimaryTypeFacet.md +4 -4
  14. data/docs/BySecondaryStorageFacet.md +4 -4
  15. data/docs/BySizeFacet.md +4 -4
  16. data/docs/ByTaskMetadataFacet.md +17 -0
  17. data/docs/ByTaskMetadataFacetAllOf.md +17 -0
  18. data/docs/ByTypeFacetBucket.md +1 -1
  19. data/docs/CloudBucket.md +3 -1
  20. data/docs/CloudBucketsApi.md +61 -0
  21. data/docs/CloudConnector.md +3 -1
  22. data/docs/DefaultFacet.md +1 -1
  23. data/docs/FileFacet.md +3 -3
  24. data/docs/FileFacetAllOf.md +3 -3
  25. data/docs/FileMetadataDefinition.md +16 -0
  26. data/docs/FileMetadataDefinitionCollection.md +19 -0
  27. data/docs/MetadataApi.md +252 -0
  28. data/docs/MetadataDefinition.md +27 -0
  29. data/docs/StatisticsApi.md +136 -0
  30. data/docs/StorageCloudBucketFacets.md +1 -1
  31. data/docs/StorageFacet.md +1 -1
  32. data/docs/StorageNasShareFacets.md +1 -1
  33. data/docs/StoragePoolFacets.md +1 -1
  34. data/docs/StorageTapeFacets.md +1 -1
  35. data/docs/SystemGroup.md +3 -3
  36. data/docs/SystemUser.md +4 -4
  37. data/docs/TaskFacet.md +11 -7
  38. data/docs/TaskFacetAllOf.md +11 -7
  39. data/docs/TaskFacetBucket.md +12 -8
  40. data/docs/TaskFacetMetadataBucket.md +35 -0
  41. data/docs/TaskFacetMetadataKeyBucket.md +17 -0
  42. data/docs/TaskFacetMetadataKeyBucketAllOf.md +17 -0
  43. data/docs/TaskFacetMetadataKeyBuckets.md +17 -0
  44. data/docs/TaskFacetMetadataValueBuckets.md +17 -0
  45. data/docs/TaskMetadataDefinition.md +25 -0
  46. data/docs/TaskMetadataDefinitionAllOf.md +25 -0
  47. data/docs/TaskMetadataDefinitionCollection.md +19 -0
  48. data/lib/nodeum_sdk.rb +22 -0
  49. data/lib/nodeum_sdk/api/cloud_buckets_api.rb +71 -0
  50. data/lib/nodeum_sdk/api/metadata_api.rb +270 -0
  51. data/lib/nodeum_sdk/api/statistics_api.rb +151 -0
  52. data/lib/nodeum_sdk/models/by_metadata_bucket.rb +218 -0
  53. data/lib/nodeum_sdk/models/by_metadata_bucket_all_of.rb +206 -0
  54. data/lib/nodeum_sdk/models/by_metadata_facet.rb +218 -0
  55. data/lib/nodeum_sdk/models/by_metadata_facet_all_of.rb +206 -0
  56. data/lib/nodeum_sdk/models/by_metadata_key_bucket.rb +218 -0
  57. data/lib/nodeum_sdk/models/by_metadata_key_bucket_all_of.rb +206 -0
  58. data/lib/nodeum_sdk/models/by_metadata_key_buckets.rb +208 -0
  59. data/lib/nodeum_sdk/models/by_metadata_value_buckets.rb +208 -0
  60. data/lib/nodeum_sdk/models/by_task_metadata_facet.rb +218 -0
  61. data/lib/nodeum_sdk/models/by_task_metadata_facet_all_of.rb +206 -0
  62. data/lib/nodeum_sdk/models/cloud_bucket.rb +14 -4
  63. data/lib/nodeum_sdk/models/cloud_connector.rb +16 -6
  64. data/lib/nodeum_sdk/models/file_metadata_definition.rb +230 -0
  65. data/lib/nodeum_sdk/models/file_metadata_definition_collection.rb +217 -0
  66. data/lib/nodeum_sdk/models/metadata_definition.rb +285 -0
  67. data/lib/nodeum_sdk/models/task_facet.rb +22 -4
  68. data/lib/nodeum_sdk/models/task_facet_all_of.rb +22 -4
  69. data/lib/nodeum_sdk/models/task_facet_bucket.rb +22 -4
  70. data/lib/nodeum_sdk/models/task_facet_metadata_bucket.rb +295 -0
  71. data/lib/nodeum_sdk/models/task_facet_metadata_key_bucket.rb +218 -0
  72. data/lib/nodeum_sdk/models/task_facet_metadata_key_bucket_all_of.rb +206 -0
  73. data/lib/nodeum_sdk/models/task_facet_metadata_key_buckets.rb +208 -0
  74. data/lib/nodeum_sdk/models/task_facet_metadata_value_buckets.rb +208 -0
  75. data/lib/nodeum_sdk/models/task_metadata_definition.rb +288 -0
  76. data/lib/nodeum_sdk/models/task_metadata_definition_all_of.rb +276 -0
  77. data/lib/nodeum_sdk/models/task_metadata_definition_collection.rb +217 -0
  78. data/lib/nodeum_sdk/version.rb +1 -1
  79. data/spec/api/metadata_api_spec.rb +85 -0
  80. data/spec/models/by_metadata_bucket_all_of_spec.rb +41 -0
  81. data/spec/models/by_metadata_bucket_spec.rb +41 -0
  82. data/spec/models/by_metadata_facet_all_of_spec.rb +41 -0
  83. data/spec/models/by_metadata_facet_spec.rb +41 -0
  84. data/spec/models/by_metadata_key_bucket_all_of_spec.rb +41 -0
  85. data/spec/models/by_metadata_key_bucket_spec.rb +41 -0
  86. data/spec/models/by_metadata_key_buckets_spec.rb +41 -0
  87. data/spec/models/by_metadata_value_buckets_spec.rb +41 -0
  88. data/spec/models/by_task_metadata_facet_all_of_spec.rb +41 -0
  89. data/spec/models/by_task_metadata_facet_spec.rb +41 -0
  90. data/spec/models/file_metadata_definition_collection_spec.rb +47 -0
  91. data/spec/models/file_metadata_definition_spec.rb +35 -0
  92. data/spec/models/metadata_definition_spec.rb +75 -0
  93. data/spec/models/task_facet_metadata_bucket_spec.rb +95 -0
  94. data/spec/models/task_facet_metadata_key_bucket_all_of_spec.rb +41 -0
  95. data/spec/models/task_facet_metadata_key_bucket_spec.rb +41 -0
  96. data/spec/models/task_facet_metadata_key_buckets_spec.rb +41 -0
  97. data/spec/models/task_facet_metadata_value_buckets_spec.rb +41 -0
  98. data/spec/models/task_metadata_definition_all_of_spec.rb +69 -0
  99. data/spec/models/task_metadata_definition_collection_spec.rb +47 -0
  100. data/spec/models/task_metadata_definition_spec.rb +69 -0
  101. metadata +245 -157
@@ -0,0 +1,295 @@
1
+ =begin
2
+ #Nodeum API
3
+
4
+ #The Nodeum API makes it easy to tap into the digital data mesh that runs across your organisation. Make requests to our API endpoints and we’ll give you everything you need to interconnect your business workflows with your storage. All production API requests are made to: http://nodeumhostname/api/ The current production version of the API is v1. **REST** The Nodeum API is a RESTful API. This means that the API is designed to allow you to get, create, update, & delete objects with the HTTP verbs GET, POST, PUT, PATCH, & DELETE. **JSON** The Nodeum API speaks exclusively in JSON. This means that you should always set the Content-Type header to application/json to ensure that your requests are properly accepted and processed by the API. **Authentication** All API calls require user-password authentication. **Cross-Origin Resource Sharing** The Nodeum API supports CORS for communicating from Javascript for these endpoints. You will need to specify an Origin URI when creating your application to allow for CORS to be whitelisted for your domain. **Pagination** Some endpoints such as File Listing return a potentially lengthy array of objects. In order to keep the response sizes manageable the API will take advantage of pagination. Pagination is a mechanism for returning a subset of the results for a request and allowing for subsequent requests to “page” through the rest of the results until the end is reached. Paginated endpoints follow a standard interface that accepts two query parameters, limit and offset, and return a payload that follows a standard form. These parameters names and their behavior are borrowed from SQL LIMIT and OFFSET keywords. **Versioning** The Nodeum API is constantly being worked on to add features, make improvements, and fix bugs. This means that you should expect changes to be introduced and documented. However, there are some changes or additions that are considered backwards-compatible and your applications should be flexible enough to handle them. These include: - Adding new endpoints to the API - Adding new attributes to the response of an existing endpoint - Changing the order of attributes of responses (JSON by definition is an object of unordered key/value pairs) **Filter parameters** When browsing a list of items, multiple filter parameters may be applied. Some operators can be added to the value as a prefix: - `=` value is equal. Default operator, may be omitted - `!=` value is different - `>` greater than - `>=` greater than or equal - `<` lower than - `>=` lower than or equal - `><` included in list, items should be separated by `|` - `!><` not included in list, items should be separated by `|` - `~` pattern matching, may include `%` (any characters) and `_` (one character) - `!~` pattern not matching, may include `%` (any characters) and `_` (one character)
5
+
6
+ The version of the OpenAPI document: 2.1.0
7
+ Contact: info@nodeum.io
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Nodeum
16
+ class TaskFacetMetadataBucket
17
+ attr_accessor :val
18
+
19
+ attr_accessor :count
20
+
21
+ attr_accessor :to_process_size_sum
22
+
23
+ attr_accessor :processed_size_sum
24
+
25
+ attr_accessor :to_process_files_sum
26
+
27
+ attr_accessor :processed_files_sum
28
+
29
+ attr_accessor :finalized_files_sum
30
+
31
+ attr_accessor :bandwidth_avg
32
+
33
+ attr_accessor :bandwidth_count
34
+
35
+ attr_accessor :tasks_count
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'val' => :'val',
41
+ :'count' => :'count',
42
+ :'to_process_size_sum' => :'to_process_size_sum',
43
+ :'processed_size_sum' => :'processed_size_sum',
44
+ :'to_process_files_sum' => :'to_process_files_sum',
45
+ :'processed_files_sum' => :'processed_files_sum',
46
+ :'finalized_files_sum' => :'finalized_files_sum',
47
+ :'bandwidth_avg' => :'bandwidth_avg',
48
+ :'bandwidth_count' => :'bandwidth_count',
49
+ :'tasks_count' => :'tasks_count'
50
+ }
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.openapi_types
55
+ {
56
+ :'val' => :'String',
57
+ :'count' => :'Integer',
58
+ :'to_process_size_sum' => :'Integer',
59
+ :'processed_size_sum' => :'Integer',
60
+ :'to_process_files_sum' => :'Integer',
61
+ :'processed_files_sum' => :'Integer',
62
+ :'finalized_files_sum' => :'Integer',
63
+ :'bandwidth_avg' => :'Integer',
64
+ :'bandwidth_count' => :'Integer',
65
+ :'tasks_count' => :'Integer'
66
+ }
67
+ end
68
+
69
+ # List of attributes with nullable: true
70
+ def self.openapi_nullable
71
+ Set.new([
72
+ ])
73
+ end
74
+
75
+ # List of class defined in allOf (OpenAPI v3)
76
+ def self.openapi_all_of
77
+ [
78
+ :'ByMetadataBucketAllOf',
79
+ :'TaskFacet'
80
+ ]
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ if (!attributes.is_a?(Hash))
87
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Nodeum::TaskFacetMetadataBucket` initialize method"
88
+ end
89
+
90
+ # check to see if the attribute exists and convert string to symbol for hash key
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!self.class.attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Nodeum::TaskFacetMetadataBucket`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'val')
99
+ self.val = attributes[:'val']
100
+ end
101
+
102
+ if attributes.key?(:'count')
103
+ self.count = attributes[:'count']
104
+ end
105
+
106
+ if attributes.key?(:'to_process_size_sum')
107
+ self.to_process_size_sum = attributes[:'to_process_size_sum']
108
+ end
109
+
110
+ if attributes.key?(:'processed_size_sum')
111
+ self.processed_size_sum = attributes[:'processed_size_sum']
112
+ end
113
+
114
+ if attributes.key?(:'to_process_files_sum')
115
+ self.to_process_files_sum = attributes[:'to_process_files_sum']
116
+ end
117
+
118
+ if attributes.key?(:'processed_files_sum')
119
+ self.processed_files_sum = attributes[:'processed_files_sum']
120
+ end
121
+
122
+ if attributes.key?(:'finalized_files_sum')
123
+ self.finalized_files_sum = attributes[:'finalized_files_sum']
124
+ end
125
+
126
+ if attributes.key?(:'bandwidth_avg')
127
+ self.bandwidth_avg = attributes[:'bandwidth_avg']
128
+ end
129
+
130
+ if attributes.key?(:'bandwidth_count')
131
+ self.bandwidth_count = attributes[:'bandwidth_count']
132
+ end
133
+
134
+ if attributes.key?(:'tasks_count')
135
+ self.tasks_count = attributes[:'tasks_count']
136
+ end
137
+ end
138
+
139
+ # Show invalid properties with the reasons. Usually used together with valid?
140
+ # @return Array for valid properties with the reasons
141
+ def list_invalid_properties
142
+ invalid_properties = Array.new
143
+ invalid_properties
144
+ end
145
+
146
+ # Check to see if the all the properties in the model are valid
147
+ # @return true if the model is valid
148
+ def valid?
149
+ true
150
+ end
151
+
152
+ # Checks equality by comparing each attribute.
153
+ # @param [Object] Object to be compared
154
+ def ==(o)
155
+ return true if self.equal?(o)
156
+ self.class == o.class &&
157
+ val == o.val &&
158
+ count == o.count &&
159
+ to_process_size_sum == o.to_process_size_sum &&
160
+ processed_size_sum == o.processed_size_sum &&
161
+ to_process_files_sum == o.to_process_files_sum &&
162
+ processed_files_sum == o.processed_files_sum &&
163
+ finalized_files_sum == o.finalized_files_sum &&
164
+ bandwidth_avg == o.bandwidth_avg &&
165
+ bandwidth_count == o.bandwidth_count &&
166
+ tasks_count == o.tasks_count
167
+ end
168
+
169
+ # @see the `==` method
170
+ # @param [Object] Object to be compared
171
+ def eql?(o)
172
+ self == o
173
+ end
174
+
175
+ # Calculates hash code according to all attributes.
176
+ # @return [Integer] Hash code
177
+ def hash
178
+ [val, count, to_process_size_sum, processed_size_sum, to_process_files_sum, processed_files_sum, finalized_files_sum, bandwidth_avg, bandwidth_count, tasks_count].hash
179
+ end
180
+
181
+ # Builds the object from hash
182
+ # @param [Hash] attributes Model attributes in the form of hash
183
+ # @return [Object] Returns the model itself
184
+ def self.build_from_hash(attributes)
185
+ new.build_from_hash(attributes)
186
+ end
187
+
188
+ # Builds the object from hash
189
+ # @param [Hash] attributes Model attributes in the form of hash
190
+ # @return [Object] Returns the model itself
191
+ def build_from_hash(attributes)
192
+ return nil unless attributes.is_a?(Hash)
193
+ self.class.openapi_types.each_pair do |key, type|
194
+ if type =~ /\AArray<(.*)>/i
195
+ # check to ensure the input is an array given that the attribute
196
+ # is documented as an array but the input is not
197
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
198
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
199
+ end
200
+ elsif !attributes[self.class.attribute_map[key]].nil?
201
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
202
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
203
+ end
204
+
205
+ self
206
+ end
207
+
208
+ # Deserializes the data based on type
209
+ # @param string type Data type
210
+ # @param string value Value to be deserialized
211
+ # @return [Object] Deserialized data
212
+ def _deserialize(type, value)
213
+ case type.to_sym
214
+ when :DateTime
215
+ DateTime.parse(value)
216
+ when :Date
217
+ Date.parse(value)
218
+ when :String
219
+ value.to_s
220
+ when :Integer
221
+ value.to_i
222
+ when :Float
223
+ value.to_f
224
+ when :Boolean
225
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
226
+ true
227
+ else
228
+ false
229
+ end
230
+ when :Object
231
+ # generic object (usually a Hash), return directly
232
+ value
233
+ when /\AArray<(?<inner_type>.+)>\z/
234
+ inner_type = Regexp.last_match[:inner_type]
235
+ value.map { |v| _deserialize(inner_type, v) }
236
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
237
+ k_type = Regexp.last_match[:k_type]
238
+ v_type = Regexp.last_match[:v_type]
239
+ {}.tap do |hash|
240
+ value.each do |k, v|
241
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
242
+ end
243
+ end
244
+ else # model
245
+ Nodeum.const_get(type).build_from_hash(value)
246
+ end
247
+ end
248
+
249
+ # Returns the string representation of the object
250
+ # @return [String] String presentation of the object
251
+ def to_s
252
+ to_hash.to_s
253
+ end
254
+
255
+ # to_body is an alias to to_hash (backward compatibility)
256
+ # @return [Hash] Returns the object in the form of hash
257
+ def to_body
258
+ to_hash
259
+ end
260
+
261
+ # Returns the object in the form of hash
262
+ # @return [Hash] Returns the object in the form of hash
263
+ def to_hash
264
+ hash = {}
265
+ self.class.attribute_map.each_pair do |attr, param|
266
+ value = self.send(attr)
267
+ if value.nil?
268
+ is_nullable = self.class.openapi_nullable.include?(attr)
269
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
270
+ end
271
+
272
+ hash[param] = _to_hash(value)
273
+ end
274
+ hash
275
+ end
276
+
277
+ # Outputs non-array value in the form of hash
278
+ # For object, use to_hash. Otherwise, just return the value
279
+ # @param [Object] value Any valid value
280
+ # @return [Hash] Returns the value in the form of hash
281
+ def _to_hash(value)
282
+ if value.is_a?(Array)
283
+ value.compact.map { |v| _to_hash(v) }
284
+ elsif value.is_a?(Hash)
285
+ {}.tap do |hash|
286
+ value.each { |k, v| hash[k] = _to_hash(v) }
287
+ end
288
+ elsif value.respond_to? :to_hash
289
+ value.to_hash
290
+ else
291
+ value
292
+ end
293
+ end
294
+ end
295
+ end
@@ -0,0 +1,218 @@
1
+ =begin
2
+ #Nodeum API
3
+
4
+ #The Nodeum API makes it easy to tap into the digital data mesh that runs across your organisation. Make requests to our API endpoints and we’ll give you everything you need to interconnect your business workflows with your storage. All production API requests are made to: http://nodeumhostname/api/ The current production version of the API is v1. **REST** The Nodeum API is a RESTful API. This means that the API is designed to allow you to get, create, update, & delete objects with the HTTP verbs GET, POST, PUT, PATCH, & DELETE. **JSON** The Nodeum API speaks exclusively in JSON. This means that you should always set the Content-Type header to application/json to ensure that your requests are properly accepted and processed by the API. **Authentication** All API calls require user-password authentication. **Cross-Origin Resource Sharing** The Nodeum API supports CORS for communicating from Javascript for these endpoints. You will need to specify an Origin URI when creating your application to allow for CORS to be whitelisted for your domain. **Pagination** Some endpoints such as File Listing return a potentially lengthy array of objects. In order to keep the response sizes manageable the API will take advantage of pagination. Pagination is a mechanism for returning a subset of the results for a request and allowing for subsequent requests to “page” through the rest of the results until the end is reached. Paginated endpoints follow a standard interface that accepts two query parameters, limit and offset, and return a payload that follows a standard form. These parameters names and their behavior are borrowed from SQL LIMIT and OFFSET keywords. **Versioning** The Nodeum API is constantly being worked on to add features, make improvements, and fix bugs. This means that you should expect changes to be introduced and documented. However, there are some changes or additions that are considered backwards-compatible and your applications should be flexible enough to handle them. These include: - Adding new endpoints to the API - Adding new attributes to the response of an existing endpoint - Changing the order of attributes of responses (JSON by definition is an object of unordered key/value pairs) **Filter parameters** When browsing a list of items, multiple filter parameters may be applied. Some operators can be added to the value as a prefix: - `=` value is equal. Default operator, may be omitted - `!=` value is different - `>` greater than - `>=` greater than or equal - `<` lower than - `>=` lower than or equal - `><` included in list, items should be separated by `|` - `!><` not included in list, items should be separated by `|` - `~` pattern matching, may include `%` (any characters) and `_` (one character) - `!~` pattern not matching, may include `%` (any characters) and `_` (one character)
5
+
6
+ The version of the OpenAPI document: 2.1.0
7
+ Contact: info@nodeum.io
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Nodeum
16
+ class TaskFacetMetadataKeyBucket < TaskFacetMetadataBucket
17
+ attr_accessor :meta_value_t
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'meta_value_t' => :'meta_value_t'
23
+ }
24
+ end
25
+
26
+ # Attribute type mapping.
27
+ def self.openapi_types
28
+ {
29
+ :'meta_value_t' => :'TaskFacetMetadataValueBuckets'
30
+ }
31
+ end
32
+
33
+ # List of attributes with nullable: true
34
+ def self.openapi_nullable
35
+ Set.new([
36
+ ])
37
+ end
38
+
39
+ # List of class defined in allOf (OpenAPI v3)
40
+ def self.openapi_all_of
41
+ [
42
+ :'TaskFacetMetadataBucket',
43
+ :'TaskFacetMetadataKeyBucketAllOf'
44
+ ]
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ if (!attributes.is_a?(Hash))
51
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Nodeum::TaskFacetMetadataKeyBucket` initialize method"
52
+ end
53
+
54
+ # check to see if the attribute exists and convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h|
56
+ if (!self.class.attribute_map.key?(k.to_sym))
57
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Nodeum::TaskFacetMetadataKeyBucket`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58
+ end
59
+ h[k.to_sym] = v
60
+ }
61
+
62
+ # call parent's initialize
63
+ super(attributes)
64
+
65
+ if attributes.key?(:'meta_value_t')
66
+ self.meta_value_t = attributes[:'meta_value_t']
67
+ end
68
+ end
69
+
70
+ # Show invalid properties with the reasons. Usually used together with valid?
71
+ # @return Array for valid properties with the reasons
72
+ def list_invalid_properties
73
+ invalid_properties = super
74
+ invalid_properties
75
+ end
76
+
77
+ # Check to see if the all the properties in the model are valid
78
+ # @return true if the model is valid
79
+ def valid?
80
+ true && super
81
+ end
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param [Object] Object to be compared
85
+ def ==(o)
86
+ return true if self.equal?(o)
87
+ self.class == o.class &&
88
+ meta_value_t == o.meta_value_t && super(o)
89
+ end
90
+
91
+ # @see the `==` method
92
+ # @param [Object] Object to be compared
93
+ def eql?(o)
94
+ self == o
95
+ end
96
+
97
+ # Calculates hash code according to all attributes.
98
+ # @return [Integer] Hash code
99
+ def hash
100
+ [meta_value_t].hash
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def self.build_from_hash(attributes)
107
+ new.build_from_hash(attributes)
108
+ end
109
+
110
+ # Builds the object from hash
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ # @return [Object] Returns the model itself
113
+ def build_from_hash(attributes)
114
+ return nil unless attributes.is_a?(Hash)
115
+ super(attributes)
116
+ self.class.openapi_types.each_pair do |key, type|
117
+ if type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
121
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
122
+ end
123
+ elsif !attributes[self.class.attribute_map[key]].nil?
124
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
125
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
126
+ end
127
+
128
+ self
129
+ end
130
+
131
+ # Deserializes the data based on type
132
+ # @param string type Data type
133
+ # @param string value Value to be deserialized
134
+ # @return [Object] Deserialized data
135
+ def _deserialize(type, value)
136
+ case type.to_sym
137
+ when :DateTime
138
+ DateTime.parse(value)
139
+ when :Date
140
+ Date.parse(value)
141
+ when :String
142
+ value.to_s
143
+ when :Integer
144
+ value.to_i
145
+ when :Float
146
+ value.to_f
147
+ when :Boolean
148
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
149
+ true
150
+ else
151
+ false
152
+ end
153
+ when :Object
154
+ # generic object (usually a Hash), return directly
155
+ value
156
+ when /\AArray<(?<inner_type>.+)>\z/
157
+ inner_type = Regexp.last_match[:inner_type]
158
+ value.map { |v| _deserialize(inner_type, v) }
159
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
160
+ k_type = Regexp.last_match[:k_type]
161
+ v_type = Regexp.last_match[:v_type]
162
+ {}.tap do |hash|
163
+ value.each do |k, v|
164
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
165
+ end
166
+ end
167
+ else # model
168
+ Nodeum.const_get(type).build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = super
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ # Outputs non-array value in the form of hash
201
+ # For object, use to_hash. Otherwise, just return the value
202
+ # @param [Object] value Any valid value
203
+ # @return [Hash] Returns the value in the form of hash
204
+ def _to_hash(value)
205
+ if value.is_a?(Array)
206
+ value.compact.map { |v| _to_hash(v) }
207
+ elsif value.is_a?(Hash)
208
+ {}.tap do |hash|
209
+ value.each { |k, v| hash[k] = _to_hash(v) }
210
+ end
211
+ elsif value.respond_to? :to_hash
212
+ value.to_hash
213
+ else
214
+ value
215
+ end
216
+ end
217
+ end
218
+ end