Class: MistApi::ConstTrafficType

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

Overview

ConstTrafficType 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(display = SKIP, dscp = SKIP, failover_policy = SKIP, max_jitter = SKIP, max_latency = SKIP, max_loss = SKIP, name = SKIP, traffic_class = SKIP) ⇒ ConstTrafficType

Returns a new instance of ConstTrafficType.



77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/mist_api/models/const_traffic_type.rb', line 77

def initialize(display = SKIP, dscp = SKIP, failover_policy = SKIP,
               max_jitter = SKIP, max_latency = SKIP, max_loss = SKIP,
               name = SKIP, traffic_class = SKIP)
  @display = display unless display == SKIP
  @dscp = dscp unless dscp == SKIP
  @failover_policy = failover_policy unless failover_policy == SKIP
  @max_jitter = max_jitter unless max_jitter == SKIP
  @max_latency = max_latency unless max_latency == SKIP
  @max_loss = max_loss unless max_loss == SKIP
  @name = name unless name == SKIP
  @traffic_class = traffic_class unless traffic_class == SKIP
end

Instance Attribute Details

#displayString

TODO: Write general description for this method

Returns:

  • (String)


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

def display
  @display
end

#dscpInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def dscp
  @dscp
end

#failover_policyString

TODO: Write general description for this method

Returns:

  • (String)


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

def failover_policy
  @failover_policy
end

#max_jitterInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def max_jitter
  @max_jitter
end

#max_latencyInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def max_latency
  @max_latency
end

#max_lossInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def max_loss
  @max_loss
end

#nameString

TODO: Write general description for this method

Returns:

  • (String)


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

def name
  @name
end

#traffic_classString

TODO: Write general description for this method

Returns:

  • (String)


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

def traffic_class
  @traffic_class
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/mist_api/models/const_traffic_type.rb', line 91

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  display = hash.key?('display') ? hash['display'] : SKIP
  dscp = hash.key?('dscp') ? hash['dscp'] : SKIP
  failover_policy =
    hash.key?('failover_policy') ? hash['failover_policy'] : SKIP
  max_jitter = hash.key?('max_jitter') ? hash['max_jitter'] : SKIP
  max_latency = hash.key?('max_latency') ? hash['max_latency'] : SKIP
  max_loss = hash.key?('max_loss') ? hash['max_loss'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  traffic_class = hash.key?('traffic_class') ? hash['traffic_class'] : SKIP

  # Create object from extracted values.
  ConstTrafficType.new(display,
                       dscp,
                       failover_policy,
                       max_jitter,
                       max_latency,
                       max_loss,
                       name,
                       traffic_class)
end

.namesObject

A mapping from model property names to API property names.



45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/mist_api/models/const_traffic_type.rb', line 45

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['display'] = 'display'
  @_hash['dscp'] = 'dscp'
  @_hash['failover_policy'] = 'failover_policy'
  @_hash['max_jitter'] = 'max_jitter'
  @_hash['max_latency'] = 'max_latency'
  @_hash['max_loss'] = 'max_loss'
  @_hash['name'] = 'name'
  @_hash['traffic_class'] = 'traffic_class'
  @_hash
end

.nullablesObject

An array for nullable fields



73
74
75
# File 'lib/mist_api/models/const_traffic_type.rb', line 73

def self.nullables
  []
end

.optionalsObject

An array for optional fields



59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/mist_api/models/const_traffic_type.rb', line 59

def self.optionals
  %w[
    display
    dscp
    failover_policy
    max_jitter
    max_latency
    max_loss
    name
    traffic_class
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} display: #{@display.inspect}, dscp: #{@dscp.inspect}, failover_policy:"\
  " #{@failover_policy.inspect}, max_jitter: #{@max_jitter.inspect}, max_latency:"\
  " #{@max_latency.inspect}, max_loss: #{@max_loss.inspect}, name: #{@name.inspect},"\
  " traffic_class: #{@traffic_class.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



117
118
119
120
121
122
# File 'lib/mist_api/models/const_traffic_type.rb', line 117

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} display: #{@display}, dscp: #{@dscp}, failover_policy: #{@failover_policy},"\
  " max_jitter: #{@max_jitter}, max_latency: #{@max_latency}, max_loss: #{@max_loss}, name:"\
  " #{@name}, traffic_class: #{@traffic_class}>"
end