Class: Verizon::SearchDeviceResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/verizon/models/search_device_response.rb

Overview

A success response includes an array of all matching events. Each event includes the full event resource definition.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(action = SKIP, createdon = SKIP, deviceid = SKIP, fields = SKIP, id = SKIP, kind = SKIP, lastupdated = SKIP, name = SKIP, state = SKIP, tagids = SKIP, transactionid = SKIP, version = SKIP, versionid = SKIP) ⇒ SearchDeviceResponse

Returns a new instance of SearchDeviceResponse.



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/verizon/models/search_device_response.rb', line 110

def initialize(action = SKIP,
               createdon = SKIP,
               deviceid = SKIP,
               fields = SKIP,
               id = SKIP,
               kind = SKIP,
               lastupdated = SKIP,
               name = SKIP,
               state = SKIP,
               tagids = SKIP,
               transactionid = SKIP,
               version = SKIP,
               versionid = SKIP)
  @action = action unless action == SKIP
  @createdon = createdon unless createdon == SKIP
  @deviceid = deviceid unless deviceid == SKIP
  @fields = fields unless fields == SKIP
  @id = id unless id == SKIP
  @kind = kind unless kind == SKIP
  @lastupdated = lastupdated unless lastupdated == SKIP
  @name = name unless name == SKIP
  @state = state unless state == SKIP
  @tagids = tagids unless tagids == SKIP
  @transactionid = transactionid unless transactionid == SKIP
  @version = version unless version == SKIP
  @versionid = versionid unless versionid == SKIP
end

Instance Attribute Details

#actionString

The action requested in this event; “change” for device configuration changes.

Returns:

  • (String)


16
17
18
# File 'lib/verizon/models/search_device_response.rb', line 16

def action
  @action
end

#createdonString

The date and time of the change request.

Returns:

  • (String)


20
21
22
# File 'lib/verizon/models/search_device_response.rb', line 20

def createdon
  @createdon
end

#deviceidString

The device’s ThingSpace UUID.

Returns:

  • (String)


24
25
26
# File 'lib/verizon/models/search_device_response.rb', line 24

def deviceid
  @deviceid
end

#fieldsFields2

List of fields affected by the event.

Returns:



28
29
30
# File 'lib/verizon/models/search_device_response.rb', line 28

def fields
  @fields
end

#idString

The unique ID of this ts.event.configuration event.

Returns:

  • (String)


32
33
34
# File 'lib/verizon/models/search_device_response.rb', line 32

def id
  @id
end

#kindString

The kind of the ThingSpace resource that is being reported; “ts.event.configuration” for device configuration changes.

Returns:

  • (String)


37
38
39
# File 'lib/verizon/models/search_device_response.rb', line 37

def kind
  @kind
end

#lastupdatedString

The date and time that the event was last updated.

Returns:

  • (String)


41
42
43
# File 'lib/verizon/models/search_device_response.rb', line 41

def lastupdated
  @lastupdated
end

#nameString

The name of the event

Returns:

  • (String)


45
46
47
# File 'lib/verizon/models/search_device_response.rb', line 45

def name
  @name
end

#stateString

The current status of the request.

Returns:

  • (String)


49
50
51
# File 'lib/verizon/models/search_device_response.rb', line 49

def state
  @state
end

#tagidsArray[String]

UUIDs of tag resources that are applied to this device.

Returns:

  • (Array[String])


53
54
55
# File 'lib/verizon/models/search_device_response.rb', line 53

def tagids
  @tagids
end

#transactionidString

transaction id

Returns:

  • (String)


57
58
59
# File 'lib/verizon/models/search_device_response.rb', line 57

def transactionid
  @transactionid
end

#versionString

The version of the resource.

Returns:

  • (String)


61
62
63
# File 'lib/verizon/models/search_device_response.rb', line 61

def version
  @version
end

#versionidString

The version of the resource.

Returns:

  • (String)


65
66
67
# File 'lib/verizon/models/search_device_response.rb', line 65

def versionid
  @versionid
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/verizon/models/search_device_response.rb', line 139

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  action = hash.key?('action') ? hash['action'] : SKIP
  createdon = hash.key?('createdon') ? hash['createdon'] : SKIP
  deviceid = hash.key?('deviceid') ? hash['deviceid'] : SKIP
  fields = Fields2.from_hash(hash['fields']) if hash['fields']
  id = hash.key?('id') ? hash['id'] : SKIP
  kind = hash.key?('kind') ? hash['kind'] : SKIP
  lastupdated = hash.key?('lastupdated') ? hash['lastupdated'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  state = hash.key?('state') ? hash['state'] : SKIP
  tagids = hash.key?('tagids') ? hash['tagids'] : SKIP
  transactionid = hash.key?('transactionid') ? hash['transactionid'] : SKIP
  version = hash.key?('version') ? hash['version'] : SKIP
  versionid = hash.key?('versionid') ? hash['versionid'] : SKIP

  # Create object from extracted values.
  SearchDeviceResponse.new(action,
                           createdon,
                           deviceid,
                           fields,
                           id,
                           kind,
                           lastupdated,
                           name,
                           state,
                           tagids,
                           transactionid,
                           version,
                           versionid)
end

.namesObject

A mapping from model property names to API property names.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/verizon/models/search_device_response.rb', line 68

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['action'] = 'action'
  @_hash['createdon'] = 'createdon'
  @_hash['deviceid'] = 'deviceid'
  @_hash['fields'] = 'fields'
  @_hash['id'] = 'id'
  @_hash['kind'] = 'kind'
  @_hash['lastupdated'] = 'lastupdated'
  @_hash['name'] = 'name'
  @_hash['state'] = 'state'
  @_hash['tagids'] = 'tagids'
  @_hash['transactionid'] = 'transactionid'
  @_hash['version'] = 'version'
  @_hash['versionid'] = 'versionid'
  @_hash
end

.nullablesObject

An array for nullable fields



106
107
108
# File 'lib/verizon/models/search_device_response.rb', line 106

def self.nullables
  []
end

.optionalsObject

An array for optional fields



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/verizon/models/search_device_response.rb', line 87

def self.optionals
  %w[
    action
    createdon
    deviceid
    fields
    id
    kind
    lastupdated
    name
    state
    tagids
    transactionid
    version
    versionid
  ]
end