Class: Verizon::UploadsActivatesDeviceRequest

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

Overview

The request body identifies the devices to upload.

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, email_address = nil, device_sku = nil, upload_type = nil, service_plan = nil, mdn_zip_code = nil, devices = nil, carrier_ip_pool_name = SKIP) ⇒ UploadsActivatesDeviceRequest

Returns a new instance of UploadsActivatesDeviceRequest.



75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/verizon/models/uploads_activates_device_request.rb', line 75

def initialize( = nil, email_address = nil, device_sku = nil,
               upload_type = nil, service_plan = nil, mdn_zip_code = nil,
               devices = nil, carrier_ip_pool_name = SKIP)
  @account_name = 
  @email_address = email_address
  @device_sku = device_sku
  @upload_type = upload_type
  @service_plan = service_plan
  @carrier_ip_pool_name = carrier_ip_pool_name unless carrier_ip_pool_name == SKIP
  @mdn_zip_code = mdn_zip_code
  @devices = devices
end

Instance Attribute Details

#account_nameString

The name of a billing account. An account name is usually numeric, and must include any leading zeros.

Returns:

  • (String)


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

def 
  @account_name
end

#carrier_ip_pool_nameString

The pool from which your device IP addresses is derived.

Returns:

  • (String)


37
38
39
# File 'lib/verizon/models/uploads_activates_device_request.rb', line 37

def carrier_ip_pool_name
  @carrier_ip_pool_name
end

#device_skuString

The stock keeping unit that identifies the type of devices in the upload and activation.

Returns:

  • (String)


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

def device_sku
  @device_sku
end

#devicesArray[DeviceList]

The devices to upload, specified by device IDs in a format matching uploadType.

Returns:



47
48
49
# File 'lib/verizon/models/uploads_activates_device_request.rb', line 47

def devices
  @devices
end

#email_addressString

The email address that the report should be sent to when the upload is complete.

Returns:

  • (String)


20
21
22
# File 'lib/verizon/models/uploads_activates_device_request.rb', line 20

def email_address
  @email_address
end

#mdn_zip_codeString

The Zip code of the location where the line of service is primarily used, or a Zip code that you have been told to use with these devices.

Returns:

  • (String)


42
43
44
# File 'lib/verizon/models/uploads_activates_device_request.rb', line 42

def mdn_zip_code
  @mdn_zip_code
end

#service_planString

The service plan code that you want to assign to all specified devices.

Returns:

  • (String)


33
34
35
# File 'lib/verizon/models/uploads_activates_device_request.rb', line 33

def service_plan
  @service_plan
end

#upload_typeString

The format of the device identifiers in the upload and activation.

Returns:

  • (String)


29
30
31
# File 'lib/verizon/models/uploads_activates_device_request.rb', line 29

def upload_type
  @upload_type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/verizon/models/uploads_activates_device_request.rb', line 89

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('accountName') ? hash['accountName'] : nil
  email_address = hash.key?('emailAddress') ? hash['emailAddress'] : nil
  device_sku = hash.key?('deviceSku') ? hash['deviceSku'] : nil
  upload_type = hash.key?('uploadType') ? hash['uploadType'] : nil
  service_plan = hash.key?('servicePlan') ? hash['servicePlan'] : nil
  mdn_zip_code = hash.key?('mdnZipCode') ? hash['mdnZipCode'] : 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')
  carrier_ip_pool_name =
    hash.key?('carrierIpPoolName') ? hash['carrierIpPoolName'] : SKIP

  # Create object from extracted values.
  UploadsActivatesDeviceRequest.new(,
                                    email_address,
                                    device_sku,
                                    upload_type,
                                    service_plan,
                                    mdn_zip_code,
                                    devices,
                                    carrier_ip_pool_name)
end

.namesObject

A mapping from model property names to API property names.



50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/verizon/models/uploads_activates_device_request.rb', line 50

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_name'] = 'accountName'
  @_hash['email_address'] = 'emailAddress'
  @_hash['device_sku'] = 'deviceSku'
  @_hash['upload_type'] = 'uploadType'
  @_hash['service_plan'] = 'servicePlan'
  @_hash['carrier_ip_pool_name'] = 'carrierIpPoolName'
  @_hash['mdn_zip_code'] = 'mdnZipCode'
  @_hash['devices'] = 'devices'
  @_hash
end

.nullablesObject

An array for nullable fields



71
72
73
# File 'lib/verizon/models/uploads_activates_device_request.rb', line 71

def self.nullables
  []
end

.optionalsObject

An array for optional fields



64
65
66
67
68
# File 'lib/verizon/models/uploads_activates_device_request.rb', line 64

def self.optionals
  %w[
    carrier_ip_pool_name
  ]
end