Class: Verizon::DeleteDevicesResult

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

Overview

Response for a request made to delete a device.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(device_ids = SKIP, status = SKIP, message = SKIP) ⇒ DeleteDevicesResult

Returns a new instance of DeleteDevicesResult.



50
51
52
53
54
# File 'lib/verizon/models/delete_devices_result.rb', line 50

def initialize(device_ids = SKIP, status = SKIP, message = SKIP)
  @device_ids = device_ids unless device_ids == SKIP
  @status = status unless status == SKIP
  @message = message unless message == SKIP
end

Instance Attribute Details

#device_idsObject

One object per device to be deleted. Each object must contain a kind and id element identifying the device.

Returns:

  • (Object)


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

def device_ids
  @device_ids
end

#messageString

Not present if status=Success. One of these messages if status=Failed:The device is not in deactivate state.The user does not have access to delete the device.

Returns:

  • (String)


25
26
27
# File 'lib/verizon/models/delete_devices_result.rb', line 25

def message
  @message
end

#statusString

“Success” if the device was deleted, or “Failed” if there was a problem.

Returns:

  • (String)


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

def status
  @status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/verizon/models/delete_devices_result.rb', line 57

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  device_ids = hash.key?('deviceIds') ? hash['deviceIds'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP
  message = hash.key?('message') ? hash['message'] : SKIP

  # Create object from extracted values.
  DeleteDevicesResult.new(device_ids,
                          status,
                          message)
end

.namesObject

A mapping from model property names to API property names.



28
29
30
31
32
33
34
# File 'lib/verizon/models/delete_devices_result.rb', line 28

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['device_ids'] = 'deviceIds'
  @_hash['status'] = 'status'
  @_hash['message'] = 'message'
  @_hash
end

.nullablesObject

An array for nullable fields



46
47
48
# File 'lib/verizon/models/delete_devices_result.rb', line 46

def self.nullables
  []
end

.optionalsObject

An array for optional fields



37
38
39
40
41
42
43
# File 'lib/verizon/models/delete_devices_result.rb', line 37

def self.optionals
  %w[
    device_ids
    status
    message
  ]
end