Class: MistApi::ResponseZoneSearchItem

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

Overview

ResponseZoneSearchItem 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(enter = SKIP, scope = SKIP, timestamp = SKIP, user = SKIP) ⇒ ResponseZoneSearchItem

Returns a new instance of ResponseZoneSearchItem.



53
54
55
56
57
58
# File 'lib/mist_api/models/response_zone_search_item.rb', line 53

def initialize(enter = SKIP, scope = SKIP, timestamp = SKIP, user = SKIP)
  @enter = enter unless enter == SKIP
  @scope = scope unless scope == SKIP
  @timestamp = timestamp unless timestamp == SKIP
  @user = user unless user == SKIP
end

Instance Attribute Details

#enterInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def enter
  @enter
end

#scopeString

TODO: Write general description for this method

Returns:

  • (String)


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

def scope
  @scope
end

#timestampFloat

Epoch (seconds)

Returns:

  • (Float)


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

def timestamp
  @timestamp
end

#userString

Epoch (seconds)

Returns:

  • (String)


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

def user
  @user
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/mist_api/models/response_zone_search_item.rb', line 61

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  enter = hash.key?('enter') ? hash['enter'] : SKIP
  scope = hash.key?('scope') ? hash['scope'] : SKIP
  timestamp = hash.key?('timestamp') ? hash['timestamp'] : SKIP
  user = hash.key?('user') ? hash['user'] : SKIP

  # Create object from extracted values.
  ResponseZoneSearchItem.new(enter,
                             scope,
                             timestamp,
                             user)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
36
# File 'lib/mist_api/models/response_zone_search_item.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['enter'] = 'enter'
  @_hash['scope'] = 'scope'
  @_hash['timestamp'] = 'timestamp'
  @_hash['user'] = 'user'
  @_hash
end

.nullablesObject

An array for nullable fields



49
50
51
# File 'lib/mist_api/models/response_zone_search_item.rb', line 49

def self.nullables
  []
end

.optionalsObject

An array for optional fields



39
40
41
42
43
44
45
46
# File 'lib/mist_api/models/response_zone_search_item.rb', line 39

def self.optionals
  %w[
    enter
    scope
    timestamp
    user
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



85
86
87
88
89
# File 'lib/mist_api/models/response_zone_search_item.rb', line 85

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} enter: #{@enter.inspect}, scope: #{@scope.inspect}, timestamp:"\
  " #{@timestamp.inspect}, user: #{@user.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



78
79
80
81
82
# File 'lib/mist_api/models/response_zone_search_item.rb', line 78

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} enter: #{@enter}, scope: #{@scope}, timestamp: #{@timestamp}, user:"\
  " #{@user}>"
end