Class: Verizon::ContactInfoUpdateRequest

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

Overview

Request to update contact information.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

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,  = SKIP,
               devices = SKIP)
  @primary_place_of_use = primary_place_of_use
  @account_name =  unless  == SKIP
  @devices = devices unless devices == SKIP
end

Instance Attribute Details

#account_nameString

The name of the billing account that the devices belong to. An account name is usually numeric, and must include any leading zeros.

Returns:

  • (String)


24
25
26
# File 'lib/verizon/models/contact_info_update_request.rb', line 24

def 
  @account_name
end

#devicesArray[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.

Returns:



31
32
33
# File 'lib/verizon/models/contact_info_update_request.rb', line 31

def devices
  @devices
end

#primary_place_of_usePlaceOfUse

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.

Returns:



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']
   = 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,
                               ,
                               devices)
end

.namesObject

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

.nullablesObject

An array for nullable fields



51
52
53
# File 'lib/verizon/models/contact_info_update_request.rb', line 51

def self.nullables
  []
end

.optionalsObject

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