nodeum_sdk 1.85.1 → 1.86.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 (168) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +69 -14
  3. data/docs/ByDateFacet.md +4 -0
  4. data/docs/ByFileExtensionFacet.md +2 -2
  5. data/docs/ByFileExtensionFacetAllOf.md +2 -2
  6. data/docs/ByGroupOwnerFacet.md +2 -2
  7. data/docs/ByGroupOwnerFacetAllOf.md +2 -2
  8. data/docs/ByPrimaryCloudFacet.md +21 -0
  9. data/docs/ByPrimaryCloudFacetAllOf.md +21 -0
  10. data/docs/ByPrimaryFacet.md +2 -2
  11. data/docs/ByPrimaryFacetAllOf.md +2 -2
  12. data/docs/ByPrimaryNasFacet.md +21 -0
  13. data/docs/ByPrimaryNasFacetAllOf.md +21 -0
  14. data/docs/ByPrimaryStorageFacet.md +31 -0
  15. data/docs/ByPrimaryTypeFacet.md +41 -0
  16. data/docs/BySecondaryCloudFacet.md +21 -0
  17. data/docs/BySecondaryCloudFacetAllOf.md +21 -0
  18. data/docs/BySecondaryNasFacet.md +21 -0
  19. data/docs/BySecondaryNasFacetAllOf.md +21 -0
  20. data/docs/BySecondaryStorageFacet.md +35 -0
  21. data/docs/BySecondaryTapeFacet.md +21 -0
  22. data/docs/BySecondaryTapeFacetAllOf.md +21 -0
  23. data/docs/BySecondaryTypeFacet.md +2 -2
  24. data/docs/BySecondaryTypeFacetAllOf.md +2 -2
  25. data/docs/BySizeFacet.md +4 -0
  26. data/docs/ByTaskStatusFacet.md +17 -0
  27. data/docs/ByTaskStatusFacetAllOf.md +17 -0
  28. data/docs/ByTaskStorageFacet.md +19 -0
  29. data/docs/ByTaskStorageFacetAllOf.md +19 -0
  30. data/docs/ByTaskWorkflowFacet.md +17 -0
  31. data/docs/ByTaskWorkflowFacetAllOf.md +17 -0
  32. data/docs/ByTypeFacetBucket.md +19 -0
  33. data/docs/ByTypeFacetBuckets.md +17 -0
  34. data/docs/ByUserOwnerFacet.md +2 -2
  35. data/docs/ByUserOwnerFacetAllOf.md +2 -2
  36. data/docs/Container.md +4 -0
  37. data/docs/DefaultFacet.md +17 -0
  38. data/docs/FileFacet.md +5 -3
  39. data/docs/FileFacetAllOf.md +21 -0
  40. data/docs/StatisticsApi.md +805 -42
  41. data/docs/StorageByTypeFacets.md +25 -0
  42. data/docs/StorageCloudBucketByTypeFacets.md +19 -0
  43. data/docs/StorageCloudBucketFacets.md +21 -0
  44. data/docs/StorageFacet.md +27 -0
  45. data/docs/StorageNasShareByTypeFacets.md +19 -0
  46. data/docs/StorageNasShareFacets.md +21 -0
  47. data/docs/StoragePoolByTypeFacets.md +19 -0
  48. data/docs/StoragePoolFacets.md +21 -0
  49. data/docs/StorageTapeByTypeFacets.md +21 -0
  50. data/docs/StorageTapeFacets.md +23 -0
  51. data/docs/TaskByWorkflowBucket.md +19 -0
  52. data/docs/TaskByWorkflowBucketAllOf.md +19 -0
  53. data/docs/TaskByWorkflowBuckets.md +17 -0
  54. data/docs/TaskFacet.md +27 -0
  55. data/docs/TaskFacetAllOf.md +27 -0
  56. data/docs/TaskFacetBucket.md +31 -0
  57. data/docs/TaskFacetBuckets.md +17 -0
  58. data/docs/TypeToPrimaryFacets.md +23 -0
  59. data/docs/TypeToSecondaryFacets.md +2 -0
  60. data/docs/UserConfiguration.md +21 -0
  61. data/docs/UserConfigurationCollection.md +19 -0
  62. data/docs/UsersApi.md +300 -0
  63. data/lib/nodeum_sdk.rb +43 -4
  64. data/lib/nodeum_sdk/api/statistics_api.rb +910 -51
  65. data/lib/nodeum_sdk/api/users_api.rb +318 -0
  66. data/lib/nodeum_sdk/models/by_date_facet.rb +19 -1
  67. data/lib/nodeum_sdk/models/by_file_extension_facet.rb +7 -7
  68. data/lib/nodeum_sdk/models/by_file_extension_facet_all_of.rb +7 -7
  69. data/lib/nodeum_sdk/models/by_group_owner_facet.rb +7 -7
  70. data/lib/nodeum_sdk/models/by_group_owner_facet_all_of.rb +7 -7
  71. data/lib/nodeum_sdk/models/by_primary_cloud_facet.rb +236 -0
  72. data/lib/nodeum_sdk/models/by_primary_cloud_facet_all_of.rb +224 -0
  73. data/lib/nodeum_sdk/models/by_primary_facet.rb +7 -7
  74. data/lib/nodeum_sdk/models/by_primary_facet_all_of.rb +7 -7
  75. data/lib/nodeum_sdk/models/by_primary_nas_facet.rb +236 -0
  76. data/lib/nodeum_sdk/models/by_primary_nas_facet_all_of.rb +224 -0
  77. data/lib/nodeum_sdk/models/by_primary_storage_facet.rb +277 -0
  78. data/lib/nodeum_sdk/models/by_primary_type_facet.rb +322 -0
  79. data/lib/nodeum_sdk/models/by_secondary_cloud_facet.rb +236 -0
  80. data/lib/nodeum_sdk/models/by_secondary_cloud_facet_all_of.rb +224 -0
  81. data/lib/nodeum_sdk/models/by_secondary_nas_facet.rb +236 -0
  82. data/lib/nodeum_sdk/models/by_secondary_nas_facet_all_of.rb +224 -0
  83. data/lib/nodeum_sdk/models/by_secondary_storage_facet.rb +295 -0
  84. data/lib/nodeum_sdk/models/by_secondary_tape_facet.rb +236 -0
  85. data/lib/nodeum_sdk/models/by_secondary_tape_facet_all_of.rb +224 -0
  86. data/lib/nodeum_sdk/models/by_secondary_type_facet.rb +7 -7
  87. data/lib/nodeum_sdk/models/by_secondary_type_facet_all_of.rb +7 -7
  88. data/lib/nodeum_sdk/models/by_size_facet.rb +19 -1
  89. data/lib/nodeum_sdk/models/by_task_status_facet.rb +218 -0
  90. data/lib/nodeum_sdk/models/by_task_status_facet_all_of.rb +206 -0
  91. data/lib/nodeum_sdk/models/by_task_storage_facet.rb +227 -0
  92. data/lib/nodeum_sdk/models/by_task_storage_facet_all_of.rb +215 -0
  93. data/lib/nodeum_sdk/models/by_task_workflow_facet.rb +218 -0
  94. data/lib/nodeum_sdk/models/by_task_workflow_facet_all_of.rb +206 -0
  95. data/lib/nodeum_sdk/models/by_type_facet_bucket.rb +223 -0
  96. data/lib/nodeum_sdk/models/by_type_facet_buckets.rb +208 -0
  97. data/lib/nodeum_sdk/models/by_user_owner_facet.rb +7 -7
  98. data/lib/nodeum_sdk/models/by_user_owner_facet_all_of.rb +7 -7
  99. data/lib/nodeum_sdk/models/container.rb +19 -1
  100. data/lib/nodeum_sdk/models/default_facet.rb +206 -0
  101. data/lib/nodeum_sdk/models/file_facet.rb +35 -14
  102. data/lib/nodeum_sdk/models/file_facet_all_of.rb +224 -0
  103. data/lib/nodeum_sdk/models/storage_by_type_facets.rb +242 -0
  104. data/lib/nodeum_sdk/models/storage_cloud_bucket_by_type_facets.rb +215 -0
  105. data/lib/nodeum_sdk/models/storage_cloud_bucket_facets.rb +232 -0
  106. data/lib/nodeum_sdk/models/storage_facet.rb +259 -0
  107. data/lib/nodeum_sdk/models/storage_nas_share_by_type_facets.rb +215 -0
  108. data/lib/nodeum_sdk/models/storage_nas_share_facets.rb +232 -0
  109. data/lib/nodeum_sdk/models/storage_pool_by_type_facets.rb +215 -0
  110. data/lib/nodeum_sdk/models/storage_pool_facets.rb +232 -0
  111. data/lib/nodeum_sdk/models/storage_tape_by_type_facets.rb +224 -0
  112. data/lib/nodeum_sdk/models/storage_tape_facets.rb +241 -0
  113. data/lib/nodeum_sdk/models/task_by_workflow_bucket.rb +227 -0
  114. data/lib/nodeum_sdk/models/task_by_workflow_bucket_all_of.rb +215 -0
  115. data/lib/nodeum_sdk/models/task_by_workflow_buckets.rb +208 -0
  116. data/lib/nodeum_sdk/models/task_facet.rb +263 -0
  117. data/lib/nodeum_sdk/models/task_facet_all_of.rb +251 -0
  118. data/lib/nodeum_sdk/models/task_facet_bucket.rb +277 -0
  119. data/lib/nodeum_sdk/models/task_facet_buckets.rb +208 -0
  120. data/lib/nodeum_sdk/models/type_to_primary_facets.rb +233 -0
  121. data/lib/nodeum_sdk/models/type_to_secondary_facets.rb +10 -1
  122. data/lib/nodeum_sdk/models/user_configuration.rb +224 -0
  123. data/lib/nodeum_sdk/models/user_configuration_collection.rb +217 -0
  124. data/lib/nodeum_sdk/version.rb +1 -1
  125. data/spec/models/by_primary_cloud_facet_all_of_spec.rb +53 -0
  126. data/spec/models/by_primary_cloud_facet_spec.rb +53 -0
  127. data/spec/models/by_primary_nas_facet_all_of_spec.rb +53 -0
  128. data/spec/models/by_primary_nas_facet_spec.rb +53 -0
  129. data/spec/models/by_primary_storage_facet_spec.rb +83 -0
  130. data/spec/models/by_primary_type_facet_spec.rb +113 -0
  131. data/spec/models/by_secondary_cloud_facet_all_of_spec.rb +53 -0
  132. data/spec/models/by_secondary_cloud_facet_spec.rb +53 -0
  133. data/spec/models/by_secondary_nas_facet_all_of_spec.rb +53 -0
  134. data/spec/models/by_secondary_nas_facet_spec.rb +53 -0
  135. data/spec/models/by_secondary_storage_facet_spec.rb +95 -0
  136. data/spec/models/by_secondary_tape_facet_all_of_spec.rb +53 -0
  137. data/spec/models/by_secondary_tape_facet_spec.rb +53 -0
  138. data/spec/models/by_task_status_facet_all_of_spec.rb +41 -0
  139. data/spec/models/by_task_status_facet_spec.rb +41 -0
  140. data/spec/models/by_task_storage_facet_all_of_spec.rb +47 -0
  141. data/spec/models/by_task_storage_facet_spec.rb +47 -0
  142. data/spec/models/by_task_workflow_facet_all_of_spec.rb +41 -0
  143. data/spec/models/by_task_workflow_facet_spec.rb +41 -0
  144. data/spec/models/by_type_facet_bucket_spec.rb +47 -0
  145. data/spec/models/by_type_facet_buckets_spec.rb +41 -0
  146. data/spec/models/default_facet_spec.rb +41 -0
  147. data/spec/models/file_facet_all_of_spec.rb +53 -0
  148. data/spec/models/storage_by_type_facets_spec.rb +65 -0
  149. data/spec/models/storage_cloud_bucket_by_type_facets_spec.rb +47 -0
  150. data/spec/models/storage_cloud_bucket_facets_spec.rb +53 -0
  151. data/spec/models/storage_facet_spec.rb +71 -0
  152. data/spec/models/storage_nas_share_by_type_facets_spec.rb +47 -0
  153. data/spec/models/storage_nas_share_facets_spec.rb +53 -0
  154. data/spec/models/storage_pool_by_type_facets_spec.rb +47 -0
  155. data/spec/models/storage_pool_facets_spec.rb +53 -0
  156. data/spec/models/storage_tape_by_type_facets_spec.rb +53 -0
  157. data/spec/models/storage_tape_facets_spec.rb +59 -0
  158. data/spec/models/task_by_workflow_bucket_all_of_spec.rb +47 -0
  159. data/spec/models/task_by_workflow_bucket_spec.rb +47 -0
  160. data/spec/models/task_by_workflow_buckets_spec.rb +41 -0
  161. data/spec/models/task_facet_all_of_spec.rb +71 -0
  162. data/spec/models/task_facet_bucket_spec.rb +83 -0
  163. data/spec/models/task_facet_buckets_spec.rb +41 -0
  164. data/spec/models/task_facet_spec.rb +71 -0
  165. data/spec/models/type_to_primary_facets_spec.rb +59 -0
  166. data/spec/models/user_configuration_collection_spec.rb +47 -0
  167. data/spec/models/user_configuration_spec.rb +53 -0
  168. metadata +174 -2
@@ -0,0 +1,208 @@
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 TaskFacetBuckets
17
+ attr_accessor :buckets
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'buckets' => :'buckets'
23
+ }
24
+ end
25
+
26
+ # Attribute type mapping.
27
+ def self.openapi_types
28
+ {
29
+ :'buckets' => :'Array<TaskFacetBucket>'
30
+ }
31
+ end
32
+
33
+ # List of attributes with nullable: true
34
+ def self.openapi_nullable
35
+ Set.new([
36
+ ])
37
+ end
38
+
39
+ # Initializes the object
40
+ # @param [Hash] attributes Model attributes in the form of hash
41
+ def initialize(attributes = {})
42
+ if (!attributes.is_a?(Hash))
43
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Nodeum::TaskFacetBuckets` initialize method"
44
+ end
45
+
46
+ # check to see if the attribute exists and convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}) { |(k, v), h|
48
+ if (!self.class.attribute_map.key?(k.to_sym))
49
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Nodeum::TaskFacetBuckets`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
50
+ end
51
+ h[k.to_sym] = v
52
+ }
53
+
54
+ if attributes.key?(:'buckets')
55
+ if (value = attributes[:'buckets']).is_a?(Array)
56
+ self.buckets = value
57
+ end
58
+ end
59
+ end
60
+
61
+ # Show invalid properties with the reasons. Usually used together with valid?
62
+ # @return Array for valid properties with the reasons
63
+ def list_invalid_properties
64
+ invalid_properties = Array.new
65
+ 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
+ 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
+ buckets == o.buckets
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 [Integer] Hash code
90
+ def hash
91
+ [buckets].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 self.build_from_hash(attributes)
98
+ new.build_from_hash(attributes)
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def build_from_hash(attributes)
105
+ return nil unless attributes.is_a?(Hash)
106
+ self.class.openapi_types.each_pair do |key, type|
107
+ if type =~ /\AArray<(.*)>/i
108
+ # check to ensure the input is an array given that the attribute
109
+ # is documented as an array but the input is not
110
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
111
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
112
+ end
113
+ elsif !attributes[self.class.attribute_map[key]].nil?
114
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
115
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
116
+ end
117
+
118
+ self
119
+ end
120
+
121
+ # Deserializes the data based on type
122
+ # @param string type Data type
123
+ # @param string value Value to be deserialized
124
+ # @return [Object] Deserialized data
125
+ def _deserialize(type, value)
126
+ case type.to_sym
127
+ when :DateTime
128
+ DateTime.parse(value)
129
+ when :Date
130
+ Date.parse(value)
131
+ when :String
132
+ value.to_s
133
+ when :Integer
134
+ value.to_i
135
+ when :Float
136
+ value.to_f
137
+ when :Boolean
138
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
139
+ true
140
+ else
141
+ false
142
+ end
143
+ when :Object
144
+ # generic object (usually a Hash), return directly
145
+ value
146
+ when /\AArray<(?<inner_type>.+)>\z/
147
+ inner_type = Regexp.last_match[:inner_type]
148
+ value.map { |v| _deserialize(inner_type, v) }
149
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
150
+ k_type = Regexp.last_match[:k_type]
151
+ v_type = Regexp.last_match[:v_type]
152
+ {}.tap do |hash|
153
+ value.each do |k, v|
154
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
155
+ end
156
+ end
157
+ else # model
158
+ Nodeum.const_get(type).build_from_hash(value)
159
+ end
160
+ end
161
+
162
+ # Returns the string representation of the object
163
+ # @return [String] String presentation of the object
164
+ def to_s
165
+ to_hash.to_s
166
+ end
167
+
168
+ # to_body is an alias to to_hash (backward compatibility)
169
+ # @return [Hash] Returns the object in the form of hash
170
+ def to_body
171
+ to_hash
172
+ end
173
+
174
+ # Returns the object in the form of hash
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_hash
177
+ hash = {}
178
+ self.class.attribute_map.each_pair do |attr, param|
179
+ value = self.send(attr)
180
+ if value.nil?
181
+ is_nullable = self.class.openapi_nullable.include?(attr)
182
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
183
+ end
184
+
185
+ hash[param] = _to_hash(value)
186
+ end
187
+ hash
188
+ end
189
+
190
+ # Outputs non-array value in the form of hash
191
+ # For object, use to_hash. Otherwise, just return the value
192
+ # @param [Object] value Any valid value
193
+ # @return [Hash] Returns the value in the form of hash
194
+ def _to_hash(value)
195
+ if value.is_a?(Array)
196
+ value.compact.map { |v| _to_hash(v) }
197
+ elsif value.is_a?(Hash)
198
+ {}.tap do |hash|
199
+ value.each { |k, v| hash[k] = _to_hash(v) }
200
+ end
201
+ elsif value.respond_to? :to_hash
202
+ value.to_hash
203
+ else
204
+ value
205
+ end
206
+ end
207
+ end
208
+ end
@@ -0,0 +1,233 @@
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 TypeToPrimaryFacets
17
+ attr_accessor :on_primary_container
18
+
19
+ attr_accessor :on_primary_nas
20
+
21
+ attr_accessor :on_primary_public_cloud
22
+
23
+ attr_accessor :on_primary_object_cloud
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'on_primary_container' => :'on_primary_container',
29
+ :'on_primary_nas' => :'on_primary_nas',
30
+ :'on_primary_public_cloud' => :'on_primary_public_cloud',
31
+ :'on_primary_object_cloud' => :'on_primary_object_cloud'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'on_primary_container' => :'ByPrimaryTypeFacet',
39
+ :'on_primary_nas' => :'ByPrimaryTypeFacet',
40
+ :'on_primary_public_cloud' => :'ByPrimaryTypeFacet',
41
+ :'on_primary_object_cloud' => :'ByPrimaryTypeFacet'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Nodeum::TypeToPrimaryFacets` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Nodeum::TypeToPrimaryFacets`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'on_primary_container')
67
+ self.on_primary_container = attributes[:'on_primary_container']
68
+ end
69
+
70
+ if attributes.key?(:'on_primary_nas')
71
+ self.on_primary_nas = attributes[:'on_primary_nas']
72
+ end
73
+
74
+ if attributes.key?(:'on_primary_public_cloud')
75
+ self.on_primary_public_cloud = attributes[:'on_primary_public_cloud']
76
+ end
77
+
78
+ if attributes.key?(:'on_primary_object_cloud')
79
+ self.on_primary_object_cloud = attributes[:'on_primary_object_cloud']
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ invalid_properties = Array.new
87
+ invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(o)
99
+ return true if self.equal?(o)
100
+ self.class == o.class &&
101
+ on_primary_container == o.on_primary_container &&
102
+ on_primary_nas == o.on_primary_nas &&
103
+ on_primary_public_cloud == o.on_primary_public_cloud &&
104
+ on_primary_object_cloud == o.on_primary_object_cloud
105
+ end
106
+
107
+ # @see the `==` method
108
+ # @param [Object] Object to be compared
109
+ def eql?(o)
110
+ self == o
111
+ end
112
+
113
+ # Calculates hash code according to all attributes.
114
+ # @return [Integer] Hash code
115
+ def hash
116
+ [on_primary_container, on_primary_nas, on_primary_public_cloud, on_primary_object_cloud].hash
117
+ end
118
+
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def self.build_from_hash(attributes)
123
+ new.build_from_hash(attributes)
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ self.class.openapi_types.each_pair do |key, type|
132
+ if type =~ /\AArray<(.*)>/i
133
+ # check to ensure the input is an array given that the attribute
134
+ # is documented as an array but the input is not
135
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
136
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
137
+ end
138
+ elsif !attributes[self.class.attribute_map[key]].nil?
139
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
140
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
141
+ end
142
+
143
+ self
144
+ end
145
+
146
+ # Deserializes the data based on type
147
+ # @param string type Data type
148
+ # @param string value Value to be deserialized
149
+ # @return [Object] Deserialized data
150
+ def _deserialize(type, value)
151
+ case type.to_sym
152
+ when :DateTime
153
+ DateTime.parse(value)
154
+ when :Date
155
+ Date.parse(value)
156
+ when :String
157
+ value.to_s
158
+ when :Integer
159
+ value.to_i
160
+ when :Float
161
+ value.to_f
162
+ when :Boolean
163
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
164
+ true
165
+ else
166
+ false
167
+ end
168
+ when :Object
169
+ # generic object (usually a Hash), return directly
170
+ value
171
+ when /\AArray<(?<inner_type>.+)>\z/
172
+ inner_type = Regexp.last_match[:inner_type]
173
+ value.map { |v| _deserialize(inner_type, v) }
174
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
175
+ k_type = Regexp.last_match[:k_type]
176
+ v_type = Regexp.last_match[:v_type]
177
+ {}.tap do |hash|
178
+ value.each do |k, v|
179
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
180
+ end
181
+ end
182
+ else # model
183
+ Nodeum.const_get(type).build_from_hash(value)
184
+ end
185
+ end
186
+
187
+ # Returns the string representation of the object
188
+ # @return [String] String presentation of the object
189
+ def to_s
190
+ to_hash.to_s
191
+ end
192
+
193
+ # to_body is an alias to to_hash (backward compatibility)
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_body
196
+ to_hash
197
+ end
198
+
199
+ # Returns the object in the form of hash
200
+ # @return [Hash] Returns the object in the form of hash
201
+ def to_hash
202
+ hash = {}
203
+ self.class.attribute_map.each_pair do |attr, param|
204
+ value = self.send(attr)
205
+ if value.nil?
206
+ is_nullable = self.class.openapi_nullable.include?(attr)
207
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
208
+ end
209
+
210
+ hash[param] = _to_hash(value)
211
+ end
212
+ hash
213
+ end
214
+
215
+ # Outputs non-array value in the form of hash
216
+ # For object, use to_hash. Otherwise, just return the value
217
+ # @param [Object] value Any valid value
218
+ # @return [Hash] Returns the value in the form of hash
219
+ def _to_hash(value)
220
+ if value.is_a?(Array)
221
+ value.compact.map { |v| _to_hash(v) }
222
+ elsif value.is_a?(Hash)
223
+ {}.tap do |hash|
224
+ value.each { |k, v| hash[k] = _to_hash(v) }
225
+ end
226
+ elsif value.respond_to? :to_hash
227
+ value.to_hash
228
+ else
229
+ value
230
+ end
231
+ end
232
+ end
233
+ end
@@ -22,6 +22,8 @@ module Nodeum
22
22
 
23
23
  attr_accessor :on_secondary_tape
24
24
 
25
+ attr_accessor :on_any_secondary
26
+
25
27
  attr_accessor :on_no_secondary
26
28
 
27
29
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -31,6 +33,7 @@ module Nodeum
31
33
  :'on_secondary_public_cloud' => :'on_secondary_public_cloud',
32
34
  :'on_secondary_object_cloud' => :'on_secondary_object_cloud',
33
35
  :'on_secondary_tape' => :'on_secondary_tape',
36
+ :'on_any_secondary' => :'on_any_secondary',
34
37
  :'on_no_secondary' => :'on_no_secondary'
35
38
  }
36
39
  end
@@ -42,6 +45,7 @@ module Nodeum
42
45
  :'on_secondary_public_cloud' => :'BySecondaryTypeFacet',
43
46
  :'on_secondary_object_cloud' => :'BySecondaryTypeFacet',
44
47
  :'on_secondary_tape' => :'BySecondaryTypeFacet',
48
+ :'on_any_secondary' => :'BySecondaryTypeFacet',
45
49
  :'on_no_secondary' => :'BySecondaryTypeFacet'
46
50
  }
47
51
  end
@@ -83,6 +87,10 @@ module Nodeum
83
87
  self.on_secondary_tape = attributes[:'on_secondary_tape']
84
88
  end
85
89
 
90
+ if attributes.key?(:'on_any_secondary')
91
+ self.on_any_secondary = attributes[:'on_any_secondary']
92
+ end
93
+
86
94
  if attributes.key?(:'on_no_secondary')
87
95
  self.on_no_secondary = attributes[:'on_no_secondary']
88
96
  end
@@ -110,6 +118,7 @@ module Nodeum
110
118
  on_secondary_public_cloud == o.on_secondary_public_cloud &&
111
119
  on_secondary_object_cloud == o.on_secondary_object_cloud &&
112
120
  on_secondary_tape == o.on_secondary_tape &&
121
+ on_any_secondary == o.on_any_secondary &&
113
122
  on_no_secondary == o.on_no_secondary
114
123
  end
115
124
 
@@ -122,7 +131,7 @@ module Nodeum
122
131
  # Calculates hash code according to all attributes.
123
132
  # @return [Integer] Hash code
124
133
  def hash
125
- [on_secondary_nas, on_secondary_public_cloud, on_secondary_object_cloud, on_secondary_tape, on_no_secondary].hash
134
+ [on_secondary_nas, on_secondary_public_cloud, on_secondary_object_cloud, on_secondary_tape, on_any_secondary, on_no_secondary].hash
126
135
  end
127
136
 
128
137
  # Builds the object from hash