Class: MistApi::AppProbing
- Defined in:
- lib/mist_api/models/app_probing.rb
Overview
AppProbing Model.
Instance Attribute Summary collapse
-
#apps ⇒ Array[String]
APp-keys from [List Applications]($e/Constants%20Definitions/listApplications).
-
#custom_apps ⇒ Array[AppProbingCustomApp]
APp-keys from [List Applications]($e/Constants%20Definitions/listApplications).
-
#enabled ⇒ TrueClass | FalseClass
APp-keys from [List Applications]($e/Constants%20Definitions/listApplications).
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(apps = SKIP, custom_apps = SKIP, enabled = SKIP) ⇒ AppProbing
constructor
A new instance of AppProbing.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(apps = SKIP, custom_apps = SKIP, enabled = SKIP) ⇒ AppProbing
Returns a new instance of AppProbing.
50 51 52 53 54 |
# File 'lib/mist_api/models/app_probing.rb', line 50 def initialize(apps = SKIP, custom_apps = SKIP, enabled = SKIP) @apps = apps unless apps == SKIP @custom_apps = custom_apps unless custom_apps == SKIP @enabled = enabled unless enabled == SKIP end |
Instance Attribute Details
#apps ⇒ Array[String]
APp-keys from [List Applications]($e/Constants%20Definitions/listApplications)
15 16 17 |
# File 'lib/mist_api/models/app_probing.rb', line 15 def apps @apps end |
#custom_apps ⇒ Array[AppProbingCustomApp]
APp-keys from [List Applications]($e/Constants%20Definitions/listApplications)
20 21 22 |
# File 'lib/mist_api/models/app_probing.rb', line 20 def custom_apps @custom_apps end |
#enabled ⇒ TrueClass | FalseClass
APp-keys from [List Applications]($e/Constants%20Definitions/listApplications)
25 26 27 |
# File 'lib/mist_api/models/app_probing.rb', line 25 def enabled @enabled end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/mist_api/models/app_probing.rb', line 57 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. apps = hash.key?('apps') ? hash['apps'] : SKIP # Parameter is an array, so we need to iterate through it custom_apps = nil unless hash['custom_apps'].nil? custom_apps = [] hash['custom_apps'].each do |structure| custom_apps << (AppProbingCustomApp.from_hash(structure) if structure) end end custom_apps = SKIP unless hash.key?('custom_apps') enabled = hash.key?('enabled') ? hash['enabled'] : SKIP # Create object from extracted values. AppProbing.new(apps, custom_apps, enabled) end |
.names ⇒ Object
A mapping from model property names to API property names.
28 29 30 31 32 33 34 |
# File 'lib/mist_api/models/app_probing.rb', line 28 def self.names @_hash = {} if @_hash.nil? @_hash['apps'] = 'apps' @_hash['custom_apps'] = 'custom_apps' @_hash['enabled'] = 'enabled' @_hash end |
.nullables ⇒ Object
An array for nullable fields
46 47 48 |
# File 'lib/mist_api/models/app_probing.rb', line 46 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
37 38 39 40 41 42 43 |
# File 'lib/mist_api/models/app_probing.rb', line 37 def self.optionals %w[ apps custom_apps enabled ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
87 88 89 90 91 |
# File 'lib/mist_api/models/app_probing.rb', line 87 def inspect class_name = self.class.name.split('::').last "<#{class_name} apps: #{@apps.inspect}, custom_apps: #{@custom_apps.inspect}, enabled:"\ " #{@enabled.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
81 82 83 84 |
# File 'lib/mist_api/models/app_probing.rb', line 81 def to_s class_name = self.class.name.split('::').last "<#{class_name} apps: #{@apps}, custom_apps: #{@custom_apps}, enabled: #{@enabled}>" end |