Class: ShellDataReportingApIs::TransactionExceptionsResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_data_reporting_ap_is/models/transaction_exceptions_response.rb

Overview

TransactionExceptionsResponse Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(card_exceptions = SKIP, transaction_exceptions = SKIP, error = SKIP, request_id = SKIP) ⇒ TransactionExceptionsResponse

Returns a new instance of TransactionExceptionsResponse.



55
56
57
58
59
60
61
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_response.rb', line 55

def initialize(card_exceptions = SKIP, transaction_exceptions = SKIP,
               error = SKIP, request_id = SKIP)
  @card_exceptions = card_exceptions unless card_exceptions == SKIP
  @transaction_exceptions = transaction_exceptions unless transaction_exceptions == SKIP
  @error = error unless error == SKIP
  @request_id = request_id unless request_id == SKIP
end

Instance Attribute Details

#card_exceptionsArray[CardExceptions]

TODO: Write general description for this method

Returns:



14
15
16
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_response.rb', line 14

def card_exceptions
  @card_exceptions
end

#errorErrorStatus

TODO: Write general description for this method

Returns:



22
23
24
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_response.rb', line 22

def error
  @error
end

#request_idString

API Request Id

Returns:

  • (String)


26
27
28
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_response.rb', line 26

def request_id
  @request_id
end

#transaction_exceptionsArray[TransactionExceptions]

TODO: Write general description for this method

Returns:



18
19
20
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_response.rb', line 18

def transaction_exceptions
  @transaction_exceptions
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



64
65
66
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
92
93
94
95
96
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_response.rb', line 64

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  # Parameter is an array, so we need to iterate through it
  card_exceptions = nil
  unless hash['CardExceptions'].nil?
    card_exceptions = []
    hash['CardExceptions'].each do |structure|
      card_exceptions << (CardExceptions.from_hash(structure) if structure)
    end
  end

  card_exceptions = SKIP unless hash.key?('CardExceptions')
  # Parameter is an array, so we need to iterate through it
  transaction_exceptions = nil
  unless hash['TransactionExceptions'].nil?
    transaction_exceptions = []
    hash['TransactionExceptions'].each do |structure|
      transaction_exceptions << (TransactionExceptions.from_hash(structure) if structure)
    end
  end

  transaction_exceptions = SKIP unless hash.key?('TransactionExceptions')
  error = ErrorStatus.from_hash(hash['Error']) if hash['Error']
  request_id = hash.key?('RequestId') ? hash['RequestId'] : SKIP

  # Create object from extracted values.
  TransactionExceptionsResponse.new(card_exceptions,
                                    transaction_exceptions,
                                    error,
                                    request_id)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
36
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_response.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['card_exceptions'] = 'CardExceptions'
  @_hash['transaction_exceptions'] = 'TransactionExceptions'
  @_hash['error'] = 'Error'
  @_hash['request_id'] = 'RequestId'
  @_hash
end

.nullablesObject

An array for nullable fields



49
50
51
52
53
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_response.rb', line 49

def self.nullables
  %w[
    transaction_exceptions
  ]
end

.optionalsObject

An array for optional fields



39
40
41
42
43
44
45
46
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_response.rb', line 39

def self.optionals
  %w[
    card_exceptions
    transaction_exceptions
    error
    request_id
  ]
end