Class: Verizon::GoToStateRequest

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

Overview

Changes the provisioning state of one or more devices to a specified customer-defined service and state.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(service_name = nil, state_name = nil, service_plan = nil, mdn_zip_code = nil, devices = SKIP, filter = SKIP, carrier_ip_pool_name = SKIP, public_ip_restriction = SKIP, sku_number = SKIP, custom_fields = SKIP, devices_with_service_address = SKIP, ipaddress = SKIP, group_name = SKIP, primary_place_of_use = SKIP) ⇒ GoToStateRequest

Returns a new instance of GoToStateRequest.



130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/verizon/models/go_to_state_request.rb', line 130

def initialize(service_name = nil, state_name = nil, service_plan = nil,
               mdn_zip_code = nil, devices = SKIP, filter = SKIP,
               carrier_ip_pool_name = SKIP, public_ip_restriction = SKIP,
               sku_number = SKIP, custom_fields = SKIP,
               devices_with_service_address = SKIP, ipaddress = SKIP,
               group_name = SKIP, primary_place_of_use = SKIP)
  @service_name = service_name
  @state_name = state_name
  @service_plan = service_plan
  @mdn_zip_code = mdn_zip_code
  @devices = devices unless devices == SKIP
  @filter = filter unless filter == SKIP
  @carrier_ip_pool_name = carrier_ip_pool_name unless carrier_ip_pool_name == SKIP
  @public_ip_restriction = public_ip_restriction unless public_ip_restriction == SKIP
  @sku_number = sku_number unless sku_number == SKIP
  @custom_fields = custom_fields unless custom_fields == SKIP
  unless devices_with_service_address == SKIP
    @devices_with_service_address =
      devices_with_service_address
  end
  @ipaddress = ipaddress unless ipaddress == SKIP
  @group_name = group_name unless group_name == SKIP
  @primary_place_of_use = primary_place_of_use unless primary_place_of_use == SKIP
end

Instance Attribute Details

#carrier_ip_pool_nameString

The pool from which your device IP addresses will be derived if the service or state change requires new IP addresses.If you do not include this element, the default pool will be used.

Returns:

  • (String)


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

def carrier_ip_pool_name
  @carrier_ip_pool_name
end

#custom_fieldsArray[CustomFields]

The names and values of any custom fields that you want to set for the devices.

Returns:



65
66
67
# File 'lib/verizon/models/go_to_state_request.rb', line 65

def custom_fields
  @custom_fields
end

#devicesArray[AccountDeviceList]

Up to 10,000 devices that you want to push to a different state, specified by device identifier.

Returns:



36
37
38
# File 'lib/verizon/models/go_to_state_request.rb', line 36

def devices
  @devices
end

#devices_with_service_addressArray[Object]

This is an array that associates an IP address with a device identifier. This variable is only relevant for Business Internet/Fixed Wireless Access

Returns:

  • (Array[Object])


70
71
72
# File 'lib/verizon/models/go_to_state_request.rb', line 70

def devices_with_service_address
  @devices_with_service_address
end

#filterDeviceFilter

Specify the kind of the device identifier, the type of match, and the string that you want to match.

Returns:



41
42
43
# File 'lib/verizon/models/go_to_state_request.rb', line 41

def filter
  @filter
end

#group_nameString

The name of a device group that the devices should be added to.

Returns:

  • (String)


78
79
80
# File 'lib/verizon/models/go_to_state_request.rb', line 78

def group_name
  @group_name
end

#ipaddressString

The IP address of the device.

Returns:

  • (String)


74
75
76
# File 'lib/verizon/models/go_to_state_request.rb', line 74

def ipaddress
  @ipaddress
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)


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

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:



87
88
89
# File 'lib/verizon/models/go_to_state_request.rb', line 87

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. Valid values are “restricted” or “unrestricted”.

Returns:

  • (String)


53
54
55
# File 'lib/verizon/models/go_to_state_request.rb', line 53

def public_ip_restriction
  @public_ip_restriction
end

#service_nameString

The name of a customer-defined service to push the devices to.

Returns:

  • (String)


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

def service_name
  @service_name
end

#service_planString

The service plan code that you want to assign to all specified devices in the new state.

Returns:

  • (String)


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

def service_plan
  @service_plan
end

#sku_numberString

The Stock Keeping Unit (SKU) number of a 4G device type with an embedded SIM. Can be used with ICCID or EID 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)


60
61
62
# File 'lib/verizon/models/go_to_state_request.rb', line 60

def sku_number
  @sku_number
end

#state_nameString

The name of a customer-defined stage state to push the devices to.

Returns:

  • (String)


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

def state_name
  @state_name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/verizon/models/go_to_state_request.rb', line 156

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  service_name = hash.key?('serviceName') ? hash['serviceName'] : nil
  state_name = hash.key?('stateName') ? hash['stateName'] : nil
  service_plan = hash.key?('servicePlan') ? hash['servicePlan'] : nil
  mdn_zip_code = hash.key?('mdnZipCode') ? hash['mdnZipCode'] : 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 << (AccountDeviceList.from_hash(structure) if structure)
    end
  end

  devices = SKIP unless hash.key?('devices')
  filter = DeviceFilter.from_hash(hash['filter']) if hash['filter']
  carrier_ip_pool_name =
    hash.key?('carrierIpPoolName') ? hash['carrierIpPoolName'] : SKIP
  public_ip_restriction =
    hash.key?('publicIpRestriction') ? hash['publicIpRestriction'] : SKIP
  sku_number = hash.key?('skuNumber') ? hash['skuNumber'] : 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')
  devices_with_service_address =
    hash.key?('devicesWithServiceAddress') ? hash['devicesWithServiceAddress'] : SKIP
  ipaddress = hash.key?('ipAddress') ? hash['ipAddress'] : SKIP
  group_name = hash.key?('groupName') ? hash['groupName'] : SKIP
  primary_place_of_use = PlaceOfUse.from_hash(hash['primaryPlaceOfUse']) if
    hash['primaryPlaceOfUse']

  # Create object from extracted values.
  GoToStateRequest.new(service_name,
                       state_name,
                       service_plan,
                       mdn_zip_code,
                       devices,
                       filter,
                       carrier_ip_pool_name,
                       public_ip_restriction,
                       sku_number,
                       custom_fields,
                       devices_with_service_address,
                       ipaddress,
                       group_name,
                       primary_place_of_use)
end

.namesObject

A mapping from model property names to API property names.



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/verizon/models/go_to_state_request.rb', line 90

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['service_name'] = 'serviceName'
  @_hash['state_name'] = 'stateName'
  @_hash['service_plan'] = 'servicePlan'
  @_hash['mdn_zip_code'] = 'mdnZipCode'
  @_hash['devices'] = 'devices'
  @_hash['filter'] = 'filter'
  @_hash['carrier_ip_pool_name'] = 'carrierIpPoolName'
  @_hash['public_ip_restriction'] = 'publicIpRestriction'
  @_hash['sku_number'] = 'skuNumber'
  @_hash['custom_fields'] = 'customFields'
  @_hash['devices_with_service_address'] = 'devicesWithServiceAddress'
  @_hash['ipaddress'] = 'ipAddress'
  @_hash['group_name'] = 'groupName'
  @_hash['primary_place_of_use'] = 'primaryPlaceOfUse'
  @_hash
end

.nullablesObject

An array for nullable fields



126
127
128
# File 'lib/verizon/models/go_to_state_request.rb', line 126

def self.nullables
  []
end

.optionalsObject

An array for optional fields



110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/verizon/models/go_to_state_request.rb', line 110

def self.optionals
  %w[
    devices
    filter
    carrier_ip_pool_name
    public_ip_restriction
    sku_number
    custom_fields
    devices_with_service_address
    ipaddress
    group_name
    primary_place_of_use
  ]
end