Class: MistApi::WanUsages

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

Overview

WanUsages 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(mac = SKIP, path_type = SKIP, path_weight = SKIP, peer_mac = SKIP, peer_port_id = SKIP, policy = SKIP, port_id = SKIP, tenant = SKIP) ⇒ WanUsages

Returns a new instance of WanUsages.



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

def initialize(mac = SKIP, path_type = SKIP, path_weight = SKIP,
               peer_mac = SKIP, peer_port_id = SKIP, policy = SKIP,
               port_id = SKIP, tenant = SKIP)
  @mac = mac unless mac == SKIP
  @path_type = path_type unless path_type == SKIP
  @path_weight = path_weight unless path_weight == SKIP
  @peer_mac = peer_mac unless peer_mac == SKIP
  @peer_port_id = peer_port_id unless peer_port_id == SKIP
  @policy = policy unless policy == SKIP
  @port_id = port_id unless port_id == SKIP
  @tenant = tenant unless tenant == SKIP
end

Instance Attribute Details

#macString

TODO: Write general description for this method

Returns:

  • (String)


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

def mac
  @mac
end

#path_typeString

TODO: Write general description for this method

Returns:

  • (String)


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

def path_type
  @path_type
end

#path_weightInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def path_weight
  @path_weight
end

#peer_macString

TODO: Write general description for this method

Returns:

  • (String)


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

def peer_mac
  @peer_mac
end

#peer_port_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def peer_port_id
  @peer_port_id
end

#policyString

TODO: Write general description for this method

Returns:

  • (String)


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

def policy
  @policy
end

#port_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def port_id
  @port_id
end

#tenantString

TODO: Write general description for this method

Returns:

  • (String)


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

def tenant
  @tenant
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
# File 'lib/mist_api/models/wan_usages.rb', line 91

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  mac = hash.key?('mac') ? hash['mac'] : SKIP
  path_type = hash.key?('path_type') ? hash['path_type'] : SKIP
  path_weight = hash.key?('path_weight') ? hash['path_weight'] : SKIP
  peer_mac = hash.key?('peer_mac') ? hash['peer_mac'] : SKIP
  peer_port_id = hash.key?('peer_port_id') ? hash['peer_port_id'] : SKIP
  policy = hash.key?('policy') ? hash['policy'] : SKIP
  port_id = hash.key?('port_id') ? hash['port_id'] : SKIP
  tenant = hash.key?('tenant') ? hash['tenant'] : SKIP

  # Create object from extracted values.
  WanUsages.new(mac,
                path_type,
                path_weight,
                peer_mac,
                peer_port_id,
                policy,
                port_id,
                tenant)
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/wan_usages.rb', line 45

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['mac'] = 'mac'
  @_hash['path_type'] = 'path_type'
  @_hash['path_weight'] = 'path_weight'
  @_hash['peer_mac'] = 'peer_mac'
  @_hash['peer_port_id'] = 'peer_port_id'
  @_hash['policy'] = 'policy'
  @_hash['port_id'] = 'port_id'
  @_hash['tenant'] = 'tenant'
  @_hash
end

.nullablesObject

An array for nullable fields



73
74
75
# File 'lib/mist_api/models/wan_usages.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/wan_usages.rb', line 59

def self.optionals
  %w[
    mac
    path_type
    path_weight
    peer_mac
    peer_port_id
    policy
    port_id
    tenant
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} mac: #{@mac.inspect}, path_type: #{@path_type.inspect}, path_weight:"\
  " #{@path_weight.inspect}, peer_mac: #{@peer_mac.inspect}, peer_port_id:"\
  " #{@peer_port_id.inspect}, policy: #{@policy.inspect}, port_id: #{@port_id.inspect},"\
  " tenant: #{@tenant.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



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

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} mac: #{@mac}, path_type: #{@path_type}, path_weight: #{@path_weight},"\
  " peer_mac: #{@peer_mac}, peer_port_id: #{@peer_port_id}, policy: #{@policy}, port_id:"\
  " #{@port_id}, tenant: #{@tenant}>"
end