Class: MistApi::ResponseAutoZone
- Defined in:
- lib/mist_api/models/response_auto_zone.rb
Overview
ResponseAutoZone Model.
Instance Attribute Summary collapse
-
#status ⇒ ResponseAutoZoneStatusEnum
The status for the auto zones service for a given map.
-
#zones ⇒ Array[ResponseAutoZoneZone]
The status for the auto zones service for a given map.
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(status = SKIP, zones = SKIP) ⇒ ResponseAutoZone
constructor
A new instance of ResponseAutoZone.
-
#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(status = SKIP, zones = SKIP) ⇒ ResponseAutoZone
Returns a new instance of ResponseAutoZone.
53 54 55 56 |
# File 'lib/mist_api/models/response_auto_zone.rb', line 53 def initialize(status = SKIP, zones = SKIP) @status = status unless status == SKIP @zones = zones unless zones == SKIP end |
Instance Attribute Details
#status ⇒ ResponseAutoZoneStatusEnum
The status for the auto zones service for a given map. enum:
* not_started: The auto zones service has not been run on this map or
the results were cleared by the user
* in_progress: The auto zones service is currently in progress
* awaiting_review: The auto zones service has completed and suggested
location zones to be added to the map
* error: There was an error with the auto zones service
20 21 22 |
# File 'lib/mist_api/models/response_auto_zone.rb', line 20 def status @status end |
#zones ⇒ Array[ResponseAutoZoneZone]
The status for the auto zones service for a given map. enum:
* not_started: The auto zones service has not been run on this map or
the results were cleared by the user
* in_progress: The auto zones service is currently in progress
* awaiting_review: The auto zones service has completed and suggested
location zones to be added to the map
* error: There was an error with the auto zones service
30 31 32 |
# File 'lib/mist_api/models/response_auto_zone.rb', line 30 def zones @zones end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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/response_auto_zone.rb', line 59 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. status = hash.key?('status') ? hash['status'] : SKIP # Parameter is an array, so we need to iterate through it zones = nil unless hash['zones'].nil? zones = [] hash['zones'].each do |structure| zones << (ResponseAutoZoneZone.from_hash(structure) if structure) end end zones = SKIP unless hash.key?('zones') # Create object from extracted values. ResponseAutoZone.new(status, zones) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 |
# File 'lib/mist_api/models/response_auto_zone.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['status'] = 'status' @_hash['zones'] = 'zones' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/mist_api/models/response_auto_zone.rb', line 49 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
41 42 43 44 45 46 |
# File 'lib/mist_api/models/response_auto_zone.rb', line 41 def self.optionals %w[ status zones ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
87 88 89 90 |
# File 'lib/mist_api/models/response_auto_zone.rb', line 87 def inspect class_name = self.class.name.split('::').last "<#{class_name} status: #{@status.inspect}, zones: #{@zones.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
81 82 83 84 |
# File 'lib/mist_api/models/response_auto_zone.rb', line 81 def to_s class_name = self.class.name.split('::').last "<#{class_name} status: #{@status}, zones: #{@zones}>" end |