Class: Verizon::ManagedAccountsAddResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::ManagedAccountsAddResponse
- Defined in:
- lib/verizon/models/managed_accounts_add_response.rb
Overview
ManagedAccountsAddResponse Model.
Instance Attribute Summary collapse
-
#status_list ⇒ Array[StatusList]
Transaction identifier.
-
#tx_id ⇒ String
Transaction identifier.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(tx_id = SKIP, status_list = SKIP) ⇒ ManagedAccountsAddResponse
constructor
A new instance of ManagedAccountsAddResponse.
Methods inherited from BaseModel
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_list ⇒ Array[StatusList]
Transaction identifier
18 19 20 |
# File 'lib/verizon/models/managed_accounts_add_response.rb', line 18 def status_list @status_list end |
#tx_id ⇒ String
Transaction identifier
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 |
.names ⇒ Object
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 |
.nullables ⇒ Object
An array for nullable fields
37 38 39 |
# File 'lib/verizon/models/managed_accounts_add_response.rb', line 37 def self.nullables [] end |
.optionals ⇒ Object
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 |