Class: MistApi::StatsMxedgePortStatLldpStats

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

Overview

StatsMxedgePortStatLldpStats 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(chassis_id = SKIP, mgmt_addr = SKIP, port_desc = SKIP, port_id = SKIP, system_desc = SKIP, system_name = SKIP) ⇒ StatsMxedgePortStatLldpStats

Returns a new instance of StatsMxedgePortStatLldpStats.



65
66
67
68
69
70
71
72
73
# File 'lib/mist_api/models/stats_mxedge_port_stat_lldp_stats.rb', line 65

def initialize(chassis_id = SKIP, mgmt_addr = SKIP, port_desc = SKIP,
               port_id = SKIP, system_desc = SKIP, system_name = SKIP)
  @chassis_id = chassis_id unless chassis_id == SKIP
  @mgmt_addr = mgmt_addr unless mgmt_addr == SKIP
  @port_desc = port_desc unless port_desc == SKIP
  @port_id = port_id unless port_id == SKIP
  @system_desc = system_desc unless system_desc == SKIP
  @system_name = system_name unless system_name == SKIP
end

Instance Attribute Details

#chassis_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def chassis_id
  @chassis_id
end

#mgmt_addrString

TODO: Write general description for this method

Returns:

  • (String)


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

def mgmt_addr
  @mgmt_addr
end

#port_descString

TODO: Write general description for this method

Returns:

  • (String)


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

def port_desc
  @port_desc
end

#port_idString

TODO: Write general description for this method

Returns:

  • (String)


26
27
28
# File 'lib/mist_api/models/stats_mxedge_port_stat_lldp_stats.rb', line 26

def port_id
  @port_id
end

#system_descString

TODO: Write general description for this method

Returns:

  • (String)


30
31
32
# File 'lib/mist_api/models/stats_mxedge_port_stat_lldp_stats.rb', line 30

def system_desc
  @system_desc
end

#system_nameString

TODO: Write general description for this method

Returns:

  • (String)


34
35
36
# File 'lib/mist_api/models/stats_mxedge_port_stat_lldp_stats.rb', line 34

def system_name
  @system_name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/mist_api/models/stats_mxedge_port_stat_lldp_stats.rb', line 76

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  chassis_id = hash.key?('chassis_id') ? hash['chassis_id'] : SKIP
  mgmt_addr = hash.key?('mgmt_addr') ? hash['mgmt_addr'] : SKIP
  port_desc = hash.key?('port_desc') ? hash['port_desc'] : SKIP
  port_id = hash.key?('port_id') ? hash['port_id'] : SKIP
  system_desc = hash.key?('system_desc') ? hash['system_desc'] : SKIP
  system_name = hash.key?('system_name') ? hash['system_name'] : SKIP

  # Create object from extracted values.
  StatsMxedgePortStatLldpStats.new(chassis_id,
                                   mgmt_addr,
                                   port_desc,
                                   port_id,
                                   system_desc,
                                   system_name)
end

.namesObject

A mapping from model property names to API property names.



37
38
39
40
41
42
43
44
45
46
# File 'lib/mist_api/models/stats_mxedge_port_stat_lldp_stats.rb', line 37

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['chassis_id'] = 'chassis_id'
  @_hash['mgmt_addr'] = 'mgmt_addr'
  @_hash['port_desc'] = 'port_desc'
  @_hash['port_id'] = 'port_id'
  @_hash['system_desc'] = 'system_desc'
  @_hash['system_name'] = 'system_name'
  @_hash
end

.nullablesObject

An array for nullable fields



61
62
63
# File 'lib/mist_api/models/stats_mxedge_port_stat_lldp_stats.rb', line 61

def self.nullables
  []
end

.optionalsObject

An array for optional fields



49
50
51
52
53
54
55
56
57
58
# File 'lib/mist_api/models/stats_mxedge_port_stat_lldp_stats.rb', line 49

def self.optionals
  %w[
    chassis_id
    mgmt_addr
    port_desc
    port_id
    system_desc
    system_name
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



105
106
107
108
109
110
# File 'lib/mist_api/models/stats_mxedge_port_stat_lldp_stats.rb', line 105

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} chassis_id: #{@chassis_id.inspect}, mgmt_addr: #{@mgmt_addr.inspect},"\
  " port_desc: #{@port_desc.inspect}, port_id: #{@port_id.inspect}, system_desc:"\
  " #{@system_desc.inspect}, system_name: #{@system_name.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



97
98
99
100
101
102
# File 'lib/mist_api/models/stats_mxedge_port_stat_lldp_stats.rb', line 97

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} chassis_id: #{@chassis_id}, mgmt_addr: #{@mgmt_addr}, port_desc:"\
  " #{@port_desc}, port_id: #{@port_id}, system_desc: #{@system_desc}, system_name:"\
  " #{@system_name}>"
end