pnap_network_api 1.0.0 → 1.1.1
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 +18 -5
- data/VERSION +1 -1
- data/docs/NetworkMembership.md +22 -0
- data/docs/PrivateNetwork.md +7 -1
- data/docs/PublicNetwork.md +34 -0
- data/docs/PublicNetworkCreate.md +24 -0
- data/docs/PublicNetworkIpBlock.md +18 -0
- data/docs/PublicNetworkMembership.md +22 -0
- data/docs/PublicNetworkModify.md +20 -0
- data/docs/PublicNetworksApi.md +510 -0
- data/lib/pnap_network_api/api/private_networks_api.rb +2 -2
- data/lib/pnap_network_api/api/public_networks_api.rb +481 -0
- data/lib/pnap_network_api/api_client.rb +5 -3
- data/lib/pnap_network_api/api_error.rb +2 -2
- data/lib/pnap_network_api/configuration.rb +4 -3
- data/lib/pnap_network_api/models/error.rb +3 -2
- data/lib/pnap_network_api/models/network_membership.rb +258 -0
- data/lib/pnap_network_api/models/private_network.rb +97 -6
- data/lib/pnap_network_api/models/private_network_create.rb +46 -2
- data/lib/pnap_network_api/models/private_network_modify.rb +46 -2
- data/lib/pnap_network_api/models/private_network_server.rb +3 -2
- data/lib/pnap_network_api/models/public_network.rb +388 -0
- data/lib/pnap_network_api/models/public_network_create.rb +321 -0
- data/lib/pnap_network_api/models/public_network_ip_block.rb +226 -0
- data/lib/pnap_network_api/models/public_network_membership.rb +257 -0
- data/lib/pnap_network_api/models/public_network_modify.rb +270 -0
- data/lib/pnap_network_api/version.rb +2 -2
- data/lib/pnap_network_api.rb +8 -2
- data/pnap_network_api.gemspec +3 -3
- data/spec/api/public_networks_api_spec.rb +122 -0
- data/spec/api_client_spec.rb +2 -2
- data/spec/configuration_spec.rb +2 -2
- data/spec/models/network_membership_spec.rb +46 -0
- data/spec/models/public_network_create_spec.rb +52 -0
- data/spec/models/public_network_ip_block_spec.rb +34 -0
- data/spec/models/public_network_membership_spec.rb +46 -0
- data/spec/models/public_network_modify_spec.rb +40 -0
- data/spec/models/public_network_spec.rb +76 -0
- data/spec/spec_helper.rb +2 -2
- metadata +34 -6
@@ -0,0 +1,258 @@
|
|
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: 6.1.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
|
+
attributes = attributes.transform_keys(&:to_sym)
|
150
|
+
self.class.openapi_types.each_pair do |key, type|
|
151
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
152
|
+
self.send("#{key}=", nil)
|
153
|
+
elsif type =~ /\AArray<(.*)>/i
|
154
|
+
# check to ensure the input is an array given that the attribute
|
155
|
+
# is documented as an array but the input is not
|
156
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
157
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
158
|
+
end
|
159
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
160
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
self
|
165
|
+
end
|
166
|
+
|
167
|
+
# Deserializes the data based on type
|
168
|
+
# @param string type Data type
|
169
|
+
# @param string value Value to be deserialized
|
170
|
+
# @return [Object] Deserialized data
|
171
|
+
def _deserialize(type, value)
|
172
|
+
case type.to_sym
|
173
|
+
when :Time
|
174
|
+
Time.parse(value)
|
175
|
+
when :Date
|
176
|
+
Date.parse(value)
|
177
|
+
when :String
|
178
|
+
value.to_s
|
179
|
+
when :Integer
|
180
|
+
value.to_i
|
181
|
+
when :Float
|
182
|
+
value.to_f
|
183
|
+
when :Boolean
|
184
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
185
|
+
true
|
186
|
+
else
|
187
|
+
false
|
188
|
+
end
|
189
|
+
when :Object
|
190
|
+
# generic object (usually a Hash), return directly
|
191
|
+
value
|
192
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
193
|
+
inner_type = Regexp.last_match[:inner_type]
|
194
|
+
value.map { |v| _deserialize(inner_type, v) }
|
195
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
196
|
+
k_type = Regexp.last_match[:k_type]
|
197
|
+
v_type = Regexp.last_match[:v_type]
|
198
|
+
{}.tap do |hash|
|
199
|
+
value.each do |k, v|
|
200
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
201
|
+
end
|
202
|
+
end
|
203
|
+
else # model
|
204
|
+
# models (e.g. Pet) or oneOf
|
205
|
+
klass = NetworkApi.const_get(type)
|
206
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
# Returns the string representation of the object
|
211
|
+
# @return [String] String presentation of the object
|
212
|
+
def to_s
|
213
|
+
to_hash.to_s
|
214
|
+
end
|
215
|
+
|
216
|
+
# to_body is an alias to to_hash (backward compatibility)
|
217
|
+
# @return [Hash] Returns the object in the form of hash
|
218
|
+
def to_body
|
219
|
+
to_hash
|
220
|
+
end
|
221
|
+
|
222
|
+
# Returns the object in the form of hash
|
223
|
+
# @return [Hash] Returns the object in the form of hash
|
224
|
+
def to_hash
|
225
|
+
hash = {}
|
226
|
+
self.class.attribute_map.each_pair do |attr, param|
|
227
|
+
value = self.send(attr)
|
228
|
+
if value.nil?
|
229
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
230
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
231
|
+
end
|
232
|
+
|
233
|
+
hash[param] = _to_hash(value)
|
234
|
+
end
|
235
|
+
hash
|
236
|
+
end
|
237
|
+
|
238
|
+
# Outputs non-array value in the form of hash
|
239
|
+
# For object, use to_hash. Otherwise, just return the value
|
240
|
+
# @param [Object] value Any valid value
|
241
|
+
# @return [Hash] Returns the value in the form of hash
|
242
|
+
def _to_hash(value)
|
243
|
+
if value.is_a?(Array)
|
244
|
+
value.compact.map { |v| _to_hash(v) }
|
245
|
+
elsif value.is_a?(Hash)
|
246
|
+
{}.tap do |hash|
|
247
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
248
|
+
end
|
249
|
+
elsif value.respond_to? :to_hash
|
250
|
+
value.to_hash
|
251
|
+
else
|
252
|
+
value
|
253
|
+
end
|
254
|
+
end
|
255
|
+
|
256
|
+
end
|
257
|
+
|
258
|
+
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Networks API
|
3
3
|
|
4
|
-
#
|
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
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -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
|
@@ -230,6 +320,7 @@ module NetworkApi
|
|
230
320
|
# @return [Object] Returns the model itself
|
231
321
|
def build_from_hash(attributes)
|
232
322
|
return nil unless attributes.is_a?(Hash)
|
323
|
+
attributes = attributes.transform_keys(&:to_sym)
|
233
324
|
self.class.openapi_types.each_pair do |key, type|
|
234
325
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
235
326
|
self.send("#{key}=", nil)
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Networks API
|
3
3
|
|
4
|
-
#
|
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
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -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)
|
@@ -166,6 +209,7 @@ module NetworkApi
|
|
166
209
|
# @return [Object] Returns the model itself
|
167
210
|
def build_from_hash(attributes)
|
168
211
|
return nil unless attributes.is_a?(Hash)
|
212
|
+
attributes = attributes.transform_keys(&:to_sym)
|
169
213
|
self.class.openapi_types.each_pair do |key, type|
|
170
214
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
171
215
|
self.send("#{key}=", nil)
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Networks API
|
3
3
|
|
4
|
-
#
|
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
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -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)
|
@@ -139,6 +182,7 @@ module NetworkApi
|
|
139
182
|
# @return [Object] Returns the model itself
|
140
183
|
def build_from_hash(attributes)
|
141
184
|
return nil unless attributes.is_a?(Hash)
|
185
|
+
attributes = attributes.transform_keys(&:to_sym)
|
142
186
|
self.class.openapi_types.each_pair do |key, type|
|
143
187
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
144
188
|
self.send("#{key}=", nil)
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Networks API
|
3
3
|
|
4
|
-
#
|
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
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -131,6 +131,7 @@ module NetworkApi
|
|
131
131
|
# @return [Object] Returns the model itself
|
132
132
|
def build_from_hash(attributes)
|
133
133
|
return nil unless attributes.is_a?(Hash)
|
134
|
+
attributes = attributes.transform_keys(&:to_sym)
|
134
135
|
self.class.openapi_types.each_pair do |key, type|
|
135
136
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
136
137
|
self.send("#{key}=", nil)
|