Class: MistApi::ConstTrafficType
- Defined in:
- lib/mist_api/models/const_traffic_type.rb
Overview
ConstTrafficType Model.
Instance Attribute Summary collapse
-
#display ⇒ String
TODO: Write general description for this method.
-
#dscp ⇒ Integer
TODO: Write general description for this method.
-
#failover_policy ⇒ String
TODO: Write general description for this method.
-
#max_jitter ⇒ Integer
TODO: Write general description for this method.
-
#max_latency ⇒ Integer
TODO: Write general description for this method.
-
#max_loss ⇒ Integer
TODO: Write general description for this method.
-
#name ⇒ String
TODO: Write general description for this method.
-
#traffic_class ⇒ String
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(display = SKIP, dscp = SKIP, failover_policy = SKIP, max_jitter = SKIP, max_latency = SKIP, max_loss = SKIP, name = SKIP, traffic_class = SKIP) ⇒ ConstTrafficType
constructor
A new instance of ConstTrafficType.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
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
#display ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/const_traffic_type.rb', line 14 def display @display end |
#dscp ⇒ Integer
TODO: Write general description for this method
18 19 20 |
# File 'lib/mist_api/models/const_traffic_type.rb', line 18 def dscp @dscp end |
#failover_policy ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/mist_api/models/const_traffic_type.rb', line 22 def failover_policy @failover_policy end |
#max_jitter ⇒ Integer
TODO: Write general description for this method
26 27 28 |
# File 'lib/mist_api/models/const_traffic_type.rb', line 26 def max_jitter @max_jitter end |
#max_latency ⇒ Integer
TODO: Write general description for this method
30 31 32 |
# File 'lib/mist_api/models/const_traffic_type.rb', line 30 def max_latency @max_latency end |
#max_loss ⇒ Integer
TODO: Write general description for this method
34 35 36 |
# File 'lib/mist_api/models/const_traffic_type.rb', line 34 def max_loss @max_loss end |
#name ⇒ String
TODO: Write general description for this method
38 39 40 |
# File 'lib/mist_api/models/const_traffic_type.rb', line 38 def name @name end |
#traffic_class ⇒ String
TODO: Write general description for this method
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 |
.names ⇒ Object
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 |
.nullables ⇒ Object
An array for nullable fields
73 74 75 |
# File 'lib/mist_api/models/const_traffic_type.rb', line 73 def self.nullables [] end |
.optionals ⇒ Object
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
#inspect ⇒ Object
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_s ⇒ Object
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 |