Class: Verizon::DeleteDevicesResult
- Defined in:
- lib/verizon/models/delete_devices_result.rb
Overview
Response for a request made to delete a device.
Instance Attribute Summary collapse
-
#device_ids ⇒ Object
One object per device to be deleted.
-
#message ⇒ String
Not present if status=Success.
-
#status ⇒ String
“Success” if the device was deleted, or “Failed” if there was a problem.
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(device_ids: SKIP, status: SKIP, message: SKIP, additional_properties: nil) ⇒ DeleteDevicesResult
constructor
A new instance of DeleteDevicesResult.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(device_ids: SKIP, status: SKIP, message: SKIP, additional_properties: nil) ⇒ DeleteDevicesResult
Returns a new instance of DeleteDevicesResult.
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/verizon/models/delete_devices_result.rb', line 50 def initialize(device_ids: SKIP, status: SKIP, message: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @device_ids = device_ids unless device_ids == SKIP @status = status unless status == SKIP @message = unless == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#device_ids ⇒ Object
One object per device to be deleted. Each object must contain a kind and id element identifying the device.
15 16 17 |
# File 'lib/verizon/models/delete_devices_result.rb', line 15 def device_ids @device_ids end |
#message ⇒ String
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.
25 26 27 |
# File 'lib/verizon/models/delete_devices_result.rb', line 25 def @message end |
#status ⇒ String
“Success” if the device was deleted, or “Failed” if there was a problem.
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.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/verizon/models/delete_devices_result.rb', line 62 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. device_ids = hash.key?('deviceIds') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:DeleteDevicesResultDeviceIds), hash['deviceIds'] ) : SKIP status = hash.key?('status') ? hash['status'] : SKIP = hash.key?('message') ? hash['message'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. DeleteDevicesResult.new(device_ids: device_ids, status: status, message: , additional_properties: additional_properties) end |
.names ⇒ Object
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 |
.nullables ⇒ Object
An array for nullable fields
46 47 48 |
# File 'lib/verizon/models/delete_devices_result.rb', line 46 def self.nullables [] end |
.optionals ⇒ Object
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 |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
88 89 90 91 92 93 94 |
# File 'lib/verizon/models/delete_devices_result.rb', line 88 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
104 105 106 107 108 |
# File 'lib/verizon/models/delete_devices_result.rb', line 104 def inspect class_name = self.class.name.split('::').last "<#{class_name} device_ids: #{@device_ids.inspect}, status: #{@status.inspect}, message:"\ " #{@message.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
97 98 99 100 101 |
# File 'lib/verizon/models/delete_devices_result.rb', line 97 def to_s class_name = self.class.name.split('::').last "<#{class_name} device_ids: #{@device_ids}, status: #{@status}, message: #{@message},"\ " additional_properties: #{@additional_properties}>" end |