Class: UntitledApi::ApiV1ConstTrafficTypesResponse1

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/untitled_api/models/api_v1_const_traffic_types_response1.rb

Overview

ApiV1ConstTrafficTypesResponse1 Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(name = SKIP, display = SKIP, failover_policy = SKIP, max_loss = SKIP, max_latency = SKIP, traffic_class = SKIP, dscp = SKIP) ⇒ ApiV1ConstTrafficTypesResponse1

Returns a new instance of ApiV1ConstTrafficTypesResponse1.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/untitled_api/models/api_v1_const_traffic_types_response1.rb', line 71

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

Instance Attribute Details

#displayString

TODO: Write general description for this method

Returns:

  • (String)


18
19
20
# File 'lib/untitled_api/models/api_v1_const_traffic_types_response1.rb', line 18

def display
  @display
end

#dscpFloat

TODO: Write general description for this method

Returns:

  • (Float)


38
39
40
# File 'lib/untitled_api/models/api_v1_const_traffic_types_response1.rb', line 38

def dscp
  @dscp
end

#failover_policyString

TODO: Write general description for this method

Returns:

  • (String)


22
23
24
# File 'lib/untitled_api/models/api_v1_const_traffic_types_response1.rb', line 22

def failover_policy
  @failover_policy
end

#max_latencyFloat

TODO: Write general description for this method

Returns:

  • (Float)


30
31
32
# File 'lib/untitled_api/models/api_v1_const_traffic_types_response1.rb', line 30

def max_latency
  @max_latency
end

#max_lossFloat

TODO: Write general description for this method

Returns:

  • (Float)


26
27
28
# File 'lib/untitled_api/models/api_v1_const_traffic_types_response1.rb', line 26

def max_loss
  @max_loss
end

#nameString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/untitled_api/models/api_v1_const_traffic_types_response1.rb', line 14

def name
  @name
end

#traffic_classString

TODO: Write general description for this method

Returns:

  • (String)


34
35
36
# File 'lib/untitled_api/models/api_v1_const_traffic_types_response1.rb', line 34

def traffic_class
  @traffic_class
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/untitled_api/models/api_v1_const_traffic_types_response1.rb', line 88

def self.from_hash(hash)
  return nil unless hash

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

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

.namesObject

A mapping from model property names to API property names.



41
42
43
44
45
46
47
48
49
50
51
# File 'lib/untitled_api/models/api_v1_const_traffic_types_response1.rb', line 41

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

.nullablesObject

An array for nullable fields



67
68
69
# File 'lib/untitled_api/models/api_v1_const_traffic_types_response1.rb', line 67

def self.nullables
  []
end

.optionalsObject

An array for optional fields



54
55
56
57
58
59
60
61
62
63
64
# File 'lib/untitled_api/models/api_v1_const_traffic_types_response1.rb', line 54

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