Class: MistApi::IfStatProperty

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

Overview

IfStatProperty 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(address_mode = SKIP, ips = SKIP, nat_addresses = SKIP, network_name = SKIP, port_id = SKIP, port_usage = SKIP, redundancy_state = SKIP, rx_bytes = SKIP, rx_pkts = SKIP, servp_info = SKIP, tx_bytes = SKIP, tx_pkts = SKIP, up = SKIP, vlan = SKIP, wan_name = SKIP, wan_type = SKIP) ⇒ IfStatProperty

Returns a new instance of IfStatProperty.



130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/mist_api/models/if_stat_property.rb', line 130

def initialize(address_mode = SKIP, ips = SKIP, nat_addresses = SKIP,
               network_name = SKIP, port_id = SKIP, port_usage = SKIP,
               redundancy_state = SKIP, rx_bytes = SKIP, rx_pkts = SKIP,
               servp_info = SKIP, tx_bytes = SKIP, tx_pkts = SKIP,
               up = SKIP, vlan = SKIP, wan_name = SKIP, wan_type = SKIP)
  @address_mode = address_mode unless address_mode == SKIP
  @ips = ips unless ips == SKIP
  @nat_addresses = nat_addresses unless nat_addresses == SKIP
  @network_name = network_name unless network_name == SKIP
  @port_id = port_id unless port_id == SKIP
  @port_usage = port_usage unless port_usage == SKIP
  @redundancy_state = redundancy_state unless redundancy_state == SKIP
  @rx_bytes = rx_bytes unless rx_bytes == SKIP
  @rx_pkts = rx_pkts unless rx_pkts == SKIP
  @servp_info = servp_info unless servp_info == SKIP
  @tx_bytes = tx_bytes unless tx_bytes == SKIP
  @tx_pkts = tx_pkts unless tx_pkts == SKIP
  @up = up unless up == SKIP
  @vlan = vlan unless vlan == SKIP
  @wan_name = wan_name unless wan_name == SKIP
  @wan_type = wan_type unless wan_type == SKIP
end

Instance Attribute Details

#address_modeString

TODO: Write general description for this method

Returns:

  • (String)


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

def address_mode
  @address_mode
end

#ipsArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


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

def ips
  @ips
end

#nat_addressesArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


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

def nat_addresses
  @nat_addresses
end

#network_nameString

TODO: Write general description for this method

Returns:

  • (String)


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

def network_name
  @network_name
end

#port_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def port_id
  @port_id
end

#port_usageString

TODO: Write general description for this method

Returns:

  • (String)


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

def port_usage
  @port_usage
end

#redundancy_stateString

TODO: Write general description for this method

Returns:

  • (String)


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

def redundancy_state
  @redundancy_state
end

#rx_bytesInteger

Amount of traffic received since connection

Returns:

  • (Integer)


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

def rx_bytes
  @rx_bytes
end

#rx_pktsInteger

Amount of packets received since connection

Returns:

  • (Integer)


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

def rx_pkts
  @rx_pkts
end

#servp_infoIfStatPropertyServpInfo

Amount of packets received since connection



50
51
52
# File 'lib/mist_api/models/if_stat_property.rb', line 50

def servp_info
  @servp_info
end

#tx_bytesInteger

Amount of traffic sent since connection

Returns:

  • (Integer)


54
55
56
# File 'lib/mist_api/models/if_stat_property.rb', line 54

def tx_bytes
  @tx_bytes
end

#tx_pktsInteger

Amount of packets sent since connection

Returns:

  • (Integer)


58
59
60
# File 'lib/mist_api/models/if_stat_property.rb', line 58

def tx_pkts
  @tx_pkts
end

#upTrueClass | FalseClass

Amount of packets sent since connection

Returns:

  • (TrueClass | FalseClass)


62
63
64
# File 'lib/mist_api/models/if_stat_property.rb', line 62

def up
  @up
end

#vlanInteger

Amount of packets sent since connection

Returns:

  • (Integer)


66
67
68
# File 'lib/mist_api/models/if_stat_property.rb', line 66

def vlan
  @vlan
end

#wan_nameString

Amount of packets sent since connection

Returns:

  • (String)


70
71
72
# File 'lib/mist_api/models/if_stat_property.rb', line 70

def wan_name
  @wan_name
end

#wan_typeString

Amount of packets sent since connection

Returns:

  • (String)


74
75
76
# File 'lib/mist_api/models/if_stat_property.rb', line 74

def wan_type
  @wan_type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# File 'lib/mist_api/models/if_stat_property.rb', line 154

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  address_mode = hash.key?('address_mode') ? hash['address_mode'] : SKIP
  ips = hash.key?('ips') ? hash['ips'] : SKIP
  nat_addresses = hash.key?('nat_addresses') ? hash['nat_addresses'] : SKIP
  network_name = hash.key?('network_name') ? hash['network_name'] : SKIP
  port_id = hash.key?('port_id') ? hash['port_id'] : SKIP
  port_usage = hash.key?('port_usage') ? hash['port_usage'] : SKIP
  redundancy_state =
    hash.key?('redundancy_state') ? hash['redundancy_state'] : SKIP
  rx_bytes = hash.key?('rx_bytes') ? hash['rx_bytes'] : SKIP
  rx_pkts = hash.key?('rx_pkts') ? hash['rx_pkts'] : SKIP
  servp_info = IfStatPropertyServpInfo.from_hash(hash['servp_info']) if hash['servp_info']
  tx_bytes = hash.key?('tx_bytes') ? hash['tx_bytes'] : SKIP
  tx_pkts = hash.key?('tx_pkts') ? hash['tx_pkts'] : SKIP
  up = hash.key?('up') ? hash['up'] : SKIP
  vlan = hash.key?('vlan') ? hash['vlan'] : SKIP
  wan_name = hash.key?('wan_name') ? hash['wan_name'] : SKIP
  wan_type = hash.key?('wan_type') ? hash['wan_type'] : SKIP

  # Create object from extracted values.
  IfStatProperty.new(address_mode,
                     ips,
                     nat_addresses,
                     network_name,
                     port_id,
                     port_usage,
                     redundancy_state,
                     rx_bytes,
                     rx_pkts,
                     servp_info,
                     tx_bytes,
                     tx_pkts,
                     up,
                     vlan,
                     wan_name,
                     wan_type)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['address_mode'] = 'address_mode'
  @_hash['ips'] = 'ips'
  @_hash['nat_addresses'] = 'nat_addresses'
  @_hash['network_name'] = 'network_name'
  @_hash['port_id'] = 'port_id'
  @_hash['port_usage'] = 'port_usage'
  @_hash['redundancy_state'] = 'redundancy_state'
  @_hash['rx_bytes'] = 'rx_bytes'
  @_hash['rx_pkts'] = 'rx_pkts'
  @_hash['servp_info'] = 'servp_info'
  @_hash['tx_bytes'] = 'tx_bytes'
  @_hash['tx_pkts'] = 'tx_pkts'
  @_hash['up'] = 'up'
  @_hash['vlan'] = 'vlan'
  @_hash['wan_name'] = 'wan_name'
  @_hash['wan_type'] = 'wan_type'
  @_hash
end

.nullablesObject

An array for nullable fields



121
122
123
124
125
126
127
128
# File 'lib/mist_api/models/if_stat_property.rb', line 121

def self.nullables
  %w[
    rx_bytes
    rx_pkts
    tx_bytes
    tx_pkts
  ]
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    address_mode
    ips
    nat_addresses
    network_name
    port_id
    port_usage
    redundancy_state
    rx_bytes
    rx_pkts
    servp_info
    tx_bytes
    tx_pkts
    up
    vlan
    wan_name
    wan_type
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



206
207
208
209
210
211
212
213
214
215
# File 'lib/mist_api/models/if_stat_property.rb', line 206

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} address_mode: #{@address_mode.inspect}, ips: #{@ips.inspect},"\
  " nat_addresses: #{@nat_addresses.inspect}, network_name: #{@network_name.inspect}, port_id:"\
  " #{@port_id.inspect}, port_usage: #{@port_usage.inspect}, redundancy_state:"\
  " #{@redundancy_state.inspect}, rx_bytes: #{@rx_bytes.inspect}, rx_pkts:"\
  " #{@rx_pkts.inspect}, servp_info: #{@servp_info.inspect}, tx_bytes: #{@tx_bytes.inspect},"\
  " tx_pkts: #{@tx_pkts.inspect}, up: #{@up.inspect}, vlan: #{@vlan.inspect}, wan_name:"\
  " #{@wan_name.inspect}, wan_type: #{@wan_type.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



196
197
198
199
200
201
202
203
# File 'lib/mist_api/models/if_stat_property.rb', line 196

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} address_mode: #{@address_mode}, ips: #{@ips}, nat_addresses:"\
  " #{@nat_addresses}, network_name: #{@network_name}, port_id: #{@port_id}, port_usage:"\
  " #{@port_usage}, redundancy_state: #{@redundancy_state}, rx_bytes: #{@rx_bytes}, rx_pkts:"\
  " #{@rx_pkts}, servp_info: #{@servp_info}, tx_bytes: #{@tx_bytes}, tx_pkts: #{@tx_pkts}, up:"\
  " #{@up}, vlan: #{@vlan}, wan_name: #{@wan_name}, wan_type: #{@wan_type}>"
end