Class: MistApi::StatsMxedgeOobIpStat

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

Overview

StatsMxedgeOobIpStat 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(dns = SKIP, gateway = SKIP, gateway6 = SKIP, ip = SKIP, ip6 = SKIP, netmask = SKIP, netmask6 = SKIP, type = MxedgeMgmtOobIpTypeEnum::DHCP, type8 = MxedgeMgmtOobIpType6Enum::AUTOCONF) ⇒ StatsMxedgeOobIpStat

Returns a new instance of StatsMxedgeOobIpStat.



83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/mist_api/models/stats_mxedge_oob_ip_stat.rb', line 83

def initialize(dns = SKIP, gateway = SKIP, gateway6 = SKIP, ip = SKIP,
               ip6 = SKIP, netmask = SKIP, netmask6 = SKIP,
               type = MxedgeMgmtOobIpTypeEnum::DHCP,
               type8 = MxedgeMgmtOobIpType6Enum::AUTOCONF)
  @dns = dns unless dns == SKIP
  @gateway = gateway unless gateway == SKIP
  @gateway6 = gateway6 unless gateway6 == SKIP
  @ip = ip unless ip == SKIP
  @ip6 = ip6 unless ip6 == SKIP
  @netmask = netmask unless netmask == SKIP
  @netmask6 = netmask6 unless netmask6 == SKIP
  @type = type unless type == SKIP
  @type8 = type8 unless type8 == SKIP
end

Instance Attribute Details

#dnsArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


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

def dns
  @dns
end

#gatewayString

TODO: Write general description for this method

Returns:

  • (String)


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

def gateway
  @gateway
end

#gateway6String

TODO: Write general description for this method

Returns:

  • (String)


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

def gateway6
  @gateway6
end

#ipString

TODO: Write general description for this method

Returns:

  • (String)


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

def ip
  @ip
end

#ip6String

TODO: Write general description for this method

Returns:

  • (String)


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

def ip6
  @ip6
end

#netmaskString

TODO: Write general description for this method

Returns:

  • (String)


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

def netmask
  @netmask
end

#netmask6String

TODO: Write general description for this method

Returns:

  • (String)


38
39
40
# File 'lib/mist_api/models/stats_mxedge_oob_ip_stat.rb', line 38

def netmask6
  @netmask6
end

#typeMxedgeMgmtOobIpTypeEnum

enum: ‘dhcp`, `disabled`, `static`



42
43
44
# File 'lib/mist_api/models/stats_mxedge_oob_ip_stat.rb', line 42

def type
  @type
end

#type8MxedgeMgmtOobIpType6Enum

enum: ‘autoconf`, `dhcp`, `disabled`, `static`



46
47
48
# File 'lib/mist_api/models/stats_mxedge_oob_ip_stat.rb', line 46

def type8
  @type8
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/mist_api/models/stats_mxedge_oob_ip_stat.rb', line 99

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  dns = hash.key?('dns') ? hash['dns'] : SKIP
  gateway = hash.key?('gateway') ? hash['gateway'] : SKIP
  gateway6 = hash.key?('gateway6') ? hash['gateway6'] : SKIP
  ip = hash.key?('ip') ? hash['ip'] : SKIP
  ip6 = hash.key?('ip6') ? hash['ip6'] : SKIP
  netmask = hash.key?('netmask') ? hash['netmask'] : SKIP
  netmask6 = hash.key?('netmask6') ? hash['netmask6'] : SKIP
  type = hash['type'] ||= MxedgeMgmtOobIpTypeEnum::DHCP
  type8 = hash['type8'] ||= MxedgeMgmtOobIpType6Enum::AUTOCONF

  # Create object from extracted values.
  StatsMxedgeOobIpStat.new(dns,
                           gateway,
                           gateway6,
                           ip,
                           ip6,
                           netmask,
                           netmask6,
                           type,
                           type8)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['dns'] = 'dns'
  @_hash['gateway'] = 'gateway'
  @_hash['gateway6'] = 'gateway6'
  @_hash['ip'] = 'ip'
  @_hash['ip6'] = 'ip6'
  @_hash['netmask'] = 'netmask'
  @_hash['netmask6'] = 'netmask6'
  @_hash['type'] = 'type'
  @_hash['type8'] = 'type8'
  @_hash
end

.nullablesObject

An array for nullable fields



79
80
81
# File 'lib/mist_api/models/stats_mxedge_oob_ip_stat.rb', line 79

def self.nullables
  []
end

.optionalsObject

An array for optional fields



64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/mist_api/models/stats_mxedge_oob_ip_stat.rb', line 64

def self.optionals
  %w[
    dns
    gateway
    gateway6
    ip
    ip6
    netmask
    netmask6
    type
    type8
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



134
135
136
137
138
139
140
# File 'lib/mist_api/models/stats_mxedge_oob_ip_stat.rb', line 134

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} dns: #{@dns.inspect}, gateway: #{@gateway.inspect}, gateway6:"\
  " #{@gateway6.inspect}, ip: #{@ip.inspect}, ip6: #{@ip6.inspect}, netmask:"\
  " #{@netmask.inspect}, netmask6: #{@netmask6.inspect}, type: #{@type.inspect}, type8:"\
  " #{@type8.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



126
127
128
129
130
131
# File 'lib/mist_api/models/stats_mxedge_oob_ip_stat.rb', line 126

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} dns: #{@dns}, gateway: #{@gateway}, gateway6: #{@gateway6}, ip: #{@ip},"\
  " ip6: #{@ip6}, netmask: #{@netmask}, netmask6: #{@netmask6}, type: #{@type}, type8:"\
  " #{@type8}>"
end