pnap_network_api 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c06c353b308f28f82070f0cf8ad710908265e3e34ce32d4f97e4a73d49d0092e
4
- data.tar.gz: 6232a6388512978c71a5adb5c65f1ff8af1c1978258b41f3db594674f3e3a08c
3
+ metadata.gz: eae6809841069e2beff1e534d99b0a74c6375237339d11d1d5d21b4284c087f4
4
+ data.tar.gz: 065743c6e7ec7544155d09e743eb7753ddc1542ec5f1616f2322b0165b86b3ad
5
5
  SHA512:
6
- metadata.gz: a9e7667be380283d21f7aa923f43c70e7f1b17cc40847193fa98fcd206ebd2ac63abcc7a8955b1546073e6dd76575881ef9c09744f65f4c43f721bfbf77a4cef
7
- data.tar.gz: 38f14f5ad05197c064788f9d628f8028cb7785e6e4544ad964b24fb8bf7d0b2e4d03f6c0677fdabe5372a1831e52d40f1453d3cf83a9dcd1e25a86a3c94360d4
6
+ metadata.gz: a64b7560d21108cd44fb469e68d9bdef3897113db9ae02886bd499d7f3b293f8282ed579656184676c38352fd432ef8ae2b6ef3736980ec43628d29f22f88c83
7
+ data.tar.gz: 71cf3d4411e7f4d71d1e3a7cfb6bf33a9245d9ded3a46f14c860f900ebe61f0fc2ffe5cf0d24fb50084c7f4711d2d6eb2127cb84a82620deaf6cac7c6102a3be
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.1
1
+ 1.2.0
@@ -8,6 +8,7 @@
8
8
  | **description** | **String** | The description of this private network. | [optional] |
9
9
  | **location** | **String** | The location of this private network. Supported values are `PHX`, `ASH`, `SGP`, `NLD`, `CHI`, `SEA` and `AUS`. | |
10
10
  | **location_default** | **Boolean** | Identifies network as the default private network for the specified location. | [optional][default to false] |
11
+ | **vlan_id** | **Integer** | The VLAN that will be assigned to this network. | [optional] |
11
12
  | **cidr** | **String** | IP range associated with this private network in CIDR notation. | |
12
13
 
13
14
  ## Example
@@ -20,6 +21,7 @@ instance = NetworkApi::PrivateNetworkCreate.new(
20
21
  description: Further details on the network,
21
22
  location: PHX,
22
23
  location_default: true,
24
+ vlan_id: 10,
23
25
  cidr: 10.0.0.0/24
24
26
  )
25
27
  ```
@@ -7,6 +7,7 @@
7
7
  | **name** | **String** | The friendly name of this public network. This name should be unique. | |
8
8
  | **description** | **String** | The description of this public network. | [optional] |
9
9
  | **location** | **String** | The location of this public network. Supported values are `PHX`, `ASH`, `SGP`, `NLD`, `CHI`, `SEA` and `AUS`. | |
10
+ | **vlan_id** | **Integer** | The VLAN that will be assigned to this network. | [optional] |
10
11
  | **ip_blocks** | [**Array<PublicNetworkIpBlock>**](PublicNetworkIpBlock.md) | A list of IP Blocks that will be associated with this public network. | [optional] |
11
12
 
12
13
  ## Example
@@ -18,6 +19,7 @@ instance = NetworkApi::PublicNetworkCreate.new(
18
19
  name: Sample Network,
19
20
  description: Further details on the network.,
20
21
  location: PHX,
22
+ vlan_id: 10,
21
23
  ip_blocks: null
22
24
  )
23
25
  ```
@@ -28,6 +28,9 @@ module NetworkApi
28
28
  # Identifies network as the default private network for the specified location.
29
29
  attr_accessor :location_default
30
30
 
31
+ # The VLAN that will be assigned to this network.
32
+ attr_accessor :vlan_id
33
+
31
34
  # IP range associated with this private network in CIDR notation.
32
35
  attr_accessor :cidr
33
36
 
@@ -38,6 +41,7 @@ module NetworkApi
38
41
  :'description' => :'description',
39
42
  :'location' => :'location',
40
43
  :'location_default' => :'locationDefault',
44
+ :'vlan_id' => :'vlanId',
41
45
  :'cidr' => :'cidr'
42
46
  }
43
47
  end
@@ -54,6 +58,7 @@ module NetworkApi
54
58
  :'description' => :'String',
55
59
  :'location' => :'String',
56
60
  :'location_default' => :'Boolean',
61
+ :'vlan_id' => :'Integer',
57
62
  :'cidr' => :'String'
58
63
  }
59
64
  end
@@ -97,6 +102,10 @@ module NetworkApi
97
102
  self.location_default = false
98
103
  end
99
104
 
105
+ if attributes.key?(:'vlan_id')
106
+ self.vlan_id = attributes[:'vlan_id']
107
+ end
108
+
100
109
  if attributes.key?(:'cidr')
101
110
  self.cidr = attributes[:'cidr']
102
111
  end
@@ -126,6 +135,14 @@ module NetworkApi
126
135
  invalid_properties.push('invalid value for "location", location cannot be nil.')
127
136
  end
128
137
 
138
+ if !@vlan_id.nil? && @vlan_id > 4094
139
+ invalid_properties.push('invalid value for "vlan_id", must be smaller than or equal to 4094.')
140
+ end
141
+
142
+ if !@vlan_id.nil? && @vlan_id < 2
143
+ invalid_properties.push('invalid value for "vlan_id", must be greater than or equal to 2.')
144
+ end
145
+
129
146
  if @cidr.nil?
130
147
  invalid_properties.push('invalid value for "cidr", cidr cannot be nil.')
131
148
  end
@@ -141,6 +158,8 @@ module NetworkApi
141
158
  return false if @name.to_s.length < 1
142
159
  return false if !@description.nil? && @description.to_s.length > 250
143
160
  return false if @location.nil?
161
+ return false if !@vlan_id.nil? && @vlan_id > 4094
162
+ return false if !@vlan_id.nil? && @vlan_id < 2
144
163
  return false if @cidr.nil?
145
164
  true
146
165
  end
@@ -173,6 +192,20 @@ module NetworkApi
173
192
  @description = description
174
193
  end
175
194
 
195
+ # Custom attribute writer method with validation
196
+ # @param [Object] vlan_id Value to be assigned
197
+ def vlan_id=(vlan_id)
198
+ if !vlan_id.nil? && vlan_id > 4094
199
+ fail ArgumentError, 'invalid value for "vlan_id", must be smaller than or equal to 4094.'
200
+ end
201
+
202
+ if !vlan_id.nil? && vlan_id < 2
203
+ fail ArgumentError, 'invalid value for "vlan_id", must be greater than or equal to 2.'
204
+ end
205
+
206
+ @vlan_id = vlan_id
207
+ end
208
+
176
209
  # Checks equality by comparing each attribute.
177
210
  # @param [Object] Object to be compared
178
211
  def ==(o)
@@ -182,6 +215,7 @@ module NetworkApi
182
215
  description == o.description &&
183
216
  location == o.location &&
184
217
  location_default == o.location_default &&
218
+ vlan_id == o.vlan_id &&
185
219
  cidr == o.cidr
186
220
  end
187
221
 
@@ -194,7 +228,7 @@ module NetworkApi
194
228
  # Calculates hash code according to all attributes.
195
229
  # @return [Integer] Hash code
196
230
  def hash
197
- [name, description, location, location_default, cidr].hash
231
+ [name, description, location, location_default, vlan_id, cidr].hash
198
232
  end
199
233
 
200
234
  # Builds the object from hash
@@ -25,6 +25,9 @@ module NetworkApi
25
25
  # The location of this public network. Supported values are `PHX`, `ASH`, `SGP`, `NLD`, `CHI`, `SEA` and `AUS`.
26
26
  attr_accessor :location
27
27
 
28
+ # The VLAN that will be assigned to this network.
29
+ attr_accessor :vlan_id
30
+
28
31
  # A list of IP Blocks that will be associated with this public network.
29
32
  attr_accessor :ip_blocks
30
33
 
@@ -34,6 +37,7 @@ module NetworkApi
34
37
  :'name' => :'name',
35
38
  :'description' => :'description',
36
39
  :'location' => :'location',
40
+ :'vlan_id' => :'vlanId',
37
41
  :'ip_blocks' => :'ipBlocks'
38
42
  }
39
43
  end
@@ -49,6 +53,7 @@ module NetworkApi
49
53
  :'name' => :'String',
50
54
  :'description' => :'String',
51
55
  :'location' => :'String',
56
+ :'vlan_id' => :'Integer',
52
57
  :'ip_blocks' => :'Array<PublicNetworkIpBlock>'
53
58
  }
54
59
  end
@@ -86,6 +91,10 @@ module NetworkApi
86
91
  self.location = attributes[:'location']
87
92
  end
88
93
 
94
+ if attributes.key?(:'vlan_id')
95
+ self.vlan_id = attributes[:'vlan_id']
96
+ end
97
+
89
98
  if attributes.key?(:'ip_blocks')
90
99
  if (value = attributes[:'ip_blocks']).is_a?(Array)
91
100
  self.ip_blocks = value
@@ -117,6 +126,14 @@ module NetworkApi
117
126
  invalid_properties.push('invalid value for "location", location cannot be nil.')
118
127
  end
119
128
 
129
+ if !@vlan_id.nil? && @vlan_id > 4094
130
+ invalid_properties.push('invalid value for "vlan_id", must be smaller than or equal to 4094.')
131
+ end
132
+
133
+ if !@vlan_id.nil? && @vlan_id < 2
134
+ invalid_properties.push('invalid value for "vlan_id", must be greater than or equal to 2.')
135
+ end
136
+
120
137
  if !@ip_blocks.nil? && @ip_blocks.length > 10
121
138
  invalid_properties.push('invalid value for "ip_blocks", number of items must be less than or equal to 10.')
122
139
  end
@@ -132,6 +149,8 @@ module NetworkApi
132
149
  return false if @name.to_s.length < 1
133
150
  return false if !@description.nil? && @description.to_s.length > 250
134
151
  return false if @location.nil?
152
+ return false if !@vlan_id.nil? && @vlan_id > 4094
153
+ return false if !@vlan_id.nil? && @vlan_id < 2
135
154
  return false if !@ip_blocks.nil? && @ip_blocks.length > 10
136
155
  true
137
156
  end
@@ -164,6 +183,20 @@ module NetworkApi
164
183
  @description = description
165
184
  end
166
185
 
186
+ # Custom attribute writer method with validation
187
+ # @param [Object] vlan_id Value to be assigned
188
+ def vlan_id=(vlan_id)
189
+ if !vlan_id.nil? && vlan_id > 4094
190
+ fail ArgumentError, 'invalid value for "vlan_id", must be smaller than or equal to 4094.'
191
+ end
192
+
193
+ if !vlan_id.nil? && vlan_id < 2
194
+ fail ArgumentError, 'invalid value for "vlan_id", must be greater than or equal to 2.'
195
+ end
196
+
197
+ @vlan_id = vlan_id
198
+ end
199
+
167
200
  # Custom attribute writer method with validation
168
201
  # @param [Object] ip_blocks Value to be assigned
169
202
  def ip_blocks=(ip_blocks)
@@ -182,6 +215,7 @@ module NetworkApi
182
215
  name == o.name &&
183
216
  description == o.description &&
184
217
  location == o.location &&
218
+ vlan_id == o.vlan_id &&
185
219
  ip_blocks == o.ip_blocks
186
220
  end
187
221
 
@@ -194,7 +228,7 @@ module NetworkApi
194
228
  # Calculates hash code according to all attributes.
195
229
  # @return [Integer] Hash code
196
230
  def hash
197
- [name, description, location, ip_blocks].hash
231
+ [name, description, location, vlan_id, ip_blocks].hash
198
232
  end
199
233
 
200
234
  # Builds the object from hash
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pnap_network_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - PhoenixNAP
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-03 00:00:00.000000000 Z
11
+ date: 2022-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0'
131
131
  requirements: []
132
- rubygems_version: 3.1.2
132
+ rubygems_version: 3.3.5
133
133
  signing_key:
134
134
  specification_version: 4
135
135
  summary: Networks API Ruby Gem
@@ -138,15 +138,15 @@ test_files:
138
138
  - spec/api/private_networks_api_spec.rb
139
139
  - spec/api_client_spec.rb
140
140
  - spec/configuration_spec.rb
141
- - spec/models/public_network_modify_spec.rb
141
+ - spec/models/network_membership_spec.rb
142
142
  - spec/models/private_network_spec.rb
143
- - spec/models/private_network_modify_spec.rb
144
143
  - spec/models/public_network_ip_block_spec.rb
145
- - spec/models/error_spec.rb
146
- - spec/models/network_membership_spec.rb
147
- - spec/models/public_network_spec.rb
148
144
  - spec/models/private_network_create_spec.rb
149
145
  - spec/models/private_network_server_spec.rb
146
+ - spec/models/private_network_modify_spec.rb
150
147
  - spec/models/public_network_create_spec.rb
148
+ - spec/models/public_network_modify_spec.rb
151
149
  - spec/models/public_network_membership_spec.rb
150
+ - spec/models/error_spec.rb
151
+ - spec/models/public_network_spec.rb
152
152
  - spec/spec_helper.rb