Class: MistApi::GwRoutingPolicyTermMatchingVpnPathSla

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

Overview

GwRoutingPolicyTermMatchingVpnPathSla 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(max_jitter = SKIP, max_latency = SKIP, max_loss = SKIP) ⇒ GwRoutingPolicyTermMatchingVpnPathSla

Returns a new instance of GwRoutingPolicyTermMatchingVpnPathSla.



51
52
53
54
55
# File 'lib/mist_api/models/gw_routing_policy_term_matching_vpn_path_sla.rb', line 51

def initialize(max_jitter = SKIP, max_latency = SKIP, max_loss = 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
end

Instance Attribute Details

#max_jitterInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def max_jitter
  @max_jitter
end

#max_latencyInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def max_latency
  @max_latency
end

#max_lossInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def max_loss
  @max_loss
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  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

  # Create object from extracted values.
  GwRoutingPolicyTermMatchingVpnPathSla.new(max_jitter,
                                            max_latency,
                                            max_loss)
end

.namesObject

A mapping from model property names to API property names.



25
26
27
28
29
30
31
# File 'lib/mist_api/models/gw_routing_policy_term_matching_vpn_path_sla.rb', line 25

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['max_jitter'] = 'max_jitter'
  @_hash['max_latency'] = 'max_latency'
  @_hash['max_loss'] = 'max_loss'
  @_hash
end

.nullablesObject

An array for nullable fields



43
44
45
46
47
48
49
# File 'lib/mist_api/models/gw_routing_policy_term_matching_vpn_path_sla.rb', line 43

def self.nullables
  %w[
    max_jitter
    max_latency
    max_loss
  ]
end

.optionalsObject

An array for optional fields



34
35
36
37
38
39
40
# File 'lib/mist_api/models/gw_routing_policy_term_matching_vpn_path_sla.rb', line 34

def self.optionals
  %w[
    max_jitter
    max_latency
    max_loss
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



74
75
76
77
78
79
80
# File 'lib/mist_api/models/gw_routing_policy_term_matching_vpn_path_sla.rb', line 74

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



90
91
92
93
94
# File 'lib/mist_api/models/gw_routing_policy_term_matching_vpn_path_sla.rb', line 90

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

#to_sObject

Provides a human-readable string representation of the object.



83
84
85
86
87
# File 'lib/mist_api/models/gw_routing_policy_term_matching_vpn_path_sla.rb', line 83

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