yapstone-payments 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (310) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +79 -0
  4. data/README.md +203 -0
  5. data/Rakefile +10 -0
  6. data/docs/APM.md +29 -0
  7. data/docs/APMSpecInParameters.md +19 -0
  8. data/docs/Action.md +16 -0
  9. data/docs/Address.md +29 -0
  10. data/docs/Amount.md +21 -0
  11. data/docs/AuthResponse.md +19 -0
  12. data/docs/AuthTokenRequest.md +19 -0
  13. data/docs/AuthTokenResponse.md +17 -0
  14. data/docs/AuthenticationApi.md +58 -0
  15. data/docs/BankAccount.md +37 -0
  16. data/docs/BillingAddress.md +29 -0
  17. data/docs/BookingInfo.md +31 -0
  18. data/docs/CapturePaymentRequest.md +21 -0
  19. data/docs/Card.md +27 -0
  20. data/docs/CardResponse.md +21 -0
  21. data/docs/Consent.md +21 -0
  22. data/docs/CreditCardAuthResponse.md +25 -0
  23. data/docs/Customer.md +29 -0
  24. data/docs/CustomerData.md +19 -0
  25. data/docs/CustomerDetails.md +23 -0
  26. data/docs/Deposit.md +23 -0
  27. data/docs/DepositDetails.md +17 -0
  28. data/docs/DisburseLineItemsReq.md +19 -0
  29. data/docs/DisburseTransaction.md +19 -0
  30. data/docs/DisburseTransactionReq.md +17 -0
  31. data/docs/Disbursement.md +17 -0
  32. data/docs/DisbursementAllOf.md +17 -0
  33. data/docs/DisbursementDetails.md +17 -0
  34. data/docs/DisbursementRequest.md +16 -0
  35. data/docs/DisbursementRequests.md +17 -0
  36. data/docs/DisbursementResponse.md +17 -0
  37. data/docs/DisbursementsApi.md +138 -0
  38. data/docs/Error.md +25 -0
  39. data/docs/ErrorResponse.md +19 -0
  40. data/docs/Fields.md +17 -0
  41. data/docs/GovIdentification.md +29 -0
  42. data/docs/Guest.md +29 -0
  43. data/docs/GuestInfoResponse.md +19 -0
  44. data/docs/Href.md +17 -0
  45. data/docs/InlineResponse200.md +25 -0
  46. data/docs/InstallmentPlan.md +19 -0
  47. data/docs/Instrument.md +21 -0
  48. data/docs/InstrumentVerificationResponse.md +31 -0
  49. data/docs/KYC.md +21 -0
  50. data/docs/LeaseInfo.md +21 -0
  51. data/docs/LineItemDetails.md +25 -0
  52. data/docs/MarketplaceData.md +23 -0
  53. data/docs/Merketplace.md +17 -0
  54. data/docs/Money.md +19 -0
  55. data/docs/Name.md +27 -0
  56. data/docs/OfferingDetails.md +21 -0
  57. data/docs/OrderTransactions.md +25 -0
  58. data/docs/Payment.md +21 -0
  59. data/docs/PaymentCancelResponse.md +23 -0
  60. data/docs/PaymentCancelTransactionResponse.md +21 -0
  61. data/docs/PaymentDetails.md +29 -0
  62. data/docs/PaymentInstrument.md +27 -0
  63. data/docs/PaymentInstrumentCard.md +19 -0
  64. data/docs/PaymentInstrumentResponse.md +19 -0
  65. data/docs/PaymentPayment.md +27 -0
  66. data/docs/PaymentPaymentAllOf.md +27 -0
  67. data/docs/PaymentResponse.md +33 -0
  68. data/docs/PaymentsApi.md +447 -0
  69. data/docs/Phone.md +21 -0
  70. data/docs/ProcessPayment.md +29 -0
  71. data/docs/PropertyInfo.md +21 -0
  72. data/docs/PropertyInfoResponse.md +19 -0
  73. data/docs/RefundAction.md +16 -0
  74. data/docs/RefundCancelResponse.md +21 -0
  75. data/docs/RefundCancelTransactionResponse.md +19 -0
  76. data/docs/RefundRequest.md +25 -0
  77. data/docs/RefundResponse.md +29 -0
  78. data/docs/RefundStatus.md +16 -0
  79. data/docs/RefundTransactions.md +27 -0
  80. data/docs/RefundsApi.md +378 -0
  81. data/docs/RentalInfo.md +21 -0
  82. data/docs/Renter.md +29 -0
  83. data/docs/Resolution.md +17 -0
  84. data/docs/Result.md +21 -0
  85. data/docs/RiskStatus.md +17 -0
  86. data/docs/SanctionedEntities.md +19 -0
  87. data/docs/SearchApi.md +132 -0
  88. data/docs/SearchPaymentResponse.md +17 -0
  89. data/docs/StackTraceElement.md +25 -0
  90. data/docs/Status.md +16 -0
  91. data/docs/Throwable.md +21 -0
  92. data/docs/ToEntityRef.md +19 -0
  93. data/docs/Token.md +19 -0
  94. data/docs/TokenApi.md +134 -0
  95. data/docs/TokenReq.md +19 -0
  96. data/docs/TokenRequest.md +17 -0
  97. data/docs/TokenResponse.md +17 -0
  98. data/docs/Transaction.md +21 -0
  99. data/docs/TransactionResponse.md +27 -0
  100. data/docs/Triggers.md +21 -0
  101. data/docs/VacationRentalInfo.md +19 -0
  102. data/docs/VacationRentalInfoRequest.md +21 -0
  103. data/docs/VerifyInstrumentRequest.md +21 -0
  104. data/git_push.sh +55 -0
  105. data/lib/yapstone-payments.rb +137 -0
  106. data/lib/yapstone-payments/api/authentication_api.rb +92 -0
  107. data/lib/yapstone-payments/api/disbursements_api.rb +202 -0
  108. data/lib/yapstone-payments/api/payments_api.rb +598 -0
  109. data/lib/yapstone-payments/api/refunds_api.rb +507 -0
  110. data/lib/yapstone-payments/api/search_api.rb +187 -0
  111. data/lib/yapstone-payments/api/token_api.rb +182 -0
  112. data/lib/yapstone-payments/api_client.rb +386 -0
  113. data/lib/yapstone-payments/api_error.rb +57 -0
  114. data/lib/yapstone-payments/configuration.rb +249 -0
  115. data/lib/yapstone-payments/models/action.rb +39 -0
  116. data/lib/yapstone-payments/models/address.rb +258 -0
  117. data/lib/yapstone-payments/models/amount.rb +218 -0
  118. data/lib/yapstone-payments/models/apm.rb +292 -0
  119. data/lib/yapstone-payments/models/apm_spec_in_parameters.rb +208 -0
  120. data/lib/yapstone-payments/models/auth_response.rb +217 -0
  121. data/lib/yapstone-payments/models/auth_token_request.rb +205 -0
  122. data/lib/yapstone-payments/models/auth_token_response.rb +196 -0
  123. data/lib/yapstone-payments/models/bank_account.rb +347 -0
  124. data/lib/yapstone-payments/models/billing_address.rb +258 -0
  125. data/lib/yapstone-payments/models/booking_info.rb +266 -0
  126. data/lib/yapstone-payments/models/capture_payment_request.rb +252 -0
  127. data/lib/yapstone-payments/models/card.rb +247 -0
  128. data/lib/yapstone-payments/models/card_response.rb +217 -0
  129. data/lib/yapstone-payments/models/consent.rb +248 -0
  130. data/lib/yapstone-payments/models/credit_card_auth_response.rb +267 -0
  131. data/lib/yapstone-payments/models/customer.rb +256 -0
  132. data/lib/yapstone-payments/models/customer_data.rb +208 -0
  133. data/lib/yapstone-payments/models/customer_details.rb +226 -0
  134. data/lib/yapstone-payments/models/deposit.rb +228 -0
  135. data/lib/yapstone-payments/models/deposit_details.rb +199 -0
  136. data/lib/yapstone-payments/models/disburse_line_items_req.rb +208 -0
  137. data/lib/yapstone-payments/models/disburse_transaction.rb +208 -0
  138. data/lib/yapstone-payments/models/disburse_transaction_req.rb +199 -0
  139. data/lib/yapstone-payments/models/disbursement.rb +203 -0
  140. data/lib/yapstone-payments/models/disbursement_all_of.rb +197 -0
  141. data/lib/yapstone-payments/models/disbursement_details.rb +200 -0
  142. data/lib/yapstone-payments/models/disbursement_request.rb +187 -0
  143. data/lib/yapstone-payments/models/disbursement_requests.rb +198 -0
  144. data/lib/yapstone-payments/models/disbursement_response.rb +198 -0
  145. data/lib/yapstone-payments/models/error.rb +241 -0
  146. data/lib/yapstone-payments/models/error_response.rb +218 -0
  147. data/lib/yapstone-payments/models/fields.rb +196 -0
  148. data/lib/yapstone-payments/models/gov_identification.rb +292 -0
  149. data/lib/yapstone-payments/models/guest.rb +257 -0
  150. data/lib/yapstone-payments/models/guest_info_response.rb +208 -0
  151. data/lib/yapstone-payments/models/href.rb +196 -0
  152. data/lib/yapstone-payments/models/inline_response200.rb +232 -0
  153. data/lib/yapstone-payments/models/installment_plan.rb +208 -0
  154. data/lib/yapstone-payments/models/instrument.rb +250 -0
  155. data/lib/yapstone-payments/models/instrument_verification_response.rb +260 -0
  156. data/lib/yapstone-payments/models/kyc.rb +215 -0
  157. data/lib/yapstone-payments/models/lease_info.rb +218 -0
  158. data/lib/yapstone-payments/models/line_item_details.rb +236 -0
  159. data/lib/yapstone-payments/models/marketplace_data.rb +260 -0
  160. data/lib/yapstone-payments/models/merketplace.rb +197 -0
  161. data/lib/yapstone-payments/models/money.rb +207 -0
  162. data/lib/yapstone-payments/models/name.rb +248 -0
  163. data/lib/yapstone-payments/models/offering_details.rb +216 -0
  164. data/lib/yapstone-payments/models/order_transactions.rb +235 -0
  165. data/lib/yapstone-payments/models/payment.rb +216 -0
  166. data/lib/yapstone-payments/models/payment_cancel_response.rb +227 -0
  167. data/lib/yapstone-payments/models/payment_cancel_transaction_response.rb +218 -0
  168. data/lib/yapstone-payments/models/payment_details.rb +319 -0
  169. data/lib/yapstone-payments/models/payment_instrument.rb +277 -0
  170. data/lib/yapstone-payments/models/payment_instrument_card.rb +241 -0
  171. data/lib/yapstone-payments/models/payment_instrument_response.rb +205 -0
  172. data/lib/yapstone-payments/models/payment_payment.rb +257 -0
  173. data/lib/yapstone-payments/models/payment_payment_all_of.rb +250 -0
  174. data/lib/yapstone-payments/models/payment_response.rb +275 -0
  175. data/lib/yapstone-payments/models/phone.rb +218 -0
  176. data/lib/yapstone-payments/models/process_payment.rb +304 -0
  177. data/lib/yapstone-payments/models/property_info.rb +216 -0
  178. data/lib/yapstone-payments/models/property_info_response.rb +207 -0
  179. data/lib/yapstone-payments/models/refund_action.rb +35 -0
  180. data/lib/yapstone-payments/models/refund_cancel_response.rb +217 -0
  181. data/lib/yapstone-payments/models/refund_cancel_transaction_response.rb +207 -0
  182. data/lib/yapstone-payments/models/refund_request.rb +285 -0
  183. data/lib/yapstone-payments/models/refund_response.rb +253 -0
  184. data/lib/yapstone-payments/models/refund_status.rb +90 -0
  185. data/lib/yapstone-payments/models/refund_transactions.rb +245 -0
  186. data/lib/yapstone-payments/models/rental_info.rb +215 -0
  187. data/lib/yapstone-payments/models/renter.rb +254 -0
  188. data/lib/yapstone-payments/models/resolution.rb +196 -0
  189. data/lib/yapstone-payments/models/result.rb +218 -0
  190. data/lib/yapstone-payments/models/risk_status.rb +196 -0
  191. data/lib/yapstone-payments/models/sanctioned_entities.rb +207 -0
  192. data/lib/yapstone-payments/models/search_payment_response.rb +196 -0
  193. data/lib/yapstone-payments/models/stack_trace_element.rb +238 -0
  194. data/lib/yapstone-payments/models/status.rb +91 -0
  195. data/lib/yapstone-payments/models/throwable.rb +220 -0
  196. data/lib/yapstone-payments/models/to_entity_ref.rb +207 -0
  197. data/lib/yapstone-payments/models/token.rb +207 -0
  198. data/lib/yapstone-payments/models/token_req.rb +206 -0
  199. data/lib/yapstone-payments/models/token_request.rb +196 -0
  200. data/lib/yapstone-payments/models/token_response.rb +196 -0
  201. data/lib/yapstone-payments/models/transaction.rb +218 -0
  202. data/lib/yapstone-payments/models/transaction_response.rb +248 -0
  203. data/lib/yapstone-payments/models/triggers.rb +216 -0
  204. data/lib/yapstone-payments/models/vacation_rental_info.rb +205 -0
  205. data/lib/yapstone-payments/models/vacation_rental_info_request.rb +215 -0
  206. data/lib/yapstone-payments/models/verify_instrument_request.rb +215 -0
  207. data/lib/yapstone-payments/version.rb +15 -0
  208. data/spec/api/authentication_api_spec.rb +48 -0
  209. data/spec/api/disbursements_api_spec.rb +69 -0
  210. data/spec/api/payments_api_spec.rb +146 -0
  211. data/spec/api/refunds_api_spec.rb +127 -0
  212. data/spec/api/search_api_spec.rb +66 -0
  213. data/spec/api/token_api_spec.rb +67 -0
  214. data/spec/api_client_spec.rb +226 -0
  215. data/spec/configuration_spec.rb +42 -0
  216. data/spec/models/action_spec.rb +35 -0
  217. data/spec/models/address_spec.rb +77 -0
  218. data/spec/models/amount_spec.rb +53 -0
  219. data/spec/models/apm_spec.rb +81 -0
  220. data/spec/models/apm_spec_in_parameters_spec.rb +47 -0
  221. data/spec/models/auth_response_spec.rb +47 -0
  222. data/spec/models/auth_token_request_spec.rb +47 -0
  223. data/spec/models/auth_token_response_spec.rb +41 -0
  224. data/spec/models/bank_account_spec.rb +105 -0
  225. data/spec/models/billing_address_spec.rb +77 -0
  226. data/spec/models/booking_info_spec.rb +83 -0
  227. data/spec/models/capture_payment_request_spec.rb +57 -0
  228. data/spec/models/card_response_spec.rb +53 -0
  229. data/spec/models/card_spec.rb +71 -0
  230. data/spec/models/consent_spec.rb +57 -0
  231. data/spec/models/credit_card_auth_response_spec.rb +69 -0
  232. data/spec/models/customer_data_spec.rb +47 -0
  233. data/spec/models/customer_details_spec.rb +59 -0
  234. data/spec/models/customer_spec.rb +77 -0
  235. data/spec/models/deposit_details_spec.rb +41 -0
  236. data/spec/models/deposit_spec.rb +59 -0
  237. data/spec/models/disburse_line_items_req_spec.rb +47 -0
  238. data/spec/models/disburse_transaction_req_spec.rb +41 -0
  239. data/spec/models/disburse_transaction_spec.rb +47 -0
  240. data/spec/models/disbursement_all_of_spec.rb +41 -0
  241. data/spec/models/disbursement_details_spec.rb +41 -0
  242. data/spec/models/disbursement_request_spec.rb +35 -0
  243. data/spec/models/disbursement_requests_spec.rb +41 -0
  244. data/spec/models/disbursement_response_spec.rb +41 -0
  245. data/spec/models/disbursement_spec.rb +41 -0
  246. data/spec/models/error_response_spec.rb +47 -0
  247. data/spec/models/error_spec.rb +65 -0
  248. data/spec/models/fields_spec.rb +41 -0
  249. data/spec/models/gov_identification_spec.rb +81 -0
  250. data/spec/models/guest_info_response_spec.rb +47 -0
  251. data/spec/models/guest_spec.rb +77 -0
  252. data/spec/models/href_spec.rb +41 -0
  253. data/spec/models/inline_response200_spec.rb +65 -0
  254. data/spec/models/installment_plan_spec.rb +47 -0
  255. data/spec/models/instrument_spec.rb +57 -0
  256. data/spec/models/instrument_verification_response_spec.rb +83 -0
  257. data/spec/models/kyc_spec.rb +53 -0
  258. data/spec/models/lease_info_spec.rb +53 -0
  259. data/spec/models/line_item_details_spec.rb +65 -0
  260. data/spec/models/marketplace_data_spec.rb +63 -0
  261. data/spec/models/merketplace_spec.rb +41 -0
  262. data/spec/models/money_spec.rb +47 -0
  263. data/spec/models/name_spec.rb +71 -0
  264. data/spec/models/offering_details_spec.rb +53 -0
  265. data/spec/models/order_transactions_spec.rb +65 -0
  266. data/spec/models/payment_cancel_response_spec.rb +59 -0
  267. data/spec/models/payment_cancel_transaction_response_spec.rb +53 -0
  268. data/spec/models/payment_details_spec.rb +81 -0
  269. data/spec/models/payment_instrument_card_spec.rb +51 -0
  270. data/spec/models/payment_instrument_response_spec.rb +47 -0
  271. data/spec/models/payment_instrument_spec.rb +75 -0
  272. data/spec/models/payment_payment_all_of_spec.rb +71 -0
  273. data/spec/models/payment_payment_spec.rb +71 -0
  274. data/spec/models/payment_response_spec.rb +89 -0
  275. data/spec/models/payment_spec.rb +53 -0
  276. data/spec/models/phone_spec.rb +53 -0
  277. data/spec/models/process_payment_spec.rb +77 -0
  278. data/spec/models/property_info_response_spec.rb +47 -0
  279. data/spec/models/property_info_spec.rb +53 -0
  280. data/spec/models/refund_action_spec.rb +35 -0
  281. data/spec/models/refund_cancel_response_spec.rb +53 -0
  282. data/spec/models/refund_cancel_transaction_response_spec.rb +47 -0
  283. data/spec/models/refund_request_spec.rb +65 -0
  284. data/spec/models/refund_response_spec.rb +77 -0
  285. data/spec/models/refund_status_spec.rb +35 -0
  286. data/spec/models/refund_transactions_spec.rb +71 -0
  287. data/spec/models/rental_info_spec.rb +53 -0
  288. data/spec/models/renter_spec.rb +77 -0
  289. data/spec/models/resolution_spec.rb +41 -0
  290. data/spec/models/result_spec.rb +53 -0
  291. data/spec/models/risk_status_spec.rb +41 -0
  292. data/spec/models/sanctioned_entities_spec.rb +47 -0
  293. data/spec/models/search_payment_response_spec.rb +41 -0
  294. data/spec/models/stack_trace_element_spec.rb +65 -0
  295. data/spec/models/status_spec.rb +35 -0
  296. data/spec/models/throwable_spec.rb +53 -0
  297. data/spec/models/to_entity_ref_spec.rb +47 -0
  298. data/spec/models/token_req_spec.rb +47 -0
  299. data/spec/models/token_request_spec.rb +41 -0
  300. data/spec/models/token_response_spec.rb +41 -0
  301. data/spec/models/token_spec.rb +47 -0
  302. data/spec/models/transaction_response_spec.rb +71 -0
  303. data/spec/models/transaction_spec.rb +53 -0
  304. data/spec/models/triggers_spec.rb +53 -0
  305. data/spec/models/vacation_rental_info_request_spec.rb +53 -0
  306. data/spec/models/vacation_rental_info_spec.rb +47 -0
  307. data/spec/models/verify_instrument_request_spec.rb +53 -0
  308. data/spec/spec_helper.rb +111 -0
  309. data/yapstone-payments.gemspec +45 -0
  310. metadata +633 -0
@@ -0,0 +1,208 @@
1
+ =begin
2
+ #Payments Orchestrator
3
+
4
+ #\"REST API for Payments Orchestrator\"
5
+
6
+ The version of the OpenAPI document: 1.6.4-SNAPSHOT
7
+ Contact: test@yapstone.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.1.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Yapstone
16
+ # sample desc
17
+ class APMSpecInParameters
18
+ # sample desc
19
+ attr_accessor :key
20
+
21
+ # sample desc
22
+ attr_accessor :value
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'key' => :'key',
28
+ :'value' => :'value'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'key' => :'String',
36
+ :'value' => :'String'
37
+ }
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ if (!attributes.is_a?(Hash))
44
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Yapstone::APMSpecInParameters` initialize method"
45
+ end
46
+
47
+ # check to see if the attribute exists and convert string to symbol for hash key
48
+ attributes = attributes.each_with_object({}) { |(k, v), h|
49
+ if (!self.class.attribute_map.key?(k.to_sym))
50
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Yapstone::APMSpecInParameters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
51
+ end
52
+ h[k.to_sym] = v
53
+ }
54
+
55
+ if attributes.key?(:'key')
56
+ self.key = attributes[:'key']
57
+ end
58
+
59
+ if attributes.key?(:'value')
60
+ self.value = attributes[:'value']
61
+ end
62
+ end
63
+
64
+ # Show invalid properties with the reasons. Usually used together with valid?
65
+ # @return Array for valid properties with the reasons
66
+ def list_invalid_properties
67
+ invalid_properties = Array.new
68
+ invalid_properties
69
+ end
70
+
71
+ # Check to see if the all the properties in the model are valid
72
+ # @return true if the model is valid
73
+ def valid?
74
+ true
75
+ end
76
+
77
+ # Checks equality by comparing each attribute.
78
+ # @param [Object] Object to be compared
79
+ def ==(o)
80
+ return true if self.equal?(o)
81
+ self.class == o.class &&
82
+ key == o.key &&
83
+ value == o.value
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
+ [key, value].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
+ new.build_from_hash(attributes)
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ self.class.openapi_types.each_pair do |key, type|
111
+ if type =~ /\AArray<(.*)>/i
112
+ # check to ensure the input is an array given that the attribute
113
+ # is documented as an array but the input is not
114
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
115
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
116
+ end
117
+ elsif !attributes[self.class.attribute_map[key]].nil?
118
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
119
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
120
+ end
121
+
122
+ self
123
+ end
124
+
125
+ # Deserializes the data based on type
126
+ # @param string type Data type
127
+ # @param string value Value to be deserialized
128
+ # @return [Object] Deserialized data
129
+ def _deserialize(type, value)
130
+ case type.to_sym
131
+ when :DateTime
132
+ DateTime.parse(value)
133
+ when :Date
134
+ Date.parse(value)
135
+ when :String
136
+ value.to_s
137
+ when :Integer
138
+ value.to_i
139
+ when :Float
140
+ value.to_f
141
+ when :Boolean
142
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
143
+ true
144
+ else
145
+ false
146
+ end
147
+ when :Object
148
+ # generic object (usually a Hash), return directly
149
+ value
150
+ when /\AArray<(?<inner_type>.+)>\z/
151
+ inner_type = Regexp.last_match[:inner_type]
152
+ value.map { |v| _deserialize(inner_type, v) }
153
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
154
+ k_type = Regexp.last_match[:k_type]
155
+ v_type = Regexp.last_match[:v_type]
156
+ {}.tap do |hash|
157
+ value.each do |k, v|
158
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
159
+ end
160
+ end
161
+ else # model
162
+ Yapstone.const_get(type).build_from_hash(value)
163
+ end
164
+ end
165
+
166
+ # Returns the string representation of the object
167
+ # @return [String] String presentation of the object
168
+ def to_s
169
+ to_hash.to_s
170
+ end
171
+
172
+ # to_body is an alias to to_hash (backward compatibility)
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_body
175
+ to_hash
176
+ end
177
+
178
+ # Returns the object in the form of hash
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_hash
181
+ hash = {}
182
+ self.class.attribute_map.each_pair do |attr, param|
183
+ value = self.send(attr)
184
+ next if value.nil?
185
+ hash[param] = _to_hash(value)
186
+ end
187
+ hash
188
+ end
189
+
190
+ # Outputs non-array value in the form of hash
191
+ # For object, use to_hash. Otherwise, just return the value
192
+ # @param [Object] value Any valid value
193
+ # @return [Hash] Returns the value in the form of hash
194
+ def _to_hash(value)
195
+ if value.is_a?(Array)
196
+ value.compact.map { |v| _to_hash(v) }
197
+ elsif value.is_a?(Hash)
198
+ {}.tap do |hash|
199
+ value.each { |k, v| hash[k] = _to_hash(v) }
200
+ end
201
+ elsif value.respond_to? :to_hash
202
+ value.to_hash
203
+ else
204
+ value
205
+ end
206
+ end
207
+ end
208
+ end
@@ -0,0 +1,217 @@
1
+ =begin
2
+ #Payments Orchestrator
3
+
4
+ #\"REST API for Payments Orchestrator\"
5
+
6
+ The version of the OpenAPI document: 1.6.4-SNAPSHOT
7
+ Contact: test@yapstone.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.1.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Yapstone
16
+ class AuthResponse
17
+ attr_accessor :instrument_type
18
+
19
+ attr_accessor :auth_result
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'instrument_type' => :'instrumentType',
25
+ :'auth_result' => :'authResult'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.openapi_types
31
+ {
32
+ :'instrument_type' => :'String',
33
+ :'auth_result' => :'Array<Result>'
34
+ }
35
+ end
36
+
37
+ # discriminator's property name in OpenAPI v3
38
+ def self.openapi_discriminator_name
39
+ :'instrument_type'
40
+ end
41
+
42
+ # Initializes the object
43
+ # @param [Hash] attributes Model attributes in the form of hash
44
+ def initialize(attributes = {})
45
+ if (!attributes.is_a?(Hash))
46
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Yapstone::AuthResponse` initialize method"
47
+ end
48
+
49
+ # check to see if the attribute exists and convert string to symbol for hash key
50
+ attributes = attributes.each_with_object({}) { |(k, v), h|
51
+ if (!self.class.attribute_map.key?(k.to_sym))
52
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Yapstone::AuthResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
53
+ end
54
+ h[k.to_sym] = v
55
+ }
56
+
57
+ if attributes.key?(:'instrument_type')
58
+ self.instrument_type = attributes[:'instrument_type']
59
+ end
60
+
61
+ if attributes.key?(:'auth_result')
62
+ if (value = attributes[:'auth_result']).is_a?(Array)
63
+ self.auth_result = value
64
+ end
65
+ end
66
+ end
67
+
68
+ # Show invalid properties with the reasons. Usually used together with valid?
69
+ # @return Array for valid properties with the reasons
70
+ def list_invalid_properties
71
+ invalid_properties = Array.new
72
+ if @instrument_type.nil?
73
+ invalid_properties.push('invalid value for "instrument_type", instrument_type cannot be nil.')
74
+ end
75
+
76
+ invalid_properties
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ return false if @instrument_type.nil?
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ instrument_type == o.instrument_type &&
92
+ auth_result == o.auth_result
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [instrument_type, auth_result].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ new.build_from_hash(attributes)
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+ self.class.openapi_types.each_pair do |key, type|
120
+ if type =~ /\AArray<(.*)>/i
121
+ # check to ensure the input is an array given that the attribute
122
+ # is documented as an array but the input is not
123
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
124
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
125
+ end
126
+ elsif !attributes[self.class.attribute_map[key]].nil?
127
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
128
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
129
+ end
130
+
131
+ self
132
+ end
133
+
134
+ # Deserializes the data based on type
135
+ # @param string type Data type
136
+ # @param string value Value to be deserialized
137
+ # @return [Object] Deserialized data
138
+ def _deserialize(type, value)
139
+ case type.to_sym
140
+ when :DateTime
141
+ DateTime.parse(value)
142
+ when :Date
143
+ Date.parse(value)
144
+ when :String
145
+ value.to_s
146
+ when :Integer
147
+ value.to_i
148
+ when :Float
149
+ value.to_f
150
+ when :Boolean
151
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
152
+ true
153
+ else
154
+ false
155
+ end
156
+ when :Object
157
+ # generic object (usually a Hash), return directly
158
+ value
159
+ when /\AArray<(?<inner_type>.+)>\z/
160
+ inner_type = Regexp.last_match[:inner_type]
161
+ value.map { |v| _deserialize(inner_type, v) }
162
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
163
+ k_type = Regexp.last_match[:k_type]
164
+ v_type = Regexp.last_match[:v_type]
165
+ {}.tap do |hash|
166
+ value.each do |k, v|
167
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
168
+ end
169
+ end
170
+ else # model
171
+ Yapstone.const_get(type).build_from_hash(value)
172
+ end
173
+ end
174
+
175
+ # Returns the string representation of the object
176
+ # @return [String] String presentation of the object
177
+ def to_s
178
+ to_hash.to_s
179
+ end
180
+
181
+ # to_body is an alias to to_hash (backward compatibility)
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_body
184
+ to_hash
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = self.send(attr)
193
+ next if value.nil?
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ # Outputs non-array value in the form of hash
200
+ # For object, use to_hash. Otherwise, just return the value
201
+ # @param [Object] value Any valid value
202
+ # @return [Hash] Returns the value in the form of hash
203
+ def _to_hash(value)
204
+ if value.is_a?(Array)
205
+ value.compact.map { |v| _to_hash(v) }
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.each { |k, v| hash[k] = _to_hash(v) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash
212
+ else
213
+ value
214
+ end
215
+ end
216
+ end
217
+ end
@@ -0,0 +1,205 @@
1
+ =begin
2
+ #Payments Orchestrator
3
+
4
+ #\"REST API for Payments Orchestrator\"
5
+
6
+ The version of the OpenAPI document: 1.6.4-SNAPSHOT
7
+ Contact: test@yapstone.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.1.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Yapstone
16
+ class AuthTokenRequest
17
+ attr_accessor :authentication
18
+
19
+ attr_accessor :platform
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'authentication' => :'authentication',
25
+ :'platform' => :'platform'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.openapi_types
31
+ {
32
+ :'authentication' => :'String',
33
+ :'platform' => :'String'
34
+ }
35
+ end
36
+
37
+ # Initializes the object
38
+ # @param [Hash] attributes Model attributes in the form of hash
39
+ def initialize(attributes = {})
40
+ if (!attributes.is_a?(Hash))
41
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Yapstone::AuthTokenRequest` initialize method"
42
+ end
43
+
44
+ # check to see if the attribute exists and convert string to symbol for hash key
45
+ attributes = attributes.each_with_object({}) { |(k, v), h|
46
+ if (!self.class.attribute_map.key?(k.to_sym))
47
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Yapstone::AuthTokenRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
48
+ end
49
+ h[k.to_sym] = v
50
+ }
51
+
52
+ if attributes.key?(:'authentication')
53
+ self.authentication = attributes[:'authentication']
54
+ end
55
+
56
+ if attributes.key?(:'platform')
57
+ self.platform = attributes[:'platform']
58
+ end
59
+ end
60
+
61
+ # Show invalid properties with the reasons. Usually used together with valid?
62
+ # @return Array for valid properties with the reasons
63
+ def list_invalid_properties
64
+ invalid_properties = Array.new
65
+ invalid_properties
66
+ end
67
+
68
+ # Check to see if the all the properties in the model are valid
69
+ # @return true if the model is valid
70
+ def valid?
71
+ true
72
+ end
73
+
74
+ # Checks equality by comparing each attribute.
75
+ # @param [Object] Object to be compared
76
+ def ==(o)
77
+ return true if self.equal?(o)
78
+ self.class == o.class &&
79
+ authentication == o.authentication &&
80
+ platform == o.platform
81
+ end
82
+
83
+ # @see the `==` method
84
+ # @param [Object] Object to be compared
85
+ def eql?(o)
86
+ self == o
87
+ end
88
+
89
+ # Calculates hash code according to all attributes.
90
+ # @return [Integer] Hash code
91
+ def hash
92
+ [authentication, platform].hash
93
+ end
94
+
95
+ # Builds the object from hash
96
+ # @param [Hash] attributes Model attributes in the form of hash
97
+ # @return [Object] Returns the model itself
98
+ def self.build_from_hash(attributes)
99
+ new.build_from_hash(attributes)
100
+ end
101
+
102
+ # Builds the object from hash
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ # @return [Object] Returns the model itself
105
+ def build_from_hash(attributes)
106
+ return nil unless attributes.is_a?(Hash)
107
+ self.class.openapi_types.each_pair do |key, type|
108
+ if 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[self.class.attribute_map[key]].is_a?(Array)
112
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
113
+ end
114
+ elsif !attributes[self.class.attribute_map[key]].nil?
115
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
116
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
117
+ end
118
+
119
+ self
120
+ end
121
+
122
+ # Deserializes the data based on type
123
+ # @param string type Data type
124
+ # @param string value Value to be deserialized
125
+ # @return [Object] Deserialized data
126
+ def _deserialize(type, value)
127
+ case type.to_sym
128
+ when :DateTime
129
+ DateTime.parse(value)
130
+ when :Date
131
+ Date.parse(value)
132
+ when :String
133
+ value.to_s
134
+ when :Integer
135
+ value.to_i
136
+ when :Float
137
+ value.to_f
138
+ when :Boolean
139
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
140
+ true
141
+ else
142
+ false
143
+ end
144
+ when :Object
145
+ # generic object (usually a Hash), return directly
146
+ value
147
+ when /\AArray<(?<inner_type>.+)>\z/
148
+ inner_type = Regexp.last_match[:inner_type]
149
+ value.map { |v| _deserialize(inner_type, v) }
150
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
151
+ k_type = Regexp.last_match[:k_type]
152
+ v_type = Regexp.last_match[:v_type]
153
+ {}.tap do |hash|
154
+ value.each do |k, v|
155
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
156
+ end
157
+ end
158
+ else # model
159
+ Yapstone.const_get(type).build_from_hash(value)
160
+ end
161
+ end
162
+
163
+ # Returns the string representation of the object
164
+ # @return [String] String presentation of the object
165
+ def to_s
166
+ to_hash.to_s
167
+ end
168
+
169
+ # to_body is an alias to to_hash (backward compatibility)
170
+ # @return [Hash] Returns the object in the form of hash
171
+ def to_body
172
+ to_hash
173
+ end
174
+
175
+ # Returns the object in the form of hash
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_hash
178
+ hash = {}
179
+ self.class.attribute_map.each_pair do |attr, param|
180
+ value = self.send(attr)
181
+ next if value.nil?
182
+ hash[param] = _to_hash(value)
183
+ end
184
+ hash
185
+ end
186
+
187
+ # Outputs non-array value in the form of hash
188
+ # For object, use to_hash. Otherwise, just return the value
189
+ # @param [Object] value Any valid value
190
+ # @return [Hash] Returns the value in the form of hash
191
+ def _to_hash(value)
192
+ if value.is_a?(Array)
193
+ value.compact.map { |v| _to_hash(v) }
194
+ elsif value.is_a?(Hash)
195
+ {}.tap do |hash|
196
+ value.each { |k, v| hash[k] = _to_hash(v) }
197
+ end
198
+ elsif value.respond_to? :to_hash
199
+ value.to_hash
200
+ else
201
+ value
202
+ end
203
+ end
204
+ end
205
+ end