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,52 @@
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
+ # AccountStatus.
8
+ class AccountStatus
9
+ ACCOUNT_STATUS = [
10
+ # TODO: Write general description for ACTIVE
11
+ ACTIVE = 'ACTIVE'.freeze,
12
+
13
+ # TODO: Write general description for DORMANT
14
+ DORMANT = 'DORMANT'.freeze,
15
+
16
+ # TODO: Write general description for SUSPENDED
17
+ SUSPENDED = 'SUSPENDED'.freeze,
18
+
19
+ # TODO: Write general description for TERMINATED
20
+ TERMINATED = 'TERMINATED'.freeze,
21
+
22
+ # TODO: Write general description for TRIAL
23
+ TRIAL = 'TRIAL'.freeze,
24
+
25
+ # TODO: Write general description for OTHER
26
+ OTHER = 'OTHER'.freeze
27
+ ].freeze
28
+
29
+ def self.validate(value)
30
+ return false if value.nil?
31
+
32
+ ACCOUNT_STATUS.include?(value)
33
+ end
34
+
35
+ def self.from_value(value, default_value = ACTIVE)
36
+ return default_value if value.nil?
37
+
38
+ str = value.to_s.strip
39
+
40
+ case str.downcase
41
+ when 'active' then ACTIVE
42
+ when 'dormant' then DORMANT
43
+ when 'suspended' then SUSPENDED
44
+ when 'terminated' then TERMINATED
45
+ when 'trial' then TRIAL
46
+ when 'other' then OTHER
47
+ else
48
+ default_value
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,44 @@
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
+ # AccountType.
8
+ class AccountType
9
+ ACCOUNT_TYPE = [
10
+ # TODO: Write general description for INDIVIDUAL
11
+ INDIVIDUAL = 'INDIVIDUAL'.freeze,
12
+
13
+ # TODO: Write general description for BUSINESS
14
+ BUSINESS = 'BUSINESS'.freeze,
15
+
16
+ # TODO: Write general description for FAMILY
17
+ FAMILY = 'FAMILY'.freeze,
18
+
19
+ # TODO: Write general description for OTHER
20
+ OTHER = 'OTHER'.freeze
21
+ ].freeze
22
+
23
+ def self.validate(value)
24
+ return false if value.nil?
25
+
26
+ ACCOUNT_TYPE.include?(value)
27
+ end
28
+
29
+ def self.from_value(value, default_value = INDIVIDUAL)
30
+ return default_value if value.nil?
31
+
32
+ str = value.to_s.strip
33
+
34
+ case str.downcase
35
+ when 'individual' then INDIVIDUAL
36
+ when 'business' then BUSINESS
37
+ when 'family' then FAMILY
38
+ when 'other' then OTHER
39
+ else
40
+ default_value
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,74 @@
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
+ # An action that needs to be completed by the end-user.
8
+ class ActionBase < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Type of action to take.
13
+ # @return [ActionType]
14
+ attr_accessor :action_type
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['action_type'] = 'actionType'
20
+ @_hash
21
+ end
22
+
23
+ # An array for optional fields
24
+ def self.optionals
25
+ []
26
+ end
27
+
28
+ # An array for nullable fields
29
+ def self.nullables
30
+ []
31
+ end
32
+
33
+ def initialize(action_type:, additional_properties: nil)
34
+ # Add additional model properties to the instance
35
+ additional_properties = {} if additional_properties.nil?
36
+
37
+ @action_type = action_type
38
+ @additional_properties = additional_properties
39
+ end
40
+
41
+ # Creates an instance of the object from a hash.
42
+ def self.from_hash(hash)
43
+ return nil unless hash
44
+
45
+ # Extract variables from the hash.
46
+ action_type = hash.key?('actionType') ? hash['actionType'] : nil
47
+
48
+ # Create a new hash for additional properties, removing known properties.
49
+ new_hash = hash.reject { |k, _| names.value?(k) }
50
+
51
+ additional_properties = APIHelper.get_additional_properties(
52
+ new_hash, proc { |value| value }
53
+ )
54
+
55
+ # Create object from extracted values.
56
+ ActionBase.new(action_type: action_type,
57
+ additional_properties: additional_properties)
58
+ end
59
+
60
+ # Provides a human-readable string representation of the object.
61
+ def to_s
62
+ class_name = self.class.name.split('::').last
63
+ "<#{class_name} action_type: #{@action_type}, additional_properties:"\
64
+ " #{@additional_properties}>"
65
+ end
66
+
67
+ # Provides a debugging-friendly string with detailed object information.
68
+ def inspect
69
+ class_name = self.class.name.split('::').last
70
+ "<#{class_name} action_type: #{@action_type.inspect}, additional_properties:"\
71
+ " #{@additional_properties}>"
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,77 @@
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
+ # The response object that is returned when the action is completed.
8
+ class ActionCompletionResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # A Payment Transaction is a transaction that is processed by a payment
13
+ # processor.
14
+ # @return [PaymentTransaction]
15
+ attr_accessor :transaction
16
+
17
+ # A mapping from model property names to API property names.
18
+ def self.names
19
+ @_hash = {} if @_hash.nil?
20
+ @_hash['transaction'] = 'transaction'
21
+ @_hash
22
+ end
23
+
24
+ # An array for optional fields
25
+ def self.optionals
26
+ %w[
27
+ transaction
28
+ ]
29
+ end
30
+
31
+ # An array for nullable fields
32
+ def self.nullables
33
+ []
34
+ end
35
+
36
+ def initialize(transaction: SKIP, additional_properties: nil)
37
+ # Add additional model properties to the instance
38
+ additional_properties = {} if additional_properties.nil?
39
+
40
+ @transaction = transaction unless transaction == SKIP
41
+ @additional_properties = additional_properties
42
+ end
43
+
44
+ # Creates an instance of the object from a hash.
45
+ def self.from_hash(hash)
46
+ return nil unless hash
47
+
48
+ # Extract variables from the hash.
49
+ transaction = PaymentTransaction.from_hash(hash['transaction']) if hash['transaction']
50
+
51
+ # Create a new hash for additional properties, removing known properties.
52
+ new_hash = hash.reject { |k, _| names.value?(k) }
53
+
54
+ additional_properties = APIHelper.get_additional_properties(
55
+ new_hash, proc { |value| value }
56
+ )
57
+
58
+ # Create object from extracted values.
59
+ ActionCompletionResponse.new(transaction: transaction,
60
+ additional_properties: additional_properties)
61
+ end
62
+
63
+ # Provides a human-readable string representation of the object.
64
+ def to_s
65
+ class_name = self.class.name.split('::').last
66
+ "<#{class_name} transaction: #{@transaction}, additional_properties:"\
67
+ " #{@additional_properties}>"
68
+ end
69
+
70
+ # Provides a debugging-friendly string with detailed object information.
71
+ def inspect
72
+ class_name = self.class.name.split('::').last
73
+ "<#{class_name} transaction: #{@transaction.inspect}, additional_properties:"\
74
+ " #{@additional_properties}>"
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,40 @@
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
+ # Result of the action.
8
+ class ActionResultStatus
9
+ ACTION_RESULT_STATUS = [
10
+ # TODO: Write general description for PENDING
11
+ PENDING = 'PENDING'.freeze,
12
+
13
+ # TODO: Write general description for SUCCEEDED
14
+ SUCCEEDED = 'SUCCEEDED'.freeze,
15
+
16
+ # TODO: Write general description for FAILED
17
+ FAILED = 'FAILED'.freeze
18
+ ].freeze
19
+
20
+ def self.validate(value)
21
+ return false if value.nil?
22
+
23
+ ACTION_RESULT_STATUS.include?(value)
24
+ end
25
+
26
+ def self.from_value(value, default_value = PENDING)
27
+ return default_value if value.nil?
28
+
29
+ str = value.to_s.strip
30
+
31
+ case str.downcase
32
+ when 'pending' then PENDING
33
+ when 'succeeded' then SUCCEEDED
34
+ when 'failed' then FAILED
35
+ else
36
+ default_value
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,36 @@
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 action to take.
8
+ class ActionType
9
+ ACTION_TYPE = [
10
+ # TODO: Write general description for REDIRECT
11
+ REDIRECT = 'REDIRECT'.freeze,
12
+
13
+ # TODO: Write general description for PAYPAL
14
+ PAYPAL = 'PAYPAL'.freeze
15
+ ].freeze
16
+
17
+ def self.validate(value)
18
+ return false if value.nil?
19
+
20
+ ACTION_TYPE.include?(value)
21
+ end
22
+
23
+ def self.from_value(value, default_value = REDIRECT)
24
+ return default_value if value.nil?
25
+
26
+ str = value.to_s.strip
27
+
28
+ case str.downcase
29
+ when 'redirect' then REDIRECT
30
+ when 'paypal' then PAYPAL
31
+ else
32
+ default_value
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,244 @@
1
+ # cell_point_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module CellPointApi
8
+ # Represents an activity that is part of a bundle.
9
+ class Activity < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Discriminator used to identify the type of line item.
14
+ # @return [String]
15
+ attr_reader :type
16
+
17
+ # What should be shown as the title of the line item on a receipt or billing
18
+ # summary.
19
+ # @return [String]
20
+ attr_accessor :title
21
+
22
+ # AuthorizationGroup that the line item should be part of for splitting
23
+ # authorizations for Aggregate Payments Payments.
24
+ # If this is set, there must be a matching AuthorizationGroup created in the
25
+ # PriceSummary.
26
+ # > NOTE: Items within a Bundle should not have an `authorizationGroupId`,
27
+ # they will use the same `authorizationGroupId` as the top-level bundle.
28
+ # @return [String]
29
+ attr_accessor :authorization_group_id
30
+
31
+ # Stock Keeping Unit (SKU) is a product and service identification code for
32
+ # a specific product.
33
+ # @return [String]
34
+ attr_accessor :sku
35
+
36
+ # Stock Keeping Unit (SKU) is a product and service identification code for
37
+ # a specific product.
38
+ # @return [Integer]
39
+ attr_accessor :quantity
40
+
41
+ # An amount that is a nonnegative number, i.e. {0, 1, 2, 3, 4, 5,…}
42
+ # @return [NonNegativeAmount]
43
+ attr_accessor :unit_price
44
+
45
+ # Total Price for the line item. Should be equal to `unitPrice` *
46
+ # `quantity`, if `unitPrice` is specified.
47
+ # @return [NonNegativeAmount]
48
+ attr_accessor :total_price
49
+
50
+ # Language (ISO 639-1) code of the language that the activity will be in.
51
+ # @return [String]
52
+ attr_accessor :language
53
+
54
+ # Type of activity.
55
+ # Options are:
56
+ # - comedy
57
+ # - concert
58
+ # - sports
59
+ # - theater
60
+ # @return [String]
61
+ attr_accessor :activity_type
62
+
63
+ # Details about a particular location.
64
+ # @return [Location]
65
+ attr_accessor :location
66
+
67
+ # Name of company supplying this activity.
68
+ # @return [String]
69
+ attr_accessor :supplier_name
70
+
71
+ # Planned start time of the activity.
72
+ # @return [DateTime]
73
+ attr_accessor :start_time
74
+
75
+ # A mapping from model property names to API property names.
76
+ def self.names
77
+ @_hash = {} if @_hash.nil?
78
+ @_hash['type'] = 'type'
79
+ @_hash['title'] = 'title'
80
+ @_hash['authorization_group_id'] = 'authorizationGroupId'
81
+ @_hash['sku'] = 'sku'
82
+ @_hash['quantity'] = 'quantity'
83
+ @_hash['unit_price'] = 'unitPrice'
84
+ @_hash['total_price'] = 'totalPrice'
85
+ @_hash['language'] = 'language'
86
+ @_hash['activity_type'] = 'activityType'
87
+ @_hash['location'] = 'location'
88
+ @_hash['supplier_name'] = 'supplierName'
89
+ @_hash['start_time'] = 'startTime'
90
+ @_hash
91
+ end
92
+
93
+ # An array for optional fields
94
+ def self.optionals
95
+ %w[
96
+ authorization_group_id
97
+ language
98
+ activity_type
99
+ location
100
+ supplier_name
101
+ ]
102
+ end
103
+
104
+ # An array for nullable fields
105
+ def self.nullables
106
+ []
107
+ end
108
+
109
+ def initialize(title:, sku:, quantity: 1, unit_price:, total_price:,
110
+ start_time:, authorization_group_id: SKIP, language: SKIP,
111
+ activity_type: SKIP, location: SKIP, supplier_name: SKIP,
112
+ additional_properties: nil)
113
+ # Add additional model properties to the instance
114
+ additional_properties = {} if additional_properties.nil?
115
+
116
+ @type = 'ACTIVITY'
117
+ @title = title
118
+ @authorization_group_id = authorization_group_id unless authorization_group_id == SKIP
119
+ @sku = sku
120
+ @quantity = quantity
121
+ @unit_price = unit_price
122
+ @total_price = total_price
123
+ @language = language unless language == SKIP
124
+ @activity_type = activity_type unless activity_type == SKIP
125
+ @location = location unless location == SKIP
126
+ @supplier_name = supplier_name unless supplier_name == SKIP
127
+ @start_time = start_time
128
+ @additional_properties = additional_properties
129
+ end
130
+
131
+ # Creates an instance of the object from a hash.
132
+ def self.from_hash(hash)
133
+ return nil unless hash
134
+
135
+ # Extract variables from the hash.
136
+ title = hash.key?('title') ? hash['title'] : nil
137
+ sku = hash.key?('sku') ? hash['sku'] : nil
138
+ quantity = hash['quantity'] ||= 1
139
+ unit_price = NonNegativeAmount.from_hash(hash['unitPrice']) if hash['unitPrice']
140
+ total_price = NonNegativeAmount.from_hash(hash['totalPrice']) if hash['totalPrice']
141
+ start_time = if hash.key?('startTime')
142
+ (DateTimeHelper.from_rfc3339(hash['startTime']) if hash['startTime'])
143
+ end
144
+ authorization_group_id =
145
+ hash.key?('authorizationGroupId') ? hash['authorizationGroupId'] : SKIP
146
+ language = hash.key?('language') ? hash['language'] : SKIP
147
+ activity_type = hash.key?('activityType') ? hash['activityType'] : SKIP
148
+ location = Location.from_hash(hash['location']) if hash['location']
149
+ supplier_name = hash.key?('supplierName') ? hash['supplierName'] : SKIP
150
+
151
+ # Create a new hash for additional properties, removing known properties.
152
+ new_hash = hash.reject { |k, _| names.value?(k) }
153
+
154
+ additional_properties = APIHelper.get_additional_properties(
155
+ new_hash, proc { |value| value }
156
+ )
157
+
158
+ # Create object from extracted values.
159
+ Activity.new(title: title,
160
+ sku: sku,
161
+ quantity: quantity,
162
+ unit_price: unit_price,
163
+ total_price: total_price,
164
+ start_time: start_time,
165
+ authorization_group_id: authorization_group_id,
166
+ language: language,
167
+ activity_type: activity_type,
168
+ location: location,
169
+ supplier_name: supplier_name,
170
+ additional_properties: additional_properties)
171
+ end
172
+
173
+ def to_custom_start_time
174
+ DateTimeHelper.to_rfc3339(start_time)
175
+ end
176
+
177
+ # Validates an instance of the object from a given value.
178
+ # @param [Activity | Hash] The value against the validation is performed.
179
+ def self.validate(value)
180
+ if value.instance_of? self
181
+ return (
182
+ APIHelper.valid_type?(value.type,
183
+ ->(val) { val.instance_of? String }) and
184
+ APIHelper.valid_type?(value.title,
185
+ ->(val) { val.instance_of? String }) and
186
+ APIHelper.valid_type?(value.sku,
187
+ ->(val) { val.instance_of? String }) and
188
+ APIHelper.valid_type?(value.quantity,
189
+ ->(val) { val.instance_of? Integer }) and
190
+ APIHelper.valid_type?(value.unit_price,
191
+ ->(val) { NonNegativeAmount.validate(val) },
192
+ is_model_hash: true) and
193
+ APIHelper.valid_type?(value.total_price,
194
+ ->(val) { NonNegativeAmount.validate(val) },
195
+ is_model_hash: true) and
196
+ APIHelper.valid_type?(value.start_time,
197
+ ->(val) { val.instance_of? DateTime })
198
+ )
199
+ end
200
+
201
+ return false unless value.instance_of? Hash
202
+
203
+ (
204
+ APIHelper.valid_type?(value['type'],
205
+ ->(val) { val.instance_of? String }) and
206
+ APIHelper.valid_type?(value['title'],
207
+ ->(val) { val.instance_of? String }) and
208
+ APIHelper.valid_type?(value['sku'],
209
+ ->(val) { val.instance_of? String }) and
210
+ APIHelper.valid_type?(value['quantity'],
211
+ ->(val) { val.instance_of? Integer }) and
212
+ APIHelper.valid_type?(value['unitPrice'],
213
+ ->(val) { NonNegativeAmount.validate(val) },
214
+ is_model_hash: true) and
215
+ APIHelper.valid_type?(value['totalPrice'],
216
+ ->(val) { NonNegativeAmount.validate(val) },
217
+ is_model_hash: true) and
218
+ APIHelper.valid_type?(value['startTime'],
219
+ ->(val) { val.instance_of? String })
220
+ )
221
+ end
222
+
223
+ # Provides a human-readable string representation of the object.
224
+ def to_s
225
+ class_name = self.class.name.split('::').last
226
+ "<#{class_name} type: #{@type}, title: #{@title}, authorization_group_id:"\
227
+ " #{@authorization_group_id}, sku: #{@sku}, quantity: #{@quantity}, unit_price:"\
228
+ " #{@unit_price}, total_price: #{@total_price}, language: #{@language}, activity_type:"\
229
+ " #{@activity_type}, location: #{@location}, supplier_name: #{@supplier_name}, start_time:"\
230
+ " #{@start_time}, additional_properties: #{@additional_properties}>"
231
+ end
232
+
233
+ # Provides a debugging-friendly string with detailed object information.
234
+ def inspect
235
+ class_name = self.class.name.split('::').last
236
+ "<#{class_name} type: #{@type.inspect}, title: #{@title.inspect}, authorization_group_id:"\
237
+ " #{@authorization_group_id.inspect}, sku: #{@sku.inspect}, quantity: #{@quantity.inspect},"\
238
+ " unit_price: #{@unit_price.inspect}, total_price: #{@total_price.inspect}, language:"\
239
+ " #{@language.inspect}, activity_type: #{@activity_type.inspect}, location:"\
240
+ " #{@location.inspect}, supplier_name: #{@supplier_name.inspect}, start_time:"\
241
+ " #{@start_time.inspect}, additional_properties: #{@additional_properties}>"
242
+ end
243
+ end
244
+ end
@@ -0,0 +1,127 @@
1
+ # cell_point_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module CellPointApi
8
+ # Activity that is being purchased, such as tickets to an event.
9
+ class ActivityData < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Language (ISO 639-1) code of the language that the activity will be in.
14
+ # @return [String]
15
+ attr_accessor :language
16
+
17
+ # Type of activity.
18
+ # Options are:
19
+ # - comedy
20
+ # - concert
21
+ # - sports
22
+ # - theater
23
+ # @return [String]
24
+ attr_accessor :activity_type
25
+
26
+ # Details about a particular location.
27
+ # @return [Location]
28
+ attr_accessor :location
29
+
30
+ # Name of company supplying this activity.
31
+ # @return [String]
32
+ attr_accessor :supplier_name
33
+
34
+ # Planned start time of the activity.
35
+ # @return [DateTime]
36
+ attr_accessor :start_time
37
+
38
+ # A mapping from model property names to API property names.
39
+ def self.names
40
+ @_hash = {} if @_hash.nil?
41
+ @_hash['language'] = 'language'
42
+ @_hash['activity_type'] = 'activityType'
43
+ @_hash['location'] = 'location'
44
+ @_hash['supplier_name'] = 'supplierName'
45
+ @_hash['start_time'] = 'startTime'
46
+ @_hash
47
+ end
48
+
49
+ # An array for optional fields
50
+ def self.optionals
51
+ %w[
52
+ language
53
+ activity_type
54
+ location
55
+ supplier_name
56
+ ]
57
+ end
58
+
59
+ # An array for nullable fields
60
+ def self.nullables
61
+ []
62
+ end
63
+
64
+ def initialize(start_time:, language: SKIP, activity_type: SKIP,
65
+ location: SKIP, supplier_name: SKIP,
66
+ additional_properties: nil)
67
+ # Add additional model properties to the instance
68
+ additional_properties = {} if additional_properties.nil?
69
+
70
+ @language = language unless language == SKIP
71
+ @activity_type = activity_type unless activity_type == SKIP
72
+ @location = location unless location == SKIP
73
+ @supplier_name = supplier_name unless supplier_name == SKIP
74
+ @start_time = start_time
75
+ @additional_properties = additional_properties
76
+ end
77
+
78
+ # Creates an instance of the object from a hash.
79
+ def self.from_hash(hash)
80
+ return nil unless hash
81
+
82
+ # Extract variables from the hash.
83
+ start_time = if hash.key?('startTime')
84
+ (DateTimeHelper.from_rfc3339(hash['startTime']) if hash['startTime'])
85
+ end
86
+ language = hash.key?('language') ? hash['language'] : SKIP
87
+ activity_type = hash.key?('activityType') ? hash['activityType'] : SKIP
88
+ location = Location.from_hash(hash['location']) if hash['location']
89
+ supplier_name = hash.key?('supplierName') ? hash['supplierName'] : SKIP
90
+
91
+ # Create a new hash for additional properties, removing known properties.
92
+ new_hash = hash.reject { |k, _| names.value?(k) }
93
+
94
+ additional_properties = APIHelper.get_additional_properties(
95
+ new_hash, proc { |value| value }
96
+ )
97
+
98
+ # Create object from extracted values.
99
+ ActivityData.new(start_time: start_time,
100
+ language: language,
101
+ activity_type: activity_type,
102
+ location: location,
103
+ supplier_name: supplier_name,
104
+ additional_properties: additional_properties)
105
+ end
106
+
107
+ def to_custom_start_time
108
+ DateTimeHelper.to_rfc3339(start_time)
109
+ end
110
+
111
+ # Provides a human-readable string representation of the object.
112
+ def to_s
113
+ class_name = self.class.name.split('::').last
114
+ "<#{class_name} language: #{@language}, activity_type: #{@activity_type}, location:"\
115
+ " #{@location}, supplier_name: #{@supplier_name}, start_time: #{@start_time},"\
116
+ " additional_properties: #{@additional_properties}>"
117
+ end
118
+
119
+ # Provides a debugging-friendly string with detailed object information.
120
+ def inspect
121
+ class_name = self.class.name.split('::').last
122
+ "<#{class_name} language: #{@language.inspect}, activity_type: #{@activity_type.inspect},"\
123
+ " location: #{@location.inspect}, supplier_name: #{@supplier_name.inspect}, start_time:"\
124
+ " #{@start_time.inspect}, additional_properties: #{@additional_properties}>"
125
+ end
126
+ end
127
+ end