Class: MistApi::AutoOrient
- Defined in:
- lib/mist_api/models/auto_orient.rb
Overview
AutoOrient Model.
Instance Attribute Summary collapse
-
#dryrun ⇒ TrueClass | FalseClass
Set to ‘true` to perform an invalid AP check and provide an estimated run time without enqueuing the run into the auto orient service.
-
#force_collection ⇒ TrueClass | FalseClass
If ‘force_collection`==`false`, the API attempts to start auto orientation with existing BLE data.
-
#macs ⇒ Array[String]
List of device macs.
-
#override ⇒ TrueClass | FalseClass
Set to ‘true` to run auto orient even if there are invalid APs in the selected APs.
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(dryrun = SKIP, force_collection = false, macs = SKIP, override = SKIP, additional_properties = nil) ⇒ AutoOrient
constructor
A new instance of AutoOrient.
-
#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(dryrun = SKIP, force_collection = false, macs = SKIP, override = SKIP, additional_properties = nil) ⇒ AutoOrient
Returns a new instance of AutoOrient.
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/mist_api/models/auto_orient.rb', line 58 def initialize(dryrun = SKIP, force_collection = false, macs = SKIP, override = SKIP, additional_properties = nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @dryrun = dryrun unless dryrun == SKIP @force_collection = force_collection unless force_collection == SKIP @macs = macs unless macs == SKIP @override = override unless override == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#dryrun ⇒ TrueClass | FalseClass
Set to ‘true` to perform an invalid AP check and provide an estimated run time without enqueuing the run into the auto orient service.
15 16 17 |
# File 'lib/mist_api/models/auto_orient.rb', line 15 def dryrun @dryrun end |
#force_collection ⇒ TrueClass | FalseClass
If ‘force_collection`==`false`, the API attempts to start auto orientation with existing BLE data. If `force_collection`==`true`, the API attempts to start BLE orchestration.
22 23 24 |
# File 'lib/mist_api/models/auto_orient.rb', line 22 def force_collection @force_collection end |
#macs ⇒ Array[String]
List of device macs
26 27 28 |
# File 'lib/mist_api/models/auto_orient.rb', line 26 def macs @macs end |
#override ⇒ TrueClass | FalseClass
Set to ‘true` to run auto orient even if there are invalid APs in the selected APs.
31 32 33 |
# File 'lib/mist_api/models/auto_orient.rb', line 31 def override @override end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/mist_api/models/auto_orient.rb', line 71 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. dryrun = hash.key?('dryrun') ? hash['dryrun'] : SKIP force_collection = hash['force_collection'] ||= false macs = hash.key?('macs') ? hash['macs'] : SKIP override = hash.key?('override') ? hash['override'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. AutoOrient.new(dryrun, force_collection, macs, override, additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 |
# File 'lib/mist_api/models/auto_orient.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['dryrun'] = 'dryrun' @_hash['force_collection'] = 'force_collection' @_hash['macs'] = 'macs' @_hash['override'] = 'override' @_hash end |
.nullables ⇒ Object
An array for nullable fields
54 55 56 |
# File 'lib/mist_api/models/auto_orient.rb', line 54 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 47 48 49 50 51 |
# File 'lib/mist_api/models/auto_orient.rb', line 44 def self.optionals %w[ dryrun force_collection macs override ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
103 104 105 106 107 108 |
# File 'lib/mist_api/models/auto_orient.rb', line 103 def inspect class_name = self.class.name.split('::').last "<#{class_name} dryrun: #{@dryrun.inspect}, force_collection: #{@force_collection.inspect},"\ " macs: #{@macs.inspect}, override: #{@override.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
96 97 98 99 100 |
# File 'lib/mist_api/models/auto_orient.rb', line 96 def to_s class_name = self.class.name.split('::').last "<#{class_name} dryrun: #{@dryrun}, force_collection: #{@force_collection}, macs: #{@macs},"\ " override: #{@override}, additional_properties: #{@additional_properties}>" end |