Class: MistApi::ResponseOrgDevicesSummary

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

Overview

ResponseOrgDevicesSummary 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(num_aps = SKIP, num_gateways = SKIP, num_mxedges = SKIP, num_switches = SKIP, num_unassigned_aps = SKIP, num_unassigned_gateways = SKIP, num_unassigned_switches = SKIP) ⇒ ResponseOrgDevicesSummary

Returns a new instance of ResponseOrgDevicesSummary.



71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/mist_api/models/response_org_devices_summary.rb', line 71

def initialize(num_aps = SKIP, num_gateways = SKIP, num_mxedges = SKIP,
               num_switches = SKIP, num_unassigned_aps = SKIP,
               num_unassigned_gateways = SKIP,
               num_unassigned_switches = SKIP)
  @num_aps = num_aps unless num_aps == SKIP
  @num_gateways = num_gateways unless num_gateways == SKIP
  @num_mxedges = num_mxedges unless num_mxedges == SKIP
  @num_switches = num_switches unless num_switches == SKIP
  @num_unassigned_aps = num_unassigned_aps unless num_unassigned_aps == SKIP
  @num_unassigned_gateways = num_unassigned_gateways unless num_unassigned_gateways == SKIP
  @num_unassigned_switches = num_unassigned_switches unless num_unassigned_switches == SKIP
end

Instance Attribute Details

#num_apsInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def num_aps
  @num_aps
end

#num_gatewaysInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def num_gateways
  @num_gateways
end

#num_mxedgesInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def num_mxedges
  @num_mxedges
end

#num_switchesInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def num_switches
  @num_switches
end

#num_unassigned_apsInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def num_unassigned_aps
  @num_unassigned_aps
end

#num_unassigned_gatewaysInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def num_unassigned_gateways
  @num_unassigned_gateways
end

#num_unassigned_switchesInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def num_unassigned_switches
  @num_unassigned_switches
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/mist_api/models/response_org_devices_summary.rb', line 85

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  num_aps = hash.key?('num_aps') ? hash['num_aps'] : SKIP
  num_gateways = hash.key?('num_gateways') ? hash['num_gateways'] : SKIP
  num_mxedges = hash.key?('num_mxedges') ? hash['num_mxedges'] : SKIP
  num_switches = hash.key?('num_switches') ? hash['num_switches'] : SKIP
  num_unassigned_aps =
    hash.key?('num_unassigned_aps') ? hash['num_unassigned_aps'] : SKIP
  num_unassigned_gateways =
    hash.key?('num_unassigned_gateways') ? hash['num_unassigned_gateways'] : SKIP
  num_unassigned_switches =
    hash.key?('num_unassigned_switches') ? hash['num_unassigned_switches'] : SKIP

  # Create object from extracted values.
  ResponseOrgDevicesSummary.new(num_aps,
                                num_gateways,
                                num_mxedges,
                                num_switches,
                                num_unassigned_aps,
                                num_unassigned_gateways,
                                num_unassigned_switches)
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/mist_api/models/response_org_devices_summary.rb', line 41

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['num_aps'] = 'num_aps'
  @_hash['num_gateways'] = 'num_gateways'
  @_hash['num_mxedges'] = 'num_mxedges'
  @_hash['num_switches'] = 'num_switches'
  @_hash['num_unassigned_aps'] = 'num_unassigned_aps'
  @_hash['num_unassigned_gateways'] = 'num_unassigned_gateways'
  @_hash['num_unassigned_switches'] = 'num_unassigned_switches'
  @_hash
end

.nullablesObject

An array for nullable fields



67
68
69
# File 'lib/mist_api/models/response_org_devices_summary.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/mist_api/models/response_org_devices_summary.rb', line 54

def self.optionals
  %w[
    num_aps
    num_gateways
    num_mxedges
    num_switches
    num_unassigned_aps
    num_unassigned_gateways
    num_unassigned_switches
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



120
121
122
123
124
125
126
127
# File 'lib/mist_api/models/response_org_devices_summary.rb', line 120

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} num_aps: #{@num_aps.inspect}, num_gateways: #{@num_gateways.inspect},"\
  " num_mxedges: #{@num_mxedges.inspect}, num_switches: #{@num_switches.inspect},"\
  " num_unassigned_aps: #{@num_unassigned_aps.inspect}, num_unassigned_gateways:"\
  " #{@num_unassigned_gateways.inspect}, num_unassigned_switches:"\
  " #{@num_unassigned_switches.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



111
112
113
114
115
116
117
# File 'lib/mist_api/models/response_org_devices_summary.rb', line 111

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} num_aps: #{@num_aps}, num_gateways: #{@num_gateways}, num_mxedges:"\
  " #{@num_mxedges}, num_switches: #{@num_switches}, num_unassigned_aps:"\
  " #{@num_unassigned_aps}, num_unassigned_gateways: #{@num_unassigned_gateways},"\
  " num_unassigned_switches: #{@num_unassigned_switches}>"
end