Class: Verizon::CarrierActivateRequest

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

Overview

Request for carrier activation.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(devices = nil, service_plan = nil, mdn_zip_code = nil, account_name = SKIP, carrier_ip_pool_name = SKIP, carrier_name = SKIP, cost_center_code = SKIP, custom_fields = SKIP, group_name = SKIP, lead_id = SKIP, primary_place_of_use = SKIP, public_ip_restriction = SKIP, sku_number = SKIP) ⇒ CarrierActivateRequest

Returns a new instance of CarrierActivateRequest.



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/verizon/models/carrier_activate_request.rb', line 122

def initialize(devices = nil, service_plan = nil, mdn_zip_code = nil,
                = SKIP, carrier_ip_pool_name = SKIP,
               carrier_name = SKIP, cost_center_code = SKIP,
               custom_fields = SKIP, group_name = SKIP, lead_id = SKIP,
               primary_place_of_use = SKIP, public_ip_restriction = SKIP,
               sku_number = SKIP)
  @devices = devices
  @service_plan = service_plan
  @mdn_zip_code = mdn_zip_code
  @account_name =  unless  == SKIP
  @carrier_ip_pool_name = carrier_ip_pool_name unless carrier_ip_pool_name == SKIP
  @carrier_name = carrier_name unless carrier_name == SKIP
  @cost_center_code = cost_center_code unless cost_center_code == SKIP
  @custom_fields = custom_fields unless custom_fields == SKIP
  @group_name = group_name unless group_name == SKIP
  @lead_id = lead_id unless lead_id == SKIP
  @primary_place_of_use = primary_place_of_use unless primary_place_of_use == SKIP
  @public_ip_restriction = public_ip_restriction unless public_ip_restriction == SKIP
  @sku_number = sku_number unless sku_number == SKIP
end

Instance Attribute Details

#account_nameString

The name of a billing account.

Returns:

  • (String)


30
31
32
# File 'lib/verizon/models/carrier_activate_request.rb', line 30

def 
  @account_name
end

#carrier_ip_pool_nameString

The private IP pool (Carrier Group Name) from which your device IP addresses will be derived.

Returns:

  • (String)


35
36
37
# File 'lib/verizon/models/carrier_activate_request.rb', line 35

def carrier_ip_pool_name
  @carrier_ip_pool_name
end

#carrier_nameString

The carrier that will perform the activation.

Returns:

  • (String)


39
40
41
# File 'lib/verizon/models/carrier_activate_request.rb', line 39

def carrier_name
  @carrier_name
end

#cost_center_codeString

A string to identify the cost center that the device is associated with.

Returns:

  • (String)


43
44
45
# File 'lib/verizon/models/carrier_activate_request.rb', line 43

def cost_center_code
  @cost_center_code
end

#custom_fieldsArray[CustomFields]

A user-defined descriptive field, limited to 50 characters.

Returns:



47
48
49
# File 'lib/verizon/models/carrier_activate_request.rb', line 47

def custom_fields
  @custom_fields
end

#devicesArray[AccountDeviceList]

Up to 10,000 devices for which you want to activate service, specified by device identifier.

Returns:



15
16
17
# File 'lib/verizon/models/carrier_activate_request.rb', line 15

def devices
  @devices
end

#group_nameString

If you specify devices by ID in the devices parameters, this is the name of a device group that the devices should be added to.If you don’t specify individual devices with the devices parameter, you can provide the name of a device group to activate all devices in that group.

Returns:

  • (String)


54
55
56
# File 'lib/verizon/models/carrier_activate_request.rb', line 54

def group_name
  @group_name
end

#lead_idString

The ID of a “Qualified” or “Closed - Won” VPP customer lead, which is used with other values to determine MDN assignment, taxation, and compensation.

Returns:

  • (String)


59
60
61
# File 'lib/verizon/models/carrier_activate_request.rb', line 59

def lead_id
  @lead_id
end

#mdn_zip_codeString

The Zip code of the location where the line of service will primarily be used, or a Zip code that you have been told to use with these devices. For accounts that are configured for geographic numbering, this is the ZIP code from which the MDN will be derived.

Returns:

  • (String)


26
27
28
# File 'lib/verizon/models/carrier_activate_request.rb', line 26

def mdn_zip_code
  @mdn_zip_code
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:



68
69
70
# File 'lib/verizon/models/carrier_activate_request.rb', line 68

def primary_place_of_use
  @primary_place_of_use
end

#public_ip_restrictionString

For devices with static IP addresses on the public network, this specifies whether the devices have general access to the Internet.

Returns:

  • (String)


73
74
75
# File 'lib/verizon/models/carrier_activate_request.rb', line 73

def public_ip_restriction
  @public_ip_restriction
end

#service_planString

The service plan code that you want to assign to all specified devices.

Returns:

  • (String)


19
20
21
# File 'lib/verizon/models/carrier_activate_request.rb', line 19

def service_plan
  @service_plan
end

#sku_numberString

The Stock Keeping Unit (SKU) of a 4G device type can be used with ICCID device identifiers in lieu of an IMEI when activating 4G devices. The SkuNumber will be used with all devices in the request, so all devices must be of the same type.

Returns:

  • (String)


80
81
82
# File 'lib/verizon/models/carrier_activate_request.rb', line 80

def sku_number
  @sku_number
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/verizon/models/carrier_activate_request.rb', line 144

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  # 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 = nil unless hash.key?('devices')
  service_plan = hash.key?('servicePlan') ? hash['servicePlan'] : nil
  mdn_zip_code = hash.key?('mdnZipCode') ? hash['mdnZipCode'] : nil
   = hash.key?('accountName') ? hash['accountName'] : SKIP
  carrier_ip_pool_name =
    hash.key?('carrierIpPoolName') ? hash['carrierIpPoolName'] : SKIP
  carrier_name = hash.key?('carrierName') ? hash['carrierName'] : SKIP
  cost_center_code =
    hash.key?('costCenterCode') ? hash['costCenterCode'] : SKIP
  # 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 << (CustomFields.from_hash(structure) if structure)
    end
  end

  custom_fields = SKIP unless hash.key?('customFields')
  group_name = hash.key?('groupName') ? hash['groupName'] : SKIP
  lead_id = hash.key?('leadId') ? hash['leadId'] : SKIP
  primary_place_of_use = PlaceOfUse.from_hash(hash['primaryPlaceOfUse']) if
    hash['primaryPlaceOfUse']
  public_ip_restriction =
    hash.key?('publicIpRestriction') ? hash['publicIpRestriction'] : SKIP
  sku_number = hash.key?('skuNumber') ? hash['skuNumber'] : SKIP

  # Create object from extracted values.
  CarrierActivateRequest.new(devices,
                             service_plan,
                             mdn_zip_code,
                             ,
                             carrier_ip_pool_name,
                             carrier_name,
                             cost_center_code,
                             custom_fields,
                             group_name,
                             lead_id,
                             primary_place_of_use,
                             public_ip_restriction,
                             sku_number)
end

.namesObject

A mapping from model property names to API property names.



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/verizon/models/carrier_activate_request.rb', line 83

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['devices'] = 'devices'
  @_hash['service_plan'] = 'servicePlan'
  @_hash['mdn_zip_code'] = 'mdnZipCode'
  @_hash['account_name'] = 'accountName'
  @_hash['carrier_ip_pool_name'] = 'carrierIpPoolName'
  @_hash['carrier_name'] = 'carrierName'
  @_hash['cost_center_code'] = 'costCenterCode'
  @_hash['custom_fields'] = 'customFields'
  @_hash['group_name'] = 'groupName'
  @_hash['lead_id'] = 'leadId'
  @_hash['primary_place_of_use'] = 'primaryPlaceOfUse'
  @_hash['public_ip_restriction'] = 'publicIpRestriction'
  @_hash['sku_number'] = 'skuNumber'
  @_hash
end

.nullablesObject

An array for nullable fields



118
119
120
# File 'lib/verizon/models/carrier_activate_request.rb', line 118

def self.nullables
  []
end

.optionalsObject

An array for optional fields



102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/verizon/models/carrier_activate_request.rb', line 102

def self.optionals
  %w[
    account_name
    carrier_ip_pool_name
    carrier_name
    cost_center_code
    custom_fields
    group_name
    lead_id
    primary_place_of_use
    public_ip_restriction
    sku_number
  ]
end