pcp-server-ruby-sdk 1.12.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/api-definition.yaml +323 -41
  5. data/lib/PCP-server-Ruby-SDK/endpoints/payment_intent_api_client.rb +37 -0
  6. data/lib/PCP-server-Ruby-SDK/models/address.rb +9 -237
  7. data/lib/PCP-server-Ruby-SDK/models/address_personal.rb +10 -246
  8. data/lib/PCP-server-Ruby-SDK/models/amount_of_money.rb +4 -195
  9. data/lib/PCP-server-Ruby-SDK/models/api_error.rb +27 -232
  10. data/lib/PCP-server-Ruby-SDK/models/apple_payment_data_token_header_information.rb +6 -194
  11. data/lib/PCP-server-Ruby-SDK/models/apple_payment_data_token_information.rb +8 -229
  12. data/lib/PCP-server-Ruby-SDK/models/bank_account_information.rb +11 -207
  13. data/lib/PCP-server-Ruby-SDK/models/bank_payout_method_specific_input.rb +4 -187
  14. data/lib/PCP-server-Ruby-SDK/models/cancel_item.rb +6 -195
  15. data/lib/PCP-server-Ruby-SDK/models/cancel_payment_request.rb +6 -222
  16. data/lib/PCP-server-Ruby-SDK/models/cancel_payment_response.rb +4 -190
  17. data/lib/PCP-server-Ruby-SDK/models/cancel_request.rb +6 -224
  18. data/lib/PCP-server-Ruby-SDK/models/cancel_response.rb +4 -190
  19. data/lib/PCP-server-Ruby-SDK/models/capture_output.rb +9 -214
  20. data/lib/PCP-server-Ruby-SDK/models/capture_payment_request.rb +14 -253
  21. data/lib/PCP-server-Ruby-SDK/models/capture_payment_response.rb +7 -239
  22. data/lib/PCP-server-Ruby-SDK/models/card_fraud_results.rb +29 -184
  23. data/lib/PCP-server-Ruby-SDK/models/card_info.rb +3 -182
  24. data/lib/PCP-server-Ruby-SDK/models/card_payment_details.rb +8 -210
  25. data/lib/PCP-server-Ruby-SDK/models/card_payment_method_specific_input.rb +32 -307
  26. data/lib/PCP-server-Ruby-SDK/models/card_payment_method_specific_output.rb +6 -210
  27. data/lib/PCP-server-Ruby-SDK/models/card_recurrence_details.rb +12 -186
  28. data/lib/PCP-server-Ruby-SDK/models/cart_item_data.rb +10 -0
  29. data/lib/PCP-server-Ruby-SDK/models/cart_item_input.rb +5 -198
  30. data/lib/PCP-server-Ruby-SDK/models/cart_item_invoice_data.rb +5 -184
  31. data/lib/PCP-server-Ruby-SDK/models/cart_item_order_status.rb +4 -213
  32. data/lib/PCP-server-Ruby-SDK/models/cart_item_patch.rb +5 -200
  33. data/lib/PCP-server-Ruby-SDK/models/cart_item_result.rb +5 -200
  34. data/lib/PCP-server-Ruby-SDK/models/cart_item_supplier_references.rb +6 -195
  35. data/lib/PCP-server-Ruby-SDK/models/checkout_references.rb +4 -192
  36. data/lib/PCP-server-Ruby-SDK/models/checkout_response.rb +15 -319
  37. data/lib/PCP-server-Ruby-SDK/models/checkouts_response.rb +4 -193
  38. data/lib/PCP-server-Ruby-SDK/models/company_information.rb +3 -182
  39. data/lib/PCP-server-Ruby-SDK/models/complete_financing_payment_method_specific_input.rb +12 -202
  40. data/lib/PCP-server-Ruby-SDK/models/complete_order_request.rb +3 -181
  41. data/lib/PCP-server-Ruby-SDK/models/complete_payment_method_specific_input.rb +4 -191
  42. data/lib/PCP-server-Ruby-SDK/models/complete_payment_product840_specific_input.rb +7 -226
  43. data/lib/PCP-server-Ruby-SDK/models/complete_payment_request.rb +6 -209
  44. data/lib/PCP-server-Ruby-SDK/models/complete_payment_response.rb +5 -199
  45. data/lib/PCP-server-Ruby-SDK/models/complete_redirect_payment_method_specific_input.rb +4 -192
  46. data/lib/PCP-server-Ruby-SDK/models/contact_details.rb +4 -191
  47. data/lib/PCP-server-Ruby-SDK/models/create_checkout_request.rb +13 -240
  48. data/lib/PCP-server-Ruby-SDK/models/create_checkout_response.rb +16 -307
  49. data/lib/PCP-server-Ruby-SDK/models/create_commerce_case_response.rb +7 -219
  50. data/lib/PCP-server-Ruby-SDK/models/create_payment_intent.rb +11 -0
  51. data/lib/PCP-server-Ruby-SDK/models/create_payment_intent_request.rb +13 -0
  52. data/lib/PCP-server-Ruby-SDK/models/create_payment_intent_response.rb +10 -0
  53. data/lib/PCP-server-Ruby-SDK/models/create_payment_response.rb +7 -218
  54. data/lib/PCP-server-Ruby-SDK/models/customer.rb +28 -260
  55. data/lib/PCP-server-Ruby-SDK/models/customer_account.rb +10 -44
  56. data/lib/PCP-server-Ruby-SDK/models/customer_device.rb +8 -209
  57. data/lib/PCP-server-Ruby-SDK/models/deliver_item.rb +6 -195
  58. data/lib/PCP-server-Ruby-SDK/models/deliver_request.rb +10 -246
  59. data/lib/PCP-server-Ruby-SDK/models/deliver_response.rb +4 -191
  60. data/lib/PCP-server-Ruby-SDK/models/delivery_information.rb +3 -185
  61. data/lib/PCP-server-Ruby-SDK/models/error_response.rb +4 -193
  62. data/lib/PCP-server-Ruby-SDK/models/financing_payment_method_specific_input.rb +15 -203
  63. data/lib/PCP-server-Ruby-SDK/models/financing_payment_method_specific_output.rb +10 -196
  64. data/lib/PCP-server-Ruby-SDK/models/fund_distribution.rb +12 -263
  65. data/lib/PCP-server-Ruby-SDK/models/fund_split.rb +5 -205
  66. data/lib/PCP-server-Ruby-SDK/models/fund_split_request.rb +3 -147
  67. data/lib/PCP-server-Ruby-SDK/models/fund_split_response.rb +10 -174
  68. data/lib/PCP-server-Ruby-SDK/models/installment_option.rb +13 -273
  69. data/lib/PCP-server-Ruby-SDK/models/link_information.rb +4 -196
  70. data/lib/PCP-server-Ruby-SDK/models/merchant_action.rb +16 -194
  71. data/lib/PCP-server-Ruby-SDK/models/mobile_payment_method_specific_input.rb +13 -246
  72. data/lib/PCP-server-Ruby-SDK/models/mobile_payment_method_specific_output.rb +7 -219
  73. data/lib/PCP-server-Ruby-SDK/models/mobile_payment_three_dsecure.rb +3 -179
  74. data/lib/PCP-server-Ruby-SDK/models/model_base.rb +147 -0
  75. data/lib/PCP-server-Ruby-SDK/models/order.rb +7 -221
  76. data/lib/PCP-server-Ruby-SDK/models/order_item.rb +6 -197
  77. data/lib/PCP-server-Ruby-SDK/models/order_line_details_input.rb +29 -305
  78. data/lib/PCP-server-Ruby-SDK/models/order_line_details_patch.rb +5 -326
  79. data/lib/PCP-server-Ruby-SDK/models/order_line_details_result.rb +5 -326
  80. data/lib/PCP-server-Ruby-SDK/models/order_request.rb +7 -244
  81. data/lib/PCP-server-Ruby-SDK/models/order_response.rb +4 -192
  82. data/lib/PCP-server-Ruby-SDK/models/patch_checkout_request.rb +8 -228
  83. data/lib/PCP-server-Ruby-SDK/models/patch_commerce_case_request.rb +3 -183
  84. data/lib/PCP-server-Ruby-SDK/models/pause_payment_request.rb +2 -165
  85. data/lib/PCP-server-Ruby-SDK/models/pause_payment_response.rb +3 -186
  86. data/lib/PCP-server-Ruby-SDK/models/payee.rb +6 -204
  87. data/lib/PCP-server-Ruby-SDK/models/payment_creation_output.rb +3 -183
  88. data/lib/PCP-server-Ruby-SDK/models/payment_event.rb +19 -274
  89. data/lib/PCP-server-Ruby-SDK/models/payment_execution.rb +29 -335
  90. data/lib/PCP-server-Ruby-SDK/models/payment_execution_request.rb +4 -191
  91. data/lib/PCP-server-Ruby-SDK/models/payment_execution_specific_input.rb +6 -212
  92. data/lib/PCP-server-Ruby-SDK/models/payment_information_refund_request.rb +7 -205
  93. data/lib/PCP-server-Ruby-SDK/models/payment_information_refund_response.rb +5 -196
  94. data/lib/PCP-server-Ruby-SDK/models/payment_information_request.rb +10 -249
  95. data/lib/PCP-server-Ruby-SDK/models/payment_information_response.rb +30 -314
  96. data/lib/PCP-server-Ruby-SDK/models/payment_instructions.rb +8 -214
  97. data/lib/PCP-server-Ruby-SDK/models/payment_intent_output.rb +13 -0
  98. data/lib/PCP-server-Ruby-SDK/models/payment_intent_response.rb +13 -0
  99. data/lib/PCP-server-Ruby-SDK/models/payment_intent_response_data.rb +12 -0
  100. data/lib/PCP-server-Ruby-SDK/models/payment_method_specific_input.rb +9 -261
  101. data/lib/PCP-server-Ruby-SDK/models/payment_method_specific_input_for_intent.rb +9 -0
  102. data/lib/PCP-server-Ruby-SDK/models/payment_output.rb +11 -255
  103. data/lib/PCP-server-Ruby-SDK/models/payment_product302_specific_input.rb +11 -225
  104. data/lib/PCP-server-Ruby-SDK/models/payment_product3391_specific_input.rb +6 -197
  105. data/lib/PCP-server-Ruby-SDK/models/payment_product3391_specific_output.rb +3 -185
  106. data/lib/PCP-server-Ruby-SDK/models/payment_product3392_specific_input.rb +3 -185
  107. data/lib/PCP-server-Ruby-SDK/models/payment_product5002_specific_input.rb +7 -203
  108. data/lib/PCP-server-Ruby-SDK/models/payment_product771_specific_output.rb +3 -183
  109. data/lib/PCP-server-Ruby-SDK/models/payment_product840_customer_account.rb +6 -210
  110. data/lib/PCP-server-Ruby-SDK/models/payment_product840_specific_output.rb +5 -209
  111. data/lib/PCP-server-Ruby-SDK/models/payment_product840_specific_output_data.rb +11 -0
  112. data/lib/PCP-server-Ruby-SDK/models/payment_product840_specific_output_for_intent.rb +13 -0
  113. data/lib/PCP-server-Ruby-SDK/models/payment_references.rb +6 -184
  114. data/lib/PCP-server-Ruby-SDK/models/payment_references_for_refund.rb +12 -197
  115. data/lib/PCP-server-Ruby-SDK/models/payment_response.rb +6 -234
  116. data/lib/PCP-server-Ruby-SDK/models/payment_status_output.rb +6 -234
  117. data/lib/PCP-server-Ruby-SDK/models/payout_output.rb +5 -205
  118. data/lib/PCP-server-Ruby-SDK/models/payout_response.rb +6 -215
  119. data/lib/PCP-server-Ruby-SDK/models/personal_information.rb +11 -227
  120. data/lib/PCP-server-Ruby-SDK/models/personal_name.rb +5 -201
  121. data/lib/PCP-server-Ruby-SDK/models/positive_amount_of_money.rb +4 -196
  122. data/lib/PCP-server-Ruby-SDK/models/processing_mandate_information.rb +9 -254
  123. data/lib/PCP-server-Ruby-SDK/models/redirect_data.rb +3 -183
  124. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_input.rb +14 -249
  125. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_input_for_intent.rb +12 -0
  126. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output.rb +6 -211
  127. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output_for_create_intent.rb +12 -0
  128. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output_for_intent.rb +10 -0
  129. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product840_specific_input.rb +6 -205
  130. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product840_specific_input_data.rb +10 -0
  131. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product900_specific_input.rb +12 -177
  132. data/lib/PCP-server-Ruby-SDK/models/redirection_data.rb +11 -186
  133. data/lib/PCP-server-Ruby-SDK/models/references.rb +47 -205
  134. data/lib/PCP-server-Ruby-SDK/models/refresh_payment_request.rb +3 -186
  135. data/lib/PCP-server-Ruby-SDK/models/refund_error_response.rb +4 -193
  136. data/lib/PCP-server-Ruby-SDK/models/refund_output.rb +8 -211
  137. data/lib/PCP-server-Ruby-SDK/models/refund_payment_response.rb +7 -242
  138. data/lib/PCP-server-Ruby-SDK/models/refund_request.rb +6 -210
  139. data/lib/PCP-server-Ruby-SDK/models/return_information.rb +4 -194
  140. data/lib/PCP-server-Ruby-SDK/models/return_item.rb +6 -196
  141. data/lib/PCP-server-Ruby-SDK/models/return_request.rb +6 -234
  142. data/lib/PCP-server-Ruby-SDK/models/return_response.rb +4 -191
  143. data/lib/PCP-server-Ruby-SDK/models/sepa_direct_debit_payment_method_specific_input.rb +4 -193
  144. data/lib/PCP-server-Ruby-SDK/models/sepa_direct_debit_payment_method_specific_output.rb +4 -193
  145. data/lib/PCP-server-Ruby-SDK/models/sepa_direct_debit_payment_product771_specific_input.rb +4 -192
  146. data/lib/PCP-server-Ruby-SDK/models/sepa_transfer_payment_product_772_specific_input.rb +3 -186
  147. data/lib/PCP-server-Ruby-SDK/models/shipping.rb +3 -183
  148. data/lib/PCP-server-Ruby-SDK/models/shipping_address.rb +14 -0
  149. data/lib/PCP-server-Ruby-SDK/models/shopping_cart_data.rb +9 -0
  150. data/lib/PCP-server-Ruby-SDK/models/shopping_cart_input.rb +3 -185
  151. data/lib/PCP-server-Ruby-SDK/models/shopping_cart_patch.rb +3 -185
  152. data/lib/PCP-server-Ruby-SDK/models/shopping_cart_result.rb +3 -185
  153. data/lib/PCP-server-Ruby-SDK/models/status_output.rb +21 -264
  154. data/lib/PCP-server-Ruby-SDK/models/three_d_secure_results.rb +6 -226
  155. data/lib/PCP-server-Ruby-SDK/version.rb +1 -1
  156. data/lib/PCP-server-Ruby-SDK.rb +18 -0
  157. data/package-lock.json +2 -2
  158. data/package.json +1 -1
  159. data/scripts/convert_models_to_model_base.rb +128 -0
  160. data/spec/endpoints/payment_intent_api_client_spec.rb +43 -0
  161. data/spec/models/api_definition_conformance_spec.rb +88 -0
  162. data/spec/models/model_base_spec.rb +87 -0
  163. data/spec/models/payment_intent_models_spec.rb +25 -0
  164. data/spec/models/required_field_validation_spec.rb +5 -5
  165. metadata +35 -11
  166. data/lib/PCP-server-Ruby-SDK/models/action_type.rb +0 -34
  167. data/lib/PCP-server-Ruby-SDK/models/avs_result.rb +0 -52
  168. data/lib/PCP-server-Ruby-SDK/models/business_relation.rb +0 -30
@@ -1,211 +1,11 @@
1
-
2
- require 'date'
3
- require 'time'
1
+ require_relative 'model_base'
4
2
 
5
3
  module PCPServerSDK
6
4
  module Models
7
- # Object containing details on the fund split for a payment.
8
- class FundSplit
9
- # Unique ID of the fund split (read-only).
10
- attr_accessor :id
11
-
12
- # Unique ID of the payment event associated with this fund split (read-only).
13
- attr_accessor :payment_event_id
14
-
15
- attr_accessor :fund_distributions
16
-
17
- # Attribute mapping from ruby-style variable name to JSON key.
18
- def self.attribute_map
19
- {
20
- :'id' => :'id',
21
- :'payment_event_id' => :'paymentEventId',
22
- :'fund_distributions' => :'fundDistributions'
23
- }
24
- end
25
-
26
- # Returns all the JSON keys this model knows about
27
- def self.acceptable_attributes
28
- attribute_map.values
29
- end
30
-
31
- # Attribute type mapping.
32
- def self.openapi_types
33
- {
34
- :'id' => :'String',
35
- :'payment_event_id' => :'String',
36
- :'fund_distributions' => :'Array<FundDistribution>'
37
- }
38
- end
39
-
40
- # List of attributes with nullable: true
41
- def self.openapi_nullable
42
- Set.new([
43
- ])
44
- end
45
-
46
- # Initializes the object
47
- # @param [Hash] attributes Model attributes in the form of hash
48
- def initialize(attributes = {})
49
- if (!attributes.is_a?(Hash))
50
- fail ArgumentError, "The input argument (attributes) must be a hash in `FundSplit` initialize method"
51
- end
52
-
53
- # check to see if the attribute exists and convert string to symbol for hash key
54
- attributes = attributes.each_with_object({}) { |(k, v), h|
55
- if (!self.class.attribute_map.key?(k.to_sym))
56
- fail ArgumentError, "`#{k}` is not a valid attribute in `FundSplit`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
- end
58
- h[k.to_sym] = v
59
- }
60
-
61
- if attributes.key?(:'id')
62
- self.id = attributes[:'id']
63
- end
64
-
65
- if attributes.key?(:'payment_event_id')
66
- self.payment_event_id = attributes[:'payment_event_id']
67
- end
68
-
69
- if attributes.key?(:'fund_distributions')
70
- if (value = attributes[:'fund_distributions']).is_a?(Array)
71
- self.fund_distributions = value
72
- end
73
- end
74
- end
75
-
76
- # Checks equality by comparing each attribute.
77
- # @param [Object] Object to be compared
78
- def ==(o)
79
- return true if self.equal?(o)
80
- self.class == o.class &&
81
- id == o.id &&
82
- payment_event_id == o.payment_event_id &&
83
- fund_distributions == o.fund_distributions
84
- end
85
-
86
- # @see the `==` method
87
- # @param [Object] Object to be compared
88
- def eql?(o)
89
- self == o
90
- end
91
-
92
- # Calculates hash code according to all attributes.
93
- # @return [Integer] Hash code
94
- def hash
95
- [id, payment_event_id, fund_distributions].hash
96
- end
97
-
98
- # Builds the object from hash
99
- # @param [Hash] attributes Model attributes in the form of hash
100
- # @return [Object] Returns the model itself
101
- def self.build_from_hash(attributes)
102
- return nil unless attributes.is_a?(Hash)
103
- attributes = attributes.transform_keys(&:to_sym)
104
- transformed_hash = {}
105
- openapi_types.each_pair do |key, type|
106
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
107
- transformed_hash["#{key}"] = nil
108
- elsif type =~ /\AArray<(.*)>/i
109
- # check to ensure the input is an array given that the attribute
110
- # is documented as an array but the input is not
111
- if attributes[attribute_map[key]].is_a?(Array)
112
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
113
- end
114
- elsif !attributes[attribute_map[key]].nil?
115
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
116
- end
117
- end
118
- new(transformed_hash)
119
- end
120
-
121
- # Deserializes the data based on type
122
- # @param string type Data type
123
- # @param string value Value to be deserialized
124
- # @return [Object] Deserialized data
125
- def self._deserialize(type, value)
126
- case type.to_sym
127
- when :Time
128
- Time.parse(value)
129
- when :Date
130
- Date.parse(value)
131
- when :String
132
- value.to_s
133
- when :Integer
134
- value.to_i
135
- when :Float
136
- value.to_f
137
- when :Boolean
138
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
139
- true
140
- else
141
- false
142
- end
143
- when :Object
144
- # generic object (usually a Hash), return directly
145
- value
146
- when /\AArray<(?<inner_type>.+)>\z/
147
- inner_type = Regexp.last_match[:inner_type]
148
- value.map { |v| _deserialize(inner_type, v) }
149
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
150
- k_type = Regexp.last_match[:k_type]
151
- v_type = Regexp.last_match[:v_type]
152
- {}.tap do |hash|
153
- value.each do |k, v|
154
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
155
- end
156
- end
157
- else # model
158
- # models (e.g. Pet) or oneOf
159
- klass = PCPServerSDK::Models.const_get(type)
160
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
161
- end
162
- end
163
-
164
- # Returns the string representation of the object
165
- # @return [String] String presentation of the object
166
- def to_s
167
- to_hash.to_s
168
- end
169
-
170
- # to_body is an alias to to_hash (backward compatibility)
171
- # @return [Hash] Returns the object in the form of hash
172
- def to_body
173
- to_hash
174
- end
175
-
176
- # Returns the object in the form of hash
177
- # @return [Hash] Returns the object in the form of hash
178
- def to_hash
179
- hash = {}
180
- self.class.attribute_map.each_pair do |attr, param|
181
- value = self.send(attr)
182
- if value.nil?
183
- is_nullable = self.class.openapi_nullable.include?(attr)
184
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
185
- end
186
-
187
- hash[param] = _to_hash(value)
188
- end
189
- hash
190
- end
191
-
192
- # Outputs non-array value in the form of hash
193
- # For object, use to_hash. Otherwise, just return the value
194
- # @param [Object] value Any valid value
195
- # @return [Hash] Returns the value in the form of hash
196
- def _to_hash(value)
197
- if value.is_a?(Array)
198
- value.compact.map { |v| _to_hash(v) }
199
- elsif value.is_a?(Hash)
200
- {}.tap do |hash|
201
- value.each { |k, v| hash[k] = _to_hash(v) }
202
- end
203
- elsif value.respond_to? :to_hash
204
- value.to_hash
205
- else
206
- value
207
- end
208
- end
5
+ class FundSplit < ModelBase
6
+ attribute :id, :id, :String
7
+ attribute :payment_event_id, :paymentEventId, :String
8
+ attribute :fund_distributions, :fundDistributions, "Array<FundDistribution>"
209
9
  end
210
10
  end
211
11
  end
@@ -1,153 +1,9 @@
1
-
2
- require 'date'
3
- require 'time'
1
+ require_relative 'model_base'
4
2
 
5
3
  module PCPServerSDK
6
4
  module Models
7
- class FundSplitRequest
8
- attr_accessor :fund_split
9
-
10
- def self.attribute_map
11
- {
12
- :'fund_split' => :'fundSplit'
13
- }
14
- end
15
-
16
- def self.acceptable_attributes
17
- attribute_map.values
18
- end
19
-
20
- def self.openapi_types
21
- {
22
- :'fund_split' => :'FundSplit'
23
- }
24
- end
25
-
26
- def self.openapi_nullable
27
- Set.new([])
28
- end
29
-
30
- def initialize(attributes = {})
31
- if (!attributes.is_a?(Hash))
32
- fail ArgumentError, "The input argument (attributes) must be a hash in `FundSplitRequest` initialize method"
33
- end
34
-
35
- attributes = attributes.each_with_object({}) { |(k, v), h|
36
- if (!self.class.attribute_map.key?(k.to_sym))
37
- fail ArgumentError, "`#{k}` is not a valid attribute in `FundSplitRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
38
- end
39
- h[k.to_sym] = v
40
- }
41
-
42
- if attributes.key?(:'fund_split')
43
- self.fund_split = attributes[:'fund_split']
44
- end
45
- end
46
-
47
- def ==(o)
48
- return true if self.equal?(o)
49
- self.class == o.class &&
50
- fund_split == o.fund_split
51
- end
52
-
53
- def eql?(o)
54
- self == o
55
- end
56
-
57
- def hash
58
- [fund_split].hash
59
- end
60
-
61
- def self.build_from_hash(attributes)
62
- return nil unless attributes.is_a?(Hash)
63
- attributes = attributes.transform_keys(&:to_sym)
64
- transformed_hash = {}
65
- openapi_types.each_pair do |key, type|
66
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
67
- transformed_hash["#{key}"] = nil
68
- elsif type =~ /\AArray<(.*)>/i
69
- if attributes[attribute_map[key]].is_a?(Array)
70
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
71
- end
72
- elsif !attributes[attribute_map[key]].nil?
73
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
74
- end
75
- end
76
- new(transformed_hash)
77
- end
78
-
79
- def self._deserialize(type, value)
80
- case type.to_sym
81
- when :Time
82
- Time.parse(value)
83
- when :Date
84
- Date.parse(value)
85
- when :String
86
- value.to_s
87
- when :Integer
88
- value.to_i
89
- when :Float
90
- value.to_f
91
- when :Boolean
92
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
93
- true
94
- else
95
- false
96
- end
97
- when :Object
98
- value
99
- when /\AArray<(?<inner_type>.+)>\z/
100
- inner_type = Regexp.last_match[:inner_type]
101
- value.map { |v| _deserialize(inner_type, v) }
102
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
103
- k_type = Regexp.last_match[:k_type]
104
- v_type = Regexp.last_match[:v_type]
105
- {}.tap do |hash|
106
- value.each do |k, v|
107
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
108
- end
109
- end
110
- else
111
- klass = PCPServerSDK::Models.const_get(type)
112
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
113
- end
114
- end
115
-
116
- def to_s
117
- to_hash.to_s
118
- end
119
-
120
- def to_body
121
- to_hash
122
- end
123
-
124
- def to_hash
125
- hash = {}
126
- self.class.attribute_map.each_pair do |attr, param|
127
- value = self.send(attr)
128
- if value.nil?
129
- is_nullable = self.class.openapi_nullable.include?(attr)
130
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
131
- end
132
-
133
- hash[param] = _to_hash(value)
134
- end
135
- hash
136
- end
137
-
138
- def _to_hash(value)
139
- if value.is_a?(Array)
140
- value.compact.map { |v| _to_hash(v) }
141
- elsif value.is_a?(Hash)
142
- {}.tap do |hash|
143
- value.each { |k, v| hash[k] = _to_hash(v) }
144
- end
145
- elsif value.respond_to? :to_hash
146
- value.to_hash
147
- else
148
- value
149
- end
150
- end
5
+ class FundSplitRequest < ModelBase
6
+ attribute :fund_split, :fundSplit, :FundSplit
151
7
  end
152
8
  end
153
9
  end
@@ -1,180 +1,16 @@
1
-
2
- require 'date'
3
- require 'time'
1
+ require_relative 'model_base'
4
2
 
5
3
  module PCPServerSDK
6
4
  module Models
7
- class FundSplitResponse
8
- attr_accessor :fund_split_id
9
-
10
- attr_accessor :payment_execution_id
11
-
12
- attr_accessor :event_id
13
-
14
- attr_accessor :fund_split
15
-
16
- def self.attribute_map
17
- {
18
- :'fund_split_id' => :'fundSplitId',
19
- :'payment_execution_id' => :'paymentExecutionId',
20
- :'event_id' => :'eventId',
21
- :'fund_split' => :'fundSplit'
22
- }
23
- end
24
-
25
- def self.acceptable_attributes
26
- attribute_map.values
27
- end
28
-
29
- def self.openapi_types
30
- {
31
- :'fund_split_id' => :'String',
32
- :'payment_execution_id' => :'String',
33
- :'event_id' => :'String',
34
- :'fund_split' => :'FundSplit'
35
- }
36
- end
37
-
38
- def self.openapi_nullable
39
- Set.new([])
40
- end
41
-
42
- def initialize(attributes = {})
43
- if (!attributes.is_a?(Hash))
44
- fail ArgumentError, "The input argument (attributes) must be a hash in `FundSplitResponse` initialize method"
45
- end
46
-
47
- attributes = attributes.each_with_object({}) { |(k, v), h|
48
- if (!self.class.attribute_map.key?(k.to_sym))
49
- fail ArgumentError, "`#{k}` is not a valid attribute in `FundSplitResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
50
- end
51
- h[k.to_sym] = v
52
- }
53
-
54
- if attributes.key?(:'fund_split_id')
55
- self.fund_split_id = attributes[:'fund_split_id']
56
- end
57
-
58
- if attributes.key?(:'payment_execution_id')
59
- self.payment_execution_id = attributes[:'payment_execution_id']
60
- end
61
-
62
- if attributes.key?(:'event_id')
63
- self.event_id = attributes[:'event_id']
64
- end
65
-
66
- if attributes.key?(:'fund_split')
67
- self.fund_split = attributes[:'fund_split']
68
- end
69
- end
70
-
71
- def ==(o)
72
- return true if self.equal?(o)
73
- self.class == o.class &&
74
- fund_split_id == o.fund_split_id &&
75
- payment_execution_id == o.payment_execution_id &&
76
- event_id == o.event_id &&
77
- fund_split == o.fund_split
78
- end
79
-
80
- def eql?(o)
81
- self == o
82
- end
83
-
84
- def hash
85
- [fund_split_id, payment_execution_id, event_id, fund_split].hash
86
- end
87
-
88
- def self.build_from_hash(attributes)
89
- return nil unless attributes.is_a?(Hash)
90
- attributes = attributes.transform_keys(&:to_sym)
91
- transformed_hash = {}
92
- openapi_types.each_pair do |key, type|
93
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
94
- transformed_hash["#{key}"] = nil
95
- elsif type =~ /\AArray<(.*)>/i
96
- if attributes[attribute_map[key]].is_a?(Array)
97
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
98
- end
99
- elsif !attributes[attribute_map[key]].nil?
100
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
101
- end
102
- end
103
- new(transformed_hash)
104
- end
105
-
106
- def self._deserialize(type, value)
107
- case type.to_sym
108
- when :Time
109
- Time.parse(value)
110
- when :Date
111
- Date.parse(value)
112
- when :String
113
- value.to_s
114
- when :Integer
115
- value.to_i
116
- when :Float
117
- value.to_f
118
- when :Boolean
119
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
120
- true
121
- else
122
- false
123
- end
124
- when :Object
125
- value
126
- when /\AArray<(?<inner_type>.+)>\z/
127
- inner_type = Regexp.last_match[:inner_type]
128
- value.map { |v| _deserialize(inner_type, v) }
129
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
130
- k_type = Regexp.last_match[:k_type]
131
- v_type = Regexp.last_match[:v_type]
132
- {}.tap do |hash|
133
- value.each do |k, v|
134
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
135
- end
136
- end
137
- else
138
- klass = PCPServerSDK::Models.const_get(type)
139
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
140
- end
141
- end
142
-
143
- def to_s
144
- to_hash.to_s
145
- end
146
-
147
- def to_body
148
- to_hash
149
- end
150
-
151
- def to_hash
152
- hash = {}
153
- self.class.attribute_map.each_pair do |attr, param|
154
- value = self.send(attr)
155
- if value.nil?
156
- is_nullable = self.class.openapi_nullable.include?(attr)
157
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
158
- end
159
-
160
- hash[param] = _to_hash(value)
161
- end
162
- hash
163
- end
164
-
165
- def _to_hash(value)
166
- if value.is_a?(Array)
167
- value.compact.map { |v| _to_hash(v) }
168
- elsif value.is_a?(Hash)
169
- {}.tap do |hash|
170
- value.each { |k, v| hash[k] = _to_hash(v) }
171
- end
172
- elsif value.respond_to? :to_hash
173
- value.to_hash
174
- else
175
- value
176
- end
177
- end
5
+ class FundSplitResponse < ModelBase
6
+ # Unique identifier assigned to the created fund split instruction. This ID can be used for tracking
7
+ # and referencing the fund split in subsequent operations or inquiries.
8
+ attribute :fund_split_id, :fundSplitId, :String
9
+ # Unique identifier of the Payment Execution that this fund split is associated with.
10
+ attribute :payment_execution_id, :paymentExecutionId, :String
11
+ # Unique identifier of the chargeback event that this fund split instruction was created for.
12
+ attribute :event_id, :eventId, :String
13
+ attribute :fund_split, :fundSplit, :FundSplit
178
14
  end
179
15
  end
180
16
  end