Class: Verizon::DeviceUploadRequest
- Defined in:
- lib/verizon/models/device_upload_request.rb
Overview
DeviceUploadRequest Model.
Instance Attribute Summary collapse
-
#account_name ⇒ String
TODO: Write general description for this method.
-
#device_sku ⇒ String
TODO: Write general description for this method.
-
#devices ⇒ Array[DeviceList]
TODO: Write general description for this method.
-
#email_address ⇒ String
TODO: Write general description for this method.
-
#upload_type ⇒ String
TODO: Write general description for this method.
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(account_name = nil, devices = nil, email_address = nil, device_sku = nil, upload_type = nil) ⇒ DeviceUploadRequest
constructor
A new instance of DeviceUploadRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(account_name = nil, devices = nil, email_address = nil, device_sku = nil, upload_type = nil) ⇒ DeviceUploadRequest
Returns a new instance of DeviceUploadRequest.
53 54 55 56 57 58 59 60 |
# File 'lib/verizon/models/device_upload_request.rb', line 53 def initialize(account_name = nil, devices = nil, email_address = nil, device_sku = nil, upload_type = nil) @account_name = account_name @devices = devices @email_address = email_address @device_sku = device_sku @upload_type = upload_type end |
Instance Attribute Details
#account_name ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/verizon/models/device_upload_request.rb', line 14 def account_name @account_name end |
#device_sku ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/verizon/models/device_upload_request.rb', line 26 def device_sku @device_sku end |
#devices ⇒ Array[DeviceList]
TODO: Write general description for this method
18 19 20 |
# File 'lib/verizon/models/device_upload_request.rb', line 18 def devices @devices end |
#email_address ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/verizon/models/device_upload_request.rb', line 22 def email_address @email_address end |
#upload_type ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/verizon/models/device_upload_request.rb', line 30 def upload_type @upload_type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/verizon/models/device_upload_request.rb', line 63 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_name = hash.key?('accountName') ? hash['accountName'] : nil # Parameter is an array, so we need to iterate through it devices = nil unless hash['devices'].nil? devices = [] hash['devices'].each do |structure| devices << (DeviceList.from_hash(structure) if structure) end end devices = nil unless hash.key?('devices') email_address = hash.key?('emailAddress') ? hash['emailAddress'] : nil device_sku = hash.key?('deviceSku') ? hash['deviceSku'] : nil upload_type = hash.key?('uploadType') ? hash['uploadType'] : nil # Create object from extracted values. DeviceUploadRequest.new(account_name, devices, email_address, device_sku, upload_type) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 |
# File 'lib/verizon/models/device_upload_request.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['account_name'] = 'accountName' @_hash['devices'] = 'devices' @_hash['email_address'] = 'emailAddress' @_hash['device_sku'] = 'deviceSku' @_hash['upload_type'] = 'uploadType' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/verizon/models/device_upload_request.rb', line 49 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 |
# File 'lib/verizon/models/device_upload_request.rb', line 44 def self.optionals [] end |