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

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

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

Returns a new instance of TransactionExceptionsResponse.



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

def initialize(card_exceptions = SKIP, transaction_exceptions = SKIP)
  @card_exceptions = card_exceptions unless card_exceptions == SKIP
  @transaction_exceptions = transaction_exceptions unless transaction_exceptions == 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

#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.



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_response.rb', line 49

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')

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

.namesObject

A mapping from model property names to API property names.



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

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

.nullablesObject

An array for nullable fields



37
38
39
40
41
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_response.rb', line 37

def self.nullables
  %w[
    transaction_exceptions
  ]
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    card_exceptions
    transaction_exceptions
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



87
88
89
90
91
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_response.rb', line 87

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} card_exceptions: #{@card_exceptions.inspect}, transaction_exceptions:"\
  " #{@transaction_exceptions.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



80
81
82
83
84
# File 'lib/shell_data_reporting_ap_is/models/transaction_exceptions_response.rb', line 80

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} card_exceptions: #{@card_exceptions}, transaction_exceptions:"\
  " #{@transaction_exceptions}>"
end