Class: MistApi::GatewayPortWanSourceNat
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- MistApi::GatewayPortWanSourceNat
- Defined in:
- lib/mist_api/models/gateway_port_wan_source_nat.rb
Overview
Only if ‘usage`==`wan`, optional. By default, source-NAT is performed on all WAN Ports using the interface-ip
Instance Attribute Summary collapse
-
#disabled ⇒ TrueClass | FalseClass
Or to disable the source-nat.
-
#nat6_pool ⇒ String
If alternative nat_pool is desired.
-
#nat_pool ⇒ String
If alternative nat_pool is desired.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(disabled = false, nat6_pool = SKIP, nat_pool = SKIP) ⇒ GatewayPortWanSourceNat
constructor
A new instance of GatewayPortWanSourceNat.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(disabled = false, nat6_pool = SKIP, nat_pool = SKIP) ⇒ GatewayPortWanSourceNat
Returns a new instance of GatewayPortWanSourceNat.
48 49 50 51 52 |
# File 'lib/mist_api/models/gateway_port_wan_source_nat.rb', line 48 def initialize(disabled = false, nat6_pool = SKIP, nat_pool = SKIP) @disabled = disabled unless disabled == SKIP @nat6_pool = nat6_pool unless nat6_pool == SKIP @nat_pool = nat_pool unless nat_pool == SKIP end |
Instance Attribute Details
#disabled ⇒ TrueClass | FalseClass
Or to disable the source-nat
15 16 17 |
# File 'lib/mist_api/models/gateway_port_wan_source_nat.rb', line 15 def disabled @disabled end |
#nat6_pool ⇒ String
If alternative nat_pool is desired
19 20 21 |
# File 'lib/mist_api/models/gateway_port_wan_source_nat.rb', line 19 def nat6_pool @nat6_pool end |
#nat_pool ⇒ String
If alternative nat_pool is desired
23 24 25 |
# File 'lib/mist_api/models/gateway_port_wan_source_nat.rb', line 23 def nat_pool @nat_pool end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/mist_api/models/gateway_port_wan_source_nat.rb', line 55 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. disabled = hash['disabled'] ||= false nat6_pool = hash.key?('nat6_pool') ? hash['nat6_pool'] : SKIP nat_pool = hash.key?('nat_pool') ? hash['nat_pool'] : SKIP # Create object from extracted values. GatewayPortWanSourceNat.new(disabled, nat6_pool, nat_pool) end |
.names ⇒ Object
A mapping from model property names to API property names.
26 27 28 29 30 31 32 |
# File 'lib/mist_api/models/gateway_port_wan_source_nat.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['disabled'] = 'disabled' @_hash['nat6_pool'] = 'nat6_pool' @_hash['nat_pool'] = 'nat_pool' @_hash end |
.nullables ⇒ Object
An array for nullable fields
44 45 46 |
# File 'lib/mist_api/models/gateway_port_wan_source_nat.rb', line 44 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
35 36 37 38 39 40 41 |
# File 'lib/mist_api/models/gateway_port_wan_source_nat.rb', line 35 def self.optionals %w[ disabled nat6_pool nat_pool ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
71 72 73 74 75 76 77 |
# File 'lib/mist_api/models/gateway_port_wan_source_nat.rb', line 71 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
86 87 88 89 90 |
# File 'lib/mist_api/models/gateway_port_wan_source_nat.rb', line 86 def inspect class_name = self.class.name.split('::').last "<#{class_name} disabled: #{@disabled.inspect}, nat6_pool: #{@nat6_pool.inspect}, nat_pool:"\ " #{@nat_pool.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
80 81 82 83 |
# File 'lib/mist_api/models/gateway_port_wan_source_nat.rb', line 80 def to_s class_name = self.class.name.split('::').last "<#{class_name} disabled: #{@disabled}, nat6_pool: #{@nat6_pool}, nat_pool: #{@nat_pool}>" end |