Class: Ingenico::Connect::SDK::Domain::Dispute::DisputeOutput

Inherits:
Ingenico::Connect::SDK::DataObject show all
Defined in:
lib/ingenico/connect/sdk/domain/dispute/dispute_output.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Connect::SDK::DataObject

new_from_hash

Instance Attribute Details

#amount_of_moneyIngenico::Connect::SDK::Domain::Definitions::AmountOfMoney



24
25
26
# File 'lib/ingenico/connect/sdk/domain/dispute/dispute_output.rb', line 24

def amount_of_money
  @amount_of_money
end

#contact_personString



24
25
26
# File 'lib/ingenico/connect/sdk/domain/dispute/dispute_output.rb', line 24

def contact_person
  @contact_person
end

#creation_detailsIngenico::Connect::SDK::Domain::Dispute::DisputeCreationDetail



24
25
26
# File 'lib/ingenico/connect/sdk/domain/dispute/dispute_output.rb', line 24

def creation_details
  @creation_details
end

#email_addressString



24
25
26
# File 'lib/ingenico/connect/sdk/domain/dispute/dispute_output.rb', line 24

def email_address
  @email_address
end

#filesArray<Ingenico::Connect::SDK::Domain::File::HostedFile>



24
25
26
# File 'lib/ingenico/connect/sdk/domain/dispute/dispute_output.rb', line 24

def files
  @files
end

#referenceIngenico::Connect::SDK::Domain::Dispute::DisputeReference



24
25
26
# File 'lib/ingenico/connect/sdk/domain/dispute/dispute_output.rb', line 24

def reference
  @reference
end

#reply_toString



24
25
26
# File 'lib/ingenico/connect/sdk/domain/dispute/dispute_output.rb', line 24

def reply_to
  @reply_to
end

#request_messageString



24
25
26
# File 'lib/ingenico/connect/sdk/domain/dispute/dispute_output.rb', line 24

def request_message
  @request_message
end

#response_messageString



24
25
26
# File 'lib/ingenico/connect/sdk/domain/dispute/dispute_output.rb', line 24

def response_message
  @response_message
end

Instance Method Details

#from_hash(hash) ⇒ Object



59
60
61
62
63
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
# File 'lib/ingenico/connect/sdk/domain/dispute/dispute_output.rb', line 59

def from_hash(hash)
  super
  if hash.has_key? 'amountOfMoney'
    raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoney']] unless hash['amountOfMoney'].is_a? Hash
    @amount_of_money = Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney.new_from_hash(hash['amountOfMoney'])
  end
  if hash.has_key? 'contactPerson'
    @contact_person = hash['contactPerson']
  end
  if hash.has_key? 'creationDetails'
    raise TypeError, "value '%s' is not a Hash" % [hash['creationDetails']] unless hash['creationDetails'].is_a? Hash
    @creation_details = Ingenico::Connect::SDK::Domain::Dispute::DisputeCreationDetail.new_from_hash(hash['creationDetails'])
  end
  if hash.has_key? 'emailAddress'
    @email_address = hash['emailAddress']
  end
  if hash.has_key? 'files'
    raise TypeError, "value '%s' is not an Array" % [hash['files']] unless hash['files'].is_a? Array
    @files = []
    hash['files'].each do |e|
      @files << Ingenico::Connect::SDK::Domain::File::HostedFile.new_from_hash(e)
    end
  end
  if hash.has_key? 'reference'
    raise TypeError, "value '%s' is not a Hash" % [hash['reference']] unless hash['reference'].is_a? Hash
    @reference = Ingenico::Connect::SDK::Domain::Dispute::DisputeReference.new_from_hash(hash['reference'])
  end
  if hash.has_key? 'replyTo'
    @reply_to = hash['replyTo']
  end
  if hash.has_key? 'requestMessage'
    @request_message = hash['requestMessage']
  end
  if hash.has_key? 'responseMessage'
    @response_message = hash['responseMessage']
  end
end

#to_hHash



45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/ingenico/connect/sdk/domain/dispute/dispute_output.rb', line 45

def to_h
  hash = super
  hash['amountOfMoney'] = @amount_of_money.to_h unless @amount_of_money.nil?
  hash['contactPerson'] = @contact_person unless @contact_person.nil?
  hash['creationDetails'] = @creation_details.to_h unless @creation_details.nil?
  hash['emailAddress'] = @email_address unless @email_address.nil?
  hash['files'] = @files.collect{|val| val.to_h} unless @files.nil?
  hash['reference'] = @reference.to_h unless @reference.nil?
  hash['replyTo'] = @reply_to unless @reply_to.nil?
  hash['requestMessage'] = @request_message unless @request_message.nil?
  hash['responseMessage'] = @response_message unless @response_message.nil?
  hash
end