apimatic-cp-sdk 0.0.1

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 (271) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +178 -0
  4. data/bin/console +15 -0
  5. data/lib/cell_point_api/api_helper.rb +10 -0
  6. data/lib/cell_point_api/apis/apple_pay_api.rb +51 -0
  7. data/lib/cell_point_api/apis/authentication_api.rb +81 -0
  8. data/lib/cell_point_api/apis/base_api.rb +67 -0
  9. data/lib/cell_point_api/apis/bulk_api.rb +93 -0
  10. data/lib/cell_point_api/apis/cards_api.rb +104 -0
  11. data/lib/cell_point_api/apis/notes_api.rb +66 -0
  12. data/lib/cell_point_api/apis/oauth_authorization_api.rb +44 -0
  13. data/lib/cell_point_api/apis/orders_api.rb +483 -0
  14. data/lib/cell_point_api/apis/payment_methods_api.rb +57 -0
  15. data/lib/cell_point_api/apis/proxy_api.rb +91 -0
  16. data/lib/cell_point_api/apis/transactions_api.rb +546 -0
  17. data/lib/cell_point_api/apis/wallet_api.rb +39 -0
  18. data/lib/cell_point_api/client.rb +145 -0
  19. data/lib/cell_point_api/configuration.rb +180 -0
  20. data/lib/cell_point_api/events/callbacks/callbacks_handler.rb +37 -0
  21. data/lib/cell_point_api/events/unknown_event.rb +32 -0
  22. data/lib/cell_point_api/exceptions/api_exception.rb +21 -0
  23. data/lib/cell_point_api/exceptions/oauth_provider_exception.rb +64 -0
  24. data/lib/cell_point_api/exceptions/problem_exception.rb +75 -0
  25. data/lib/cell_point_api/http/api_response.rb +19 -0
  26. data/lib/cell_point_api/http/auth/cpd_issued_jwt.rb +156 -0
  27. data/lib/cell_point_api/http/auth/merchant_issued_jwt.rb +53 -0
  28. data/lib/cell_point_api/http/http_call_back.rb +10 -0
  29. data/lib/cell_point_api/http/http_method_enum.rb +10 -0
  30. data/lib/cell_point_api/http/http_request.rb +10 -0
  31. data/lib/cell_point_api/http/http_response.rb +10 -0
  32. data/lib/cell_point_api/http/proxy_settings.rb +22 -0
  33. data/lib/cell_point_api/logging/configuration/api_logging_configuration.rb +186 -0
  34. data/lib/cell_point_api/logging/sdk_logger.rb +17 -0
  35. data/lib/cell_point_api/models/account.rb +168 -0
  36. data/lib/cell_point_api/models/account_status.rb +52 -0
  37. data/lib/cell_point_api/models/account_type.rb +44 -0
  38. data/lib/cell_point_api/models/action_base.rb +74 -0
  39. data/lib/cell_point_api/models/action_completion_response.rb +77 -0
  40. data/lib/cell_point_api/models/action_result_status.rb +40 -0
  41. data/lib/cell_point_api/models/action_type.rb +36 -0
  42. data/lib/cell_point_api/models/activity.rb +244 -0
  43. data/lib/cell_point_api/models/activity_data.rb +127 -0
  44. data/lib/cell_point_api/models/address_verification_status.rb +56 -0
  45. data/lib/cell_point_api/models/airline_ancillary.rb +244 -0
  46. data/lib/cell_point_api/models/airline_ancillary_data.rb +120 -0
  47. data/lib/cell_point_api/models/airline_fare.rb +348 -0
  48. data/lib/cell_point_api/models/airline_fare_data.rb +217 -0
  49. data/lib/cell_point_api/models/airline_industry_data.rb +152 -0
  50. data/lib/cell_point_api/models/airport.rb +144 -0
  51. data/lib/cell_point_api/models/amount.rb +105 -0
  52. data/lib/cell_point_api/models/ancillary_details.rb +366 -0
  53. data/lib/cell_point_api/models/apple_pay_config.rb +83 -0
  54. data/lib/cell_point_api/models/apple_pay_instrument_apple_pay_node.rb +119 -0
  55. data/lib/cell_point_api/models/apple_pay_payment_instrument.rb +123 -0
  56. data/lib/cell_point_api/models/apple_tokenized_token.rb +143 -0
  57. data/lib/cell_point_api/models/audience.rb +36 -0
  58. data/lib/cell_point_api/models/authorization.rb +145 -0
  59. data/lib/cell_point_api/models/authorization_group.rb +99 -0
  60. data/lib/cell_point_api/models/authorization_group1.rb +216 -0
  61. data/lib/cell_point_api/models/authorization_group_full.rb +193 -0
  62. data/lib/cell_point_api/models/authorize_order_by_id_post201_response.rb +128 -0
  63. data/lib/cell_point_api/models/auto_rental.rb +195 -0
  64. data/lib/cell_point_api/models/auto_rental_data.rb +76 -0
  65. data/lib/cell_point_api/models/auto_rental_industry_data.rb +182 -0
  66. data/lib/cell_point_api/models/base_model.rb +110 -0
  67. data/lib/cell_point_api/models/bin.rb +73 -0
  68. data/lib/cell_point_api/models/breadcrumb.rb +86 -0
  69. data/lib/cell_point_api/models/browser_info.rb +114 -0
  70. data/lib/cell_point_api/models/bundle.rb +195 -0
  71. data/lib/cell_point_api/models/bundled_activity.rb +229 -0
  72. data/lib/cell_point_api/models/bundled_airline_ancillary.rb +226 -0
  73. data/lib/cell_point_api/models/bundled_airline_fare.rb +330 -0
  74. data/lib/cell_point_api/models/bundled_auto_rental.rb +176 -0
  75. data/lib/cell_point_api/models/bundled_discount.rb +132 -0
  76. data/lib/cell_point_api/models/bundled_item_base.rb +123 -0
  77. data/lib/cell_point_api/models/bundled_lodging_reservation.rb +176 -0
  78. data/lib/cell_point_api/models/bundled_product.rb +161 -0
  79. data/lib/cell_point_api/models/buyer.rb +129 -0
  80. data/lib/cell_point_api/models/buyer_fingerprint.rb +125 -0
  81. data/lib/cell_point_api/models/buyer_history.rb +199 -0
  82. data/lib/cell_point_api/models/cancel.rb +109 -0
  83. data/lib/cell_point_api/models/cancelled_payment_transactions.rb +84 -0
  84. data/lib/cell_point_api/models/capabilities.rb +77 -0
  85. data/lib/cell_point_api/models/capture.rb +84 -0
  86. data/lib/cell_point_api/models/capture_payment_response.rb +159 -0
  87. data/lib/cell_point_api/models/card.rb +131 -0
  88. data/lib/cell_point_api/models/card_config.rb +105 -0
  89. data/lib/cell_point_api/models/card_identification.rb +126 -0
  90. data/lib/cell_point_api/models/card_instrument_card_node.rb +232 -0
  91. data/lib/cell_point_api/models/card_number.rb +122 -0
  92. data/lib/cell_point_api/models/card_payment_instrument.rb +136 -0
  93. data/lib/cell_point_api/models/card_scheme.rb +63 -0
  94. data/lib/cell_point_api/models/card_scheme_configuration.rb +87 -0
  95. data/lib/cell_point_api/models/carrier.rb +82 -0
  96. data/lib/cell_point_api/models/category.rb +36 -0
  97. data/lib/cell_point_api/models/client_assertion.rb +135 -0
  98. data/lib/cell_point_api/models/close.rb +89 -0
  99. data/lib/cell_point_api/models/close_refund_response.rb +73 -0
  100. data/lib/cell_point_api/models/closed_payment_transactions.rb +83 -0
  101. data/lib/cell_point_api/models/codeshare.rb +87 -0
  102. data/lib/cell_point_api/models/complete_person_name.rb +120 -0
  103. data/lib/cell_point_api/models/completion_redirect.rb +93 -0
  104. data/lib/cell_point_api/models/configuration.rb +86 -0
  105. data/lib/cell_point_api/models/contact_data.rb +82 -0
  106. data/lib/cell_point_api/models/cpu.rb +74 -0
  107. data/lib/cell_point_api/models/device_os.rb +60 -0
  108. data/lib/cell_point_api/models/discount.rb +150 -0
  109. data/lib/cell_point_api/models/discount_data.rb +83 -0
  110. data/lib/cell_point_api/models/driver.rb +86 -0
  111. data/lib/cell_point_api/models/external_transaction.rb +227 -0
  112. data/lib/cell_point_api/models/externally_tokenized_card.rb +81 -0
  113. data/lib/cell_point_api/models/failover.rb +105 -0
  114. data/lib/cell_point_api/models/failure_category.rb +62 -0
  115. data/lib/cell_point_api/models/failure_module.rb +58 -0
  116. data/lib/cell_point_api/models/fingerprint.rb +82 -0
  117. data/lib/cell_point_api/models/fraud_assessment.rb +163 -0
  118. data/lib/cell_point_api/models/fulfilled_activity.rb +207 -0
  119. data/lib/cell_point_api/models/fulfilled_airline_ancillary.rb +207 -0
  120. data/lib/cell_point_api/models/fulfilled_airline_fare.rb +207 -0
  121. data/lib/cell_point_api/models/fulfilled_auto_rental.rb +207 -0
  122. data/lib/cell_point_api/models/fulfilled_bundle.rb +207 -0
  123. data/lib/cell_point_api/models/fulfilled_discount.rb +178 -0
  124. data/lib/cell_point_api/models/fulfilled_line_item_base.rb +177 -0
  125. data/lib/cell_point_api/models/fulfilled_lodging_reservation.rb +207 -0
  126. data/lib/cell_point_api/models/fulfilled_order.rb +148 -0
  127. data/lib/cell_point_api/models/fulfilled_product.rb +207 -0
  128. data/lib/cell_point_api/models/fulfilled_tax_line.rb +162 -0
  129. data/lib/cell_point_api/models/fulfillment_data.rb +90 -0
  130. data/lib/cell_point_api/models/fulfillment_status.rb +41 -0
  131. data/lib/cell_point_api/models/funding_type.rb +40 -0
  132. data/lib/cell_point_api/models/gender.rb +40 -0
  133. data/lib/cell_point_api/models/hpp_data.rb +155 -0
  134. data/lib/cell_point_api/models/identifying_document.rb +159 -0
  135. data/lib/cell_point_api/models/identifying_document_type.rb +60 -0
  136. data/lib/cell_point_api/models/industry_data.rb +124 -0
  137. data/lib/cell_point_api/models/informational_price_row.rb +97 -0
  138. data/lib/cell_point_api/models/informational_price_section.rb +104 -0
  139. data/lib/cell_point_api/models/itinerary_type.rb +47 -0
  140. data/lib/cell_point_api/models/journey_segment.rb +83 -0
  141. data/lib/cell_point_api/models/line_item_base.rb +101 -0
  142. data/lib/cell_point_api/models/line_item_type.rb +60 -0
  143. data/lib/cell_point_api/models/links.rb +86 -0
  144. data/lib/cell_point_api/models/location.rb +153 -0
  145. data/lib/cell_point_api/models/lodging_industry_data.rb +216 -0
  146. data/lib/cell_point_api/models/lodging_reservation.rb +195 -0
  147. data/lib/cell_point_api/models/lodging_reservation_data.rb +76 -0
  148. data/lib/cell_point_api/models/loyalty_account.rb +103 -0
  149. data/lib/cell_point_api/models/network_info.rb +76 -0
  150. data/lib/cell_point_api/models/non_negative_amount.rb +105 -0
  151. data/lib/cell_point_api/models/non_positive_amount.rb +105 -0
  152. data/lib/cell_point_api/models/note.rb +139 -0
  153. data/lib/cell_point_api/models/note_request.rb +90 -0
  154. data/lib/cell_point_api/models/oauth_provider_error.rb +62 -0
  155. data/lib/cell_point_api/models/oauth_scope_cpd_issued_jwt.rb +158 -0
  156. data/lib/cell_point_api/models/oauth_token.rb +96 -0
  157. data/lib/cell_point_api/models/order.rb +414 -0
  158. data/lib/cell_point_api/models/order_canceled_reason.rb +56 -0
  159. data/lib/cell_point_api/models/order_core.rb +343 -0
  160. data/lib/cell_point_api/models/order_extended.rb +150 -0
  161. data/lib/cell_point_api/models/order_payment_summary.rb +117 -0
  162. data/lib/cell_point_api/models/order_status.rb +161 -0
  163. data/lib/cell_point_api/models/order_status_type.rb +58 -0
  164. data/lib/cell_point_api/models/order_transactions.rb +88 -0
  165. data/lib/cell_point_api/models/owner.rb +131 -0
  166. data/lib/cell_point_api/models/page_type.rb +26 -0
  167. data/lib/cell_point_api/models/passenger.rb +229 -0
  168. data/lib/cell_point_api/models/password_change_type.rb +41 -0
  169. data/lib/cell_point_api/models/pay_pal_action.rb +129 -0
  170. data/lib/cell_point_api/models/pay_pal_payment_instrument.rb +88 -0
  171. data/lib/cell_point_api/models/payment_data.rb +102 -0
  172. data/lib/cell_point_api/models/payment_data_header.rb +94 -0
  173. data/lib/cell_point_api/models/payment_data_version.rb +26 -0
  174. data/lib/cell_point_api/models/payment_field.rb +68 -0
  175. data/lib/cell_point_api/models/payment_instrument_base.rb +87 -0
  176. data/lib/cell_point_api/models/payment_method.rb +52 -0
  177. data/lib/cell_point_api/models/payment_methods_for_order_get200_response.rb +157 -0
  178. data/lib/cell_point_api/models/payment_methods_search_vouchers_post200_response.rb +82 -0
  179. data/lib/cell_point_api/models/payment_processor.rb +121 -0
  180. data/lib/cell_point_api/models/payment_status.rb +122 -0
  181. data/lib/cell_point_api/models/payment_transaction.rb +605 -0
  182. data/lib/cell_point_api/models/payment_transaction_authorized_amount.rb +105 -0
  183. data/lib/cell_point_api/models/payment_transaction_canceled_amount.rb +105 -0
  184. data/lib/cell_point_api/models/payment_transaction_captured_amount.rb +105 -0
  185. data/lib/cell_point_api/models/payment_transaction_pending_authorize_amount.rb +106 -0
  186. data/lib/cell_point_api/models/payment_transaction_pending_cancel_amount.rb +106 -0
  187. data/lib/cell_point_api/models/payment_transaction_pending_capture_amount.rb +106 -0
  188. data/lib/cell_point_api/models/payment_transaction_processing_fee.rb +106 -0
  189. data/lib/cell_point_api/models/payment_transaction_refunded_amount.rb +105 -0
  190. data/lib/cell_point_api/models/payments_v1_bulks_response.rb +74 -0
  191. data/lib/cell_point_api/models/payments_v1_orders_payments_retry_failed_refunds_request.rb +74 -0
  192. data/lib/cell_point_api/models/payments_v1_refunds_closures_request.rb +74 -0
  193. data/lib/cell_point_api/models/payments_v1_refunds_retry_failed_refunds_request.rb +74 -0
  194. data/lib/cell_point_api/models/payments_v1_schemes_response.rb +76 -0
  195. data/lib/cell_point_api/models/paypal_config.rb +94 -0
  196. data/lib/cell_point_api/models/person.rb +161 -0
  197. data/lib/cell_point_api/models/person_name.rb +89 -0
  198. data/lib/cell_point_api/models/phone.rb +132 -0
  199. data/lib/cell_point_api/models/pk_payment_method.rb +111 -0
  200. data/lib/cell_point_api/models/pk_payment_token.rb +94 -0
  201. data/lib/cell_point_api/models/postal_address.rb +217 -0
  202. data/lib/cell_point_api/models/price_summary.rb +191 -0
  203. data/lib/cell_point_api/models/product.rb +179 -0
  204. data/lib/cell_point_api/models/product_data.rb +104 -0
  205. data/lib/cell_point_api/models/property.rb +110 -0
  206. data/lib/cell_point_api/models/provider.rb +129 -0
  207. data/lib/cell_point_api/models/psp.rb +26 -0
  208. data/lib/cell_point_api/models/redirect_action.rb +116 -0
  209. data/lib/cell_point_api/models/refund_item.rb +310 -0
  210. data/lib/cell_point_api/models/refund_method.rb +36 -0
  211. data/lib/cell_point_api/models/refund_order_group_post201_response.rb +91 -0
  212. data/lib/cell_point_api/models/refund_reason.rb +104 -0
  213. data/lib/cell_point_api/models/refund_request.rb +161 -0
  214. data/lib/cell_point_api/models/refund_status.rb +44 -0
  215. data/lib/cell_point_api/models/refund_transaction.rb +311 -0
  216. data/lib/cell_point_api/models/refund_transaction_amount.rb +105 -0
  217. data/lib/cell_point_api/models/refund_type.rb +38 -0
  218. data/lib/cell_point_api/models/related_payment.rb +106 -0
  219. data/lib/cell_point_api/models/related_refund.rb +106 -0
  220. data/lib/cell_point_api/models/rental_location.rb +226 -0
  221. data/lib/cell_point_api/models/retry_refund_response.rb +73 -0
  222. data/lib/cell_point_api/models/reward.rb +101 -0
  223. data/lib/cell_point_api/models/room.rb +100 -0
  224. data/lib/cell_point_api/models/sales_channel.rb +36 -0
  225. data/lib/cell_point_api/models/save_pk_payment_token_request.rb +83 -0
  226. data/lib/cell_point_api/models/save_wallet_payment_token_request.rb +83 -0
  227. data/lib/cell_point_api/models/screen.rb +97 -0
  228. data/lib/cell_point_api/models/search_vouchers_request.rb +119 -0
  229. data/lib/cell_point_api/models/security_code.rb +83 -0
  230. data/lib/cell_point_api/models/security_code_match_status.rb +50 -0
  231. data/lib/cell_point_api/models/status.rb +43 -0
  232. data/lib/cell_point_api/models/status1.rb +52 -0
  233. data/lib/cell_point_api/models/summary.rb +82 -0
  234. data/lib/cell_point_api/models/tax.rb +134 -0
  235. data/lib/cell_point_api/models/taxes_and_fees_breakdown_page.rb +82 -0
  236. data/lib/cell_point_api/models/token_post200_response.rb +96 -0
  237. data/lib/cell_point_api/models/tokenized_card.rb +229 -0
  238. data/lib/cell_point_api/models/tokenized_card_with_contact_data.rb +247 -0
  239. data/lib/cell_point_api/models/tokenized_data.rb +169 -0
  240. data/lib/cell_point_api/models/total_row.rb +83 -0
  241. data/lib/cell_point_api/models/transaction_action.rb +108 -0
  242. data/lib/cell_point_api/models/transaction_action_result.rb +94 -0
  243. data/lib/cell_point_api/models/transaction_base.rb +132 -0
  244. data/lib/cell_point_api/models/transaction_failure.rb +222 -0
  245. data/lib/cell_point_api/models/travel_journey.rb +139 -0
  246. data/lib/cell_point_api/models/travel_leg.rb +194 -0
  247. data/lib/cell_point_api/models/trigger_bulk_request.rb +83 -0
  248. data/lib/cell_point_api/models/type.rb +67 -0
  249. data/lib/cell_point_api/models/type1.rb +47 -0
  250. data/lib/cell_point_api/models/type2.rb +40 -0
  251. data/lib/cell_point_api/models/type3.rb +41 -0
  252. data/lib/cell_point_api/models/type4.rb +56 -0
  253. data/lib/cell_point_api/models/type5.rb +78 -0
  254. data/lib/cell_point_api/models/uplift_config.rb +73 -0
  255. data/lib/cell_point_api/models/uplift_payment_instrument.rb +102 -0
  256. data/lib/cell_point_api/models/vehicle.rb +139 -0
  257. data/lib/cell_point_api/models/voucher_config.rb +92 -0
  258. data/lib/cell_point_api/models/voucher_issuer.rb +26 -0
  259. data/lib/cell_point_api/models/voucher_payment_instrument.rb +233 -0
  260. data/lib/cell_point_api/models/voucher_payment_instrument_node.rb +198 -0
  261. data/lib/cell_point_api/models/voucher_type.rb +36 -0
  262. data/lib/cell_point_api/models/wallet_instrument_wallet_node.rb +136 -0
  263. data/lib/cell_point_api/models/wallet_payment_instrument.rb +123 -0
  264. data/lib/cell_point_api/models/wallet_tokenized_token.rb +148 -0
  265. data/lib/cell_point_api/models/wallet_tokenized_token_identification.rb +75 -0
  266. data/lib/cell_point_api/models/wallet_type.rb +36 -0
  267. data/lib/cell_point_api/utilities/date_time_helper.rb +11 -0
  268. data/lib/cell_point_api/utilities/file_wrapper.rb +28 -0
  269. data/lib/cell_point_api/utilities/union_type_lookup.rb +260 -0
  270. data/lib/cell_point_api.rb +301 -0
  271. metadata +354 -0
@@ -0,0 +1,161 @@
1
+ # cell_point_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module CellPointApi
7
+ # Status on the order level.
8
+ class OrderStatus < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Status of the order.
13
+ # <table>
14
+ # <thead>
15
+ # <tr>
16
+ # <th>Type</th>
17
+ # <th>Description</th>
18
+ # </tr>
19
+ # </thead>
20
+ # <tbody>
21
+ # <tr>
22
+ # <td>ACTIVE</td>
23
+ # <td>Order is currently active and is pending payment.</td>
24
+ # </tr>
25
+ # <tr>
26
+ # <td>CANCELED</td>
27
+ # <td>Order has been canceled. See `reason` for why order has been
28
+ # canceled.</td>
29
+ # </tr>
30
+ # <tr>
31
+ # <td>PAID</td>
32
+ # <td>Order has been fully paid for by the buyer. There are now
33
+ # transactions associated with the order.</td>
34
+ # </tr>
35
+ # <tr>
36
+ # <td>FULFILLED</td>
37
+ # <td>Order has been fulfilled by the merchant.</td>
38
+ # </tr>
39
+ # <tr>
40
+ # <td>COMPLETED</td>
41
+ # <td>Order has been marked as complete and all transactions have been
42
+ # captured.</td>
43
+ # </tr>
44
+ # </tbody>
45
+ # </table>
46
+ # @return [OrderStatusType]
47
+ attr_accessor :type
48
+
49
+ # Reason that the order was canceled.
50
+ # Will only be sent if order state is `CANCELED`.
51
+ # <table>
52
+ # <thead>
53
+ # <tr>
54
+ # <th>Type</th>
55
+ # <th>Description</th>
56
+ # </tr>
57
+ # </thead>
58
+ # <tbody>
59
+ # <tr>
60
+ # <td>ABANDONED</td>
61
+ # <td>Order has been abandoned. Time is out to complete payment.
62
+ # Please create a new order.</td>
63
+ # </tr>
64
+ # <tr>
65
+ # <td>FULFILLMENT_FAILURE</td>
66
+ # <td>Order was unable to be fulfilled by the merchant. All
67
+ # transactions have been canceled.</td>
68
+ # </tr>
69
+ # <tr>
70
+ # <td>FRAUD_REJECT</td>
71
+ # <td>Order was canceled due to the detection of fraud.</td>
72
+ # </tr>
73
+ # <tr>
74
+ # <td>MAXIMUM_NUMBER_OF_PAYMENT_ATTEMPTS_EXCEEDED</td>
75
+ # <td>Order was canceled because the maximum number of payment
76
+ # attempts has been exceeded on every possible payment method</td>
77
+ # </tr>
78
+ # </tbody>
79
+ # </table>
80
+ # @return [OrderCanceledReason]
81
+ attr_accessor :reason
82
+
83
+ # A mapping from model property names to API property names.
84
+ def self.names
85
+ @_hash = {} if @_hash.nil?
86
+ @_hash['type'] = 'type'
87
+ @_hash['reason'] = 'reason'
88
+ @_hash
89
+ end
90
+
91
+ # An array for optional fields
92
+ def self.optionals
93
+ %w[
94
+ reason
95
+ ]
96
+ end
97
+
98
+ # An array for nullable fields
99
+ def self.nullables
100
+ []
101
+ end
102
+
103
+ def initialize(type:, reason: SKIP, additional_properties: nil)
104
+ # Add additional model properties to the instance
105
+ additional_properties = {} if additional_properties.nil?
106
+
107
+ @type = type
108
+ @reason = reason unless reason == SKIP
109
+ @additional_properties = additional_properties
110
+ end
111
+
112
+ # Creates an instance of the object from a hash.
113
+ def self.from_hash(hash)
114
+ return nil unless hash
115
+
116
+ # Extract variables from the hash.
117
+ type = hash.key?('type') ? hash['type'] : nil
118
+ reason = hash.key?('reason') ? hash['reason'] : SKIP
119
+
120
+ # Create a new hash for additional properties, removing known properties.
121
+ new_hash = hash.reject { |k, _| names.value?(k) }
122
+
123
+ additional_properties = APIHelper.get_additional_properties(
124
+ new_hash, proc { |value| value }
125
+ )
126
+
127
+ # Create object from extracted values.
128
+ OrderStatus.new(type: type,
129
+ reason: reason,
130
+ additional_properties: additional_properties)
131
+ end
132
+
133
+ # Validates an instance of the object from a given value.
134
+ # @param [OrderStatus | Hash] The value against the validation is performed.
135
+ def self.validate(value)
136
+ if value.instance_of? self
137
+ return APIHelper.valid_type?(value.type,
138
+ ->(val) { OrderStatusType.validate(val) })
139
+ end
140
+
141
+ return false unless value.instance_of? Hash
142
+
143
+ APIHelper.valid_type?(value['type'],
144
+ ->(val) { OrderStatusType.validate(val) })
145
+ end
146
+
147
+ # Provides a human-readable string representation of the object.
148
+ def to_s
149
+ class_name = self.class.name.split('::').last
150
+ "<#{class_name} type: #{@type}, reason: #{@reason}, additional_properties:"\
151
+ " #{@additional_properties}>"
152
+ end
153
+
154
+ # Provides a debugging-friendly string with detailed object information.
155
+ def inspect
156
+ class_name = self.class.name.split('::').last
157
+ "<#{class_name} type: #{@type.inspect}, reason: #{@reason.inspect}, additional_properties:"\
158
+ " #{@additional_properties}>"
159
+ end
160
+ end
161
+ end
@@ -0,0 +1,58 @@
1
+ # cell_point_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module CellPointApi
7
+ # Status of the order. <table> <thead> <tr> <th>Type</th>
8
+ # <th>Description</th> </tr> </thead> <tbody> <tr>
9
+ # <td>ACTIVE</td> <td>Order is currently active and is pending
10
+ # payment.</td> </tr> <tr> <td>CANCELED</td> <td>Order has
11
+ # been canceled. See `reason` for why order has been canceled.</td> </tr>
12
+ # <tr> <td>PAID</td> <td>Order has been fully paid for by the
13
+ # buyer. There are now transactions associated with the order.</td> </tr>
14
+ # <tr> <td>FULFILLED</td> <td>Order has been fulfilled by the
15
+ # merchant.</td> </tr> <tr> <td>COMPLETED</td> <td>Order
16
+ # has been marked as complete and all transactions have been captured.</td>
17
+ # </tr> </tbody> </table>
18
+ class OrderStatusType
19
+ ORDER_STATUS_TYPE = [
20
+ # TODO: Write general description for ACTIVE
21
+ ACTIVE = 'ACTIVE'.freeze,
22
+
23
+ # TODO: Write general description for CANCELED
24
+ CANCELED = 'CANCELED'.freeze,
25
+
26
+ # TODO: Write general description for PAID
27
+ PAID = 'PAID'.freeze,
28
+
29
+ # TODO: Write general description for FULFILLED
30
+ FULFILLED = 'FULFILLED'.freeze,
31
+
32
+ # TODO: Write general description for COMPLETED
33
+ COMPLETED = 'COMPLETED'.freeze
34
+ ].freeze
35
+
36
+ def self.validate(value)
37
+ return false if value.nil?
38
+
39
+ ORDER_STATUS_TYPE.include?(value)
40
+ end
41
+
42
+ def self.from_value(value, default_value = ACTIVE)
43
+ return default_value if value.nil?
44
+
45
+ str = value.to_s.strip
46
+
47
+ case str.downcase
48
+ when 'active' then ACTIVE
49
+ when 'canceled' then CANCELED
50
+ when 'paid' then PAID
51
+ when 'fulfilled' then FULFILLED
52
+ when 'completed' then COMPLETED
53
+ else
54
+ default_value
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,88 @@
1
+ # cell_point_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module CellPointApi
7
+ # List of transactions associated with an order.
8
+ class OrderTransactions < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [Array[Object]]
14
+ attr_accessor :transactions
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['transactions'] = 'transactions'
20
+ @_hash
21
+ end
22
+
23
+ # An array for optional fields
24
+ def self.optionals
25
+ %w[
26
+ transactions
27
+ ]
28
+ end
29
+
30
+ # An array for nullable fields
31
+ def self.nullables
32
+ []
33
+ end
34
+
35
+ def initialize(transactions: SKIP, additional_properties: nil)
36
+ # Add additional model properties to the instance
37
+ additional_properties = {} if additional_properties.nil?
38
+
39
+ @transactions = transactions unless transactions == SKIP
40
+ @additional_properties = additional_properties
41
+ end
42
+
43
+ # Creates an instance of the object from a hash.
44
+ def self.from_hash(hash)
45
+ return nil unless hash
46
+
47
+ # Extract variables from the hash.
48
+ transactions = hash.key?('transactions') ? APIHelper.deserialize_union_type(
49
+ UnionTypeLookUp.get(:Transaction), hash['transactions']
50
+ ) : SKIP
51
+
52
+ # Create a new hash for additional properties, removing known properties.
53
+ new_hash = hash.reject { |k, _| names.value?(k) }
54
+
55
+ additional_properties = APIHelper.get_additional_properties(
56
+ new_hash, proc { |value| value }
57
+ )
58
+
59
+ # Create object from extracted values.
60
+ OrderTransactions.new(transactions: transactions,
61
+ additional_properties: additional_properties)
62
+ end
63
+
64
+ # Validates an instance of the object from a given value.
65
+ # @param [OrderTransactions | Hash] The value against the validation is performed.
66
+ def self.validate(value)
67
+ return true if value.instance_of? self
68
+
69
+ return false unless value.instance_of? Hash
70
+
71
+ true
72
+ end
73
+
74
+ # Provides a human-readable string representation of the object.
75
+ def to_s
76
+ class_name = self.class.name.split('::').last
77
+ "<#{class_name} transactions: #{@transactions}, additional_properties:"\
78
+ " #{@additional_properties}>"
79
+ end
80
+
81
+ # Provides a debugging-friendly string with detailed object information.
82
+ def inspect
83
+ class_name = self.class.name.split('::').last
84
+ "<#{class_name} transactions: #{@transactions.inspect}, additional_properties:"\
85
+ " #{@additional_properties}>"
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,131 @@
1
+ # cell_point_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module CellPointApi
7
+ # Owner Model.
8
+ class Owner < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :id
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :loyalty_account_id
19
+
20
+ # Name bestowed upon an individual to differentiate them from other members
21
+ # of a group that share a family name.
22
+ # In the U.S., the first name of a Person.
23
+ # @return [String]
24
+ attr_accessor :given_name
25
+
26
+ # Name bestowed upon an individual to denote membership in a group or
27
+ # family.
28
+ # In the U.S., the last name of a Person.
29
+ # @return [String]
30
+ attr_accessor :family_name
31
+
32
+ # A mapping from model property names to API property names.
33
+ def self.names
34
+ @_hash = {} if @_hash.nil?
35
+ @_hash['id'] = 'id'
36
+ @_hash['loyalty_account_id'] = 'loyaltyAccountId'
37
+ @_hash['given_name'] = 'givenName'
38
+ @_hash['family_name'] = 'familyName'
39
+ @_hash
40
+ end
41
+
42
+ # An array for optional fields
43
+ def self.optionals
44
+ %w[
45
+ id
46
+ loyalty_account_id
47
+ ]
48
+ end
49
+
50
+ # An array for nullable fields
51
+ def self.nullables
52
+ []
53
+ end
54
+
55
+ def initialize(given_name:, family_name:, id: SKIP,
56
+ loyalty_account_id: SKIP, additional_properties: nil)
57
+ # Add additional model properties to the instance
58
+ additional_properties = {} if additional_properties.nil?
59
+
60
+ @id = id unless id == SKIP
61
+ @loyalty_account_id = loyalty_account_id unless loyalty_account_id == SKIP
62
+ @given_name = given_name
63
+ @family_name = family_name
64
+ @additional_properties = additional_properties
65
+ end
66
+
67
+ # Creates an instance of the object from a hash.
68
+ def self.from_hash(hash)
69
+ return nil unless hash
70
+
71
+ # Extract variables from the hash.
72
+ given_name = hash.key?('givenName') ? hash['givenName'] : nil
73
+ family_name = hash.key?('familyName') ? hash['familyName'] : nil
74
+ id = hash.key?('id') ? hash['id'] : SKIP
75
+ loyalty_account_id =
76
+ hash.key?('loyaltyAccountId') ? hash['loyaltyAccountId'] : SKIP
77
+
78
+ # Create a new hash for additional properties, removing known properties.
79
+ new_hash = hash.reject { |k, _| names.value?(k) }
80
+
81
+ additional_properties = APIHelper.get_additional_properties(
82
+ new_hash, proc { |value| value }
83
+ )
84
+
85
+ # Create object from extracted values.
86
+ Owner.new(given_name: given_name,
87
+ family_name: family_name,
88
+ id: id,
89
+ loyalty_account_id: loyalty_account_id,
90
+ additional_properties: additional_properties)
91
+ end
92
+
93
+ # Validates an instance of the object from a given value.
94
+ # @param [Owner | Hash] The value against the validation is performed.
95
+ def self.validate(value)
96
+ if value.instance_of? self
97
+ return (
98
+ APIHelper.valid_type?(value.given_name,
99
+ ->(val) { val.instance_of? String }) and
100
+ APIHelper.valid_type?(value.family_name,
101
+ ->(val) { val.instance_of? String })
102
+ )
103
+ end
104
+
105
+ return false unless value.instance_of? Hash
106
+
107
+ (
108
+ APIHelper.valid_type?(value['givenName'],
109
+ ->(val) { val.instance_of? String }) and
110
+ APIHelper.valid_type?(value['familyName'],
111
+ ->(val) { val.instance_of? String })
112
+ )
113
+ end
114
+
115
+ # Provides a human-readable string representation of the object.
116
+ def to_s
117
+ class_name = self.class.name.split('::').last
118
+ "<#{class_name} id: #{@id}, loyalty_account_id: #{@loyalty_account_id}, given_name:"\
119
+ " #{@given_name}, family_name: #{@family_name}, additional_properties:"\
120
+ " #{@additional_properties}>"
121
+ end
122
+
123
+ # Provides a debugging-friendly string with detailed object information.
124
+ def inspect
125
+ class_name = self.class.name.split('::').last
126
+ "<#{class_name} id: #{@id.inspect}, loyalty_account_id: #{@loyalty_account_id.inspect},"\
127
+ " given_name: #{@given_name.inspect}, family_name: #{@family_name.inspect},"\
128
+ " additional_properties: #{@additional_properties}>"
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,26 @@
1
+ # cell_point_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module CellPointApi
7
+ # Type of page to use for the Hosted Payment Page.
8
+ class PageType
9
+ PAGE_TYPE = [
10
+ # TODO: Write general description for FULL_PAGE_REDIRECT
11
+ FULL_PAGE_REDIRECT = 'FULL_PAGE_REDIRECT'.freeze
12
+ ].freeze
13
+
14
+ def self.validate(value)
15
+ return false if value.nil?
16
+
17
+ PAGE_TYPE.include?(value)
18
+ end
19
+
20
+ def self.from_value(value, default_value = FULL_PAGE_REDIRECT)
21
+ return default_value if value.nil?
22
+
23
+ default_value
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,229 @@
1
+ # cell_point_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module CellPointApi
7
+ # Passenger that is traveling.
8
+ class Passenger < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Name bestowed upon an individual to differentiate them from other members
13
+ # of a group that share a family name.
14
+ # In the U.S., the first name of a Person.
15
+ # @return [String]
16
+ attr_accessor :given_name
17
+
18
+ # Name bestowed upon an individual to denote membership in a group or
19
+ # family.
20
+ # In the U.S., the last name of a Person.
21
+ # @return [String]
22
+ attr_accessor :family_name
23
+
24
+ # Secondary name bestowed upon an individual to differentiate them from
25
+ # others that have the same given name.
26
+ # @return [String]
27
+ attr_accessor :middle_name
28
+
29
+ # The portion of a name's full form of address that precedes the name
30
+ # itself.
31
+ # @return [String]
32
+ attr_accessor :name_prefix
33
+
34
+ # The portion of a name's full form of address that follows the name itself.
35
+ # @return [String]
36
+ attr_accessor :name_suffix
37
+
38
+ # The shopper's date of birth.
39
+ # Format ISO-8601: YYYY-MM-DD
40
+ # @return [Date]
41
+ attr_accessor :date_of_birth
42
+
43
+ # Genders for individuals
44
+ # @return [Gender]
45
+ attr_accessor :gender
46
+
47
+ # User email address
48
+ # @return [String]
49
+ attr_accessor :email
50
+
51
+ # Telephone number.
52
+ # @return [Phone]
53
+ attr_accessor :phone
54
+
55
+ # Identifier for passenger that is unique within this order.
56
+ # This identifier should be used for any reference to this passenger
57
+ # elsewhere,
58
+ # such as fares or ancillaries in the price summary.
59
+ # How this identifier is generated is up to the merchant, as long as it is
60
+ # unique within the order.
61
+ # @return [String]
62
+ attr_accessor :id
63
+
64
+ # Passenger type code (PTC). IATA PTC values are 3-letter alphabetical.
65
+ # Example: ADT, SRC, CNN, INS.
66
+ # Commonly used codes include (but definitely not limited to):
67
+ # - `ADT`: Adult
68
+ # - `CNN`: Child
69
+ # - `INF`: Infant without a seat
70
+ # - `INS`: Infant with a seat
71
+ # - `SRC`: Senior Citizen
72
+ # However, several carriers use non-standard codes that can be up to 5
73
+ # alphanumeric characters.
74
+ # @return [String]
75
+ attr_accessor :type
76
+
77
+ # Passenger type code (PTC). IATA PTC values are 3-letter alphabetical.
78
+ # Example: ADT, SRC, CNN, INS.
79
+ # Commonly used codes include (but definitely not limited to):
80
+ # - `ADT`: Adult
81
+ # - `CNN`: Child
82
+ # - `INF`: Infant without a seat
83
+ # - `INS`: Infant with a seat
84
+ # - `SRC`: Senior Citizen
85
+ # However, several carriers use non-standard codes that can be up to 5
86
+ # alphanumeric characters.
87
+ # @return [Array[IdentifyingDocument]]
88
+ attr_accessor :documents
89
+
90
+ # Loyalty account information.
91
+ # @return [LoyaltyAccount]
92
+ attr_accessor :loyalty_account
93
+
94
+ # A mapping from model property names to API property names.
95
+ def self.names
96
+ @_hash = {} if @_hash.nil?
97
+ @_hash['given_name'] = 'givenName'
98
+ @_hash['family_name'] = 'familyName'
99
+ @_hash['middle_name'] = 'middleName'
100
+ @_hash['name_prefix'] = 'namePrefix'
101
+ @_hash['name_suffix'] = 'nameSuffix'
102
+ @_hash['date_of_birth'] = 'dateOfBirth'
103
+ @_hash['gender'] = 'gender'
104
+ @_hash['email'] = 'email'
105
+ @_hash['phone'] = 'phone'
106
+ @_hash['id'] = 'id'
107
+ @_hash['type'] = 'type'
108
+ @_hash['documents'] = 'documents'
109
+ @_hash['loyalty_account'] = 'loyaltyAccount'
110
+ @_hash
111
+ end
112
+
113
+ # An array for optional fields
114
+ def self.optionals
115
+ %w[
116
+ middle_name
117
+ name_prefix
118
+ name_suffix
119
+ date_of_birth
120
+ gender
121
+ email
122
+ phone
123
+ documents
124
+ loyalty_account
125
+ ]
126
+ end
127
+
128
+ # An array for nullable fields
129
+ def self.nullables
130
+ []
131
+ end
132
+
133
+ def initialize(given_name:, family_name:, id:, type:, middle_name: SKIP,
134
+ name_prefix: SKIP, name_suffix: SKIP, date_of_birth: SKIP,
135
+ gender: SKIP, email: SKIP, phone: SKIP, documents: SKIP,
136
+ loyalty_account: SKIP, additional_properties: nil)
137
+ # Add additional model properties to the instance
138
+ additional_properties = {} if additional_properties.nil?
139
+
140
+ @given_name = given_name
141
+ @family_name = family_name
142
+ @middle_name = middle_name unless middle_name == SKIP
143
+ @name_prefix = name_prefix unless name_prefix == SKIP
144
+ @name_suffix = name_suffix unless name_suffix == SKIP
145
+ @date_of_birth = date_of_birth unless date_of_birth == SKIP
146
+ @gender = gender unless gender == SKIP
147
+ @email = email unless email == SKIP
148
+ @phone = phone unless phone == SKIP
149
+ @id = id
150
+ @type = type
151
+ @documents = documents unless documents == SKIP
152
+ @loyalty_account = loyalty_account unless loyalty_account == SKIP
153
+ @additional_properties = additional_properties
154
+ end
155
+
156
+ # Creates an instance of the object from a hash.
157
+ def self.from_hash(hash)
158
+ return nil unless hash
159
+
160
+ # Extract variables from the hash.
161
+ given_name = hash.key?('givenName') ? hash['givenName'] : nil
162
+ family_name = hash.key?('familyName') ? hash['familyName'] : nil
163
+ id = hash.key?('id') ? hash['id'] : nil
164
+ type = hash.key?('type') ? hash['type'] : nil
165
+ middle_name = hash.key?('middleName') ? hash['middleName'] : SKIP
166
+ name_prefix = hash.key?('namePrefix') ? hash['namePrefix'] : SKIP
167
+ name_suffix = hash.key?('nameSuffix') ? hash['nameSuffix'] : SKIP
168
+ date_of_birth = hash.key?('dateOfBirth') ? hash['dateOfBirth'] : SKIP
169
+ gender = hash.key?('gender') ? hash['gender'] : SKIP
170
+ email = hash.key?('email') ? hash['email'] : SKIP
171
+ phone = Phone.from_hash(hash['phone']) if hash['phone']
172
+ # Parameter is an array, so we need to iterate through it
173
+ documents = nil
174
+ unless hash['documents'].nil?
175
+ documents = []
176
+ hash['documents'].each do |structure|
177
+ documents << (IdentifyingDocument.from_hash(structure) if structure)
178
+ end
179
+ end
180
+
181
+ documents = SKIP unless hash.key?('documents')
182
+ loyalty_account = LoyaltyAccount.from_hash(hash['loyaltyAccount']) if hash['loyaltyAccount']
183
+
184
+ # Create a new hash for additional properties, removing known properties.
185
+ new_hash = hash.reject { |k, _| names.value?(k) }
186
+
187
+ additional_properties = APIHelper.get_additional_properties(
188
+ new_hash, proc { |value| value }
189
+ )
190
+
191
+ # Create object from extracted values.
192
+ Passenger.new(given_name: given_name,
193
+ family_name: family_name,
194
+ id: id,
195
+ type: type,
196
+ middle_name: middle_name,
197
+ name_prefix: name_prefix,
198
+ name_suffix: name_suffix,
199
+ date_of_birth: date_of_birth,
200
+ gender: gender,
201
+ email: email,
202
+ phone: phone,
203
+ documents: documents,
204
+ loyalty_account: loyalty_account,
205
+ additional_properties: additional_properties)
206
+ end
207
+
208
+ # Provides a human-readable string representation of the object.
209
+ def to_s
210
+ class_name = self.class.name.split('::').last
211
+ "<#{class_name} given_name: #{@given_name}, family_name: #{@family_name}, middle_name:"\
212
+ " #{@middle_name}, name_prefix: #{@name_prefix}, name_suffix: #{@name_suffix},"\
213
+ " date_of_birth: #{@date_of_birth}, gender: #{@gender}, email: #{@email}, phone: #{@phone},"\
214
+ " id: #{@id}, type: #{@type}, documents: #{@documents}, loyalty_account:"\
215
+ " #{@loyalty_account}, additional_properties: #{@additional_properties}>"
216
+ end
217
+
218
+ # Provides a debugging-friendly string with detailed object information.
219
+ def inspect
220
+ class_name = self.class.name.split('::').last
221
+ "<#{class_name} given_name: #{@given_name.inspect}, family_name: #{@family_name.inspect},"\
222
+ " middle_name: #{@middle_name.inspect}, name_prefix: #{@name_prefix.inspect}, name_suffix:"\
223
+ " #{@name_suffix.inspect}, date_of_birth: #{@date_of_birth.inspect}, gender:"\
224
+ " #{@gender.inspect}, email: #{@email.inspect}, phone: #{@phone.inspect}, id:"\
225
+ " #{@id.inspect}, type: #{@type.inspect}, documents: #{@documents.inspect}, loyalty_account:"\
226
+ " #{@loyalty_account.inspect}, additional_properties: #{@additional_properties}>"
227
+ end
228
+ end
229
+ end