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:, account_name: SKIP, devices: SKIP, additional_properties: nil) ⇒ ContactInfoUpdateRequest
constructor
A new instance of ContactInfoUpdateRequest.
-
#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(primary_place_of_use:, account_name: SKIP, devices: SKIP, additional_properties: nil) ⇒ ContactInfoUpdateRequest
Returns a new instance of ContactInfoUpdateRequest.
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/verizon/models/contact_info_update_request.rb', line 55 def initialize(primary_place_of_use:, account_name: SKIP, devices: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @primary_place_of_use = primary_place_of_use @account_name = account_name unless account_name == SKIP @devices = devices unless devices == SKIP @additional_properties = additional_properties 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.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/verizon/models/contact_info_update_request.rb', line 67 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 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. ContactInfoUpdateRequest.new(primary_place_of_use: primary_place_of_use, account_name: account_name, devices: devices, additional_properties: additional_properties) 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 |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
107 108 109 110 111 112 |
# File 'lib/verizon/models/contact_info_update_request.rb', line 107 def inspect class_name = self.class.name.split('::').last "<#{class_name} primary_place_of_use: #{@primary_place_of_use.inspect}, account_name:"\ " #{@account_name.inspect}, devices: #{@devices.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
100 101 102 103 104 |
# File 'lib/verizon/models/contact_info_update_request.rb', line 100 def to_s class_name = self.class.name.split('::').last "<#{class_name} primary_place_of_use: #{@primary_place_of_use}, account_name:"\ " #{@account_name}, devices: #{@devices}, additional_properties: #{@additional_properties}>" end |