Class: Verizon::HplAddDevicesRequest
- Defined in:
- lib/verizon/models/hpl_add_devices_request.rb
Overview
Request to add the devices.
Instance Attribute Summary collapse
-
#account_name ⇒ HplAccountname
The numeric name of the account and must include leading zeroes.
-
#custom_fields ⇒ Array[HplCustomFields]
The names and values for any custom fields that you want set for the devices as they are added to the account.
-
#devices_to_add ⇒ Array[HplAccountDeviceList]
The devices that you want to add.
-
#group_name ⇒ String
The name of a device group to add the devices to.
-
#number_of_virtual_imei ⇒ Integer
numberOfVirtualImei.
-
#sku_number ⇒ String
The Stock Keeping Unit (SKU) number of a 4G device type with an embedded SIM.
-
#smsr_oid ⇒ String
The Stock Keeping Unit (SKU) number of a 4G device type with an embedded SIM.
-
#state ⇒ String
The initial service state for the devices.
-
#upload_type ⇒ String
uploadType.
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(state:, devices_to_add:, account_name: SKIP, custom_fields: SKIP, group_name: SKIP, sku_number: SKIP, smsr_oid: SKIP, number_of_virtual_imei: SKIP, upload_type: SKIP, additional_properties: nil) ⇒ HplAddDevicesRequest
constructor
A new instance of HplAddDevicesRequest.
-
#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(state:, devices_to_add:, account_name: SKIP, custom_fields: SKIP, group_name: SKIP, sku_number: SKIP, smsr_oid: SKIP, number_of_virtual_imei: SKIP, upload_type: SKIP, additional_properties: nil) ⇒ HplAddDevicesRequest
Returns a new instance of HplAddDevicesRequest.
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/verizon/models/hpl_add_devices_request.rb', line 86 def initialize(state:, devices_to_add:, account_name: SKIP, custom_fields: SKIP, group_name: SKIP, sku_number: SKIP, smsr_oid: SKIP, number_of_virtual_imei: SKIP, upload_type: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @state = state @devices_to_add = devices_to_add @account_name = account_name unless account_name == SKIP @custom_fields = custom_fields unless custom_fields == SKIP @group_name = group_name unless group_name == SKIP @sku_number = sku_number unless sku_number == SKIP @smsr_oid = smsr_oid unless smsr_oid == SKIP @number_of_virtual_imei = number_of_virtual_imei unless number_of_virtual_imei == SKIP @upload_type = upload_type unless upload_type == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account_name ⇒ HplAccountname
The numeric name of the account and must include leading zeroes.
23 24 25 |
# File 'lib/verizon/models/hpl_add_devices_request.rb', line 23 def account_name @account_name end |
#custom_fields ⇒ Array[HplCustomFields]
The names and values for any custom fields that you want set for the devices as they are added to the account.
28 29 30 |
# File 'lib/verizon/models/hpl_add_devices_request.rb', line 28 def custom_fields @custom_fields end |
#devices_to_add ⇒ Array[HplAccountDeviceList]
The devices that you want to add.
19 20 21 |
# File 'lib/verizon/models/hpl_add_devices_request.rb', line 19 def devices_to_add @devices_to_add end |
#group_name ⇒ String
The name of a device group to add the devices to. They are added to the default device group if you don’t include this parameter.
33 34 35 |
# File 'lib/verizon/models/hpl_add_devices_request.rb', line 33 def group_name @group_name end |
#number_of_virtual_imei ⇒ Integer
numberOfVirtualImei.
47 48 49 |
# File 'lib/verizon/models/hpl_add_devices_request.rb', line 47 def number_of_virtual_imei @number_of_virtual_imei end |
#sku_number ⇒ String
The Stock Keeping Unit (SKU) number of a 4G device type with an embedded SIM.
38 39 40 |
# File 'lib/verizon/models/hpl_add_devices_request.rb', line 38 def sku_number @sku_number end |
#smsr_oid ⇒ String
The Stock Keeping Unit (SKU) number of a 4G device type with an embedded SIM.
43 44 45 |
# File 'lib/verizon/models/hpl_add_devices_request.rb', line 43 def smsr_oid @smsr_oid end |
#state ⇒ String
The initial service state for the devices. The only valid state is “Preactive.”
15 16 17 |
# File 'lib/verizon/models/hpl_add_devices_request.rb', line 15 def state @state end |
#upload_type ⇒ String
uploadType.
51 52 53 |
# File 'lib/verizon/models/hpl_add_devices_request.rb', line 51 def upload_type @upload_type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/verizon/models/hpl_add_devices_request.rb', line 106 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. state = hash.key?('state') ? hash['state'] : nil # Parameter is an array, so we need to iterate through it devices_to_add = nil unless hash['devicesToAdd'].nil? devices_to_add = [] hash['devicesToAdd'].each do |structure| devices_to_add << (HplAccountDeviceList.from_hash(structure) if structure) end end devices_to_add = nil unless hash.key?('devicesToAdd') account_name = HplAccountname.from_hash(hash['accountName']) if hash['accountName'] # 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 << (HplCustomFields.from_hash(structure) if structure) end end custom_fields = SKIP unless hash.key?('customFields') group_name = hash.key?('groupName') ? hash['groupName'] : SKIP sku_number = hash.key?('skuNumber') ? hash['skuNumber'] : SKIP smsr_oid = hash.key?('smsrOid') ? hash['smsrOid'] : SKIP number_of_virtual_imei = hash.key?('numberOfVirtualImei') ? hash['numberOfVirtualImei'] : SKIP upload_type = hash.key?('uploadType') ? hash['uploadType'] : 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. HplAddDevicesRequest.new(state: state, devices_to_add: devices_to_add, account_name: account_name, custom_fields: custom_fields, group_name: group_name, sku_number: sku_number, smsr_oid: smsr_oid, number_of_virtual_imei: number_of_virtual_imei, upload_type: upload_type, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/verizon/models/hpl_add_devices_request.rb', line 54 def self.names @_hash = {} if @_hash.nil? @_hash['state'] = 'state' @_hash['devices_to_add'] = 'devicesToAdd' @_hash['account_name'] = 'accountName' @_hash['custom_fields'] = 'customFields' @_hash['group_name'] = 'groupName' @_hash['sku_number'] = 'skuNumber' @_hash['smsr_oid'] = 'smsrOid' @_hash['number_of_virtual_imei'] = 'numberOfVirtualImei' @_hash['upload_type'] = 'uploadType' @_hash end |
.nullables ⇒ Object
An array for nullable fields
82 83 84 |
# File 'lib/verizon/models/hpl_add_devices_request.rb', line 82 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/verizon/models/hpl_add_devices_request.rb', line 69 def self.optionals %w[ account_name custom_fields group_name sku_number smsr_oid number_of_virtual_imei upload_type ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
170 171 172 173 174 175 176 177 |
# File 'lib/verizon/models/hpl_add_devices_request.rb', line 170 def inspect class_name = self.class.name.split('::').last "<#{class_name} state: #{@state.inspect}, devices_to_add: #{@devices_to_add.inspect},"\ " account_name: #{@account_name.inspect}, custom_fields: #{@custom_fields.inspect},"\ " group_name: #{@group_name.inspect}, sku_number: #{@sku_number.inspect}, smsr_oid:"\ " #{@smsr_oid.inspect}, number_of_virtual_imei: #{@number_of_virtual_imei.inspect},"\ " upload_type: #{@upload_type.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
160 161 162 163 164 165 166 167 |
# File 'lib/verizon/models/hpl_add_devices_request.rb', line 160 def to_s class_name = self.class.name.split('::').last "<#{class_name} state: #{@state}, devices_to_add: #{@devices_to_add}, account_name:"\ " #{@account_name}, custom_fields: #{@custom_fields}, group_name: #{@group_name},"\ " sku_number: #{@sku_number}, smsr_oid: #{@smsr_oid}, number_of_virtual_imei:"\ " #{@number_of_virtual_imei}, upload_type: #{@upload_type}, additional_properties:"\ " #{@additional_properties}>" end |