Class: MistApi::TuntermPortConfig
- Defined in:
- lib/mist_api/models/tunterm_port_config.rb
Overview
Ethernet port configurations
Instance Attribute Summary collapse
-
#downstream_ports ⇒ Array[String]
List of ports to be used for downstream (to AP) purpose.
-
#separate_upstream_downstream ⇒ TrueClass | FalseClass
Whether to separate upstream / downstream ports.
-
#upstream_port_vlan_id ⇒ Object
Native VLAN id for upstream ports.
-
#upstream_ports ⇒ Array[String]
List of ports to be used for upstream purpose (to LAN).
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(downstream_ports = SKIP, separate_upstream_downstream = false, upstream_port_vlan_id = SKIP, upstream_ports = SKIP) ⇒ TuntermPortConfig
constructor
A new instance of TuntermPortConfig.
-
#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(downstream_ports = SKIP, separate_upstream_downstream = false, upstream_port_vlan_id = SKIP, upstream_ports = SKIP) ⇒ TuntermPortConfig
Returns a new instance of TuntermPortConfig.
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/mist_api/models/tunterm_port_config.rb', line 54 def initialize(downstream_ports = SKIP, separate_upstream_downstream = false, upstream_port_vlan_id = SKIP, upstream_ports = SKIP) @downstream_ports = downstream_ports unless downstream_ports == SKIP unless separate_upstream_downstream == SKIP @separate_upstream_downstream = separate_upstream_downstream end @upstream_port_vlan_id = upstream_port_vlan_id unless upstream_port_vlan_id == SKIP @upstream_ports = upstream_ports unless upstream_ports == SKIP end |
Instance Attribute Details
#downstream_ports ⇒ Array[String]
List of ports to be used for downstream (to AP) purpose
14 15 16 |
# File 'lib/mist_api/models/tunterm_port_config.rb', line 14 def downstream_ports @downstream_ports end |
#separate_upstream_downstream ⇒ TrueClass | FalseClass
Whether to separate upstream / downstream ports. default is false where all ports will be used.
19 20 21 |
# File 'lib/mist_api/models/tunterm_port_config.rb', line 19 def separate_upstream_downstream @separate_upstream_downstream end |
#upstream_port_vlan_id ⇒ Object
Native VLAN id for upstream ports
23 24 25 |
# File 'lib/mist_api/models/tunterm_port_config.rb', line 23 def upstream_port_vlan_id @upstream_port_vlan_id end |
#upstream_ports ⇒ Array[String]
List of ports to be used for upstream purpose (to LAN)
27 28 29 |
# File 'lib/mist_api/models/tunterm_port_config.rb', line 27 def upstream_ports @upstream_ports end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/mist_api/models/tunterm_port_config.rb', line 67 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. downstream_ports = hash.key?('downstream_ports') ? hash['downstream_ports'] : SKIP separate_upstream_downstream = hash['separate_upstream_downstream'] ||= false upstream_port_vlan_id = hash.key?('upstream_port_vlan_id') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:TuntermPortConfigUpstreamPortVlanId), hash['upstream_port_vlan_id'] ) : SKIP upstream_ports = hash.key?('upstream_ports') ? hash['upstream_ports'] : SKIP # Create object from extracted values. TuntermPortConfig.new(downstream_ports, separate_upstream_downstream, upstream_port_vlan_id, upstream_ports) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 36 37 |
# File 'lib/mist_api/models/tunterm_port_config.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['downstream_ports'] = 'downstream_ports' @_hash['separate_upstream_downstream'] = 'separate_upstream_downstream' @_hash['upstream_port_vlan_id'] = 'upstream_port_vlan_id' @_hash['upstream_ports'] = 'upstream_ports' @_hash end |
.nullables ⇒ Object
An array for nullable fields
50 51 52 |
# File 'lib/mist_api/models/tunterm_port_config.rb', line 50 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
40 41 42 43 44 45 46 47 |
# File 'lib/mist_api/models/tunterm_port_config.rb', line 40 def self.optionals %w[ downstream_ports separate_upstream_downstream upstream_port_vlan_id upstream_ports ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
90 91 92 93 94 95 96 |
# File 'lib/mist_api/models/tunterm_port_config.rb', line 90 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.
107 108 109 110 111 112 113 |
# File 'lib/mist_api/models/tunterm_port_config.rb', line 107 def inspect class_name = self.class.name.split('::').last "<#{class_name} downstream_ports: #{@downstream_ports.inspect},"\ " separate_upstream_downstream: #{@separate_upstream_downstream.inspect},"\ " upstream_port_vlan_id: #{@upstream_port_vlan_id.inspect}, upstream_ports:"\ " #{@upstream_ports.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
99 100 101 102 103 104 |
# File 'lib/mist_api/models/tunterm_port_config.rb', line 99 def to_s class_name = self.class.name.split('::').last "<#{class_name} downstream_ports: #{@downstream_ports}, separate_upstream_downstream:"\ " #{@separate_upstream_downstream}, upstream_port_vlan_id: #{@upstream_port_vlan_id},"\ " upstream_ports: #{@upstream_ports}>" end |