Class: CyberSourceMergedSpec::PullFundsRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/cyber_source_merged_spec/models/pull_funds_request.rb

Overview

PullFundsRequest 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, order_information: SKIP, processing_information: SKIP, recipient_information: SKIP, sender_information: SKIP, buyer_information: SKIP, aggregator_information: SKIP, merchant_information: SKIP, additional_properties: nil) ⇒ PullFundsRequest

Returns a new instance of PullFundsRequest.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/cyber_source_merged_spec/models/pull_funds_request.rb', line 77

def initialize(client_reference_information: SKIP, order_information: SKIP,
               processing_information: SKIP, recipient_information: SKIP,
               sender_information: SKIP, buyer_information: SKIP,
               aggregator_information: SKIP, merchant_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
  @order_information = order_information unless order_information == SKIP
  @processing_information = processing_information unless processing_information == SKIP
  @recipient_information = recipient_information unless recipient_information == SKIP
  @sender_information = sender_information unless sender_information == SKIP
  @buyer_information = buyer_information unless buyer_information == SKIP
  @aggregator_information = aggregator_information unless aggregator_information == SKIP
  @merchant_information = merchant_information unless merchant_information == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#aggregator_informationAggregatorInformation8

TODO: Write general description for this method



38
39
40
# File 'lib/cyber_source_merged_spec/models/pull_funds_request.rb', line 38

def aggregator_information
  @aggregator_information
end

#buyer_informationBuyerInformation42

TODO: Write general description for this method

Returns:



34
35
36
# File 'lib/cyber_source_merged_spec/models/pull_funds_request.rb', line 34

def buyer_information
  @buyer_information
end

#client_reference_informationClientReferenceInformation64

TODO: Write general description for this method



14
15
16
# File 'lib/cyber_source_merged_spec/models/pull_funds_request.rb', line 14

def client_reference_information
  @client_reference_information
end

#merchant_informationMerchantInformation23

TODO: Write general description for this method



42
43
44
# File 'lib/cyber_source_merged_spec/models/pull_funds_request.rb', line 42

def merchant_information
  @merchant_information
end

#order_informationOrderInformation45

TODO: Write general description for this method

Returns:



18
19
20
# File 'lib/cyber_source_merged_spec/models/pull_funds_request.rb', line 18

def order_information
  @order_information
end

#processing_informationProcessingInformation63

TODO: Write general description for this method



22
23
24
# File 'lib/cyber_source_merged_spec/models/pull_funds_request.rb', line 22

def processing_information
  @processing_information
end

#recipient_informationRecipientInformation5

TODO: Write general description for this method



26
27
28
# File 'lib/cyber_source_merged_spec/models/pull_funds_request.rb', line 26

def recipient_information
  @recipient_information
end

#sender_informationSenderInformation4

TODO: Write general description for this method

Returns:



30
31
32
# File 'lib/cyber_source_merged_spec/models/pull_funds_request.rb', line 30

def sender_information
  @sender_information
end

Class Method Details

.from_element(root) ⇒ Object



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/cyber_source_merged_spec/models/pull_funds_request.rb', line 141

def self.from_element(root)
  client_reference_information = XmlUtilities.from_element(
    root, 'ClientReferenceInformation64',
    ClientReferenceInformation64
  )
  order_information = XmlUtilities.from_element(root, 'OrderInformation45',
                                                OrderInformation45)
  processing_information = XmlUtilities.from_element(
    root, 'ProcessingInformation63', ProcessingInformation63
  )
  recipient_information = XmlUtilities.from_element(root,
                                                    'RecipientInformation5',
                                                    RecipientInformation5)
  sender_information = XmlUtilities.from_element(root, 'SenderInformation4',
                                                 SenderInformation4)
  buyer_information = XmlUtilities.from_element(root, 'BuyerInformation42',
                                                BuyerInformation42)
  aggregator_information = XmlUtilities.from_element(
    root, 'AggregatorInformation8', AggregatorInformation8
  )
  merchant_information = XmlUtilities.from_element(root,
                                                   'MerchantInformation23',
                                                   MerchantInformation23)

  new(client_reference_information: client_reference_information,
      order_information: order_information,
      processing_information: processing_information,
      recipient_information: recipient_information,
      sender_information: sender_information,
      buyer_information: buyer_information,
      aggregator_information: aggregator_information,
      merchant_information: merchant_information,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/cyber_source_merged_spec/models/pull_funds_request.rb', line 100

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  if hash['clientReferenceInformation']
    client_reference_information = ClientReferenceInformation64.from_hash(hash['clientReferenceInformation'])
  end
  order_information = OrderInformation45.from_hash(hash['orderInformation']) if
    hash['orderInformation']
  processing_information = ProcessingInformation63.from_hash(hash['processingInformation']) if
    hash['processingInformation']
  recipient_information = RecipientInformation5.from_hash(hash['recipientInformation']) if
    hash['recipientInformation']
  sender_information = SenderInformation4.from_hash(hash['senderInformation']) if
    hash['senderInformation']
  buyer_information = BuyerInformation42.from_hash(hash['buyerInformation']) if
    hash['buyerInformation']
  aggregator_information = AggregatorInformation8.from_hash(hash['aggregatorInformation']) if
    hash['aggregatorInformation']
  merchant_information = MerchantInformation23.from_hash(hash['merchantInformation']) if
    hash['merchantInformation']

  # 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.
  PullFundsRequest.new(client_reference_information: client_reference_information,
                       order_information: order_information,
                       processing_information: processing_information,
                       recipient_information: recipient_information,
                       sender_information: sender_information,
                       buyer_information: buyer_information,
                       aggregator_information: aggregator_information,
                       merchant_information: merchant_information,
                       additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/cyber_source_merged_spec/models/pull_funds_request.rb', line 45

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['client_reference_information'] = 'clientReferenceInformation'
  @_hash['order_information'] = 'orderInformation'
  @_hash['processing_information'] = 'processingInformation'
  @_hash['recipient_information'] = 'recipientInformation'
  @_hash['sender_information'] = 'senderInformation'
  @_hash['buyer_information'] = 'buyerInformation'
  @_hash['aggregator_information'] = 'aggregatorInformation'
  @_hash['merchant_information'] = 'merchantInformation'
  @_hash
end

.nullablesObject

An array for nullable fields



73
74
75
# File 'lib/cyber_source_merged_spec/models/pull_funds_request.rb', line 73

def self.nullables
  []
end

.optionalsObject

An array for optional fields



59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/cyber_source_merged_spec/models/pull_funds_request.rb', line 59

def self.optionals
  %w[
    client_reference_information
    order_information
    processing_information
    recipient_information
    sender_information
    buyer_information
    aggregator_information
    merchant_information
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



213
214
215
216
217
218
219
220
221
222
# File 'lib/cyber_source_merged_spec/models/pull_funds_request.rb', line 213

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

#to_sObject

Provides a human-readable string representation of the object.



202
203
204
205
206
207
208
209
210
# File 'lib/cyber_source_merged_spec/models/pull_funds_request.rb', line 202

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

#to_xml_element(doc, root_name) ⇒ Object



176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/cyber_source_merged_spec/models/pull_funds_request.rb', line 176

def to_xml_element(doc, root_name)
  root = doc.create_element(root_name)

  XmlUtilities.add_as_subelement(doc, root, 'ClientReferenceInformation64',
                                 client_reference_information)
  XmlUtilities.add_as_subelement(doc, root, 'OrderInformation45',
                                 order_information)
  XmlUtilities.add_as_subelement(doc, root, 'ProcessingInformation63',
                                 processing_information)
  XmlUtilities.add_as_subelement(doc, root, 'RecipientInformation5',
                                 recipient_information)
  XmlUtilities.add_as_subelement(doc, root, 'SenderInformation4',
                                 sender_information)
  XmlUtilities.add_as_subelement(doc, root, 'BuyerInformation42',
                                 buyer_information)
  XmlUtilities.add_as_subelement(doc, root, 'AggregatorInformation8',
                                 aggregator_information)
  XmlUtilities.add_as_subelement(doc, root, 'MerchantInformation23',
                                 merchant_information)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end