Class: Verizon::ContactInfoUpdateRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::ContactInfoUpdateRequest
- Defined in:
- lib/verizon/models/contact_info_update_request.rb
Overview
Request to update contact information.
Instance Attribute Summary collapse
-
#account_name ⇒ String
The name of the billing account that the devices belong to.
-
#devices ⇒ Array[AccountDeviceList]
A list of the devices that you want to change, specified by device identifier.
-
#primary_place_of_use ⇒ PlaceOfUse
The customer name and the address of the device’s primary place of use.
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(primary_place_of_use = nil, account_name = SKIP, devices = SKIP) ⇒ ContactInfoUpdateRequest
constructor
A new instance of ContactInfoUpdateRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(primary_place_of_use = nil, account_name = SKIP, devices = SKIP) ⇒ ContactInfoUpdateRequest
Returns a new instance of ContactInfoUpdateRequest.
55 56 57 58 59 60 |
# File 'lib/verizon/models/contact_info_update_request.rb', line 55 def initialize(primary_place_of_use = nil, account_name = SKIP, devices = SKIP) @primary_place_of_use = primary_place_of_use @account_name = account_name unless account_name == SKIP @devices = devices unless devices == SKIP end |
Instance Attribute Details
#account_name ⇒ String
The name of the billing account that the devices belong to. An account name is usually numeric, and must include any leading zeros.
24 25 26 |
# File 'lib/verizon/models/contact_info_update_request.rb', line 24 def account_name @account_name end |
#devices ⇒ Array[AccountDeviceList]
A list of the devices that you want to change, specified by device identifier. You only need to provide one identifier per device. Do not include accountName, groupName, customFields, or servicePlan if you use this parameter.
31 32 33 |
# File 'lib/verizon/models/contact_info_update_request.rb', line 31 def devices @devices end |
#primary_place_of_use ⇒ PlaceOfUse
The customer name and the address of the device’s primary place of use. Leave these fields empty to use the account profile address as the primary place of use. These values will be applied to all devices in the request.If the account is enabled for non-geographic MDNs and the device supports it, the primaryPlaceOfUse address will also be used to derive the MDN for the device.
19 20 21 |
# File 'lib/verizon/models/contact_info_update_request.rb', line 19 def primary_place_of_use @primary_place_of_use 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 |
# File 'lib/verizon/models/contact_info_update_request.rb', line 63 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. primary_place_of_use = PlaceOfUse.from_hash(hash['primaryPlaceOfUse']) if hash['primaryPlaceOfUse'] account_name = hash.key?('accountName') ? hash['accountName'] : SKIP # 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') # Create object from extracted values. ContactInfoUpdateRequest.new(primary_place_of_use, account_name, devices) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 |
# File 'lib/verizon/models/contact_info_update_request.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['primary_place_of_use'] = 'primaryPlaceOfUse' @_hash['account_name'] = 'accountName' @_hash['devices'] = 'devices' @_hash end |
.nullables ⇒ Object
An array for nullable fields
51 52 53 |
# File 'lib/verizon/models/contact_info_update_request.rb', line 51 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
43 44 45 46 47 48 |
# File 'lib/verizon/models/contact_info_update_request.rb', line 43 def self.optionals %w[ account_name devices ] end |