pnap_network_api 2.1.2 → 2.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.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/VERSION +1 -1
  4. data/docs/BgpIpPrefix.md +24 -0
  5. data/docs/BgpPeerGroup.md +6 -2
  6. data/docs/BgpPeerGroupCreate.md +1 -1
  7. data/docs/PrivateNetworkCreate.md +1 -1
  8. data/docs/PublicNetwork.md +1 -1
  9. data/docs/PublicNetworkCreate.md +1 -1
  10. data/lib/pnap_network_api/api/bgp_peer_groups_api.rb +6 -6
  11. data/lib/pnap_network_api/api/private_networks_api.rb +6 -6
  12. data/lib/pnap_network_api/api/public_networks_api.rb +8 -8
  13. data/lib/pnap_network_api/api_client.rb +17 -14
  14. data/lib/pnap_network_api/api_error.rb +1 -1
  15. data/lib/pnap_network_api/api_model_base.rb +88 -0
  16. data/lib/pnap_network_api/configuration.rb +11 -1
  17. data/lib/pnap_network_api/models/asn_details.rb +41 -78
  18. data/lib/pnap_network_api/models/bgp_ip_prefix.rb +247 -0
  19. data/lib/pnap_network_api/models/bgp_ipv4_prefix.rb +52 -79
  20. data/lib/pnap_network_api/models/bgp_peer_group.rb +184 -83
  21. data/lib/pnap_network_api/models/bgp_peer_group_create.rb +44 -81
  22. data/lib/pnap_network_api/models/bgp_peer_group_patch.rb +13 -80
  23. data/lib/pnap_network_api/models/error.rb +21 -78
  24. data/lib/pnap_network_api/models/network_membership.rb +41 -78
  25. data/lib/pnap_network_api/models/private_network.rb +103 -80
  26. data/lib/pnap_network_api/models/private_network_create.rb +24 -81
  27. data/lib/pnap_network_api/models/private_network_modify.rb +23 -80
  28. data/lib/pnap_network_api/models/private_network_server.rb +31 -78
  29. data/lib/pnap_network_api/models/public_network.rb +84 -81
  30. data/lib/pnap_network_api/models/public_network_create.rb +24 -81
  31. data/lib/pnap_network_api/models/public_network_ip_block.rb +41 -78
  32. data/lib/pnap_network_api/models/public_network_ip_block_create.rb +21 -78
  33. data/lib/pnap_network_api/models/public_network_modify.rb +13 -80
  34. data/lib/pnap_network_api/version.rb +1 -2
  35. data/lib/pnap_network_api.rb +3 -1
  36. data/pnap_network_api.gemspec +6 -6
  37. data/spec/api/bgp_peer_groups_api_spec.rb +1 -1
  38. data/spec/api/private_networks_api_spec.rb +1 -1
  39. data/spec/api/public_networks_api_spec.rb +1 -1
  40. data/spec/models/asn_details_spec.rb +2 -2
  41. data/spec/models/bgp_ip_prefix_spec.rb +54 -0
  42. data/spec/models/bgp_ipv4_prefix_spec.rb +2 -2
  43. data/spec/models/bgp_peer_group_create_spec.rb +2 -2
  44. data/spec/models/bgp_peer_group_patch_spec.rb +2 -2
  45. data/spec/models/bgp_peer_group_spec.rb +14 -2
  46. data/spec/models/error_spec.rb +2 -2
  47. data/spec/models/network_membership_spec.rb +2 -2
  48. data/spec/models/private_network_create_spec.rb +2 -2
  49. data/spec/models/private_network_modify_spec.rb +2 -2
  50. data/spec/models/private_network_server_spec.rb +2 -2
  51. data/spec/models/private_network_spec.rb +2 -2
  52. data/spec/models/public_network_create_spec.rb +2 -2
  53. data/spec/models/public_network_ip_block_create_spec.rb +2 -2
  54. data/spec/models/public_network_ip_block_spec.rb +2 -2
  55. data/spec/models/public_network_modify_spec.rb +2 -2
  56. data/spec/models/public_network_spec.rb +2 -2
  57. data/spec/spec_helper.rb +1 -1
  58. metadata +31 -18
@@ -6,7 +6,7 @@
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: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -15,19 +15,22 @@ require 'time'
15
15
 
16
16
  module NetworkApi
17
17
  # The Border Gateway Protocol (BGP) Peer Group.
18
- class BgpPeerGroup
18
+ class BgpPeerGroup < ApiModelBase
19
19
  # The unique identifier of the BGP Peer Group.
20
20
  attr_accessor :id
21
21
 
22
22
  # The BGP Peer Group status. Can have one of the following values: `PENDING`, `ON_HOLD`, `BUSY`, `READY`, `ERROR`, `PENDING_DELETION` and `DELETING`.
23
23
  attr_accessor :status
24
24
 
25
- # The BGP Peer Group location. Can have one of the following values: `PHX`, `ASH`, `SGP`, `NLD`, `CHI`, `SEA` and `AUS`.
25
+ # The BGP Peer Group location. Can have one of the following values: `PHX`, `ASH`, `SGP`, `NLD`, `CHI` and `SEA`.
26
26
  attr_accessor :location
27
27
 
28
- # The List of the BGP Peer Group IPv4 prefixes.
28
+ # The List of the BGP Peer Group IPv4 prefixes. Deprecated in favour of generic ipPrefixes.
29
29
  attr_accessor :ipv4_prefixes
30
30
 
31
+ # The List of the BGP Peer Group IP prefixes.
32
+ attr_accessor :ip_prefixes
33
+
31
34
  attr_accessor :target_asn_details
32
35
 
33
36
  attr_accessor :active_asn_details
@@ -47,6 +50,9 @@ module NetworkApi
47
50
  # The IPv4 Peering Loopback addresses of the BGP Peer Group. Valid IP formats are IPv4 addresses.
48
51
  attr_accessor :peering_loopbacks_v4
49
52
 
53
+ # The IPv6 Peering Loopback addresses of the BGP Peer Group. Valid IP formats are IPv6 addresses.
54
+ attr_accessor :peering_loopbacks_v6
55
+
50
56
  # The Keep Alive Timer in seconds of the BGP Peer Group.
51
57
  attr_accessor :keep_alive_timer_seconds
52
58
 
@@ -66,6 +72,7 @@ module NetworkApi
66
72
  :'status' => :'status',
67
73
  :'location' => :'location',
68
74
  :'ipv4_prefixes' => :'ipv4Prefixes',
75
+ :'ip_prefixes' => :'ipPrefixes',
69
76
  :'target_asn_details' => :'targetAsnDetails',
70
77
  :'active_asn_details' => :'activeAsnDetails',
71
78
  :'password' => :'password',
@@ -73,6 +80,7 @@ module NetworkApi
73
80
  :'rpki_roa_origin_asn' => :'rpkiRoaOriginAsn',
74
81
  :'e_bgp_multi_hop' => :'eBgpMultiHop',
75
82
  :'peering_loopbacks_v4' => :'peeringLoopbacksV4',
83
+ :'peering_loopbacks_v6' => :'peeringLoopbacksV6',
76
84
  :'keep_alive_timer_seconds' => :'keepAliveTimerSeconds',
77
85
  :'hold_timer_seconds' => :'holdTimerSeconds',
78
86
  :'created_on' => :'createdOn',
@@ -80,9 +88,14 @@ module NetworkApi
80
88
  }
81
89
  end
82
90
 
91
+ # Returns attribute mapping this model knows about
92
+ def self.acceptable_attribute_map
93
+ attribute_map
94
+ end
95
+
83
96
  # Returns all the JSON keys this model knows about
84
97
  def self.acceptable_attributes
85
- attribute_map.values
98
+ acceptable_attribute_map.values
86
99
  end
87
100
 
88
101
  # Attribute type mapping.
@@ -92,6 +105,7 @@ module NetworkApi
92
105
  :'status' => :'String',
93
106
  :'location' => :'String',
94
107
  :'ipv4_prefixes' => :'Array<BgpIPv4Prefix>',
108
+ :'ip_prefixes' => :'Array<BgpIpPrefix>',
95
109
  :'target_asn_details' => :'AsnDetails',
96
110
  :'active_asn_details' => :'AsnDetails',
97
111
  :'password' => :'String',
@@ -99,6 +113,7 @@ module NetworkApi
99
113
  :'rpki_roa_origin_asn' => :'Integer',
100
114
  :'e_bgp_multi_hop' => :'Integer',
101
115
  :'peering_loopbacks_v4' => :'Array<String>',
116
+ :'peering_loopbacks_v6' => :'Array<String>',
102
117
  :'keep_alive_timer_seconds' => :'Integer',
103
118
  :'hold_timer_seconds' => :'Integer',
104
119
  :'created_on' => :'String',
@@ -120,9 +135,10 @@ module NetworkApi
120
135
  end
121
136
 
122
137
  # check to see if the attribute exists and convert string to symbol for hash key
138
+ acceptable_attribute_map = self.class.acceptable_attribute_map
123
139
  attributes = attributes.each_with_object({}) { |(k, v), h|
124
- if (!self.class.attribute_map.key?(k.to_sym))
125
- fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkApi::BgpPeerGroup`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
140
+ if (!acceptable_attribute_map.key?(k.to_sym))
141
+ fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkApi::BgpPeerGroup`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
126
142
  end
127
143
  h[k.to_sym] = v
128
144
  }
@@ -153,6 +169,14 @@ module NetworkApi
153
169
  self.ipv4_prefixes = nil
154
170
  end
155
171
 
172
+ if attributes.key?(:'ip_prefixes')
173
+ if (value = attributes[:'ip_prefixes']).is_a?(Array)
174
+ self.ip_prefixes = value
175
+ end
176
+ else
177
+ self.ip_prefixes = nil
178
+ end
179
+
156
180
  if attributes.key?(:'target_asn_details')
157
181
  self.target_asn_details = attributes[:'target_asn_details']
158
182
  else
@@ -195,6 +219,14 @@ module NetworkApi
195
219
  self.peering_loopbacks_v4 = nil
196
220
  end
197
221
 
222
+ if attributes.key?(:'peering_loopbacks_v6')
223
+ if (value = attributes[:'peering_loopbacks_v6']).is_a?(Array)
224
+ self.peering_loopbacks_v6 = value
225
+ end
226
+ else
227
+ self.peering_loopbacks_v6 = nil
228
+ end
229
+
198
230
  if attributes.key?(:'keep_alive_timer_seconds')
199
231
  self.keep_alive_timer_seconds = attributes[:'keep_alive_timer_seconds']
200
232
  else
@@ -237,6 +269,10 @@ module NetworkApi
237
269
  invalid_properties.push('invalid value for "ipv4_prefixes", ipv4_prefixes cannot be nil.')
238
270
  end
239
271
 
272
+ if @ip_prefixes.nil?
273
+ invalid_properties.push('invalid value for "ip_prefixes", ip_prefixes cannot be nil.')
274
+ end
275
+
240
276
  if @target_asn_details.nil?
241
277
  invalid_properties.push('invalid value for "target_asn_details", target_asn_details cannot be nil.')
242
278
  end
@@ -250,7 +286,7 @@ module NetworkApi
250
286
  end
251
287
 
252
288
  if @password.to_s.length < 8
253
- invalid_properties.push('invalid value for "password", the character length must be great than or equal to 8.')
289
+ invalid_properties.push('invalid value for "password", the character length must be greater than or equal to 8.')
254
290
  end
255
291
 
256
292
  pattern = Regexp.new(/^[a-zA-Z0-9!@#$%^&*()\-|\[\]{}=;:<>,.]+$/)
@@ -274,6 +310,10 @@ module NetworkApi
274
310
  invalid_properties.push('invalid value for "peering_loopbacks_v4", peering_loopbacks_v4 cannot be nil.')
275
311
  end
276
312
 
313
+ if @peering_loopbacks_v6.nil?
314
+ invalid_properties.push('invalid value for "peering_loopbacks_v6", peering_loopbacks_v6 cannot be nil.')
315
+ end
316
+
277
317
  if @keep_alive_timer_seconds.nil?
278
318
  invalid_properties.push('invalid value for "keep_alive_timer_seconds", keep_alive_timer_seconds cannot be nil.')
279
319
  end
@@ -293,6 +333,7 @@ module NetworkApi
293
333
  return false if @status.nil?
294
334
  return false if @location.nil?
295
335
  return false if @ipv4_prefixes.nil?
336
+ return false if @ip_prefixes.nil?
296
337
  return false if @target_asn_details.nil?
297
338
  return false if @password.nil?
298
339
  return false if @password.to_s.length > 32
@@ -302,11 +343,72 @@ module NetworkApi
302
343
  return false if @rpki_roa_origin_asn.nil?
303
344
  return false if @e_bgp_multi_hop.nil?
304
345
  return false if @peering_loopbacks_v4.nil?
346
+ return false if @peering_loopbacks_v6.nil?
305
347
  return false if @keep_alive_timer_seconds.nil?
306
348
  return false if @hold_timer_seconds.nil?
307
349
  true
308
350
  end
309
351
 
352
+ # Custom attribute writer method with validation
353
+ # @param [Object] id Value to be assigned
354
+ def id=(id)
355
+ if id.nil?
356
+ fail ArgumentError, 'id cannot be nil'
357
+ end
358
+
359
+ @id = id
360
+ end
361
+
362
+ # Custom attribute writer method with validation
363
+ # @param [Object] status Value to be assigned
364
+ def status=(status)
365
+ if status.nil?
366
+ fail ArgumentError, 'status cannot be nil'
367
+ end
368
+
369
+ @status = status
370
+ end
371
+
372
+ # Custom attribute writer method with validation
373
+ # @param [Object] location Value to be assigned
374
+ def location=(location)
375
+ if location.nil?
376
+ fail ArgumentError, 'location cannot be nil'
377
+ end
378
+
379
+ @location = location
380
+ end
381
+
382
+ # Custom attribute writer method with validation
383
+ # @param [Object] ipv4_prefixes Value to be assigned
384
+ def ipv4_prefixes=(ipv4_prefixes)
385
+ if ipv4_prefixes.nil?
386
+ fail ArgumentError, 'ipv4_prefixes cannot be nil'
387
+ end
388
+
389
+ @ipv4_prefixes = ipv4_prefixes
390
+ end
391
+
392
+ # Custom attribute writer method with validation
393
+ # @param [Object] ip_prefixes Value to be assigned
394
+ def ip_prefixes=(ip_prefixes)
395
+ if ip_prefixes.nil?
396
+ fail ArgumentError, 'ip_prefixes cannot be nil'
397
+ end
398
+
399
+ @ip_prefixes = ip_prefixes
400
+ end
401
+
402
+ # Custom attribute writer method with validation
403
+ # @param [Object] target_asn_details Value to be assigned
404
+ def target_asn_details=(target_asn_details)
405
+ if target_asn_details.nil?
406
+ fail ArgumentError, 'target_asn_details cannot be nil'
407
+ end
408
+
409
+ @target_asn_details = target_asn_details
410
+ end
411
+
310
412
  # Custom attribute writer method with validation
311
413
  # @param [Object] password Value to be assigned
312
414
  def password=(password)
@@ -319,7 +421,7 @@ module NetworkApi
319
421
  end
320
422
 
321
423
  if password.to_s.length < 8
322
- fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 8.'
424
+ fail ArgumentError, 'invalid value for "password", the character length must be greater than or equal to 8.'
323
425
  end
324
426
 
325
427
  pattern = Regexp.new(/^[a-zA-Z0-9!@#$%^&*()\-|\[\]{}=;:<>,.]+$/)
@@ -330,6 +432,76 @@ module NetworkApi
330
432
  @password = password
331
433
  end
332
434
 
435
+ # Custom attribute writer method with validation
436
+ # @param [Object] advertised_routes Value to be assigned
437
+ def advertised_routes=(advertised_routes)
438
+ if advertised_routes.nil?
439
+ fail ArgumentError, 'advertised_routes cannot be nil'
440
+ end
441
+
442
+ @advertised_routes = advertised_routes
443
+ end
444
+
445
+ # Custom attribute writer method with validation
446
+ # @param [Object] rpki_roa_origin_asn Value to be assigned
447
+ def rpki_roa_origin_asn=(rpki_roa_origin_asn)
448
+ if rpki_roa_origin_asn.nil?
449
+ fail ArgumentError, 'rpki_roa_origin_asn cannot be nil'
450
+ end
451
+
452
+ @rpki_roa_origin_asn = rpki_roa_origin_asn
453
+ end
454
+
455
+ # Custom attribute writer method with validation
456
+ # @param [Object] e_bgp_multi_hop Value to be assigned
457
+ def e_bgp_multi_hop=(e_bgp_multi_hop)
458
+ if e_bgp_multi_hop.nil?
459
+ fail ArgumentError, 'e_bgp_multi_hop cannot be nil'
460
+ end
461
+
462
+ @e_bgp_multi_hop = e_bgp_multi_hop
463
+ end
464
+
465
+ # Custom attribute writer method with validation
466
+ # @param [Object] peering_loopbacks_v4 Value to be assigned
467
+ def peering_loopbacks_v4=(peering_loopbacks_v4)
468
+ if peering_loopbacks_v4.nil?
469
+ fail ArgumentError, 'peering_loopbacks_v4 cannot be nil'
470
+ end
471
+
472
+ @peering_loopbacks_v4 = peering_loopbacks_v4
473
+ end
474
+
475
+ # Custom attribute writer method with validation
476
+ # @param [Object] peering_loopbacks_v6 Value to be assigned
477
+ def peering_loopbacks_v6=(peering_loopbacks_v6)
478
+ if peering_loopbacks_v6.nil?
479
+ fail ArgumentError, 'peering_loopbacks_v6 cannot be nil'
480
+ end
481
+
482
+ @peering_loopbacks_v6 = peering_loopbacks_v6
483
+ end
484
+
485
+ # Custom attribute writer method with validation
486
+ # @param [Object] keep_alive_timer_seconds Value to be assigned
487
+ def keep_alive_timer_seconds=(keep_alive_timer_seconds)
488
+ if keep_alive_timer_seconds.nil?
489
+ fail ArgumentError, 'keep_alive_timer_seconds cannot be nil'
490
+ end
491
+
492
+ @keep_alive_timer_seconds = keep_alive_timer_seconds
493
+ end
494
+
495
+ # Custom attribute writer method with validation
496
+ # @param [Object] hold_timer_seconds Value to be assigned
497
+ def hold_timer_seconds=(hold_timer_seconds)
498
+ if hold_timer_seconds.nil?
499
+ fail ArgumentError, 'hold_timer_seconds cannot be nil'
500
+ end
501
+
502
+ @hold_timer_seconds = hold_timer_seconds
503
+ end
504
+
333
505
  # Checks equality by comparing each attribute.
334
506
  # @param [Object] Object to be compared
335
507
  def ==(o)
@@ -339,6 +511,7 @@ module NetworkApi
339
511
  status == o.status &&
340
512
  location == o.location &&
341
513
  ipv4_prefixes == o.ipv4_prefixes &&
514
+ ip_prefixes == o.ip_prefixes &&
342
515
  target_asn_details == o.target_asn_details &&
343
516
  active_asn_details == o.active_asn_details &&
344
517
  password == o.password &&
@@ -346,6 +519,7 @@ module NetworkApi
346
519
  rpki_roa_origin_asn == o.rpki_roa_origin_asn &&
347
520
  e_bgp_multi_hop == o.e_bgp_multi_hop &&
348
521
  peering_loopbacks_v4 == o.peering_loopbacks_v4 &&
522
+ peering_loopbacks_v6 == o.peering_loopbacks_v6 &&
349
523
  keep_alive_timer_seconds == o.keep_alive_timer_seconds &&
350
524
  hold_timer_seconds == o.hold_timer_seconds &&
351
525
  created_on == o.created_on &&
@@ -361,7 +535,7 @@ module NetworkApi
361
535
  # Calculates hash code according to all attributes.
362
536
  # @return [Integer] Hash code
363
537
  def hash
364
- [id, status, location, ipv4_prefixes, target_asn_details, active_asn_details, password, advertised_routes, rpki_roa_origin_asn, e_bgp_multi_hop, peering_loopbacks_v4, keep_alive_timer_seconds, hold_timer_seconds, created_on, last_updated_on].hash
538
+ [id, status, location, ipv4_prefixes, ip_prefixes, target_asn_details, active_asn_details, password, advertised_routes, rpki_roa_origin_asn, e_bgp_multi_hop, peering_loopbacks_v4, peering_loopbacks_v6, keep_alive_timer_seconds, hold_timer_seconds, created_on, last_updated_on].hash
365
539
  end
366
540
 
367
541
  # Builds the object from hash
@@ -387,61 +561,6 @@ module NetworkApi
387
561
  new(transformed_hash)
388
562
  end
389
563
 
390
- # Deserializes the data based on type
391
- # @param string type Data type
392
- # @param string value Value to be deserialized
393
- # @return [Object] Deserialized data
394
- def self._deserialize(type, value)
395
- case type.to_sym
396
- when :Time
397
- Time.parse(value)
398
- when :Date
399
- Date.parse(value)
400
- when :String
401
- value.to_s
402
- when :Integer
403
- value.to_i
404
- when :Float
405
- value.to_f
406
- when :Boolean
407
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
408
- true
409
- else
410
- false
411
- end
412
- when :Object
413
- # generic object (usually a Hash), return directly
414
- value
415
- when /\AArray<(?<inner_type>.+)>\z/
416
- inner_type = Regexp.last_match[:inner_type]
417
- value.map { |v| _deserialize(inner_type, v) }
418
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
419
- k_type = Regexp.last_match[:k_type]
420
- v_type = Regexp.last_match[:v_type]
421
- {}.tap do |hash|
422
- value.each do |k, v|
423
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
424
- end
425
- end
426
- else # model
427
- # models (e.g. Pet) or oneOf
428
- klass = NetworkApi.const_get(type)
429
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
430
- end
431
- end
432
-
433
- # Returns the string representation of the object
434
- # @return [String] String presentation of the object
435
- def to_s
436
- to_hash.to_s
437
- end
438
-
439
- # to_body is an alias to to_hash (backward compatibility)
440
- # @return [Hash] Returns the object in the form of hash
441
- def to_body
442
- to_hash
443
- end
444
-
445
564
  # Returns the object in the form of hash
446
565
  # @return [Hash] Returns the object in the form of hash
447
566
  def to_hash
@@ -458,24 +577,6 @@ module NetworkApi
458
577
  hash
459
578
  end
460
579
 
461
- # Outputs non-array value in the form of hash
462
- # For object, use to_hash. Otherwise, just return the value
463
- # @param [Object] value Any valid value
464
- # @return [Hash] Returns the value in the form of hash
465
- def _to_hash(value)
466
- if value.is_a?(Array)
467
- value.compact.map { |v| _to_hash(v) }
468
- elsif value.is_a?(Hash)
469
- {}.tap do |hash|
470
- value.each { |k, v| hash[k] = _to_hash(v) }
471
- end
472
- elsif value.respond_to? :to_hash
473
- value.to_hash
474
- else
475
- value
476
- end
477
- end
478
-
479
580
  end
480
581
 
481
582
  end
@@ -6,7 +6,7 @@
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: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -15,8 +15,8 @@ require 'time'
15
15
 
16
16
  module NetworkApi
17
17
  # Create a BGP Peer Group.
18
- class BgpPeerGroupCreate
19
- # The BGP Peer Group location. Can have one of the following values: `PHX`, `ASH`, `SGP`, `NLD`, `CHI`, `SEA` and `AUS`.
18
+ class BgpPeerGroupCreate < ApiModelBase
19
+ # The BGP Peer Group location. Can have one of the following values: `PHX`, `ASH`, `SGP`, `NLD`, `CHI` and `SEA`.
20
20
  attr_accessor :location
21
21
 
22
22
  # The BGP Peer Group ASN.
@@ -38,9 +38,14 @@ module NetworkApi
38
38
  }
39
39
  end
40
40
 
41
+ # Returns attribute mapping this model knows about
42
+ def self.acceptable_attribute_map
43
+ attribute_map
44
+ end
45
+
41
46
  # Returns all the JSON keys this model knows about
42
47
  def self.acceptable_attributes
43
- attribute_map.values
48
+ acceptable_attribute_map.values
44
49
  end
45
50
 
46
51
  # Attribute type mapping.
@@ -67,9 +72,10 @@ module NetworkApi
67
72
  end
68
73
 
69
74
  # check to see if the attribute exists and convert string to symbol for hash key
75
+ acceptable_attribute_map = self.class.acceptable_attribute_map
70
76
  attributes = attributes.each_with_object({}) { |(k, v), h|
71
- if (!self.class.attribute_map.key?(k.to_sym))
72
- fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkApi::BgpPeerGroupCreate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ if (!acceptable_attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkApi::BgpPeerGroupCreate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
79
  end
74
80
  h[k.to_sym] = v
75
81
  }
@@ -115,7 +121,7 @@ module NetworkApi
115
121
  end
116
122
 
117
123
  if !@password.nil? && @password.to_s.length < 8
118
- invalid_properties.push('invalid value for "password", the character length must be great than or equal to 8.')
124
+ invalid_properties.push('invalid value for "password", the character length must be greater than or equal to 8.')
119
125
  end
120
126
 
121
127
  pattern = Regexp.new(/^[a-zA-Z0-9!@#$%^&*()\-|\[\]{}=;:<>,.]+$/)
@@ -143,6 +149,26 @@ module NetworkApi
143
149
  true
144
150
  end
145
151
 
152
+ # Custom attribute writer method with validation
153
+ # @param [Object] location Value to be assigned
154
+ def location=(location)
155
+ if location.nil?
156
+ fail ArgumentError, 'location cannot be nil'
157
+ end
158
+
159
+ @location = location
160
+ end
161
+
162
+ # Custom attribute writer method with validation
163
+ # @param [Object] asn Value to be assigned
164
+ def asn=(asn)
165
+ if asn.nil?
166
+ fail ArgumentError, 'asn cannot be nil'
167
+ end
168
+
169
+ @asn = asn
170
+ end
171
+
146
172
  # Custom attribute writer method with validation
147
173
  # @param [Object] password Value to be assigned
148
174
  def password=(password)
@@ -155,7 +181,7 @@ module NetworkApi
155
181
  end
156
182
 
157
183
  if password.to_s.length < 8
158
- fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 8.'
184
+ fail ArgumentError, 'invalid value for "password", the character length must be greater than or equal to 8.'
159
185
  end
160
186
 
161
187
  pattern = Regexp.new(/^[a-zA-Z0-9!@#$%^&*()\-|\[\]{}=;:<>,.]+$/)
@@ -166,6 +192,16 @@ module NetworkApi
166
192
  @password = password
167
193
  end
168
194
 
195
+ # Custom attribute writer method with validation
196
+ # @param [Object] advertised_routes Value to be assigned
197
+ def advertised_routes=(advertised_routes)
198
+ if advertised_routes.nil?
199
+ fail ArgumentError, 'advertised_routes cannot be nil'
200
+ end
201
+
202
+ @advertised_routes = advertised_routes
203
+ end
204
+
169
205
  # Checks equality by comparing each attribute.
170
206
  # @param [Object] Object to be compared
171
207
  def ==(o)
@@ -212,61 +248,6 @@ module NetworkApi
212
248
  new(transformed_hash)
213
249
  end
214
250
 
215
- # Deserializes the data based on type
216
- # @param string type Data type
217
- # @param string value Value to be deserialized
218
- # @return [Object] Deserialized data
219
- def self._deserialize(type, value)
220
- case type.to_sym
221
- when :Time
222
- Time.parse(value)
223
- when :Date
224
- Date.parse(value)
225
- when :String
226
- value.to_s
227
- when :Integer
228
- value.to_i
229
- when :Float
230
- value.to_f
231
- when :Boolean
232
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
233
- true
234
- else
235
- false
236
- end
237
- when :Object
238
- # generic object (usually a Hash), return directly
239
- value
240
- when /\AArray<(?<inner_type>.+)>\z/
241
- inner_type = Regexp.last_match[:inner_type]
242
- value.map { |v| _deserialize(inner_type, v) }
243
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
244
- k_type = Regexp.last_match[:k_type]
245
- v_type = Regexp.last_match[:v_type]
246
- {}.tap do |hash|
247
- value.each do |k, v|
248
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
249
- end
250
- end
251
- else # model
252
- # models (e.g. Pet) or oneOf
253
- klass = NetworkApi.const_get(type)
254
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
255
- end
256
- end
257
-
258
- # Returns the string representation of the object
259
- # @return [String] String presentation of the object
260
- def to_s
261
- to_hash.to_s
262
- end
263
-
264
- # to_body is an alias to to_hash (backward compatibility)
265
- # @return [Hash] Returns the object in the form of hash
266
- def to_body
267
- to_hash
268
- end
269
-
270
251
  # Returns the object in the form of hash
271
252
  # @return [Hash] Returns the object in the form of hash
272
253
  def to_hash
@@ -283,24 +264,6 @@ module NetworkApi
283
264
  hash
284
265
  end
285
266
 
286
- # Outputs non-array value in the form of hash
287
- # For object, use to_hash. Otherwise, just return the value
288
- # @param [Object] value Any valid value
289
- # @return [Hash] Returns the value in the form of hash
290
- def _to_hash(value)
291
- if value.is_a?(Array)
292
- value.compact.map { |v| _to_hash(v) }
293
- elsif value.is_a?(Hash)
294
- {}.tap do |hash|
295
- value.each { |k, v| hash[k] = _to_hash(v) }
296
- end
297
- elsif value.respond_to? :to_hash
298
- value.to_hash
299
- else
300
- value
301
- end
302
- end
303
-
304
267
  end
305
268
 
306
269
  end