Class: VisaAcceptanceMergedSpec::IncrementAuthRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_merged_spec/models/increment_auth_request.rb

Overview

IncrementAuthRequest 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(client_reference_information: SKIP, processing_information: SKIP, order_information: SKIP, merchant_information: SKIP, travel_information: SKIP, additional_properties: nil) ⇒ IncrementAuthRequest

Returns a new instance of IncrementAuthRequest.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/visa_acceptance_merged_spec/models/increment_auth_request.rb', line 59

def initialize(client_reference_information: SKIP,
               processing_information: SKIP, order_information: SKIP,
               merchant_information: SKIP, travel_information: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  unless client_reference_information == SKIP
    @client_reference_information =
      client_reference_information
  end
  @processing_information = processing_information unless processing_information == SKIP
  @order_information = order_information unless order_information == SKIP
  @merchant_information = merchant_information unless merchant_information == SKIP
  @travel_information = travel_information unless travel_information == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#client_reference_informationClientReferenceInformation2

TODO: Write general description for this method



14
15
16
# File 'lib/visa_acceptance_merged_spec/models/increment_auth_request.rb', line 14

def client_reference_information
  @client_reference_information
end

#merchant_informationMerchantInformation2

TODO: Write general description for this method



26
27
28
# File 'lib/visa_acceptance_merged_spec/models/increment_auth_request.rb', line 26

def merchant_information
  @merchant_information
end

#order_informationOrderInformation2

TODO: Write general description for this method

Returns:



22
23
24
# File 'lib/visa_acceptance_merged_spec/models/increment_auth_request.rb', line 22

def order_information
  @order_information
end

#processing_informationProcessingInformation2

TODO: Write general description for this method



18
19
20
# File 'lib/visa_acceptance_merged_spec/models/increment_auth_request.rb', line 18

def processing_information
  @processing_information
end

#travel_informationTravelInformation1

TODO: Write general description for this method

Returns:



30
31
32
# File 'lib/visa_acceptance_merged_spec/models/increment_auth_request.rb', line 30

def travel_information
  @travel_information
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/visa_acceptance_merged_spec/models/increment_auth_request.rb', line 78

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  if hash['clientReferenceInformation']
    client_reference_information = ClientReferenceInformation2.from_hash(hash['clientReferenceInformation'])
  end
  processing_information = ProcessingInformation2.from_hash(hash['processingInformation']) if
    hash['processingInformation']
  order_information = OrderInformation2.from_hash(hash['orderInformation']) if
    hash['orderInformation']
  merchant_information = MerchantInformation2.from_hash(hash['merchantInformation']) if
    hash['merchantInformation']
  travel_information = TravelInformation1.from_hash(hash['travelInformation']) if
    hash['travelInformation']

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  IncrementAuthRequest.new(client_reference_information: client_reference_information,
                           processing_information: processing_information,
                           order_information: order_information,
                           merchant_information: merchant_information,
                           travel_information: travel_information,
                           additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
41
# File 'lib/visa_acceptance_merged_spec/models/increment_auth_request.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['client_reference_information'] = 'clientReferenceInformation'
  @_hash['processing_information'] = 'processingInformation'
  @_hash['order_information'] = 'orderInformation'
  @_hash['merchant_information'] = 'merchantInformation'
  @_hash['travel_information'] = 'travelInformation'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/visa_acceptance_merged_spec/models/increment_auth_request.rb', line 55

def self.nullables
  []
end

.optionalsObject

An array for optional fields



44
45
46
47
48
49
50
51
52
# File 'lib/visa_acceptance_merged_spec/models/increment_auth_request.rb', line 44

def self.optionals
  %w[
    client_reference_information
    processing_information
    order_information
    merchant_information
    travel_information
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



120
121
122
123
124
125
126
127
# File 'lib/visa_acceptance_merged_spec/models/increment_auth_request.rb', line 120

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} client_reference_information: #{@client_reference_information.inspect},"\
  " processing_information: #{@processing_information.inspect}, order_information:"\
  " #{@order_information.inspect}, merchant_information: #{@merchant_information.inspect},"\
  " travel_information: #{@travel_information.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



111
112
113
114
115
116
117
# File 'lib/visa_acceptance_merged_spec/models/increment_auth_request.rb', line 111

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} client_reference_information: #{@client_reference_information},"\
  " processing_information: #{@processing_information}, order_information:"\
  " #{@order_information}, merchant_information: #{@merchant_information}, travel_information:"\
  " #{@travel_information}, additional_properties: #{@additional_properties}>"
end