Class: Verizon::SearchDeviceResponse
- 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
-
#action ⇒ String
The action requested in this event; “change” for device configuration changes.
-
#createdon ⇒ String
The date and time of the change request.
-
#deviceid ⇒ String
The device’s ThingSpace UUID.
-
#fields ⇒ Fields2
List of fields affected by the event.
-
#id ⇒ String
The unique ID of this ts.event.configuration event.
-
#kind ⇒ String
The kind of the ThingSpace resource that is being reported; “ts.event.configuration” for device configuration changes.
-
#lastupdated ⇒ String
The date and time that the event was last updated.
-
#name ⇒ String
The name of the event.
-
#state ⇒ String
The current status of the request.
-
#tagids ⇒ Array[String]
UUIDs of tag resources that are applied to this device.
-
#transactionid ⇒ String
transaction id.
-
#version ⇒ String
The version of the resource.
-
#versionid ⇒ String
The version of the resource.
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(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
constructor
A new instance of SearchDeviceResponse.
Methods inherited from BaseModel
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 |
# 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
#action ⇒ String
The action requested in this event; “change” for device configuration changes.
16 17 18 |
# File 'lib/verizon/models/search_device_response.rb', line 16 def action @action end |
#createdon ⇒ String
The date and time of the change request.
20 21 22 |
# File 'lib/verizon/models/search_device_response.rb', line 20 def createdon @createdon end |
#deviceid ⇒ String
The device’s ThingSpace UUID.
24 25 26 |
# File 'lib/verizon/models/search_device_response.rb', line 24 def deviceid @deviceid end |
#fields ⇒ Fields2
List of fields affected by the event.
28 29 30 |
# File 'lib/verizon/models/search_device_response.rb', line 28 def fields @fields end |
#id ⇒ String
The unique ID of this ts.event.configuration event.
32 33 34 |
# File 'lib/verizon/models/search_device_response.rb', line 32 def id @id end |
#kind ⇒ String
The kind of the ThingSpace resource that is being reported; “ts.event.configuration” for device configuration changes.
37 38 39 |
# File 'lib/verizon/models/search_device_response.rb', line 37 def kind @kind end |
#lastupdated ⇒ String
The date and time that the event was last updated.
41 42 43 |
# File 'lib/verizon/models/search_device_response.rb', line 41 def lastupdated @lastupdated end |
#name ⇒ String
The name of the event
45 46 47 |
# File 'lib/verizon/models/search_device_response.rb', line 45 def name @name end |
#state ⇒ String
The current status of the request.
49 50 51 |
# File 'lib/verizon/models/search_device_response.rb', line 49 def state @state end |
#tagids ⇒ Array[String]
UUIDs of tag resources that are applied to this device.
53 54 55 |
# File 'lib/verizon/models/search_device_response.rb', line 53 def tagids @tagids end |
#transactionid ⇒ String
transaction id
57 58 59 |
# File 'lib/verizon/models/search_device_response.rb', line 57 def transactionid @transactionid end |
#version ⇒ String
The version of the resource.
61 62 63 |
# File 'lib/verizon/models/search_device_response.rb', line 61 def version @version end |
#versionid ⇒ String
The version of the resource.
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.
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/verizon/models/search_device_response.rb', line 130 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 |
.names ⇒ Object
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 |
.nullables ⇒ Object
An array for nullable fields
106 107 108 |
# File 'lib/verizon/models/search_device_response.rb', line 106 def self.nullables [] end |
.optionals ⇒ Object
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 |