Class: MistApi::LicenseUsageOrg

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

Overview

LicenseUsageOrg 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_devices = nil, site_id = nil, usages = nil, for_site = SKIP, fully_loaded = SKIP, summary = SKIP) ⇒ LicenseUsageOrg

Returns a new instance of LicenseUsageOrg.



70
71
72
73
74
75
76
77
78
# File 'lib/mist_api/models/license_usage_org.rb', line 70

def initialize(num_devices = nil, site_id = nil, usages = nil,
               for_site = SKIP, fully_loaded = SKIP, summary = SKIP)
  @for_site = for_site unless for_site == SKIP
  @fully_loaded = fully_loaded unless fully_loaded == SKIP
  @num_devices = num_devices
  @site_id = site_id
  @summary = summary unless summary == SKIP
  @usages = usages
end

Instance Attribute Details

#for_siteTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def for_site
  @for_site
end

#fully_loadedHash[String, Integer]

Maximum number of licenses that may be required if the service is enabled on all the Organization Devices. Property key is the service name (e.g. “SUB-MAN”).

Returns:

  • (Hash[String, Integer])


20
21
22
# File 'lib/mist_api/models/license_usage_org.rb', line 20

def fully_loaded
  @fully_loaded
end

#num_devicesInteger

Maximum number of licenses that may be required if the service is enabled on all the Organization Devices. Property key is the service name (e.g. “SUB-MAN”).

Returns:

  • (Integer)


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

def num_devices
  @num_devices
end

#site_idUUID | String

Maximum number of licenses that may be required if the service is enabled on all the Organization Devices. Property key is the service name (e.g. “SUB-MAN”).

Returns:

  • (UUID | String)


32
33
34
# File 'lib/mist_api/models/license_usage_org.rb', line 32

def site_id
  @site_id
end

#summaryHash[String, Integer]

Number of licenses currently consumed. Property key is license type (e.g. SUB-MAN).

Returns:

  • (Hash[String, Integer])


37
38
39
# File 'lib/mist_api/models/license_usage_org.rb', line 37

def summary
  @summary
end

#usagesHash[String, Integer]

Number of available licenes. Property key is the service name (e.g. “SUB-MAN”). name (e.g. “SUB-MAN”)

Returns:

  • (Hash[String, Integer])


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

def usages
  @usages
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/mist_api/models/license_usage_org.rb', line 81

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  num_devices = hash.key?('num_devices') ? hash['num_devices'] : nil
  site_id = hash.key?('site_id') ? hash['site_id'] : nil
  usages = hash.key?('usages') ? hash['usages'] : nil
  for_site = hash.key?('for_site') ? hash['for_site'] : SKIP
  fully_loaded = hash.key?('fully_loaded') ? hash['fully_loaded'] : SKIP
  summary = hash.key?('summary') ? hash['summary'] : SKIP

  # Create object from extracted values.
  LicenseUsageOrg.new(num_devices,
                      site_id,
                      usages,
                      for_site,
                      fully_loaded,
                      summary)
end

.namesObject

A mapping from model property names to API property names.



45
46
47
48
49
50
51
52
53
54
# File 'lib/mist_api/models/license_usage_org.rb', line 45

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['for_site'] = 'for_site'
  @_hash['fully_loaded'] = 'fully_loaded'
  @_hash['num_devices'] = 'num_devices'
  @_hash['site_id'] = 'site_id'
  @_hash['summary'] = 'summary'
  @_hash['usages'] = 'usages'
  @_hash
end

.nullablesObject

An array for nullable fields



66
67
68
# File 'lib/mist_api/models/license_usage_org.rb', line 66

def self.nullables
  []
end

.optionalsObject

An array for optional fields



57
58
59
60
61
62
63
# File 'lib/mist_api/models/license_usage_org.rb', line 57

def self.optionals
  %w[
    for_site
    fully_loaded
    summary
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



109
110
111
112
113
114
# File 'lib/mist_api/models/license_usage_org.rb', line 109

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} for_site: #{@for_site.inspect}, fully_loaded: #{@fully_loaded.inspect},"\
  " num_devices: #{@num_devices.inspect}, site_id: #{@site_id.inspect}, summary:"\
  " #{@summary.inspect}, usages: #{@usages.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



102
103
104
105
106
# File 'lib/mist_api/models/license_usage_org.rb', line 102

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} for_site: #{@for_site}, fully_loaded: #{@fully_loaded}, num_devices:"\
  " #{@num_devices}, site_id: #{@site_id}, summary: #{@summary}, usages: #{@usages}>"
end