Class: Verizon::MoveDeviceRequest
- Defined in:
- lib/verizon/models/move_device_request.rb
Overview
Request to move active devices from one billing account to another within a customer profile.
Instance Attribute Summary collapse
-
#account_name ⇒ String
The name of the billing account that you want to move the devices to.
-
#carrier_ip_pool_name ⇒ String
The pool from which device IP addresses will be derived in the new account.
-
#custom_fields ⇒ Array[CustomFields]
Custom field names and values, if you want to only include devices that have matching values.
-
#devices ⇒ Array[AccountDeviceList]
Up to 10,000 devices that you want to move to a different account, specified by device identifier.
-
#filter ⇒ DeviceFilter
Specify the kind of the device identifier, the type of match, and the string that you want to match.
-
#group_name ⇒ String
The name of a device group, to only include devices in that group.
-
#service_plan ⇒ String
The service plan code that you want to assign to the devices in the new account.
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, filter = SKIP, custom_fields = SKIP, devices = SKIP, group_name = SKIP, carrier_ip_pool_name = SKIP, service_plan = SKIP) ⇒ MoveDeviceRequest
constructor
A new instance of MoveDeviceRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(account_name = nil, filter = SKIP, custom_fields = SKIP, devices = SKIP, group_name = SKIP, carrier_ip_pool_name = SKIP, service_plan = SKIP) ⇒ MoveDeviceRequest
Returns a new instance of MoveDeviceRequest.
79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/verizon/models/move_device_request.rb', line 79 def initialize(account_name = nil, filter = SKIP, custom_fields = SKIP, devices = SKIP, group_name = SKIP, carrier_ip_pool_name = SKIP, service_plan = SKIP) @account_name = account_name @filter = filter unless filter == SKIP @custom_fields = custom_fields unless custom_fields == SKIP @devices = devices unless devices == SKIP @group_name = group_name unless group_name == SKIP @carrier_ip_pool_name = carrier_ip_pool_name unless carrier_ip_pool_name == SKIP @service_plan = service_plan unless service_plan == SKIP end |
Instance Attribute Details
#account_name ⇒ String
The name of the billing account that you want to move the devices to.
15 16 17 |
# File 'lib/verizon/models/move_device_request.rb', line 15 def account_name @account_name end |
#carrier_ip_pool_name ⇒ String
The pool from which device IP addresses will be derived in the new account. If you do not include this element, the default pool will be used.
40 41 42 |
# File 'lib/verizon/models/move_device_request.rb', line 40 def carrier_ip_pool_name @carrier_ip_pool_name end |
#custom_fields ⇒ Array[CustomFields]
Custom field names and values, if you want to only include devices that have matching values.
25 26 27 |
# File 'lib/verizon/models/move_device_request.rb', line 25 def custom_fields @custom_fields end |
#devices ⇒ Array[AccountDeviceList]
Up to 10,000 devices that you want to move to a different account, specified by device identifier.
30 31 32 |
# File 'lib/verizon/models/move_device_request.rb', line 30 def devices @devices end |
#filter ⇒ DeviceFilter
Specify the kind of the device identifier, the type of match, and the string that you want to match.
20 21 22 |
# File 'lib/verizon/models/move_device_request.rb', line 20 def filter @filter end |
#group_name ⇒ String
The name of a device group, to only include devices in that group.
34 35 36 |
# File 'lib/verizon/models/move_device_request.rb', line 34 def group_name @group_name end |
#service_plan ⇒ String
The service plan code that you want to assign to the devices in the new account. If you do not include this element, ThingSpace will attempt to use the current service plan, which will result in a error if the new account does not have that service plan.
47 48 49 |
# File 'lib/verizon/models/move_device_request.rb', line 47 def service_plan @service_plan end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/verizon/models/move_device_request.rb', line 92 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_name = hash.key?('accountName') ? hash['accountName'] : nil filter = DeviceFilter.from_hash(hash['filter']) if hash['filter'] # Parameter is an array, so we need to iterate through it custom_fields = nil unless hash['customFields'].nil? custom_fields = [] hash['customFields'].each do |structure| custom_fields << (CustomFields.from_hash(structure) if structure) end end custom_fields = SKIP unless hash.key?('customFields') # Parameter is an array, so we need to iterate through it devices = nil unless hash['devices'].nil? devices = [] hash['devices'].each do |structure| devices << (AccountDeviceList.from_hash(structure) if structure) end end devices = SKIP unless hash.key?('devices') group_name = hash.key?('groupName') ? hash['groupName'] : SKIP carrier_ip_pool_name = hash.key?('carrierIpPoolName') ? hash['carrierIpPoolName'] : SKIP service_plan = hash.key?('servicePlan') ? hash['servicePlan'] : SKIP # Create object from extracted values. MoveDeviceRequest.new(account_name, filter, custom_fields, devices, group_name, carrier_ip_pool_name, service_plan) end |
.names ⇒ Object
A mapping from model property names to API property names.
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/verizon/models/move_device_request.rb', line 50 def self.names @_hash = {} if @_hash.nil? @_hash['account_name'] = 'accountName' @_hash['filter'] = 'filter' @_hash['custom_fields'] = 'customFields' @_hash['devices'] = 'devices' @_hash['group_name'] = 'groupName' @_hash['carrier_ip_pool_name'] = 'carrierIpPoolName' @_hash['service_plan'] = 'servicePlan' @_hash end |
.nullables ⇒ Object
An array for nullable fields
75 76 77 |
# File 'lib/verizon/models/move_device_request.rb', line 75 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
63 64 65 66 67 68 69 70 71 72 |
# File 'lib/verizon/models/move_device_request.rb', line 63 def self.optionals %w[ filter custom_fields devices group_name carrier_ip_pool_name service_plan ] end |