Class: Verizon::CheckOrderStatusRequest

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

Overview

The request body identifies the devices to upload.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(account_name = nil, devices = nil, order_request_id = SKIP) ⇒ CheckOrderStatusRequest

Returns a new instance of CheckOrderStatusRequest.



47
48
49
50
51
52
53
# File 'lib/verizon/models/check_order_status_request.rb', line 47

def initialize( = nil,
               devices = nil,
               order_request_id = SKIP)
  @account_name = 
  @order_request_id = order_request_id unless order_request_id == SKIP
  @devices = devices
end

Instance Attribute Details

#account_nameString

The name of a billing account. An account name is usually numeric, and must include any leading zeros.

Returns:

  • (String)


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

def 
  @account_name
end

#devicesArray[DeviceList]

The devices to upload, specified by device IDs in a format matching uploadType.

Returns:



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

def devices
  @devices
end

#order_request_idString

The request id from the activation order.

Returns:

  • (String)


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

def order_request_id
  @order_request_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/verizon/models/check_order_status_request.rb', line 56

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = 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')
  order_request_id =
    hash.key?('orderRequestId') ? hash['orderRequestId'] : SKIP

  # Create object from extracted values.
  CheckOrderStatusRequest.new(,
                              devices,
                              order_request_id)
end

.namesObject

A mapping from model property names to API property names.



27
28
29
30
31
32
33
# File 'lib/verizon/models/check_order_status_request.rb', line 27

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_name'] = 'accountName'
  @_hash['order_request_id'] = 'orderRequestId'
  @_hash['devices'] = 'devices'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



36
37
38
39
40
# File 'lib/verizon/models/check_order_status_request.rb', line 36

def self.optionals
  %w[
    order_request_id
  ]
end