pnap_network_api 2.0.0 → 2.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 (61) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +19 -7
  3. data/VERSION +1 -1
  4. data/docs/AsnDetails.md +24 -0
  5. data/docs/BGPPeerGroupsApi.md +361 -0
  6. data/docs/BgpIPv4Prefix.md +26 -0
  7. data/docs/BgpPeerGroup.md +46 -0
  8. data/docs/BgpPeerGroupCreate.md +24 -0
  9. data/docs/BgpPeerGroupPatch.md +22 -0
  10. data/docs/PublicNetwork.md +3 -1
  11. data/docs/PublicNetworkCreate.md +4 -2
  12. data/docs/PublicNetworkIpBlock.md +5 -1
  13. data/docs/PublicNetworkIpBlockCreate.md +18 -0
  14. data/docs/PublicNetworkModify.md +3 -1
  15. data/docs/PublicNetworksApi.md +6 -6
  16. data/lib/pnap_network_api/api/bgp_peer_groups_api.rb +350 -0
  17. data/lib/pnap_network_api/api/private_networks_api.rb +1 -1
  18. data/lib/pnap_network_api/api/public_networks_api.rb +10 -10
  19. data/lib/pnap_network_api/api_client.rb +3 -3
  20. data/lib/pnap_network_api/api_error.rb +1 -1
  21. data/lib/pnap_network_api/configuration.rb +1 -1
  22. data/lib/pnap_network_api/models/asn_details.rb +267 -0
  23. data/lib/pnap_network_api/models/bgp_ipv4_prefix.rb +312 -0
  24. data/lib/pnap_network_api/models/bgp_peer_group.rb +481 -0
  25. data/lib/pnap_network_api/models/bgp_peer_group_create.rb +306 -0
  26. data/lib/pnap_network_api/models/bgp_peer_group_patch.rb +275 -0
  27. data/lib/pnap_network_api/models/error.rb +1 -1
  28. data/lib/pnap_network_api/models/network_membership.rb +1 -1
  29. data/lib/pnap_network_api/models/private_network.rb +1 -1
  30. data/lib/pnap_network_api/models/private_network_create.rb +1 -1
  31. data/lib/pnap_network_api/models/private_network_modify.rb +1 -1
  32. data/lib/pnap_network_api/models/private_network_server.rb +1 -1
  33. data/lib/pnap_network_api/models/public_network.rb +15 -5
  34. data/lib/pnap_network_api/models/public_network_create.rb +21 -11
  35. data/lib/pnap_network_api/models/public_network_ip_block.rb +39 -5
  36. data/lib/pnap_network_api/models/public_network_ip_block_create.rb +223 -0
  37. data/lib/pnap_network_api/models/public_network_modify.rb +15 -5
  38. data/lib/pnap_network_api/version.rb +1 -1
  39. data/lib/pnap_network_api.rb +8 -1
  40. data/pnap_network_api.gemspec +1 -1
  41. data/spec/api/bgp_peer_groups_api_spec.rb +96 -0
  42. data/spec/api/private_networks_api_spec.rb +1 -1
  43. data/spec/api/public_networks_api_spec.rb +2 -2
  44. data/spec/models/asn_details_spec.rb +54 -0
  45. data/spec/models/bgp_ipv4_prefix_spec.rb +60 -0
  46. data/spec/models/bgp_peer_group_create_spec.rb +54 -0
  47. data/spec/models/bgp_peer_group_patch_spec.rb +48 -0
  48. data/spec/models/bgp_peer_group_spec.rb +120 -0
  49. data/spec/models/error_spec.rb +1 -1
  50. data/spec/models/network_membership_spec.rb +1 -1
  51. data/spec/models/private_network_create_spec.rb +1 -1
  52. data/spec/models/private_network_modify_spec.rb +1 -1
  53. data/spec/models/private_network_server_spec.rb +1 -1
  54. data/spec/models/private_network_spec.rb +1 -1
  55. data/spec/models/public_network_create_spec.rb +7 -1
  56. data/spec/models/public_network_ip_block_create_spec.rb +36 -0
  57. data/spec/models/public_network_ip_block_spec.rb +13 -1
  58. data/spec/models/public_network_modify_spec.rb +7 -1
  59. data/spec/models/public_network_spec.rb +7 -1
  60. data/spec/spec_helper.rb +1 -1
  61. metadata +40 -12
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #Networks API
3
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>
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>, <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#ftoc-heading-15' target='_blank'>public networks</a> and <a href='https://phoenixnap.com/kb/border-gateway-protocol-bmc' target='_blank'>border gateway protocol peer groups</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
@@ -43,6 +43,9 @@ module NetworkApi
43
43
  # A list of IP Blocks that are associated with this public network.
44
44
  attr_accessor :ip_blocks
45
45
 
46
+ # Boolean indicating whether Router Advertisement is enabled. Only applicable for Network with IPv6 Blocks.
47
+ attr_accessor :ra_enabled
48
+
46
49
  # Attribute mapping from ruby-style variable name to JSON key.
47
50
  def self.attribute_map
48
51
  {
@@ -54,7 +57,8 @@ module NetworkApi
54
57
  :'description' => :'description',
55
58
  :'status' => :'status',
56
59
  :'created_on' => :'createdOn',
57
- :'ip_blocks' => :'ipBlocks'
60
+ :'ip_blocks' => :'ipBlocks',
61
+ :'ra_enabled' => :'raEnabled'
58
62
  }
59
63
  end
60
64
 
@@ -74,7 +78,8 @@ module NetworkApi
74
78
  :'description' => :'String',
75
79
  :'status' => :'String',
76
80
  :'created_on' => :'Time',
77
- :'ip_blocks' => :'Array<PublicNetworkIpBlock>'
81
+ :'ip_blocks' => :'Array<PublicNetworkIpBlock>',
82
+ :'ra_enabled' => :'Boolean'
78
83
  }
79
84
  end
80
85
 
@@ -154,6 +159,10 @@ module NetworkApi
154
159
  else
155
160
  self.ip_blocks = nil
156
161
  end
162
+
163
+ if attributes.key?(:'ra_enabled')
164
+ self.ra_enabled = attributes[:'ra_enabled']
165
+ end
157
166
  end
158
167
 
159
168
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -271,7 +280,8 @@ module NetworkApi
271
280
  description == o.description &&
272
281
  status == o.status &&
273
282
  created_on == o.created_on &&
274
- ip_blocks == o.ip_blocks
283
+ ip_blocks == o.ip_blocks &&
284
+ ra_enabled == o.ra_enabled
275
285
  end
276
286
 
277
287
  # @see the `==` method
@@ -283,7 +293,7 @@ module NetworkApi
283
293
  # Calculates hash code according to all attributes.
284
294
  # @return [Integer] Hash code
285
295
  def hash
286
- [id, vlan_id, memberships, name, location, description, status, created_on, ip_blocks].hash
296
+ [id, vlan_id, memberships, name, location, description, status, created_on, ip_blocks, ra_enabled].hash
287
297
  end
288
298
 
289
299
  # Builds the object from hash
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #Networks API
3
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>
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>, <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#ftoc-heading-15' target='_blank'>public networks</a> and <a href='https://phoenixnap.com/kb/border-gateway-protocol-bmc' target='_blank'>border gateway protocol peer groups</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
@@ -28,9 +28,12 @@ module NetworkApi
28
28
  # The VLAN that will be assigned to this network.
29
29
  attr_accessor :vlan_id
30
30
 
31
- # A list of IP Blocks that will be associated with this public network.
31
+ # A list of IP Blocks that will be associated with this public network. Supported maximum of 10 IPv4 Blocks and 1 IPv6 Block.
32
32
  attr_accessor :ip_blocks
33
33
 
34
+ # Boolean indicating whether Router Advertisement is enabled. Only applicable for Network with IPv6 Blocks.
35
+ attr_accessor :ra_enabled
36
+
34
37
  # Attribute mapping from ruby-style variable name to JSON key.
35
38
  def self.attribute_map
36
39
  {
@@ -38,7 +41,8 @@ module NetworkApi
38
41
  :'description' => :'description',
39
42
  :'location' => :'location',
40
43
  :'vlan_id' => :'vlanId',
41
- :'ip_blocks' => :'ipBlocks'
44
+ :'ip_blocks' => :'ipBlocks',
45
+ :'ra_enabled' => :'raEnabled'
42
46
  }
43
47
  end
44
48
 
@@ -54,7 +58,8 @@ module NetworkApi
54
58
  :'description' => :'String',
55
59
  :'location' => :'String',
56
60
  :'vlan_id' => :'Integer',
57
- :'ip_blocks' => :'Array<PublicNetworkIpBlock>'
61
+ :'ip_blocks' => :'Array<PublicNetworkIpBlockCreate>',
62
+ :'ra_enabled' => :'Boolean'
58
63
  }
59
64
  end
60
65
 
@@ -104,6 +109,10 @@ module NetworkApi
104
109
  self.ip_blocks = value
105
110
  end
106
111
  end
112
+
113
+ if attributes.key?(:'ra_enabled')
114
+ self.ra_enabled = attributes[:'ra_enabled']
115
+ end
107
116
  end
108
117
 
109
118
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -144,8 +153,8 @@ module NetworkApi
144
153
  invalid_properties.push('invalid value for "vlan_id", must be greater than or equal to 2.')
145
154
  end
146
155
 
147
- if !@ip_blocks.nil? && @ip_blocks.length > 10
148
- invalid_properties.push('invalid value for "ip_blocks", number of items must be less than or equal to 10.')
156
+ if !@ip_blocks.nil? && @ip_blocks.length > 11
157
+ invalid_properties.push('invalid value for "ip_blocks", number of items must be less than or equal to 11.')
149
158
  end
150
159
 
151
160
  invalid_properties
@@ -163,7 +172,7 @@ module NetworkApi
163
172
  return false if @location.nil?
164
173
  return false if !@vlan_id.nil? && @vlan_id > 4094
165
174
  return false if !@vlan_id.nil? && @vlan_id < 2
166
- return false if !@ip_blocks.nil? && @ip_blocks.length > 10
175
+ return false if !@ip_blocks.nil? && @ip_blocks.length > 11
167
176
  true
168
177
  end
169
178
 
@@ -229,8 +238,8 @@ module NetworkApi
229
238
  fail ArgumentError, 'ip_blocks cannot be nil'
230
239
  end
231
240
 
232
- if ip_blocks.length > 10
233
- fail ArgumentError, 'invalid value for "ip_blocks", number of items must be less than or equal to 10.'
241
+ if ip_blocks.length > 11
242
+ fail ArgumentError, 'invalid value for "ip_blocks", number of items must be less than or equal to 11.'
234
243
  end
235
244
 
236
245
  @ip_blocks = ip_blocks
@@ -245,7 +254,8 @@ module NetworkApi
245
254
  description == o.description &&
246
255
  location == o.location &&
247
256
  vlan_id == o.vlan_id &&
248
- ip_blocks == o.ip_blocks
257
+ ip_blocks == o.ip_blocks &&
258
+ ra_enabled == o.ra_enabled
249
259
  end
250
260
 
251
261
  # @see the `==` method
@@ -257,7 +267,7 @@ module NetworkApi
257
267
  # Calculates hash code according to all attributes.
258
268
  # @return [Integer] Hash code
259
269
  def hash
260
- [name, description, location, vlan_id, ip_blocks].hash
270
+ [name, description, location, vlan_id, ip_blocks, ra_enabled].hash
261
271
  end
262
272
 
263
273
  # Builds the object from hash
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #Networks API
3
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>
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>, <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#ftoc-heading-15' target='_blank'>public networks</a> and <a href='https://phoenixnap.com/kb/border-gateway-protocol-bmc' target='_blank'>border gateway protocol peer groups</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
@@ -19,10 +19,18 @@ module NetworkApi
19
19
  # The IP Block identifier.
20
20
  attr_accessor :id
21
21
 
22
+ # The CIDR notation of the IP block.
23
+ attr_accessor :cidr
24
+
25
+ # The number of IPs used in the IP block.
26
+ attr_accessor :used_ips_count
27
+
22
28
  # Attribute mapping from ruby-style variable name to JSON key.
23
29
  def self.attribute_map
24
30
  {
25
- :'id' => :'id'
31
+ :'id' => :'id',
32
+ :'cidr' => :'cidr',
33
+ :'used_ips_count' => :'usedIpsCount'
26
34
  }
27
35
  end
28
36
 
@@ -34,7 +42,9 @@ module NetworkApi
34
42
  # Attribute type mapping.
35
43
  def self.openapi_types
36
44
  {
37
- :'id' => :'String'
45
+ :'id' => :'String',
46
+ :'cidr' => :'String',
47
+ :'used_ips_count' => :'String'
38
48
  }
39
49
  end
40
50
 
@@ -64,6 +74,18 @@ module NetworkApi
64
74
  else
65
75
  self.id = nil
66
76
  end
77
+
78
+ if attributes.key?(:'cidr')
79
+ self.cidr = attributes[:'cidr']
80
+ else
81
+ self.cidr = nil
82
+ end
83
+
84
+ if attributes.key?(:'used_ips_count')
85
+ self.used_ips_count = attributes[:'used_ips_count']
86
+ else
87
+ self.used_ips_count = nil
88
+ end
67
89
  end
68
90
 
69
91
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -75,6 +97,14 @@ module NetworkApi
75
97
  invalid_properties.push('invalid value for "id", id cannot be nil.')
76
98
  end
77
99
 
100
+ if @cidr.nil?
101
+ invalid_properties.push('invalid value for "cidr", cidr cannot be nil.')
102
+ end
103
+
104
+ if @used_ips_count.nil?
105
+ invalid_properties.push('invalid value for "used_ips_count", used_ips_count cannot be nil.')
106
+ end
107
+
78
108
  invalid_properties
79
109
  end
80
110
 
@@ -83,6 +113,8 @@ module NetworkApi
83
113
  def valid?
84
114
  warn '[DEPRECATED] the `valid?` method is obsolete'
85
115
  return false if @id.nil?
116
+ return false if @cidr.nil?
117
+ return false if @used_ips_count.nil?
86
118
  true
87
119
  end
88
120
 
@@ -91,7 +123,9 @@ module NetworkApi
91
123
  def ==(o)
92
124
  return true if self.equal?(o)
93
125
  self.class == o.class &&
94
- id == o.id
126
+ id == o.id &&
127
+ cidr == o.cidr &&
128
+ used_ips_count == o.used_ips_count
95
129
  end
96
130
 
97
131
  # @see the `==` method
@@ -103,7 +137,7 @@ module NetworkApi
103
137
  # Calculates hash code according to all attributes.
104
138
  # @return [Integer] Hash code
105
139
  def hash
106
- [id].hash
140
+ [id, cidr, used_ips_count].hash
107
141
  end
108
142
 
109
143
  # Builds the object from hash
@@ -0,0 +1,223 @@
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>, <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#ftoc-heading-15' target='_blank'>public networks</a> and <a href='https://phoenixnap.com/kb/border-gateway-protocol-bmc' target='_blank'>border gateway protocol peer groups</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: 7.2.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module NetworkApi
17
+ # Details of IP block to be assigned to Public Network.
18
+ class PublicNetworkIpBlockCreate
19
+ # The IP Block identifier.
20
+ attr_accessor :id
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'id' => :'id'
26
+ }
27
+ end
28
+
29
+ # Returns all the JSON keys this model knows about
30
+ def self.acceptable_attributes
31
+ attribute_map.values
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.openapi_types
36
+ {
37
+ :'id' => :'String'
38
+ }
39
+ end
40
+
41
+ # List of attributes with nullable: true
42
+ def self.openapi_nullable
43
+ Set.new([
44
+ ])
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ if (!attributes.is_a?(Hash))
51
+ fail ArgumentError, "The input argument (attributes) must be a hash in `NetworkApi::PublicNetworkIpBlockCreate` initialize method"
52
+ end
53
+
54
+ # check to see if the attribute exists and convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h|
56
+ if (!self.class.attribute_map.key?(k.to_sym))
57
+ fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkApi::PublicNetworkIpBlockCreate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58
+ end
59
+ h[k.to_sym] = v
60
+ }
61
+
62
+ if attributes.key?(:'id')
63
+ self.id = attributes[:'id']
64
+ else
65
+ self.id = nil
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
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
73
+ invalid_properties = Array.new
74
+ if @id.nil?
75
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
76
+ end
77
+
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
85
+ return false if @id.nil?
86
+ true
87
+ end
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] Object to be compared
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ id == o.id
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param [Object] Object to be compared
99
+ def eql?(o)
100
+ self == o
101
+ end
102
+
103
+ # Calculates hash code according to all attributes.
104
+ # @return [Integer] Hash code
105
+ def hash
106
+ [id].hash
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def self.build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+ attributes = attributes.transform_keys(&:to_sym)
115
+ transformed_hash = {}
116
+ openapi_types.each_pair do |key, type|
117
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
118
+ transformed_hash["#{key}"] = nil
119
+ elsif type =~ /\AArray<(.*)>/i
120
+ # check to ensure the input is an array given that the attribute
121
+ # is documented as an array but the input is not
122
+ if attributes[attribute_map[key]].is_a?(Array)
123
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
124
+ end
125
+ elsif !attributes[attribute_map[key]].nil?
126
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
127
+ end
128
+ end
129
+ new(transformed_hash)
130
+ end
131
+
132
+ # Deserializes the data based on type
133
+ # @param string type Data type
134
+ # @param string value Value to be deserialized
135
+ # @return [Object] Deserialized data
136
+ def self._deserialize(type, value)
137
+ case type.to_sym
138
+ when :Time
139
+ Time.parse(value)
140
+ when :Date
141
+ Date.parse(value)
142
+ when :String
143
+ value.to_s
144
+ when :Integer
145
+ value.to_i
146
+ when :Float
147
+ value.to_f
148
+ when :Boolean
149
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150
+ true
151
+ else
152
+ false
153
+ end
154
+ when :Object
155
+ # generic object (usually a Hash), return directly
156
+ value
157
+ when /\AArray<(?<inner_type>.+)>\z/
158
+ inner_type = Regexp.last_match[:inner_type]
159
+ value.map { |v| _deserialize(inner_type, v) }
160
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161
+ k_type = Regexp.last_match[:k_type]
162
+ v_type = Regexp.last_match[:v_type]
163
+ {}.tap do |hash|
164
+ value.each do |k, v|
165
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
+ end
167
+ end
168
+ else # model
169
+ # models (e.g. Pet) or oneOf
170
+ klass = NetworkApi.const_get(type)
171
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
172
+ end
173
+ end
174
+
175
+ # Returns the string representation of the object
176
+ # @return [String] String presentation of the object
177
+ def to_s
178
+ to_hash.to_s
179
+ end
180
+
181
+ # to_body is an alias to to_hash (backward compatibility)
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_body
184
+ to_hash
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = self.send(attr)
193
+ if value.nil?
194
+ is_nullable = self.class.openapi_nullable.include?(attr)
195
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
196
+ end
197
+
198
+ hash[param] = _to_hash(value)
199
+ end
200
+ hash
201
+ end
202
+
203
+ # Outputs non-array value in the form of hash
204
+ # For object, use to_hash. Otherwise, just return the value
205
+ # @param [Object] value Any valid value
206
+ # @return [Hash] Returns the value in the form of hash
207
+ def _to_hash(value)
208
+ if value.is_a?(Array)
209
+ value.compact.map { |v| _to_hash(v) }
210
+ elsif value.is_a?(Hash)
211
+ {}.tap do |hash|
212
+ value.each { |k, v| hash[k] = _to_hash(v) }
213
+ end
214
+ elsif value.respond_to? :to_hash
215
+ value.to_hash
216
+ else
217
+ value
218
+ end
219
+ end
220
+
221
+ end
222
+
223
+ end
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #Networks API
3
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>
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>, <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#ftoc-heading-15' target='_blank'>public networks</a> and <a href='https://phoenixnap.com/kb/border-gateway-protocol-bmc' target='_blank'>border gateway protocol peer groups</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
@@ -22,11 +22,15 @@ module NetworkApi
22
22
  # The description of this public network
23
23
  attr_accessor :description
24
24
 
25
+ # Boolean indicating whether Router Advertisement is enabled. Only applicable for Network with IPv6 Blocks.
26
+ attr_accessor :ra_enabled
27
+
25
28
  # Attribute mapping from ruby-style variable name to JSON key.
26
29
  def self.attribute_map
27
30
  {
28
31
  :'name' => :'name',
29
- :'description' => :'description'
32
+ :'description' => :'description',
33
+ :'ra_enabled' => :'raEnabled'
30
34
  }
31
35
  end
32
36
 
@@ -39,7 +43,8 @@ module NetworkApi
39
43
  def self.openapi_types
40
44
  {
41
45
  :'name' => :'String',
42
- :'description' => :'String'
46
+ :'description' => :'String',
47
+ :'ra_enabled' => :'Boolean'
43
48
  }
44
49
  end
45
50
 
@@ -71,6 +76,10 @@ module NetworkApi
71
76
  if attributes.key?(:'description')
72
77
  self.description = attributes[:'description']
73
78
  end
79
+
80
+ if attributes.key?(:'ra_enabled')
81
+ self.ra_enabled = attributes[:'ra_enabled']
82
+ end
74
83
  end
75
84
 
76
85
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -152,7 +161,8 @@ module NetworkApi
152
161
  return true if self.equal?(o)
153
162
  self.class == o.class &&
154
163
  name == o.name &&
155
- description == o.description
164
+ description == o.description &&
165
+ ra_enabled == o.ra_enabled
156
166
  end
157
167
 
158
168
  # @see the `==` method
@@ -164,7 +174,7 @@ module NetworkApi
164
174
  # Calculates hash code according to all attributes.
165
175
  # @return [Integer] Hash code
166
176
  def hash
167
- [name, description].hash
177
+ [name, description, ra_enabled].hash
168
178
  end
169
179
 
170
180
  # Builds the object from hash
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #Networks API
3
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>
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>, <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#ftoc-heading-15' target='_blank'>public networks</a> and <a href='https://phoenixnap.com/kb/border-gateway-protocol-bmc' target='_blank'>border gateway protocol peer groups</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
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #Networks API
3
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>
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>, <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#ftoc-heading-15' target='_blank'>public networks</a> and <a href='https://phoenixnap.com/kb/border-gateway-protocol-bmc' target='_blank'>border gateway protocol peer groups</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
@@ -17,6 +17,11 @@ require 'pnap_network_api/version'
17
17
  require 'pnap_network_api/configuration'
18
18
 
19
19
  # Models
20
+ require 'pnap_network_api/models/asn_details'
21
+ require 'pnap_network_api/models/bgp_ipv4_prefix'
22
+ require 'pnap_network_api/models/bgp_peer_group'
23
+ require 'pnap_network_api/models/bgp_peer_group_create'
24
+ require 'pnap_network_api/models/bgp_peer_group_patch'
20
25
  require 'pnap_network_api/models/error'
21
26
  require 'pnap_network_api/models/network_membership'
22
27
  require 'pnap_network_api/models/private_network'
@@ -26,9 +31,11 @@ require 'pnap_network_api/models/private_network_server'
26
31
  require 'pnap_network_api/models/public_network'
27
32
  require 'pnap_network_api/models/public_network_create'
28
33
  require 'pnap_network_api/models/public_network_ip_block'
34
+ require 'pnap_network_api/models/public_network_ip_block_create'
29
35
  require 'pnap_network_api/models/public_network_modify'
30
36
 
31
37
  # APIs
38
+ require 'pnap_network_api/api/bgp_peer_groups_api'
32
39
  require 'pnap_network_api/api/private_networks_api'
33
40
  require 'pnap_network_api/api/public_networks_api'
34
41
 
@@ -3,7 +3,7 @@
3
3
  =begin
4
4
  #Networks API
5
5
 
6
- #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>
6
+ #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>, <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#ftoc-heading-15' target='_blank'>public networks</a> and <a href='https://phoenixnap.com/kb/border-gateway-protocol-bmc' target='_blank'>border gateway protocol peer groups</a>. </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/networks/v1/)</b>
7
7
 
8
8
  The version of the OpenAPI document: 1.0
9
9
  Contact: support@phoenixnap.com