Class: MistApi::WebhookLocationSdkEvent

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

Overview

WebhookLocationSdkEvent 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(id = SKIP, map_id = SKIP, name = SKIP, site_id = SKIP, timestamp = SKIP, type = 'sdk', x = SKIP, y = SKIP) ⇒ WebhookLocationSdkEvent

Returns a new instance of WebhookLocationSdkEvent.



77
78
79
80
81
82
83
84
85
86
87
# File 'lib/mist_api/models/webhook_location_sdk_event.rb', line 77

def initialize(id = SKIP, map_id = SKIP, name = SKIP, site_id = SKIP,
               timestamp = SKIP, type = 'sdk', x = SKIP, y = SKIP)
  @id = id unless id == SKIP
  @map_id = map_id unless map_id == SKIP
  @name = name unless name == SKIP
  @site_id = site_id unless site_id == SKIP
  @timestamp = timestamp unless timestamp == SKIP
  @type = type unless type == SKIP
  @x = x unless x == SKIP
  @y = y unless y == SKIP
end

Instance Attribute Details

#idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


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

def id
  @id
end

#map_idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


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

def map_id
  @map_id
end

#nameString

Unique ID of the object instance in the Mist Organization

Returns:

  • (String)


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

def name
  @name
end

#site_idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


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

def site_id
  @site_id
end

#timestampFloat

Epoch (seconds)

Returns:

  • (Float)


30
31
32
# File 'lib/mist_api/models/webhook_location_sdk_event.rb', line 30

def timestamp
  @timestamp
end

#typeString

Epoch (seconds)

Returns:

  • (String)


34
35
36
# File 'lib/mist_api/models/webhook_location_sdk_event.rb', line 34

def type
  @type
end

#xFloat

x, in meter

Returns:

  • (Float)


38
39
40
# File 'lib/mist_api/models/webhook_location_sdk_event.rb', line 38

def x
  @x
end

#yFloat

y, in meter

Returns:

  • (Float)


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

def y
  @y
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/mist_api/models/webhook_location_sdk_event.rb', line 90

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : SKIP
  map_id = hash.key?('map_id') ? hash['map_id'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
  timestamp = hash.key?('timestamp') ? hash['timestamp'] : SKIP
  type = hash['type'] ||= 'sdk'
  x = hash.key?('x') ? hash['x'] : SKIP
  y = hash.key?('y') ? hash['y'] : SKIP

  # Create object from extracted values.
  WebhookLocationSdkEvent.new(id,
                              map_id,
                              name,
                              site_id,
                              timestamp,
                              type,
                              x,
                              y)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['map_id'] = 'map_id'
  @_hash['name'] = 'name'
  @_hash['site_id'] = 'site_id'
  @_hash['timestamp'] = 'timestamp'
  @_hash['type'] = 'type'
  @_hash['x'] = 'x'
  @_hash['y'] = 'y'
  @_hash
end

.nullablesObject

An array for nullable fields



73
74
75
# File 'lib/mist_api/models/webhook_location_sdk_event.rb', line 73

def self.nullables
  []
end

.optionalsObject

An array for optional fields



59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/mist_api/models/webhook_location_sdk_event.rb', line 59

def self.optionals
  %w[
    id
    map_id
    name
    site_id
    timestamp
    type
    x
    y
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



116
117
118
119
120
121
122
# File 'lib/mist_api/models/webhook_location_sdk_event.rb', line 116

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



132
133
134
135
136
137
# File 'lib/mist_api/models/webhook_location_sdk_event.rb', line 132

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id.inspect}, map_id: #{@map_id.inspect}, name: #{@name.inspect},"\
  " site_id: #{@site_id.inspect}, timestamp: #{@timestamp.inspect}, type: #{@type.inspect}, x:"\
  " #{@x.inspect}, y: #{@y.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



125
126
127
128
129
# File 'lib/mist_api/models/webhook_location_sdk_event.rb', line 125

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id}, map_id: #{@map_id}, name: #{@name}, site_id: #{@site_id},"\
  " timestamp: #{@timestamp}, type: #{@type}, x: #{@x}, y: #{@y}>"
end