Class: Verizon::DeviceUploadRequest

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

Overview

DeviceUploadRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

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( = nil, devices = nil, email_address = nil,
               device_sku = nil, upload_type = nil)
  @account_name = 
  @devices = devices
  @email_address = email_address
  @device_sku = device_sku
  @upload_type = upload_type
end

Instance Attribute Details

#account_nameString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/verizon/models/device_upload_request.rb', line 14

def 
  @account_name
end

#device_skuString

TODO: Write general description for this method

Returns:

  • (String)


26
27
28
# File 'lib/verizon/models/device_upload_request.rb', line 26

def device_sku
  @device_sku
end

#devicesArray[DeviceList]

TODO: Write general description for this method

Returns:



18
19
20
# File 'lib/verizon/models/device_upload_request.rb', line 18

def devices
  @devices
end

#email_addressString

TODO: Write general description for this method

Returns:

  • (String)


22
23
24
# File 'lib/verizon/models/device_upload_request.rb', line 22

def email_address
  @email_address
end

#upload_typeString

TODO: Write general description for this method

Returns:

  • (String)


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.
   = 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(,
                          devices,
                          email_address,
                          device_sku,
                          upload_type)
end

.namesObject

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

.nullablesObject

An array for nullable fields



49
50
51
# File 'lib/verizon/models/device_upload_request.rb', line 49

def self.nullables
  []
end

.optionalsObject

An array for optional fields



44
45
46
# File 'lib/verizon/models/device_upload_request.rb', line 44

def self.optionals
  []
end