Class: Verizon::ProfileRequest
- Defined in:
- lib/verizon/models/profile_request.rb
Overview
ProfileRequest Model.
Instance Attribute Summary collapse
-
#account_name ⇒ String
TODO: Write general description for this method.
-
#carrier_ip_pool_name ⇒ String
The name of the pool of IP addresses assigned to the profile.
-
#carrier_name ⇒ String
TODO: Write general description for this method.
-
#devices ⇒ Array[DeviceList]
TODO: Write general description for this method.
-
#mdn_zip_code ⇒ String
TODO: Write general description for this method.
-
#primary_place_of_use ⇒ Array[PrimaryPlaceOfUse]
TODO: Write general description for this method.
-
#service_plan ⇒ String
TODO: Write general description for this method.
-
#smsr_oid ⇒ String
TODO: Write general description for this method.
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, devices = nil, carrier_name = SKIP, service_plan = SKIP, mdn_zip_code = SKIP, primary_place_of_use = SKIP, smsr_oid = SKIP, carrier_ip_pool_name = SKIP) ⇒ ProfileRequest
constructor
A new instance of ProfileRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(account_name = nil, devices = nil, carrier_name = SKIP, service_plan = SKIP, mdn_zip_code = SKIP, primary_place_of_use = SKIP, smsr_oid = SKIP, carrier_ip_pool_name = SKIP) ⇒ ProfileRequest
Returns a new instance of ProfileRequest.
75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/verizon/models/profile_request.rb', line 75 def initialize(account_name = nil, devices = nil, carrier_name = SKIP, service_plan = SKIP, mdn_zip_code = SKIP, primary_place_of_use = SKIP, smsr_oid = SKIP, carrier_ip_pool_name = SKIP) @account_name = account_name @devices = devices @carrier_name = carrier_name unless carrier_name == SKIP @service_plan = service_plan unless service_plan == SKIP @mdn_zip_code = mdn_zip_code unless mdn_zip_code == SKIP @primary_place_of_use = primary_place_of_use unless primary_place_of_use == SKIP @smsr_oid = smsr_oid unless smsr_oid == SKIP @carrier_ip_pool_name = carrier_ip_pool_name unless carrier_ip_pool_name == SKIP end |
Instance Attribute Details
#account_name ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/verizon/models/profile_request.rb', line 14 def account_name @account_name end |
#carrier_ip_pool_name ⇒ String
The name of the pool of IP addresses assigned to the profile.
42 43 44 |
# File 'lib/verizon/models/profile_request.rb', line 42 def carrier_ip_pool_name @carrier_ip_pool_name end |
#carrier_name ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/verizon/models/profile_request.rb', line 22 def carrier_name @carrier_name end |
#devices ⇒ Array[DeviceList]
TODO: Write general description for this method
18 19 20 |
# File 'lib/verizon/models/profile_request.rb', line 18 def devices @devices end |
#mdn_zip_code ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/verizon/models/profile_request.rb', line 30 def mdn_zip_code @mdn_zip_code end |
#primary_place_of_use ⇒ Array[PrimaryPlaceOfUse]
TODO: Write general description for this method
34 35 36 |
# File 'lib/verizon/models/profile_request.rb', line 34 def primary_place_of_use @primary_place_of_use end |
#service_plan ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/verizon/models/profile_request.rb', line 26 def service_plan @service_plan end |
#smsr_oid ⇒ String
TODO: Write general description for this method
38 39 40 |
# File 'lib/verizon/models/profile_request.rb', line 38 def smsr_oid @smsr_oid end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
90 91 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/profile_request.rb', line 90 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_name = hash.key?('accountName') ? hash['accountName'] : nil # Parameter is an array, so we need to iterate through it devices = nil unless hash['devices'].nil? devices = [] hash['devices'].each do |structure| devices << (DeviceList.from_hash(structure) if structure) end end devices = nil unless hash.key?('devices') carrier_name = hash.key?('carrierName') ? hash['carrierName'] : SKIP service_plan = hash.key?('servicePlan') ? hash['servicePlan'] : SKIP mdn_zip_code = hash.key?('mdnZipCode') ? hash['mdnZipCode'] : SKIP # Parameter is an array, so we need to iterate through it primary_place_of_use = nil unless hash['primaryPlaceOfUse'].nil? primary_place_of_use = [] hash['primaryPlaceOfUse'].each do |structure| primary_place_of_use << (PrimaryPlaceOfUse.from_hash(structure) if structure) end end primary_place_of_use = SKIP unless hash.key?('primaryPlaceOfUse') smsr_oid = hash.key?('smsrOid') ? hash['smsrOid'] : SKIP carrier_ip_pool_name = hash.key?('carrierIpPoolName') ? hash['carrierIpPoolName'] : SKIP # Create object from extracted values. ProfileRequest.new(account_name, devices, carrier_name, service_plan, mdn_zip_code, primary_place_of_use, smsr_oid, carrier_ip_pool_name) end |
.names ⇒ Object
A mapping from model property names to API property names.
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/verizon/models/profile_request.rb', line 45 def self.names @_hash = {} if @_hash.nil? @_hash['account_name'] = 'accountName' @_hash['devices'] = 'devices' @_hash['carrier_name'] = 'carrierName' @_hash['service_plan'] = 'servicePlan' @_hash['mdn_zip_code'] = 'mdnZipCode' @_hash['primary_place_of_use'] = 'primaryPlaceOfUse' @_hash['smsr_oid'] = 'smsrOid' @_hash['carrier_ip_pool_name'] = 'carrierIpPoolName' @_hash end |
.nullables ⇒ Object
An array for nullable fields
71 72 73 |
# File 'lib/verizon/models/profile_request.rb', line 71 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
59 60 61 62 63 64 65 66 67 68 |
# File 'lib/verizon/models/profile_request.rb', line 59 def self.optionals %w[ carrier_name service_plan mdn_zip_code primary_place_of_use smsr_oid carrier_ip_pool_name ] end |