Class: MistApi::RouteSummaryStats

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

Overview

RouteSummaryStats 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(fib_routes = SKIP, max_unicast_routes_supported = SKIP, rib_routes = SKIP, total_routes = SKIP) ⇒ RouteSummaryStats

Returns a new instance of RouteSummaryStats.



53
54
55
56
57
58
59
60
61
62
# File 'lib/mist_api/models/route_summary_stats.rb', line 53

def initialize(fib_routes = SKIP, max_unicast_routes_supported = SKIP,
               rib_routes = SKIP, total_routes = SKIP)
  @fib_routes = fib_routes unless fib_routes == SKIP
  unless max_unicast_routes_supported == SKIP
    @max_unicast_routes_supported =
      max_unicast_routes_supported
  end
  @rib_routes = rib_routes unless rib_routes == SKIP
  @total_routes = total_routes unless total_routes == SKIP
end

Instance Attribute Details

#fib_routesInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def fib_routes
  @fib_routes
end

#max_unicast_routes_supportedInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def max_unicast_routes_supported
  @max_unicast_routes_supported
end

#rib_routesInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def rib_routes
  @rib_routes
end

#total_routesInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def total_routes
  @total_routes
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/mist_api/models/route_summary_stats.rb', line 65

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  fib_routes = hash.key?('fib_routes') ? hash['fib_routes'] : SKIP
  max_unicast_routes_supported =
    hash.key?('max_unicast_routes_supported') ? hash['max_unicast_routes_supported'] : SKIP
  rib_routes = hash.key?('rib_routes') ? hash['rib_routes'] : SKIP
  total_routes = hash.key?('total_routes') ? hash['total_routes'] : SKIP

  # Create object from extracted values.
  RouteSummaryStats.new(fib_routes,
                        max_unicast_routes_supported,
                        rib_routes,
                        total_routes)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
36
# File 'lib/mist_api/models/route_summary_stats.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['fib_routes'] = 'fib_routes'
  @_hash['max_unicast_routes_supported'] = 'max_unicast_routes_supported'
  @_hash['rib_routes'] = 'rib_routes'
  @_hash['total_routes'] = 'total_routes'
  @_hash
end

.nullablesObject

An array for nullable fields



49
50
51
# File 'lib/mist_api/models/route_summary_stats.rb', line 49

def self.nullables
  []
end

.optionalsObject

An array for optional fields



39
40
41
42
43
44
45
46
# File 'lib/mist_api/models/route_summary_stats.rb', line 39

def self.optionals
  %w[
    fib_routes
    max_unicast_routes_supported
    rib_routes
    total_routes
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



91
92
93
94
95
96
# File 'lib/mist_api/models/route_summary_stats.rb', line 91

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} fib_routes: #{@fib_routes.inspect}, max_unicast_routes_supported:"\
  " #{@max_unicast_routes_supported.inspect}, rib_routes: #{@rib_routes.inspect},"\
  " total_routes: #{@total_routes.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



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

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} fib_routes: #{@fib_routes}, max_unicast_routes_supported:"\
  " #{@max_unicast_routes_supported}, rib_routes: #{@rib_routes}, total_routes:"\
  " #{@total_routes}>"
end