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.
- checksums.yaml +4 -4
- data/README.md +32 -4
- data/docs/ByDateFacet.md +4 -4
- data/docs/ByMetadataBucket.md +17 -0
- data/docs/ByMetadataBucketAllOf.md +17 -0
- data/docs/ByMetadataFacet.md +17 -0
- data/docs/ByMetadataFacetAllOf.md +17 -0
- data/docs/ByMetadataKeyBucket.md +17 -0
- data/docs/ByMetadataKeyBucketAllOf.md +17 -0
- data/docs/ByMetadataKeyBuckets.md +17 -0
- data/docs/ByMetadataValueBuckets.md +17 -0
- data/docs/ByPrimaryStorageFacet.md +4 -4
- data/docs/ByPrimaryTypeFacet.md +4 -4
- data/docs/BySecondaryStorageFacet.md +4 -4
- data/docs/BySizeFacet.md +4 -4
- data/docs/ByTaskMetadataFacet.md +17 -0
- data/docs/ByTaskMetadataFacetAllOf.md +17 -0
- data/docs/ByTypeFacetBucket.md +1 -1
- data/docs/CloudBucket.md +3 -1
- data/docs/CloudBucketsApi.md +61 -0
- data/docs/CloudConnector.md +3 -1
- data/docs/DefaultFacet.md +1 -1
- data/docs/FileFacet.md +3 -3
- data/docs/FileFacetAllOf.md +3 -3
- data/docs/FileMetadataDefinition.md +16 -0
- data/docs/FileMetadataDefinitionCollection.md +19 -0
- data/docs/MetadataApi.md +252 -0
- data/docs/MetadataDefinition.md +27 -0
- data/docs/StatisticsApi.md +136 -0
- data/docs/StorageCloudBucketFacets.md +1 -1
- data/docs/StorageFacet.md +1 -1
- data/docs/StorageNasShareFacets.md +1 -1
- data/docs/StoragePoolFacets.md +1 -1
- data/docs/StorageTapeFacets.md +1 -1
- data/docs/SystemGroup.md +3 -3
- data/docs/SystemUser.md +4 -4
- data/docs/TaskFacet.md +11 -7
- data/docs/TaskFacetAllOf.md +11 -7
- data/docs/TaskFacetBucket.md +12 -8
- data/docs/TaskFacetMetadataBucket.md +35 -0
- data/docs/TaskFacetMetadataKeyBucket.md +17 -0
- data/docs/TaskFacetMetadataKeyBucketAllOf.md +17 -0
- data/docs/TaskFacetMetadataKeyBuckets.md +17 -0
- data/docs/TaskFacetMetadataValueBuckets.md +17 -0
- data/docs/TaskMetadataDefinition.md +25 -0
- data/docs/TaskMetadataDefinitionAllOf.md +25 -0
- data/docs/TaskMetadataDefinitionCollection.md +19 -0
- data/lib/nodeum_sdk.rb +22 -0
- data/lib/nodeum_sdk/api/cloud_buckets_api.rb +71 -0
- data/lib/nodeum_sdk/api/metadata_api.rb +270 -0
- data/lib/nodeum_sdk/api/statistics_api.rb +151 -0
- data/lib/nodeum_sdk/models/by_metadata_bucket.rb +218 -0
- data/lib/nodeum_sdk/models/by_metadata_bucket_all_of.rb +206 -0
- data/lib/nodeum_sdk/models/by_metadata_facet.rb +218 -0
- data/lib/nodeum_sdk/models/by_metadata_facet_all_of.rb +206 -0
- data/lib/nodeum_sdk/models/by_metadata_key_bucket.rb +218 -0
- data/lib/nodeum_sdk/models/by_metadata_key_bucket_all_of.rb +206 -0
- data/lib/nodeum_sdk/models/by_metadata_key_buckets.rb +208 -0
- data/lib/nodeum_sdk/models/by_metadata_value_buckets.rb +208 -0
- data/lib/nodeum_sdk/models/by_task_metadata_facet.rb +218 -0
- data/lib/nodeum_sdk/models/by_task_metadata_facet_all_of.rb +206 -0
- data/lib/nodeum_sdk/models/cloud_bucket.rb +14 -4
- data/lib/nodeum_sdk/models/cloud_connector.rb +16 -6
- data/lib/nodeum_sdk/models/file_metadata_definition.rb +230 -0
- data/lib/nodeum_sdk/models/file_metadata_definition_collection.rb +217 -0
- data/lib/nodeum_sdk/models/metadata_definition.rb +285 -0
- data/lib/nodeum_sdk/models/task_facet.rb +22 -4
- data/lib/nodeum_sdk/models/task_facet_all_of.rb +22 -4
- data/lib/nodeum_sdk/models/task_facet_bucket.rb +22 -4
- data/lib/nodeum_sdk/models/task_facet_metadata_bucket.rb +295 -0
- data/lib/nodeum_sdk/models/task_facet_metadata_key_bucket.rb +218 -0
- data/lib/nodeum_sdk/models/task_facet_metadata_key_bucket_all_of.rb +206 -0
- data/lib/nodeum_sdk/models/task_facet_metadata_key_buckets.rb +208 -0
- data/lib/nodeum_sdk/models/task_facet_metadata_value_buckets.rb +208 -0
- data/lib/nodeum_sdk/models/task_metadata_definition.rb +288 -0
- data/lib/nodeum_sdk/models/task_metadata_definition_all_of.rb +276 -0
- data/lib/nodeum_sdk/models/task_metadata_definition_collection.rb +217 -0
- data/lib/nodeum_sdk/version.rb +1 -1
- data/spec/api/metadata_api_spec.rb +85 -0
- data/spec/models/by_metadata_bucket_all_of_spec.rb +41 -0
- data/spec/models/by_metadata_bucket_spec.rb +41 -0
- data/spec/models/by_metadata_facet_all_of_spec.rb +41 -0
- data/spec/models/by_metadata_facet_spec.rb +41 -0
- data/spec/models/by_metadata_key_bucket_all_of_spec.rb +41 -0
- data/spec/models/by_metadata_key_bucket_spec.rb +41 -0
- data/spec/models/by_metadata_key_buckets_spec.rb +41 -0
- data/spec/models/by_metadata_value_buckets_spec.rb +41 -0
- data/spec/models/by_task_metadata_facet_all_of_spec.rb +41 -0
- data/spec/models/by_task_metadata_facet_spec.rb +41 -0
- data/spec/models/file_metadata_definition_collection_spec.rb +47 -0
- data/spec/models/file_metadata_definition_spec.rb +35 -0
- data/spec/models/metadata_definition_spec.rb +75 -0
- data/spec/models/task_facet_metadata_bucket_spec.rb +95 -0
- data/spec/models/task_facet_metadata_key_bucket_all_of_spec.rb +41 -0
- data/spec/models/task_facet_metadata_key_bucket_spec.rb +41 -0
- data/spec/models/task_facet_metadata_key_buckets_spec.rb +41 -0
- data/spec/models/task_facet_metadata_value_buckets_spec.rb +41 -0
- data/spec/models/task_metadata_definition_all_of_spec.rb +69 -0
- data/spec/models/task_metadata_definition_collection_spec.rb +47 -0
- data/spec/models/task_metadata_definition_spec.rb +69 -0
- metadata +245 -157
@@ -30,6 +30,9 @@ module Nodeum
|
|
30
30
|
|
31
31
|
attr_accessor :price
|
32
32
|
|
33
|
+
# S3FS mounting options, separated by comma
|
34
|
+
attr_accessor :options
|
35
|
+
|
33
36
|
# Attribute mapping from ruby-style variable name to JSON key.
|
34
37
|
def self.attribute_map
|
35
38
|
{
|
@@ -40,7 +43,8 @@ module Nodeum
|
|
40
43
|
:'file_count' => :'file_count',
|
41
44
|
:'file_size_sum' => :'file_size_sum',
|
42
45
|
:'location' => :'location',
|
43
|
-
:'price' => :'price'
|
46
|
+
:'price' => :'price',
|
47
|
+
:'options' => :'options'
|
44
48
|
}
|
45
49
|
end
|
46
50
|
|
@@ -54,7 +58,8 @@ module Nodeum
|
|
54
58
|
:'file_count' => :'Integer',
|
55
59
|
:'file_size_sum' => :'Integer',
|
56
60
|
:'location' => :'String',
|
57
|
-
:'price' => :'String'
|
61
|
+
:'price' => :'String',
|
62
|
+
:'options' => :'String'
|
58
63
|
}
|
59
64
|
end
|
60
65
|
|
@@ -110,6 +115,10 @@ module Nodeum
|
|
110
115
|
if attributes.key?(:'price')
|
111
116
|
self.price = attributes[:'price']
|
112
117
|
end
|
118
|
+
|
119
|
+
if attributes.key?(:'options')
|
120
|
+
self.options = attributes[:'options']
|
121
|
+
end
|
113
122
|
end
|
114
123
|
|
115
124
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -137,7 +146,8 @@ module Nodeum
|
|
137
146
|
file_count == o.file_count &&
|
138
147
|
file_size_sum == o.file_size_sum &&
|
139
148
|
location == o.location &&
|
140
|
-
price == o.price
|
149
|
+
price == o.price &&
|
150
|
+
options == o.options
|
141
151
|
end
|
142
152
|
|
143
153
|
# @see the `==` method
|
@@ -149,7 +159,7 @@ module Nodeum
|
|
149
159
|
# Calculates hash code according to all attributes.
|
150
160
|
# @return [Integer] Hash code
|
151
161
|
def hash
|
152
|
-
[id, cloud_connector_id, pool_id, name, file_count, file_size_sum, location, price].hash
|
162
|
+
[id, cloud_connector_id, pool_id, name, file_count, file_size_sum, location, price, options].hash
|
153
163
|
end
|
154
164
|
|
155
165
|
# Builds the object from hash
|
@@ -30,6 +30,9 @@ module Nodeum
|
|
30
30
|
|
31
31
|
attr_accessor :secret_key
|
32
32
|
|
33
|
+
# S3FS mounting options, separated by comma
|
34
|
+
attr_accessor :options
|
35
|
+
|
33
36
|
class EnumAttributeValidator
|
34
37
|
attr_reader :datatype
|
35
38
|
attr_reader :allowable_values
|
@@ -62,7 +65,8 @@ module Nodeum
|
|
62
65
|
:'provider' => :'provider',
|
63
66
|
:'region' => :'region',
|
64
67
|
:'access_key' => :'access_key',
|
65
|
-
:'secret_key' => :'secret_key'
|
68
|
+
:'secret_key' => :'secret_key',
|
69
|
+
:'options' => :'options'
|
66
70
|
}
|
67
71
|
end
|
68
72
|
|
@@ -76,7 +80,8 @@ module Nodeum
|
|
76
80
|
:'provider' => :'String',
|
77
81
|
:'region' => :'String',
|
78
82
|
:'access_key' => :'String',
|
79
|
-
:'secret_key' => :'String'
|
83
|
+
:'secret_key' => :'String',
|
84
|
+
:'options' => :'String'
|
80
85
|
}
|
81
86
|
end
|
82
87
|
|
@@ -132,6 +137,10 @@ module Nodeum
|
|
132
137
|
if attributes.key?(:'secret_key')
|
133
138
|
self.secret_key = attributes[:'secret_key']
|
134
139
|
end
|
140
|
+
|
141
|
+
if attributes.key?(:'options')
|
142
|
+
self.options = attributes[:'options']
|
143
|
+
end
|
135
144
|
end
|
136
145
|
|
137
146
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -144,7 +153,7 @@ module Nodeum
|
|
144
153
|
# Check to see if the all the properties in the model are valid
|
145
154
|
# @return true if the model is valid
|
146
155
|
def valid?
|
147
|
-
provider_validator = EnumAttributeValidator.new('String', ["generic_s3", "amazon_aws_s3", "cloudian_hyperstore", "scality_ring", "dell_emc_ecs", "azure", "google_cloud_storage", "openstack_swift"])
|
156
|
+
provider_validator = EnumAttributeValidator.new('String', ["generic_s3", "amazon_aws_s3", "cloudian_hyperstore", "scality_ring", "dell_emc_ecs", "azure", "google_cloud_storage", "openstack_swift", "wasabi"])
|
148
157
|
return false unless provider_validator.valid?(@provider)
|
149
158
|
true
|
150
159
|
end
|
@@ -152,7 +161,7 @@ module Nodeum
|
|
152
161
|
# Custom attribute writer method checking allowed values (enum).
|
153
162
|
# @param [Object] provider Object to be assigned
|
154
163
|
def provider=(provider)
|
155
|
-
validator = EnumAttributeValidator.new('String', ["generic_s3", "amazon_aws_s3", "cloudian_hyperstore", "scality_ring", "dell_emc_ecs", "azure", "google_cloud_storage", "openstack_swift"])
|
164
|
+
validator = EnumAttributeValidator.new('String', ["generic_s3", "amazon_aws_s3", "cloudian_hyperstore", "scality_ring", "dell_emc_ecs", "azure", "google_cloud_storage", "openstack_swift", "wasabi"])
|
156
165
|
unless validator.valid?(provider)
|
157
166
|
fail ArgumentError, "invalid value for \"provider\", must be one of #{validator.allowable_values}."
|
158
167
|
end
|
@@ -171,7 +180,8 @@ module Nodeum
|
|
171
180
|
provider == o.provider &&
|
172
181
|
region == o.region &&
|
173
182
|
access_key == o.access_key &&
|
174
|
-
secret_key == o.secret_key
|
183
|
+
secret_key == o.secret_key &&
|
184
|
+
options == o.options
|
175
185
|
end
|
176
186
|
|
177
187
|
# @see the `==` method
|
@@ -183,7 +193,7 @@ module Nodeum
|
|
183
193
|
# Calculates hash code according to all attributes.
|
184
194
|
# @return [Integer] Hash code
|
185
195
|
def hash
|
186
|
-
[id, name, url, url_proxy, provider, region, access_key, secret_key].hash
|
196
|
+
[id, name, url, url_proxy, provider, region, access_key, secret_key, options].hash
|
187
197
|
end
|
188
198
|
|
189
199
|
# Builds the object from hash
|
@@ -0,0 +1,230 @@
|
|
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 FileMetadataDefinition < MetadataDefinition
|
17
|
+
class EnumAttributeValidator
|
18
|
+
attr_reader :datatype
|
19
|
+
attr_reader :allowable_values
|
20
|
+
|
21
|
+
def initialize(datatype, allowable_values)
|
22
|
+
@allowable_values = allowable_values.map do |value|
|
23
|
+
case datatype.to_s
|
24
|
+
when /Integer/i
|
25
|
+
value.to_i
|
26
|
+
when /Float/i
|
27
|
+
value.to_f
|
28
|
+
else
|
29
|
+
value
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def valid?(value)
|
35
|
+
!value || allowable_values.include?(value)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
40
|
+
def self.attribute_map
|
41
|
+
{
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# Attribute type mapping.
|
46
|
+
def self.openapi_types
|
47
|
+
{
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# List of attributes with nullable: true
|
52
|
+
def self.openapi_nullable
|
53
|
+
Set.new([
|
54
|
+
])
|
55
|
+
end
|
56
|
+
|
57
|
+
# List of class defined in allOf (OpenAPI v3)
|
58
|
+
def self.openapi_all_of
|
59
|
+
[
|
60
|
+
:'MetadataDefinition'
|
61
|
+
]
|
62
|
+
end
|
63
|
+
|
64
|
+
# Initializes the object
|
65
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
66
|
+
def initialize(attributes = {})
|
67
|
+
if (!attributes.is_a?(Hash))
|
68
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Nodeum::FileMetadataDefinition` initialize method"
|
69
|
+
end
|
70
|
+
|
71
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
72
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
73
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
74
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Nodeum::FileMetadataDefinition`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
75
|
+
end
|
76
|
+
h[k.to_sym] = v
|
77
|
+
}
|
78
|
+
|
79
|
+
# call parent's initialize
|
80
|
+
super(attributes)
|
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 = super
|
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 && super
|
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 && super(o)
|
101
|
+
end
|
102
|
+
|
103
|
+
# @see the `==` method
|
104
|
+
# @param [Object] Object to be compared
|
105
|
+
def eql?(o)
|
106
|
+
self == o
|
107
|
+
end
|
108
|
+
|
109
|
+
# Calculates hash code according to all attributes.
|
110
|
+
# @return [Integer] Hash code
|
111
|
+
def hash
|
112
|
+
[].hash
|
113
|
+
end
|
114
|
+
|
115
|
+
# Builds the object from hash
|
116
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
117
|
+
# @return [Object] Returns the model itself
|
118
|
+
def self.build_from_hash(attributes)
|
119
|
+
new.build_from_hash(attributes)
|
120
|
+
end
|
121
|
+
|
122
|
+
# Builds the object from hash
|
123
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
124
|
+
# @return [Object] Returns the model itself
|
125
|
+
def build_from_hash(attributes)
|
126
|
+
return nil unless attributes.is_a?(Hash)
|
127
|
+
super(attributes)
|
128
|
+
self.class.openapi_types.each_pair do |key, type|
|
129
|
+
if type =~ /\AArray<(.*)>/i
|
130
|
+
# check to ensure the input is an array given that the attribute
|
131
|
+
# is documented as an array but the input is not
|
132
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
133
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
134
|
+
end
|
135
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
136
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
137
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
138
|
+
end
|
139
|
+
|
140
|
+
self
|
141
|
+
end
|
142
|
+
|
143
|
+
# Deserializes the data based on type
|
144
|
+
# @param string type Data type
|
145
|
+
# @param string value Value to be deserialized
|
146
|
+
# @return [Object] Deserialized data
|
147
|
+
def _deserialize(type, value)
|
148
|
+
case type.to_sym
|
149
|
+
when :DateTime
|
150
|
+
DateTime.parse(value)
|
151
|
+
when :Date
|
152
|
+
Date.parse(value)
|
153
|
+
when :String
|
154
|
+
value.to_s
|
155
|
+
when :Integer
|
156
|
+
value.to_i
|
157
|
+
when :Float
|
158
|
+
value.to_f
|
159
|
+
when :Boolean
|
160
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
161
|
+
true
|
162
|
+
else
|
163
|
+
false
|
164
|
+
end
|
165
|
+
when :Object
|
166
|
+
# generic object (usually a Hash), return directly
|
167
|
+
value
|
168
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
169
|
+
inner_type = Regexp.last_match[:inner_type]
|
170
|
+
value.map { |v| _deserialize(inner_type, v) }
|
171
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
172
|
+
k_type = Regexp.last_match[:k_type]
|
173
|
+
v_type = Regexp.last_match[:v_type]
|
174
|
+
{}.tap do |hash|
|
175
|
+
value.each do |k, v|
|
176
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
else # model
|
180
|
+
Nodeum.const_get(type).build_from_hash(value)
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
# Returns the string representation of the object
|
185
|
+
# @return [String] String presentation of the object
|
186
|
+
def to_s
|
187
|
+
to_hash.to_s
|
188
|
+
end
|
189
|
+
|
190
|
+
# to_body is an alias to to_hash (backward compatibility)
|
191
|
+
# @return [Hash] Returns the object in the form of hash
|
192
|
+
def to_body
|
193
|
+
to_hash
|
194
|
+
end
|
195
|
+
|
196
|
+
# Returns the object in the form of hash
|
197
|
+
# @return [Hash] Returns the object in the form of hash
|
198
|
+
def to_hash
|
199
|
+
hash = super
|
200
|
+
self.class.attribute_map.each_pair do |attr, param|
|
201
|
+
value = self.send(attr)
|
202
|
+
if value.nil?
|
203
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
204
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
205
|
+
end
|
206
|
+
|
207
|
+
hash[param] = _to_hash(value)
|
208
|
+
end
|
209
|
+
hash
|
210
|
+
end
|
211
|
+
|
212
|
+
# Outputs non-array value in the form of hash
|
213
|
+
# For object, use to_hash. Otherwise, just return the value
|
214
|
+
# @param [Object] value Any valid value
|
215
|
+
# @return [Hash] Returns the value in the form of hash
|
216
|
+
def _to_hash(value)
|
217
|
+
if value.is_a?(Array)
|
218
|
+
value.compact.map { |v| _to_hash(v) }
|
219
|
+
elsif value.is_a?(Hash)
|
220
|
+
{}.tap do |hash|
|
221
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
222
|
+
end
|
223
|
+
elsif value.respond_to? :to_hash
|
224
|
+
value.to_hash
|
225
|
+
else
|
226
|
+
value
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|
230
|
+
end
|
@@ -0,0 +1,217 @@
|
|
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 FileMetadataDefinitionCollection
|
17
|
+
attr_accessor :count
|
18
|
+
|
19
|
+
attr_accessor :file_metadata_definitions
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'count' => :'count',
|
25
|
+
:'file_metadata_definitions' => :'file_metadata_definitions'
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
# Attribute type mapping.
|
30
|
+
def self.openapi_types
|
31
|
+
{
|
32
|
+
:'count' => :'Integer',
|
33
|
+
:'file_metadata_definitions' => :'Array<FileMetadataDefinition>'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# List of attributes with nullable: true
|
38
|
+
def self.openapi_nullable
|
39
|
+
Set.new([
|
40
|
+
])
|
41
|
+
end
|
42
|
+
|
43
|
+
# Initializes the object
|
44
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
45
|
+
def initialize(attributes = {})
|
46
|
+
if (!attributes.is_a?(Hash))
|
47
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Nodeum::FileMetadataDefinitionCollection` initialize method"
|
48
|
+
end
|
49
|
+
|
50
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
51
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
52
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
53
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Nodeum::FileMetadataDefinitionCollection`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
54
|
+
end
|
55
|
+
h[k.to_sym] = v
|
56
|
+
}
|
57
|
+
|
58
|
+
if attributes.key?(:'count')
|
59
|
+
self.count = attributes[:'count']
|
60
|
+
end
|
61
|
+
|
62
|
+
if attributes.key?(:'file_metadata_definitions')
|
63
|
+
if (value = attributes[:'file_metadata_definitions']).is_a?(Array)
|
64
|
+
self.file_metadata_definitions = value
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
70
|
+
# @return Array for valid properties with the reasons
|
71
|
+
def list_invalid_properties
|
72
|
+
invalid_properties = Array.new
|
73
|
+
invalid_properties
|
74
|
+
end
|
75
|
+
|
76
|
+
# Check to see if the all the properties in the model are valid
|
77
|
+
# @return true if the model is valid
|
78
|
+
def valid?
|
79
|
+
true
|
80
|
+
end
|
81
|
+
|
82
|
+
# Checks equality by comparing each attribute.
|
83
|
+
# @param [Object] Object to be compared
|
84
|
+
def ==(o)
|
85
|
+
return true if self.equal?(o)
|
86
|
+
self.class == o.class &&
|
87
|
+
count == o.count &&
|
88
|
+
file_metadata_definitions == o.file_metadata_definitions
|
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
|
+
[count, file_metadata_definitions].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
|
+
self.class.openapi_types.each_pair do |key, type|
|
116
|
+
if type =~ /\AArray<(.*)>/i
|
117
|
+
# check to ensure the input is an array given that the attribute
|
118
|
+
# is documented as an array but the input is not
|
119
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
120
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
121
|
+
end
|
122
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
123
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
124
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
125
|
+
end
|
126
|
+
|
127
|
+
self
|
128
|
+
end
|
129
|
+
|
130
|
+
# Deserializes the data based on type
|
131
|
+
# @param string type Data type
|
132
|
+
# @param string value Value to be deserialized
|
133
|
+
# @return [Object] Deserialized data
|
134
|
+
def _deserialize(type, value)
|
135
|
+
case type.to_sym
|
136
|
+
when :DateTime
|
137
|
+
DateTime.parse(value)
|
138
|
+
when :Date
|
139
|
+
Date.parse(value)
|
140
|
+
when :String
|
141
|
+
value.to_s
|
142
|
+
when :Integer
|
143
|
+
value.to_i
|
144
|
+
when :Float
|
145
|
+
value.to_f
|
146
|
+
when :Boolean
|
147
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
148
|
+
true
|
149
|
+
else
|
150
|
+
false
|
151
|
+
end
|
152
|
+
when :Object
|
153
|
+
# generic object (usually a Hash), return directly
|
154
|
+
value
|
155
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
156
|
+
inner_type = Regexp.last_match[:inner_type]
|
157
|
+
value.map { |v| _deserialize(inner_type, v) }
|
158
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
159
|
+
k_type = Regexp.last_match[:k_type]
|
160
|
+
v_type = Regexp.last_match[:v_type]
|
161
|
+
{}.tap do |hash|
|
162
|
+
value.each do |k, v|
|
163
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
else # model
|
167
|
+
Nodeum.const_get(type).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
|
+
if value.nil?
|
190
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
191
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
192
|
+
end
|
193
|
+
|
194
|
+
hash[param] = _to_hash(value)
|
195
|
+
end
|
196
|
+
hash
|
197
|
+
end
|
198
|
+
|
199
|
+
# Outputs non-array value in the form of hash
|
200
|
+
# For object, use to_hash. Otherwise, just return the value
|
201
|
+
# @param [Object] value Any valid value
|
202
|
+
# @return [Hash] Returns the value in the form of hash
|
203
|
+
def _to_hash(value)
|
204
|
+
if value.is_a?(Array)
|
205
|
+
value.compact.map { |v| _to_hash(v) }
|
206
|
+
elsif value.is_a?(Hash)
|
207
|
+
{}.tap do |hash|
|
208
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
209
|
+
end
|
210
|
+
elsif value.respond_to? :to_hash
|
211
|
+
value.to_hash
|
212
|
+
else
|
213
|
+
value
|
214
|
+
end
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|