Class: Verizon::ManagedAccountsAddResponse

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

Overview

ManagedAccountsAddResponse Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(tx_id = SKIP, status_list = SKIP) ⇒ ManagedAccountsAddResponse

Returns a new instance of ManagedAccountsAddResponse.



41
42
43
44
45
# File 'lib/verizon/models/managed_accounts_add_response.rb', line 41

def initialize(tx_id = SKIP,
               status_list = SKIP)
  @tx_id = tx_id unless tx_id == SKIP
  @status_list = status_list unless status_list == SKIP
end

Instance Attribute Details

#status_listArray[StatusList]

Transaction identifier

Returns:



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

def status_list
  @status_list
end

#tx_idString

Transaction identifier

Returns:

  • (String)


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

def tx_id
  @tx_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/verizon/models/managed_accounts_add_response.rb', line 48

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  tx_id = hash.key?('TxId') ? hash['TxId'] : SKIP
  # Parameter is an array, so we need to iterate through it
  status_list = nil
  unless hash['statusList'].nil?
    status_list = []
    hash['statusList'].each do |structure|
      status_list << (StatusList.from_hash(structure) if structure)
    end
  end

  status_list = SKIP unless hash.key?('statusList')

  # Create object from extracted values.
  ManagedAccountsAddResponse.new(tx_id,
                                 status_list)
end

.namesObject

A mapping from model property names to API property names.



21
22
23
24
25
26
# File 'lib/verizon/models/managed_accounts_add_response.rb', line 21

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['tx_id'] = 'TxId'
  @_hash['status_list'] = 'statusList'
  @_hash
end

.nullablesObject

An array for nullable fields



37
38
39
# File 'lib/verizon/models/managed_accounts_add_response.rb', line 37

def self.nullables
  []
end

.optionalsObject

An array for optional fields



29
30
31
32
33
34
# File 'lib/verizon/models/managed_accounts_add_response.rb', line 29

def self.optionals
  %w[
    tx_id
    status_list
  ]
end