Class: MistApi::MxedgeTuntermIgmpSnoopingConfig

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/mxedge_tunterm_igmp_snooping_config.rb

Overview

MxedgeTuntermIgmpSnoopingConfig Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(enabled = SKIP, querier = SKIP, vlan_ids = SKIP) ⇒ MxedgeTuntermIgmpSnoopingConfig

Returns a new instance of MxedgeTuntermIgmpSnoopingConfig.



47
48
49
50
51
# File 'lib/mist_api/models/mxedge_tunterm_igmp_snooping_config.rb', line 47

def initialize(enabled = SKIP, querier = SKIP, vlan_ids = SKIP)
  @enabled = enabled unless enabled == SKIP
  @querier = querier unless querier == SKIP
  @vlan_ids = vlan_ids unless vlan_ids == SKIP
end

Instance Attribute Details

#enabledObject

TODO: Write general description for this method

Returns:

  • (Object)


14
15
16
# File 'lib/mist_api/models/mxedge_tunterm_igmp_snooping_config.rb', line 14

def enabled
  @enabled
end

#querierMxedgeTuntermIgmpSnoopingQuerier

TODO: Write general description for this method



18
19
20
# File 'lib/mist_api/models/mxedge_tunterm_igmp_snooping_config.rb', line 18

def querier
  @querier
end

#vlan_idsObject

List of vlans on which tunterm performs IGMP snooping

Returns:

  • (Object)


22
23
24
# File 'lib/mist_api/models/mxedge_tunterm_igmp_snooping_config.rb', line 22

def vlan_ids
  @vlan_ids
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/mist_api/models/mxedge_tunterm_igmp_snooping_config.rb', line 54

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  enabled = hash.key?('enabled') ? APIHelper.deserialize_union_type(
    UnionTypeLookUp.get(:MxedgeTuntermIgmpSnoopingConfigEnabled), hash['enabled']
  ) : SKIP
  querier = MxedgeTuntermIgmpSnoopingQuerier.from_hash(hash['querier']) if hash['querier']
  vlan_ids = hash.key?('vlan_ids') ? APIHelper.deserialize_union_type(
    UnionTypeLookUp.get(:MxedgeTuntermIgmpSnoopingConfigVlanIds), hash['vlan_ids']
  ) : SKIP

  # Create object from extracted values.
  MxedgeTuntermIgmpSnoopingConfig.new(enabled,
                                      querier,
                                      vlan_ids)
end

.namesObject

A mapping from model property names to API property names.



25
26
27
28
29
30
31
# File 'lib/mist_api/models/mxedge_tunterm_igmp_snooping_config.rb', line 25

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['enabled'] = 'enabled'
  @_hash['querier'] = 'querier'
  @_hash['vlan_ids'] = 'vlan_ids'
  @_hash
end

.nullablesObject

An array for nullable fields



43
44
45
# File 'lib/mist_api/models/mxedge_tunterm_igmp_snooping_config.rb', line 43

def self.nullables
  []
end

.optionalsObject

An array for optional fields



34
35
36
37
38
39
40
# File 'lib/mist_api/models/mxedge_tunterm_igmp_snooping_config.rb', line 34

def self.optionals
  %w[
    enabled
    querier
    vlan_ids
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



74
75
76
77
78
79
80
# File 'lib/mist_api/models/mxedge_tunterm_igmp_snooping_config.rb', line 74

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



89
90
91
92
93
# File 'lib/mist_api/models/mxedge_tunterm_igmp_snooping_config.rb', line 89

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} enabled: #{@enabled.inspect}, querier: #{@querier.inspect}, vlan_ids:"\
  " #{@vlan_ids.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



83
84
85
86
# File 'lib/mist_api/models/mxedge_tunterm_igmp_snooping_config.rb', line 83

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} enabled: #{@enabled}, querier: #{@querier}, vlan_ids: #{@vlan_ids}>"
end