pnap_network_api 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 (41) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -5
  3. data/VERSION +1 -1
  4. data/docs/NetworkMembership.md +22 -0
  5. data/docs/PrivateNetwork.md +7 -1
  6. data/docs/PublicNetwork.md +34 -0
  7. data/docs/PublicNetworkCreate.md +24 -0
  8. data/docs/PublicNetworkIpBlock.md +18 -0
  9. data/docs/PublicNetworkMembership.md +22 -0
  10. data/docs/PublicNetworkModify.md +20 -0
  11. data/docs/PublicNetworksApi.md +510 -0
  12. data/lib/pnap_network_api/api/private_networks_api.rb +1 -1
  13. data/lib/pnap_network_api/api/public_networks_api.rb +481 -0
  14. data/lib/pnap_network_api/api_client.rb +1 -1
  15. data/lib/pnap_network_api/api_error.rb +1 -1
  16. data/lib/pnap_network_api/configuration.rb +1 -1
  17. data/lib/pnap_network_api/models/error.rb +1 -1
  18. data/lib/pnap_network_api/models/network_membership.rb +257 -0
  19. data/lib/pnap_network_api/models/private_network.rb +95 -5
  20. data/lib/pnap_network_api/models/private_network_create.rb +44 -1
  21. data/lib/pnap_network_api/models/private_network_modify.rb +44 -1
  22. data/lib/pnap_network_api/models/private_network_server.rb +1 -1
  23. data/lib/pnap_network_api/models/public_network.rb +387 -0
  24. data/lib/pnap_network_api/models/public_network_create.rb +320 -0
  25. data/lib/pnap_network_api/models/public_network_ip_block.rb +225 -0
  26. data/lib/pnap_network_api/models/public_network_membership.rb +257 -0
  27. data/lib/pnap_network_api/models/public_network_modify.rb +269 -0
  28. data/lib/pnap_network_api/version.rb +1 -1
  29. data/lib/pnap_network_api.rb +7 -1
  30. data/pnap_network_api.gemspec +2 -2
  31. data/spec/api/public_networks_api_spec.rb +122 -0
  32. data/spec/api_client_spec.rb +1 -1
  33. data/spec/configuration_spec.rb +1 -1
  34. data/spec/models/network_membership_spec.rb +46 -0
  35. data/spec/models/public_network_create_spec.rb +52 -0
  36. data/spec/models/public_network_ip_block_spec.rb +34 -0
  37. data/spec/models/public_network_membership_spec.rb +46 -0
  38. data/spec/models/public_network_modify_spec.rb +40 -0
  39. data/spec/models/public_network_spec.rb +76 -0
  40. data/spec/spec_helper.rb +1 -1
  41. metadata +34 -6
@@ -0,0 +1,257 @@
1
+ =begin
2
+ #Networks API
3
+
4
+ #Create, list, edit and delete public/private networks with the Network API. Use public networks to place multiple servers on the same network or VLAN. Assign new servers with IP addresses from the same CIDR range. Use private networks to avoid unnecessary egress data charges. Model your networks according to your business needs.<br> <br> <span class='pnap-api-knowledge-base-link'> Helpful knowledge base articles are available for <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#multi-private-backend-network-api' target='_blank'>multi-private backend networks</a> and <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#ftoc-heading-15' target='_blank'>public networks</a>. </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/networks/v1/)</b>
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@phoenixnap.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module NetworkApi
17
+ # Resource details linked to the Network.
18
+ class NetworkMembership
19
+ # The resource identifier.
20
+ attr_accessor :resource_id
21
+
22
+ # The resource's type.
23
+ attr_accessor :resource_type
24
+
25
+ # List of IPs associated to the resource.
26
+ attr_accessor :ips
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'resource_id' => :'resourceId',
32
+ :'resource_type' => :'resourceType',
33
+ :'ips' => :'ips'
34
+ }
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'resource_id' => :'String',
46
+ :'resource_type' => :'String',
47
+ :'ips' => :'Array<String>'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `NetworkApi::NetworkMembership` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkApi::NetworkMembership`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'resource_id')
73
+ self.resource_id = attributes[:'resource_id']
74
+ end
75
+
76
+ if attributes.key?(:'resource_type')
77
+ self.resource_type = attributes[:'resource_type']
78
+ end
79
+
80
+ if attributes.key?(:'ips')
81
+ if (value = attributes[:'ips']).is_a?(Array)
82
+ self.ips = value
83
+ end
84
+ end
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properties with the reasons
89
+ def list_invalid_properties
90
+ invalid_properties = Array.new
91
+ if @resource_id.nil?
92
+ invalid_properties.push('invalid value for "resource_id", resource_id cannot be nil.')
93
+ end
94
+
95
+ if @resource_type.nil?
96
+ invalid_properties.push('invalid value for "resource_type", resource_type cannot be nil.')
97
+ end
98
+
99
+ if @ips.nil?
100
+ invalid_properties.push('invalid value for "ips", ips cannot be nil.')
101
+ end
102
+
103
+ invalid_properties
104
+ end
105
+
106
+ # Check to see if the all the properties in the model are valid
107
+ # @return true if the model is valid
108
+ def valid?
109
+ return false if @resource_id.nil?
110
+ return false if @resource_type.nil?
111
+ return false if @ips.nil?
112
+ true
113
+ end
114
+
115
+ # Checks equality by comparing each attribute.
116
+ # @param [Object] Object to be compared
117
+ def ==(o)
118
+ return true if self.equal?(o)
119
+ self.class == o.class &&
120
+ resource_id == o.resource_id &&
121
+ resource_type == o.resource_type &&
122
+ ips == o.ips
123
+ end
124
+
125
+ # @see the `==` method
126
+ # @param [Object] Object to be compared
127
+ def eql?(o)
128
+ self == o
129
+ end
130
+
131
+ # Calculates hash code according to all attributes.
132
+ # @return [Integer] Hash code
133
+ def hash
134
+ [resource_id, resource_type, ips].hash
135
+ end
136
+
137
+ # Builds the object from hash
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ # @return [Object] Returns the model itself
140
+ def self.build_from_hash(attributes)
141
+ new.build_from_hash(attributes)
142
+ end
143
+
144
+ # Builds the object from hash
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ # @return [Object] Returns the model itself
147
+ def build_from_hash(attributes)
148
+ return nil unless attributes.is_a?(Hash)
149
+ self.class.openapi_types.each_pair do |key, type|
150
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
151
+ self.send("#{key}=", nil)
152
+ elsif type =~ /\AArray<(.*)>/i
153
+ # check to ensure the input is an array given that the attribute
154
+ # is documented as an array but the input is not
155
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
156
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
157
+ end
158
+ elsif !attributes[self.class.attribute_map[key]].nil?
159
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
160
+ end
161
+ end
162
+
163
+ self
164
+ end
165
+
166
+ # Deserializes the data based on type
167
+ # @param string type Data type
168
+ # @param string value Value to be deserialized
169
+ # @return [Object] Deserialized data
170
+ def _deserialize(type, value)
171
+ case type.to_sym
172
+ when :Time
173
+ Time.parse(value)
174
+ when :Date
175
+ Date.parse(value)
176
+ when :String
177
+ value.to_s
178
+ when :Integer
179
+ value.to_i
180
+ when :Float
181
+ value.to_f
182
+ when :Boolean
183
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
184
+ true
185
+ else
186
+ false
187
+ end
188
+ when :Object
189
+ # generic object (usually a Hash), return directly
190
+ value
191
+ when /\AArray<(?<inner_type>.+)>\z/
192
+ inner_type = Regexp.last_match[:inner_type]
193
+ value.map { |v| _deserialize(inner_type, v) }
194
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
195
+ k_type = Regexp.last_match[:k_type]
196
+ v_type = Regexp.last_match[:v_type]
197
+ {}.tap do |hash|
198
+ value.each do |k, v|
199
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
200
+ end
201
+ end
202
+ else # model
203
+ # models (e.g. Pet) or oneOf
204
+ klass = NetworkApi.const_get(type)
205
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
206
+ end
207
+ end
208
+
209
+ # Returns the string representation of the object
210
+ # @return [String] String presentation of the object
211
+ def to_s
212
+ to_hash.to_s
213
+ end
214
+
215
+ # to_body is an alias to to_hash (backward compatibility)
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_body
218
+ to_hash
219
+ end
220
+
221
+ # Returns the object in the form of hash
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_hash
224
+ hash = {}
225
+ self.class.attribute_map.each_pair do |attr, param|
226
+ value = self.send(attr)
227
+ if value.nil?
228
+ is_nullable = self.class.openapi_nullable.include?(attr)
229
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
230
+ end
231
+
232
+ hash[param] = _to_hash(value)
233
+ end
234
+ hash
235
+ end
236
+
237
+ # Outputs non-array value in the form of hash
238
+ # For object, use to_hash. Otherwise, just return the value
239
+ # @param [Object] value Any valid value
240
+ # @return [Hash] Returns the value in the form of hash
241
+ def _to_hash(value)
242
+ if value.is_a?(Array)
243
+ value.compact.map { |v| _to_hash(v) }
244
+ elsif value.is_a?(Hash)
245
+ {}.tap do |hash|
246
+ value.each { |k, v| hash[k] = _to_hash(v) }
247
+ end
248
+ elsif value.respond_to? :to_hash
249
+ value.to_hash
250
+ else
251
+ value
252
+ end
253
+ end
254
+
255
+ end
256
+
257
+ end
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #Networks API
3
3
 
4
- #Use the Networks API to create, list, edit, and delete private networks to best fit your business needs. Private networks allow your servers to communicate without connecting to the public internet, avoiding unnecessary egress data charges.<br> <br> <span class='pnap-api-knowledge-base-link'> Knowledge base articles to help you can be found <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#multi-private-backend-network-api' target='_blank'>here</a> </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/networks/v1/)</b>
4
+ #Create, list, edit and delete public/private networks with the Network API. Use public networks to place multiple servers on the same network or VLAN. Assign new servers with IP addresses from the same CIDR range. Use private networks to avoid unnecessary egress data charges. Model your networks according to your business needs.<br> <br> <span class='pnap-api-knowledge-base-link'> Helpful knowledge base articles are available for <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#multi-private-backend-network-api' target='_blank'>multi-private backend networks</a> and <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#ftoc-heading-15' target='_blank'>public networks</a>. </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/networks/v1/)</b>
5
5
 
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
@@ -42,6 +42,15 @@ module NetworkApi
42
42
 
43
43
  attr_accessor :servers
44
44
 
45
+ # A list of resources that are members of this private network.
46
+ attr_accessor :memberships
47
+
48
+ # The status of the private network. Can have one of the following values: `BUSY` or `READY`.
49
+ attr_accessor :status
50
+
51
+ # Date and time when this private network was created.
52
+ attr_accessor :created_on
53
+
45
54
  # Attribute mapping from ruby-style variable name to JSON key.
46
55
  def self.attribute_map
47
56
  {
@@ -53,7 +62,10 @@ module NetworkApi
53
62
  :'location' => :'location',
54
63
  :'location_default' => :'locationDefault',
55
64
  :'cidr' => :'cidr',
56
- :'servers' => :'servers'
65
+ :'servers' => :'servers',
66
+ :'memberships' => :'memberships',
67
+ :'status' => :'status',
68
+ :'created_on' => :'createdOn'
57
69
  }
58
70
  end
59
71
 
@@ -73,7 +85,10 @@ module NetworkApi
73
85
  :'location' => :'String',
74
86
  :'location_default' => :'Boolean',
75
87
  :'cidr' => :'String',
76
- :'servers' => :'Array<PrivateNetworkServer>'
88
+ :'servers' => :'Array<PrivateNetworkServer>',
89
+ :'memberships' => :'Array<NetworkMembership>',
90
+ :'status' => :'String',
91
+ :'created_on' => :'Time'
77
92
  }
78
93
  end
79
94
 
@@ -135,6 +150,20 @@ module NetworkApi
135
150
  self.servers = value
136
151
  end
137
152
  end
153
+
154
+ if attributes.key?(:'memberships')
155
+ if (value = attributes[:'memberships']).is_a?(Array)
156
+ self.memberships = value
157
+ end
158
+ end
159
+
160
+ if attributes.key?(:'status')
161
+ self.status = attributes[:'status']
162
+ end
163
+
164
+ if attributes.key?(:'created_on')
165
+ self.created_on = attributes[:'created_on']
166
+ end
138
167
  end
139
168
 
140
169
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -149,6 +178,18 @@ module NetworkApi
149
178
  invalid_properties.push('invalid value for "name", name cannot be nil.')
150
179
  end
151
180
 
181
+ if @name.to_s.length > 100
182
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.')
183
+ end
184
+
185
+ if @name.to_s.length < 1
186
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
187
+ end
188
+
189
+ if !@description.nil? && @description.to_s.length > 250
190
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 250.')
191
+ end
192
+
152
193
  if @vlan_id.nil?
153
194
  invalid_properties.push('invalid value for "vlan_id", vlan_id cannot be nil.')
154
195
  end
@@ -173,6 +214,18 @@ module NetworkApi
173
214
  invalid_properties.push('invalid value for "servers", servers cannot be nil.')
174
215
  end
175
216
 
217
+ if @memberships.nil?
218
+ invalid_properties.push('invalid value for "memberships", memberships cannot be nil.')
219
+ end
220
+
221
+ if @status.nil?
222
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
223
+ end
224
+
225
+ if @created_on.nil?
226
+ invalid_properties.push('invalid value for "created_on", created_on cannot be nil.')
227
+ end
228
+
176
229
  invalid_properties
177
230
  end
178
231
 
@@ -181,15 +234,49 @@ module NetworkApi
181
234
  def valid?
182
235
  return false if @id.nil?
183
236
  return false if @name.nil?
237
+ return false if @name.to_s.length > 100
238
+ return false if @name.to_s.length < 1
239
+ return false if !@description.nil? && @description.to_s.length > 250
184
240
  return false if @vlan_id.nil?
185
241
  return false if @type.nil?
186
242
  return false if @location.nil?
187
243
  return false if @location_default.nil?
188
244
  return false if @cidr.nil?
189
245
  return false if @servers.nil?
246
+ return false if @memberships.nil?
247
+ return false if @status.nil?
248
+ return false if @created_on.nil?
190
249
  true
191
250
  end
192
251
 
252
+ # Custom attribute writer method with validation
253
+ # @param [Object] name Value to be assigned
254
+ def name=(name)
255
+ if name.nil?
256
+ fail ArgumentError, 'name cannot be nil'
257
+ end
258
+
259
+ if name.to_s.length > 100
260
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.'
261
+ end
262
+
263
+ if name.to_s.length < 1
264
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
265
+ end
266
+
267
+ @name = name
268
+ end
269
+
270
+ # Custom attribute writer method with validation
271
+ # @param [Object] description Value to be assigned
272
+ def description=(description)
273
+ if !description.nil? && description.to_s.length > 250
274
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 250.'
275
+ end
276
+
277
+ @description = description
278
+ end
279
+
193
280
  # Checks equality by comparing each attribute.
194
281
  # @param [Object] Object to be compared
195
282
  def ==(o)
@@ -203,7 +290,10 @@ module NetworkApi
203
290
  location == o.location &&
204
291
  location_default == o.location_default &&
205
292
  cidr == o.cidr &&
206
- servers == o.servers
293
+ servers == o.servers &&
294
+ memberships == o.memberships &&
295
+ status == o.status &&
296
+ created_on == o.created_on
207
297
  end
208
298
 
209
299
  # @see the `==` method
@@ -215,7 +305,7 @@ module NetworkApi
215
305
  # Calculates hash code according to all attributes.
216
306
  # @return [Integer] Hash code
217
307
  def hash
218
- [id, name, description, vlan_id, type, location, location_default, cidr, servers].hash
308
+ [id, name, description, vlan_id, type, location, location_default, cidr, servers, memberships, status, created_on].hash
219
309
  end
220
310
 
221
311
  # Builds the object from hash
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #Networks API
3
3
 
4
- #Use the Networks API to create, list, edit, and delete private networks to best fit your business needs. Private networks allow your servers to communicate without connecting to the public internet, avoiding unnecessary egress data charges.<br> <br> <span class='pnap-api-knowledge-base-link'> Knowledge base articles to help you can be found <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#multi-private-backend-network-api' target='_blank'>here</a> </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/networks/v1/)</b>
4
+ #Create, list, edit and delete public/private networks with the Network API. Use public networks to place multiple servers on the same network or VLAN. Assign new servers with IP addresses from the same CIDR range. Use private networks to avoid unnecessary egress data charges. Model your networks according to your business needs.<br> <br> <span class='pnap-api-knowledge-base-link'> Helpful knowledge base articles are available for <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#multi-private-backend-network-api' target='_blank'>multi-private backend networks</a> and <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#ftoc-heading-15' target='_blank'>public networks</a>. </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/networks/v1/)</b>
5
5
 
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
@@ -110,6 +110,18 @@ module NetworkApi
110
110
  invalid_properties.push('invalid value for "name", name cannot be nil.')
111
111
  end
112
112
 
113
+ if @name.to_s.length > 100
114
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.')
115
+ end
116
+
117
+ if @name.to_s.length < 1
118
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
119
+ end
120
+
121
+ if !@description.nil? && @description.to_s.length > 250
122
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 250.')
123
+ end
124
+
113
125
  if @location.nil?
114
126
  invalid_properties.push('invalid value for "location", location cannot be nil.')
115
127
  end
@@ -125,11 +137,42 @@ module NetworkApi
125
137
  # @return true if the model is valid
126
138
  def valid?
127
139
  return false if @name.nil?
140
+ return false if @name.to_s.length > 100
141
+ return false if @name.to_s.length < 1
142
+ return false if !@description.nil? && @description.to_s.length > 250
128
143
  return false if @location.nil?
129
144
  return false if @cidr.nil?
130
145
  true
131
146
  end
132
147
 
148
+ # Custom attribute writer method with validation
149
+ # @param [Object] name Value to be assigned
150
+ def name=(name)
151
+ if name.nil?
152
+ fail ArgumentError, 'name cannot be nil'
153
+ end
154
+
155
+ if name.to_s.length > 100
156
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.'
157
+ end
158
+
159
+ if name.to_s.length < 1
160
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
161
+ end
162
+
163
+ @name = name
164
+ end
165
+
166
+ # Custom attribute writer method with validation
167
+ # @param [Object] description Value to be assigned
168
+ def description=(description)
169
+ if !description.nil? && description.to_s.length > 250
170
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 250.'
171
+ end
172
+
173
+ @description = description
174
+ end
175
+
133
176
  # Checks equality by comparing each attribute.
134
177
  # @param [Object] Object to be compared
135
178
  def ==(o)
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #Networks API
3
3
 
4
- #Use the Networks API to create, list, edit, and delete private networks to best fit your business needs. Private networks allow your servers to communicate without connecting to the public internet, avoiding unnecessary egress data charges.<br> <br> <span class='pnap-api-knowledge-base-link'> Knowledge base articles to help you can be found <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#multi-private-backend-network-api' target='_blank'>here</a> </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/networks/v1/)</b>
4
+ #Create, list, edit and delete public/private networks with the Network API. Use public networks to place multiple servers on the same network or VLAN. Assign new servers with IP addresses from the same CIDR range. Use private networks to avoid unnecessary egress data charges. Model your networks according to your business needs.<br> <br> <span class='pnap-api-knowledge-base-link'> Helpful knowledge base articles are available for <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#multi-private-backend-network-api' target='_blank'>multi-private backend networks</a> and <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#ftoc-heading-15' target='_blank'>public networks</a>. </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/networks/v1/)</b>
5
5
 
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
@@ -90,6 +90,18 @@ module NetworkApi
90
90
  invalid_properties.push('invalid value for "name", name cannot be nil.')
91
91
  end
92
92
 
93
+ if @name.to_s.length > 100
94
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.')
95
+ end
96
+
97
+ if @name.to_s.length < 1
98
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
99
+ end
100
+
101
+ if !@description.nil? && @description.to_s.length > 250
102
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 250.')
103
+ end
104
+
93
105
  if @location_default.nil?
94
106
  invalid_properties.push('invalid value for "location_default", location_default cannot be nil.')
95
107
  end
@@ -101,10 +113,41 @@ module NetworkApi
101
113
  # @return true if the model is valid
102
114
  def valid?
103
115
  return false if @name.nil?
116
+ return false if @name.to_s.length > 100
117
+ return false if @name.to_s.length < 1
118
+ return false if !@description.nil? && @description.to_s.length > 250
104
119
  return false if @location_default.nil?
105
120
  true
106
121
  end
107
122
 
123
+ # Custom attribute writer method with validation
124
+ # @param [Object] name Value to be assigned
125
+ def name=(name)
126
+ if name.nil?
127
+ fail ArgumentError, 'name cannot be nil'
128
+ end
129
+
130
+ if name.to_s.length > 100
131
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.'
132
+ end
133
+
134
+ if name.to_s.length < 1
135
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
136
+ end
137
+
138
+ @name = name
139
+ end
140
+
141
+ # Custom attribute writer method with validation
142
+ # @param [Object] description Value to be assigned
143
+ def description=(description)
144
+ if !description.nil? && description.to_s.length > 250
145
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 250.'
146
+ end
147
+
148
+ @description = description
149
+ end
150
+
108
151
  # Checks equality by comparing each attribute.
109
152
  # @param [Object] Object to be compared
110
153
  def ==(o)
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #Networks API
3
3
 
4
- #Use the Networks API to create, list, edit, and delete private networks to best fit your business needs. Private networks allow your servers to communicate without connecting to the public internet, avoiding unnecessary egress data charges.<br> <br> <span class='pnap-api-knowledge-base-link'> Knowledge base articles to help you can be found <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#multi-private-backend-network-api' target='_blank'>here</a> </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/networks/v1/)</b>
4
+ #Create, list, edit and delete public/private networks with the Network API. Use public networks to place multiple servers on the same network or VLAN. Assign new servers with IP addresses from the same CIDR range. Use private networks to avoid unnecessary egress data charges. Model your networks according to your business needs.<br> <br> <span class='pnap-api-knowledge-base-link'> Helpful knowledge base articles are available for <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#multi-private-backend-network-api' target='_blank'>multi-private backend networks</a> and <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#ftoc-heading-15' target='_blank'>public networks</a>. </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/networks/v1/)</b>
5
5
 
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com