Class: Verizon::M5gBichangeRequest

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

Overview

M5gBichangeRequest Model.

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 = SKIP, service_plan = SKIP, device_list_with_service_address = SKIP, current_service_plan = SKIP) ⇒ M5gBichangeRequest

Returns a new instance of M5gBichangeRequest.



54
55
56
57
58
59
60
61
62
63
64
# File 'lib/verizon/models/m_5g_bichange_request.rb', line 54

def initialize( = SKIP, service_plan = SKIP,
               device_list_with_service_address = SKIP,
               current_service_plan = SKIP)
  @account_name =  unless  == SKIP
  @service_plan = service_plan unless service_plan == SKIP
  unless device_list_with_service_address == SKIP
    @device_list_with_service_address =
      device_list_with_service_address
  end
  @current_service_plan = current_service_plan unless current_service_plan == SKIP
end

Instance Attribute Details

#account_nameString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/verizon/models/m_5g_bichange_request.rb', line 14

def 
  @account_name
end

#current_service_planString

TODO: Write general description for this method

Returns:

  • (String)


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

def current_service_plan
  @current_service_plan
end

#device_list_with_service_addressArray[DeviceListWithServiceAddress]

TODO: Write general description for this method

Returns:



22
23
24
# File 'lib/verizon/models/m_5g_bichange_request.rb', line 22

def device_list_with_service_address
  @device_list_with_service_address
end

#service_planString

TODO: Write general description for this method

Returns:

  • (String)


18
19
20
# File 'lib/verizon/models/m_5g_bichange_request.rb', line 18

def service_plan
  @service_plan
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/verizon/models/m_5g_bichange_request.rb', line 67

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('accountName') ? hash['accountName'] : SKIP
  service_plan = hash.key?('servicePlan') ? hash['servicePlan'] : SKIP
  # Parameter is an array, so we need to iterate through it
  device_list_with_service_address = nil
  unless hash['deviceListWithServiceAddress'].nil?
    device_list_with_service_address = []
    hash['deviceListWithServiceAddress'].each do |structure|
      device_list_with_service_address << (DeviceListWithServiceAddress.from_hash(structure) if structure)
    end
  end

  device_list_with_service_address = SKIP unless hash.key?('deviceListWithServiceAddress')
  current_service_plan =
    hash.key?('currentServicePlan') ? hash['currentServicePlan'] : SKIP

  # Create object from extracted values.
  M5gBichangeRequest.new(,
                         service_plan,
                         device_list_with_service_address,
                         current_service_plan)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
36
37
# File 'lib/verizon/models/m_5g_bichange_request.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_name'] = 'accountName'
  @_hash['service_plan'] = 'servicePlan'
  @_hash['device_list_with_service_address'] =
    'deviceListWithServiceAddress'
  @_hash['current_service_plan'] = 'currentServicePlan'
  @_hash
end

.nullablesObject

An array for nullable fields



50
51
52
# File 'lib/verizon/models/m_5g_bichange_request.rb', line 50

def self.nullables
  []
end

.optionalsObject

An array for optional fields



40
41
42
43
44
45
46
47
# File 'lib/verizon/models/m_5g_bichange_request.rb', line 40

def self.optionals
  %w[
    account_name
    service_plan
    device_list_with_service_address
    current_service_plan
  ]
end