ionoscloud-dbaas-mongo 1.0.0 → 1.1.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 (36) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -3
  3. data/README.md +6 -2
  4. data/docs/README.md +56 -0
  5. data/docs/api/ClustersApi.md +78 -0
  6. data/docs/api/UsersApi.md +82 -0
  7. data/docs/models/ClusterProperties.md +1 -1
  8. data/docs/models/Connection.md +1 -1
  9. data/docs/models/CreateClusterProperties.md +1 -1
  10. data/docs/models/PatchClusterProperties.md +26 -0
  11. data/docs/models/PatchClusterRequest.md +20 -0
  12. data/docs/models/PatchUserProperties.md +20 -0
  13. data/docs/models/PatchUserRequest.md +20 -0
  14. data/docs/models/TemplateList.md +11 -1
  15. data/docs/models/TemplateListAllOf.md +4 -0
  16. data/docs/models/TemplateResponse.md +4 -0
  17. data/docs/models/UserProperties.md +0 -2
  18. data/lib/ionoscloud-dbaas-mongo/api/clusters_api.rb +71 -0
  19. data/lib/ionoscloud-dbaas-mongo/api/users_api.rb +83 -0
  20. data/lib/ionoscloud-dbaas-mongo/api_client.rb +1 -1
  21. data/lib/ionoscloud-dbaas-mongo/models/cluster_properties.rb +1 -1
  22. data/lib/ionoscloud-dbaas-mongo/models/connection.rb +1 -1
  23. data/lib/ionoscloud-dbaas-mongo/models/create_cluster_properties.rb +1 -1
  24. data/lib/ionoscloud-dbaas-mongo/models/patch_cluster_properties.rb +322 -0
  25. data/lib/ionoscloud-dbaas-mongo/models/patch_cluster_request.rb +244 -0
  26. data/lib/ionoscloud-dbaas-mongo/models/patch_user_properties.rb +259 -0
  27. data/lib/ionoscloud-dbaas-mongo/models/patch_user_request.rb +244 -0
  28. data/lib/ionoscloud-dbaas-mongo/models/resource_type.rb +1 -0
  29. data/lib/ionoscloud-dbaas-mongo/models/template_list.rb +123 -4
  30. data/lib/ionoscloud-dbaas-mongo/models/template_list_all_of.rb +36 -1
  31. data/lib/ionoscloud-dbaas-mongo/models/template_response.rb +37 -1
  32. data/lib/ionoscloud-dbaas-mongo/models/user_properties.rb +19 -23
  33. data/lib/ionoscloud-dbaas-mongo/version.rb +1 -1
  34. data/lib/ionoscloud-dbaas-mongo.rb +4 -0
  35. data/sonar-project.properties +12 -0
  36. metadata +12 -2
@@ -0,0 +1,259 @@
1
+ =begin
2
+ #IONOS DBaaS MongoDB REST API
3
+
4
+ #With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module IonoscloudDbaasMongo
17
+ # MongoDB database user patch request properties.
18
+ class PatchUserProperties
19
+
20
+ attr_accessor :password
21
+
22
+
23
+ attr_accessor :roles
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+
29
+ :'password' => :'password',
30
+
31
+ :'roles' => :'roles'
32
+ }
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+
44
+ :'password' => :'String',
45
+
46
+ :'roles' => :'Array<UserRoles>'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+
54
+
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IonoscloudDbaasMongo::PatchUserProperties` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!self.class.attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IonoscloudDbaasMongo::PatchUserProperties`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
72
+
73
+
74
+ if attributes.key?(:'password')
75
+ self.password = attributes[:'password']
76
+ end
77
+
78
+
79
+ if attributes.key?(:'roles') && (value = attributes[:'roles']).is_a?(Array)
80
+ self.roles = value
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ invalid_properties = Array.new
88
+
89
+ if !@password.nil? && @password.to_s.length < 10
90
+ invalid_properties.push('invalid value for "password", the character length must be great than or equal to 10.')
91
+ end
92
+
93
+
94
+ invalid_properties
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ def valid?
100
+
101
+ return false if !@password.nil? && @password.to_s.length < 10
102
+
103
+ true
104
+ end
105
+
106
+
107
+ # Custom attribute writer method with validation
108
+ # @param [Object] password Value to be assigned
109
+ def password=(password)
110
+ if !password.nil? && password.to_s.length < 10
111
+ fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 10.'
112
+ end
113
+
114
+ @password = password
115
+ end
116
+
117
+
118
+ # Checks equality by comparing each attribute.
119
+ # @param [Object] Object to be compared
120
+ def ==(o)
121
+ return true if self.equal?(o)
122
+ self.class == o.class &&
123
+ password == o.password &&
124
+ roles == o.roles
125
+ end
126
+
127
+ # @see the `==` method
128
+ # @param [Object] Object to be compared
129
+ def eql?(o)
130
+ self == o
131
+ end
132
+
133
+ # Calculates hash code according to all attributes.
134
+ # @return [Integer] Hash code
135
+ def hash
136
+ [password, roles].hash
137
+ end
138
+
139
+ # Builds the object from hash
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ # @return [Object] Returns the model itself
142
+ def self.build_from_hash(attributes)
143
+ new.build_from_hash(attributes)
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def build_from_hash(attributes)
150
+ return nil unless attributes.is_a?(Hash)
151
+ self.class.openapi_types.each_pair do |key, type|
152
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
153
+ self.send("#{key}=", nil)
154
+ elsif type =~ /\AArray<(.*)>/i
155
+ # check to ensure the input is an array given that the attribute
156
+ # is documented as an array but the input is not
157
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
158
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
159
+ end
160
+ elsif !attributes[self.class.attribute_map[key]].nil?
161
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
162
+ end
163
+ end
164
+
165
+ self
166
+ end
167
+
168
+ # Deserializes the data based on type
169
+ # @param string type Data type
170
+ # @param string value Value to be deserialized
171
+ # @return [Object] Deserialized data
172
+ def _deserialize(type, value)
173
+ case type.to_sym
174
+ when :Time
175
+ Time.parse(value)
176
+ when :Date
177
+ Date.parse(value)
178
+ when :String
179
+ value.to_s
180
+ when :Integer
181
+ value.to_i
182
+ when :Float
183
+ value.to_f
184
+ when :Boolean
185
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
186
+ true
187
+ else
188
+ false
189
+ end
190
+ when :Object
191
+ # generic object (usually a Hash), return directly
192
+ value
193
+ when /\AArray<(?<inner_type>.+)>\z/
194
+ inner_type = Regexp.last_match[:inner_type]
195
+ value.map { |v| _deserialize(inner_type, v) }
196
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
197
+ k_type = Regexp.last_match[:k_type]
198
+ v_type = Regexp.last_match[:v_type]
199
+ {}.tap do |hash|
200
+ value.each do |k, v|
201
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
202
+ end
203
+ end
204
+ else # model
205
+ # models (e.g. Pet) or oneOf
206
+ klass = IonoscloudDbaasMongo.const_get(type)
207
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
208
+ end
209
+ end
210
+
211
+ # Returns the string representation of the object
212
+ # @return [String] String presentation of the object
213
+ def to_s
214
+ to_hash.to_s
215
+ end
216
+
217
+ # to_body is an alias to to_hash (backward compatibility)
218
+ # @return [Hash] Returns the object in the form of hash
219
+ def to_body
220
+ to_hash
221
+ end
222
+
223
+ # Returns the object in the form of hash
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_hash
226
+ hash = {}
227
+ self.class.attribute_map.each_pair do |attr, param|
228
+ value = self.send(attr)
229
+ if value.nil?
230
+ is_nullable = self.class.openapi_nullable.include?(attr)
231
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
232
+ end
233
+
234
+ hash[param] = _to_hash(value)
235
+ end
236
+ hash
237
+ end
238
+
239
+ # Outputs non-array value in the form of hash
240
+ # For object, use to_hash. Otherwise, just return the value
241
+ # @param [Object] value Any valid value
242
+ # @return [Hash] Returns the value in the form of hash
243
+ def _to_hash(value)
244
+ if value.is_a?(Array)
245
+ value.compact.map { |v| _to_hash(v) }
246
+ elsif value.is_a?(Hash)
247
+ {}.tap do |hash|
248
+ value.each { |k, v| hash[k] = _to_hash(v) }
249
+ end
250
+ elsif value.respond_to? :to_hash
251
+ value.to_hash
252
+ else
253
+ value
254
+ end
255
+ end
256
+
257
+ end
258
+
259
+ end
@@ -0,0 +1,244 @@
1
+ =begin
2
+ #IONOS DBaaS MongoDB REST API
3
+
4
+ #With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module IonoscloudDbaasMongo
17
+ # MongoDB database user patch request.
18
+ class PatchUserRequest
19
+
20
+ attr_accessor :metadata
21
+
22
+
23
+ attr_accessor :properties
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+
29
+ :'metadata' => :'metadata',
30
+
31
+ :'properties' => :'properties'
32
+ }
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+
44
+ :'metadata' => :'UserMetadata',
45
+
46
+ :'properties' => :'PatchUserProperties'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+
54
+
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IonoscloudDbaasMongo::PatchUserRequest` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!self.class.attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IonoscloudDbaasMongo::PatchUserRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
72
+
73
+
74
+ if attributes.key?(:'metadata')
75
+ self.metadata = attributes[:'metadata']
76
+ end
77
+
78
+
79
+ if attributes.key?(:'properties')
80
+ self.properties = attributes[:'properties']
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ invalid_properties = Array.new
88
+
89
+
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+
97
+
98
+ true
99
+ end
100
+
101
+
102
+
103
+ # Checks equality by comparing each attribute.
104
+ # @param [Object] Object to be compared
105
+ def ==(o)
106
+ return true if self.equal?(o)
107
+ self.class == o.class &&
108
+ metadata == o.metadata &&
109
+ properties == o.properties
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [metadata, properties].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ new.build_from_hash(attributes)
129
+ end
130
+
131
+ # Builds the object from hash
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ # @return [Object] Returns the model itself
134
+ def build_from_hash(attributes)
135
+ return nil unless attributes.is_a?(Hash)
136
+ self.class.openapi_types.each_pair do |key, type|
137
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
138
+ self.send("#{key}=", nil)
139
+ elsif type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
143
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
144
+ end
145
+ elsif !attributes[self.class.attribute_map[key]].nil?
146
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
147
+ end
148
+ end
149
+
150
+ self
151
+ end
152
+
153
+ # Deserializes the data based on type
154
+ # @param string type Data type
155
+ # @param string value Value to be deserialized
156
+ # @return [Object] Deserialized data
157
+ def _deserialize(type, value)
158
+ case type.to_sym
159
+ when :Time
160
+ Time.parse(value)
161
+ when :Date
162
+ Date.parse(value)
163
+ when :String
164
+ value.to_s
165
+ when :Integer
166
+ value.to_i
167
+ when :Float
168
+ value.to_f
169
+ when :Boolean
170
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
171
+ true
172
+ else
173
+ false
174
+ end
175
+ when :Object
176
+ # generic object (usually a Hash), return directly
177
+ value
178
+ when /\AArray<(?<inner_type>.+)>\z/
179
+ inner_type = Regexp.last_match[:inner_type]
180
+ value.map { |v| _deserialize(inner_type, v) }
181
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
182
+ k_type = Regexp.last_match[:k_type]
183
+ v_type = Regexp.last_match[:v_type]
184
+ {}.tap do |hash|
185
+ value.each do |k, v|
186
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
187
+ end
188
+ end
189
+ else # model
190
+ # models (e.g. Pet) or oneOf
191
+ klass = IonoscloudDbaasMongo.const_get(type)
192
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
193
+ end
194
+ end
195
+
196
+ # Returns the string representation of the object
197
+ # @return [String] String presentation of the object
198
+ def to_s
199
+ to_hash.to_s
200
+ end
201
+
202
+ # to_body is an alias to to_hash (backward compatibility)
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_body
205
+ to_hash
206
+ end
207
+
208
+ # Returns the object in the form of hash
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_hash
211
+ hash = {}
212
+ self.class.attribute_map.each_pair do |attr, param|
213
+ value = self.send(attr)
214
+ if value.nil?
215
+ is_nullable = self.class.openapi_nullable.include?(attr)
216
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
217
+ end
218
+
219
+ hash[param] = _to_hash(value)
220
+ end
221
+ hash
222
+ end
223
+
224
+ # Outputs non-array value in the form of hash
225
+ # For object, use to_hash. Otherwise, just return the value
226
+ # @param [Object] value Any valid value
227
+ # @return [Hash] Returns the value in the form of hash
228
+ def _to_hash(value)
229
+ if value.is_a?(Array)
230
+ value.compact.map { |v| _to_hash(v) }
231
+ elsif value.is_a?(Hash)
232
+ {}.tap do |hash|
233
+ value.each { |k, v| hash[k] = _to_hash(v) }
234
+ end
235
+ elsif value.respond_to? :to_hash
236
+ value.to_hash
237
+ else
238
+ value
239
+ end
240
+ end
241
+
242
+ end
243
+
244
+ end
@@ -18,6 +18,7 @@ module IonoscloudDbaasMongo
18
18
  COLLECTION = "collection".freeze
19
19
  CLUSTER = "cluster".freeze
20
20
  USER = "user".freeze
21
+ SNAPSHOT = "snapshot".freeze
21
22
 
22
23
  # Builds the enum from string
23
24
  # @param [String] The enum value in the form of the string
@@ -17,13 +17,41 @@ module IonoscloudDbaasMongo
17
17
  # The list of MongoDB templates.
18
18
  class TemplateList
19
19
 
20
+ attr_accessor :type
21
+
22
+
23
+ # The unique ID of the resource.
24
+ attr_accessor :id
25
+
26
+
20
27
  attr_accessor :items
21
28
 
29
+
30
+ # The offset specified in the request (if none was specified, the default offset is 0) (not implemented yet).
31
+ attr_accessor :offset
32
+
33
+
34
+ # The limit specified in the request (if none was specified, use the endpoint's default pagination limit) (not implemented yet, always return number of items).
35
+ attr_accessor :limit
36
+
37
+
38
+ attr_accessor :_links
39
+
22
40
  # Attribute mapping from ruby-style variable name to JSON key.
23
41
  def self.attribute_map
24
42
  {
25
43
 
26
- :'items' => :'items'
44
+ :'type' => :'type',
45
+
46
+ :'id' => :'id',
47
+
48
+ :'items' => :'items',
49
+
50
+ :'offset' => :'offset',
51
+
52
+ :'limit' => :'limit',
53
+
54
+ :'_links' => :'_links'
27
55
  }
28
56
  end
29
57
 
@@ -36,7 +64,17 @@ module IonoscloudDbaasMongo
36
64
  def self.openapi_types
37
65
  {
38
66
 
39
- :'items' => :'Array<TemplateResponse>'
67
+ :'type' => :'ResourceType',
68
+
69
+ :'id' => :'String',
70
+
71
+ :'items' => :'Array<TemplateResponse>',
72
+
73
+ :'offset' => :'Integer',
74
+
75
+ :'limit' => :'Integer',
76
+
77
+ :'_links' => :'PaginationLinks'
40
78
  }
41
79
  end
42
80
 
@@ -44,12 +82,18 @@ module IonoscloudDbaasMongo
44
82
  def self.openapi_nullable
45
83
  Set.new([
46
84
 
85
+
86
+
87
+
88
+
89
+
47
90
  ])
48
91
  end
49
92
 
50
93
  # List of class defined in allOf (OpenAPI v3)
51
94
  def self.openapi_all_of
52
95
  [
96
+ :'Pagination',
53
97
  :'TemplateListAllOf'
54
98
  ]
55
99
  end
@@ -70,9 +114,34 @@ module IonoscloudDbaasMongo
70
114
  }
71
115
 
72
116
 
117
+ if attributes.key?(:'type')
118
+ self.type = attributes[:'type']
119
+ end
120
+
121
+
122
+ if attributes.key?(:'id')
123
+ self.id = attributes[:'id']
124
+ end
125
+
126
+
73
127
  if attributes.key?(:'items') && (value = attributes[:'items']).is_a?(Array)
74
128
  self.items = value
75
129
  end
130
+
131
+
132
+ if attributes.key?(:'offset')
133
+ self.offset = attributes[:'offset']
134
+ end
135
+
136
+
137
+ if attributes.key?(:'limit')
138
+ self.limit = attributes[:'limit']
139
+ end
140
+
141
+
142
+ if attributes.key?(:'_links')
143
+ self._links = attributes[:'_links']
144
+ end
76
145
  end
77
146
 
78
147
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -80,6 +149,19 @@ module IonoscloudDbaasMongo
80
149
  def list_invalid_properties
81
150
  invalid_properties = Array.new
82
151
 
152
+
153
+
154
+
155
+ if !@offset.nil? && @offset < 0
156
+ invalid_properties.push('invalid value for "offset", must be greater than or equal to 0.')
157
+ end
158
+
159
+
160
+ if !@limit.nil? && @limit < 0
161
+ invalid_properties.push('invalid value for "limit", must be greater than or equal to 0.')
162
+ end
163
+
164
+
83
165
  invalid_properties
84
166
  end
85
167
 
@@ -87,16 +169,53 @@ module IonoscloudDbaasMongo
87
169
  # @return true if the model is valid
88
170
  def valid?
89
171
 
172
+
173
+
174
+
175
+ return false if !@offset.nil? && @offset < 0
176
+
177
+ return false if !@limit.nil? && @limit < 0
178
+
90
179
  true
91
180
  end
92
181
 
93
182
 
183
+
184
+
185
+
186
+ # Custom attribute writer method with validation
187
+ # @param [Object] offset Value to be assigned
188
+ def offset=(offset)
189
+ if !offset.nil? && offset < 0
190
+ fail ArgumentError, 'invalid value for "offset", must be greater than or equal to 0.'
191
+ end
192
+
193
+ @offset = offset
194
+ end
195
+
196
+
197
+ # Custom attribute writer method with validation
198
+ # @param [Object] limit Value to be assigned
199
+ def limit=(limit)
200
+ if !limit.nil? && limit < 0
201
+ fail ArgumentError, 'invalid value for "limit", must be greater than or equal to 0.'
202
+ end
203
+
204
+ @limit = limit
205
+ end
206
+
207
+
94
208
  # Checks equality by comparing each attribute.
95
209
  # @param [Object] Object to be compared
96
210
  def ==(o)
97
211
  return true if self.equal?(o)
98
212
  self.class == o.class &&
99
- items == o.items
213
+ type == o.type &&
214
+ id == o.id &&
215
+ items == o.items &&
216
+ offset == o.offset &&
217
+ limit == o.limit &&
218
+ _links == o._links
100
219
  end
101
220
 
102
221
  # @see the `==` method
@@ -108,7 +227,7 @@ module IonoscloudDbaasMongo
108
227
  # Calculates hash code according to all attributes.
109
228
  # @return [Integer] Hash code
110
229
  def hash
111
- [items].hash
230
+ [type, id, items, offset, limit, _links].hash
112
231
  end
113
232
 
114
233
  # Builds the object from hash