Class: Verizon::ChangeConfigurationResponse

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

Overview

Change Configuration 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, foreignid = SKIP, id = SKIP, kind = SKIP, lastupdated = SKIP, name = SKIP, state = SKIP, transactionid = SKIP, version = SKIP) ⇒ ChangeConfigurationResponse

Returns a new instance of ChangeConfigurationResponse.



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/verizon/models/change_configuration_response.rb', line 104

def initialize(action = SKIP, createdon = SKIP, deviceid = SKIP,
               fields = SKIP, foreignid = SKIP, id = SKIP, kind = SKIP,
               lastupdated = SKIP, name = SKIP, state = SKIP,
               transactionid = SKIP, version = SKIP)
  @action = action unless action == SKIP
  @createdon = createdon unless createdon == SKIP
  @deviceid = deviceid unless deviceid == SKIP
  @fields = fields unless fields == SKIP
  @foreignid = foreignid unless foreignid == 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
  @transactionid = transactionid unless transactionid == SKIP
  @version = version unless version == SKIP
end

Instance Attribute Details

#actionString

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

Returns:

  • (String)


15
16
17
# File 'lib/verizon/models/change_configuration_response.rb', line 15

def action
  @action
end

#createdonString

The date and time of the change request.

Returns:

  • (String)


19
20
21
# File 'lib/verizon/models/change_configuration_response.rb', line 19

def createdon
  @createdon
end

#deviceidString

The device’s ThingSpace UUID.

Returns:

  • (String)


23
24
25
# File 'lib/verizon/models/change_configuration_response.rb', line 23

def deviceid
  @deviceid
end

#fieldsFields

List of fields affected by the event.

Returns:



27
28
29
# File 'lib/verizon/models/change_configuration_response.rb', line 27

def fields
  @fields
end

#foreignidString

foreign id

Returns:

  • (String)


31
32
33
# File 'lib/verizon/models/change_configuration_response.rb', line 31

def foreignid
  @foreignid
end

#idString

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

Returns:

  • (String)


35
36
37
# File 'lib/verizon/models/change_configuration_response.rb', line 35

def id
  @id
end

#kindString

The kind of the ThingSpace resource that is being reported

Returns:

  • (String)


39
40
41
# File 'lib/verizon/models/change_configuration_response.rb', line 39

def kind
  @kind
end

#lastupdatedString

The date and time that the event was last updated.

Returns:

  • (String)


43
44
45
# File 'lib/verizon/models/change_configuration_response.rb', line 43

def lastupdated
  @lastupdated
end

#nameString

The name of the event; “SetConfigurationReq” for device configuration changes.

Returns:

  • (String)


48
49
50
# File 'lib/verizon/models/change_configuration_response.rb', line 48

def name
  @name
end

#stateString

The current status of the request. The value will be “pending” until the device wakes up and ThingSpace can send the request to the device.

Returns:

  • (String)


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

def state
  @state
end

#transactionidString

transaction id

Returns:

  • (String)


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

def transactionid
  @transactionid
end

#versionString

version

Returns:

  • (String)


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

def version
  @version
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/verizon/models/change_configuration_response.rb', line 123

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 = Fields.from_hash(hash['fields']) if hash['fields']
  foreignid = hash.key?('foreignid') ? hash['foreignid'] : SKIP
  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
  transactionid = hash.key?('transactionid') ? hash['transactionid'] : SKIP
  version = hash.key?('version') ? hash['version'] : SKIP

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

.namesObject

A mapping from model property names to API property names.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/verizon/models/change_configuration_response.rb', line 64

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

.nullablesObject

An array for nullable fields



100
101
102
# File 'lib/verizon/models/change_configuration_response.rb', line 100

def self.nullables
  []
end

.optionalsObject

An array for optional fields



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/verizon/models/change_configuration_response.rb', line 82

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