data-and-reporting-sdk 2.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +67 -17
  4. data/bin/console +15 -0
  5. data/lib/shell_data_reporting_ap_is/client.rb +17 -2
  6. data/lib/shell_data_reporting_ap_is/configuration.rb +132 -6
  7. data/lib/shell_data_reporting_ap_is/controllers/customer_controller.rb +97 -97
  8. data/lib/shell_data_reporting_ap_is/controllers/invoice_controller.rb +45 -45
  9. data/lib/shell_data_reporting_ap_is/controllers/transaction_controller.rb +66 -66
  10. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_accounts400_error_exception.rb +69 -0
  11. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_accounts401_error_exception.rb +69 -0
  12. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_accounts403_error_exception.rb +69 -0
  13. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_accounts404_error_exception.rb +69 -0
  14. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_accounts500_error_exception.rb +69 -0
  15. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_auditreport400_error_exception.rb +69 -0
  16. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_auditreport401_error_exception.rb +69 -0
  17. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_auditreport403_error_exception.rb +69 -0
  18. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_auditreport404_error_exception.rb +69 -0
  19. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_auditreport500_error_exception.rb +69 -0
  20. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_cardgroups400_error_exception.rb +69 -0
  21. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_cardgroups401_error_exception.rb +69 -0
  22. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_cardgroups403_error_exception.rb +69 -0
  23. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_cardgroups404_error_exception.rb +69 -0
  24. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_cardgroups500_error_exception.rb +69 -0
  25. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_customer400_error_exception.rb +69 -0
  26. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_customer401_error_exception.rb +69 -0
  27. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_customer403_error_exception.rb +69 -0
  28. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_customer404_error_exception.rb +69 -0
  29. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_customer500_error_exception.rb +69 -0
  30. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_payers400_error_exception.rb +69 -0
  31. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_payers401_error_exception.rb +69 -0
  32. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_payers403_error_exception.rb +69 -0
  33. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_payers404_error_exception.rb +69 -0
  34. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_payers500_error_exception.rb +69 -0
  35. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_pricelist400_error_exception.rb +69 -0
  36. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_pricelist401_error_exception.rb +69 -0
  37. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_pricelist403_error_exception.rb +69 -0
  38. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_pricelist404_error_exception.rb +69 -0
  39. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v1_pricelist500_error_exception.rb +69 -0
  40. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v2_cardtype400_error_exception.rb +69 -0
  41. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v2_cardtype401_error_exception.rb +69 -0
  42. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v2_cardtype403_error_exception.rb +69 -0
  43. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v2_cardtype404_error_exception.rb +69 -0
  44. data/lib/shell_data_reporting_ap_is/exceptions/customer_management_v2_cardtype500_error_exception.rb +69 -0
  45. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_dates400_error_exception.rb +69 -0
  46. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_dates401_error_exception.rb +69 -0
  47. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_dates403_error_exception.rb +69 -0
  48. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_dates404_error_exception.rb +69 -0
  49. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_dates500_error_exception.rb +69 -0
  50. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_download400_error_exception.rb +69 -0
  51. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_download401_error_exception.rb +69 -0
  52. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_download403_error_exception.rb +69 -0
  53. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_download404_error_exception.rb +69 -0
  54. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_download500_error_exception.rb +69 -0
  55. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_eiddownload400_error_exception.rb +69 -0
  56. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_eiddownload401_error_exception.rb +69 -0
  57. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_eiddownload403_error_exception.rb +69 -0
  58. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_eiddownload404_error_exception.rb +69 -0
  59. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_eiddownload500_error_exception.rb +69 -0
  60. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_eidsearch400_error_exception.rb +69 -0
  61. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_eidsearch401_error_exception.rb +69 -0
  62. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_eidsearch403_error_exception.rb +69 -0
  63. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_eidsearch404_error_exception.rb +69 -0
  64. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_eidsearch500_error_exception.rb +69 -0
  65. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_search400_error_exception.rb +69 -0
  66. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_search401_error_exception.rb +69 -0
  67. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_search403_error_exception.rb +69 -0
  68. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_search404_error_exception.rb +69 -0
  69. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_search500_error_exception.rb +69 -0
  70. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_searchdocuments400_error_exception.rb +69 -0
  71. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_searchdocuments401_error_exception.rb +69 -0
  72. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_searchdocuments403_error_exception.rb +69 -0
  73. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_searchdocuments404_error_exception.rb +69 -0
  74. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_searchdocuments500_error_exception.rb +69 -0
  75. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_searchstatementofaccount400_error_exception.rb +69 -0
  76. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_searchstatementofaccount401_error_exception.rb +69 -0
  77. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_searchstatementofaccount403_error_exception.rb +69 -0
  78. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_searchstatementofaccount404_error_exception.rb +69 -0
  79. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_searchstatementofaccount500_error_exception.rb +69 -0
  80. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_statementofaccount400_error_exception.rb +69 -0
  81. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_statementofaccount401_error_exception.rb +69 -0
  82. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_statementofaccount403_error_exception.rb +69 -0
  83. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_statementofaccount404_error_exception.rb +69 -0
  84. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_statementofaccount500_error_exception.rb +69 -0
  85. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_summary400_error_exception.rb +69 -0
  86. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_summary401_error_exception.rb +69 -0
  87. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_summary403_error_exception.rb +69 -0
  88. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_summary404_error_exception.rb +69 -0
  89. data/lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_summary500_error_exception.rb +69 -0
  90. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_cardusagesummary400_error_exception.rb +69 -0
  91. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_cardusagesummary401_error_exception.rb +69 -0
  92. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_cardusagesummary403_error_exception.rb +69 -0
  93. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_cardusagesummary404_error_exception.rb +69 -0
  94. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_cardusagesummary500_error_exception.rb +69 -0
  95. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_exceptions400_error_exception.rb +69 -0
  96. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_exceptions401_error_exception.rb +69 -0
  97. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_exceptions403_error_exception.rb +69 -0
  98. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_exceptions404_error_exception.rb +69 -0
  99. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_exceptions500_error_exception.rb +69 -0
  100. data/lib/shell_data_reporting_ap_is/exceptions/{error_object_exception.rb → transaction_data_v1_fees400_error_exception.rb} +2 -2
  101. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_fees401_error_exception.rb +69 -0
  102. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_fees403_error_exception.rb +69 -0
  103. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_fees404_error_exception.rb +69 -0
  104. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_fees500_error_exception.rb +69 -0
  105. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_feessummary400_error_exception.rb +69 -0
  106. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_feessummary401_error_exception.rb +69 -0
  107. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_feessummary403_error_exception.rb +69 -0
  108. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_feessummary404_error_exception.rb +69 -0
  109. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_feessummary500_error_exception.rb +69 -0
  110. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_fuelconsumption400_error_exception.rb +69 -0
  111. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_fuelconsumption401_error_exception.rb +69 -0
  112. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_fuelconsumption403_error_exception.rb +69 -0
  113. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_fuelconsumption404_error_exception.rb +69 -0
  114. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_fuelconsumption500_error_exception.rb +69 -0
  115. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_multipayerspricedtransactions400_error_exception.rb +69 -0
  116. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_multipayerspricedtransactions401_error_exception.rb +69 -0
  117. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_multipayerspricedtransactions403_error_exception.rb +69 -0
  118. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_multipayerspricedtransactions404_error_exception.rb +69 -0
  119. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_multipayerspricedtransactions500_error_exception.rb +69 -0
  120. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_priced400_error_exception.rb +69 -0
  121. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_priced401_error_exception.rb +69 -0
  122. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_priced403_error_exception.rb +69 -0
  123. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_priced404_error_exception.rb +69 -0
  124. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_priced500_error_exception.rb +69 -0
  125. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_pricedtransaction400_error_exception.rb +69 -0
  126. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_pricedtransaction401_error_exception.rb +69 -0
  127. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_pricedtransaction403_error_exception.rb +69 -0
  128. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_pricedtransaction404_error_exception.rb +69 -0
  129. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_pricedtransaction500_error_exception.rb +69 -0
  130. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_pricedtransactionssummary400_error_exception.rb +69 -0
  131. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_pricedtransactionssummary401_error_exception.rb +69 -0
  132. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_pricedtransactionssummary403_error_exception.rb +69 -0
  133. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_pricedtransactionssummary404_error_exception.rb +69 -0
  134. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_pricedtransactionssummary500_error_exception.rb +69 -0
  135. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_recent400_error_exception.rb +69 -0
  136. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_recent401_error_exception.rb +69 -0
  137. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_recent403_error_exception.rb +69 -0
  138. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_recent404_error_exception.rb +69 -0
  139. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_recent500_error_exception.rb +69 -0
  140. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_updateodometer400_error_exception.rb +69 -0
  141. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_updateodometer401_error_exception.rb +69 -0
  142. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_updateodometer403_error_exception.rb +69 -0
  143. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_updateodometer404_error_exception.rb +69 -0
  144. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_updateodometer500_error_exception.rb +69 -0
  145. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_volumebasedbonus400_error_exception.rb +69 -0
  146. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_volumebasedbonus401_error_exception.rb +69 -0
  147. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_volumebasedbonus403_error_exception.rb +69 -0
  148. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_volumebasedbonus404_error_exception.rb +69 -0
  149. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_volumebasedbonus500_error_exception.rb +69 -0
  150. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_volumebasedpricing400_error_exception.rb +69 -0
  151. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_volumebasedpricing401_error_exception.rb +69 -0
  152. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_volumebasedpricing403_error_exception.rb +69 -0
  153. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_volumebasedpricing404_error_exception.rb +69 -0
  154. data/lib/shell_data_reporting_ap_is/exceptions/transaction_data_v1_volumebasedpricing500_error_exception.rb +69 -0
  155. data/lib/shell_data_reporting_ap_is/exceptions/user_management_v1_loggedinuser400_error_exception.rb +69 -0
  156. data/lib/shell_data_reporting_ap_is/exceptions/user_management_v1_loggedinuser401_error_exception.rb +69 -0
  157. data/lib/shell_data_reporting_ap_is/exceptions/user_management_v1_loggedinuser403_error_exception.rb +69 -0
  158. data/lib/shell_data_reporting_ap_is/exceptions/user_management_v1_loggedinuser404_error_exception.rb +69 -0
  159. data/lib/shell_data_reporting_ap_is/exceptions/user_management_v1_loggedinuser500_error_exception.rb +69 -0
  160. data/lib/shell_data_reporting_ap_is/http/auth/o_auth2.rb +15 -0
  161. data/lib/shell_data_reporting_ap_is/http/proxy_settings.rb +9 -0
  162. data/lib/shell_data_reporting_ap_is/models/card_type_response_customer_card_types_items.rb +164 -289
  163. data/lib/shell_data_reporting_ap_is/models/cart_type_account.rb +161 -0
  164. data/lib/shell_data_reporting_ap_is/models/eid_document.rb +5 -21
  165. data/lib/shell_data_reporting_ap_is/models/eid_document_response.rb +18 -18
  166. data/lib/shell_data_reporting_ap_is/models/eid_search_req.rb +4 -20
  167. data/lib/shell_data_reporting_ap_is/models/error_object.rb +93 -0
  168. data/lib/shell_data_reporting_ap_is/models/filters.rb +4 -1
  169. data/lib/shell_data_reporting_ap_is/models/o_auth_provider_error_enum.rb +17 -0
  170. data/lib/shell_data_reporting_ap_is/models/priced_request_data.rb +4 -1
  171. data/lib/shell_data_reporting_ap_is/models/priced_transaction_req_v2_invoice_status_enum.rb +14 -0
  172. data/lib/shell_data_reporting_ap_is/models/priced_transaction_req_v2_period_enum.rb +20 -0
  173. data/lib/shell_data_reporting_ap_is/models/priced_transaction_req_v2_sort_order_enum.rb +17 -0
  174. data/lib/shell_data_reporting_ap_is/models/priced_transaction_resp_v2_refund_flag_enum.rb +13 -0
  175. data/lib/shell_data_reporting_ap_is/models/recent_transaction_req.rb +1 -1
  176. data/lib/shell_data_reporting_ap_is/models/search_doc_req.rb +16 -35
  177. data/lib/shell_data_reporting_ap_is/models/search_documents_invoice.rb +20 -19
  178. data/lib/shell_data_reporting_ap_is/models/search_documents_response.rb +15 -15
  179. data/lib/shell_data_reporting_ap_is/models/transaction_fees_request.rb +57 -16
  180. data/lib/shell_data_reporting_ap_is.rb +317 -1
  181. data/test/controllers/controller_test_base.rb +3 -8
  182. data/test/controllers/test_invoice_controller.rb +25 -27
  183. data/test/controllers/test_transaction_controller.rb +8 -8
  184. metadata +159 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '029daa034be160955c29be965509aadc2b080bfb587f24225b26b144b774b258'
4
- data.tar.gz: 1c7f87bb1def847aba87695075112c83f91414b7998d1d55f313c61af7fc28b4
3
+ metadata.gz: 6721542a03c25fde2867c8819966d572e40239f74641037d6e971723228bf665
4
+ data.tar.gz: 8d0e17cadf7651a4081b3947c1e7fc7599352866855d607e992592135658ada1
5
5
  SHA512:
6
- metadata.gz: a3ab34fbd35187ac36a8442076cb6cf9cd0afc01a0b870074e0d4308c650996ed4f36d810ef84b883bb23d80c176d0ce6a9112dce5cda7af2a5104f0ed49242d
7
- data.tar.gz: e6ada66e602acf2b3edaf55ea8b6c248bf9354cb58c215daab2297962b3435aa8db98e799d50b4681893d27b3af2027faaeb65d0c2627f064522a9758ddc330e
6
+ metadata.gz: 8dedb952feff5a50e1f9f4e9250fd64c92d356c12cbada08777892b8897ef4c1c296c54aa6a1c1b1ed30d2eb4a0faab681e93bbc7fe72b824212c5619a314c35
7
+ data.tar.gz: af5ed4def4c983b362ae315fd81f4192d0bf23bf4fd82ef36c1f913d9a33c4e79dc3c04b1f8e695cd2eb5819d338dcfba2565bf233a45c3af7bf7a7784cea6eb
data/LICENSE CHANGED
@@ -3,7 +3,7 @@ License:
3
3
  The MIT License (MIT)
4
4
  http://opensource.org/licenses/MIT
5
5
 
6
- Copyright (c) 2014 - 2025 APIMATIC Limited
6
+ Copyright (c) 2014 - 2026 APIMATIC Limited
7
7
 
8
8
  Permission is hereby granted, free of charge, to any person obtaining a copy
9
9
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -38,16 +38,51 @@ Go to the Shell Developer Portal: [https://developer.shell.com](https://develope
38
38
  Install the gem from the command line:
39
39
 
40
40
  ```bash
41
- gem install data-and-reporting-sdk -v 2.0.0
41
+ gem install data-and-reporting-sdk -v 3.0.0
42
42
  ```
43
43
 
44
44
  Or add the gem to your Gemfile and run `bundle`:
45
45
 
46
46
  ```ruby
47
- gem 'data-and-reporting-sdk', '2.0.0'
47
+ gem 'data-and-reporting-sdk', '3.0.0'
48
48
  ```
49
49
 
50
- For additional gem details, see the [RubyGems page for the data-and-reporting-sdk gem](https://rubygems.org/gems/data-and-reporting-sdk/versions/2.0.0).
50
+ For additional gem details, see the [RubyGems page for the data-and-reporting-sdk gem](https://rubygems.org/gems/data-and-reporting-sdk/versions/3.0.0).
51
+
52
+ ## IRB Console Usage
53
+
54
+ You can explore the SDK interactively using IRB in two ways
55
+
56
+ ### 1. Use IRB with Installed Gem
57
+
58
+ Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and type the following command to start the irb console.
59
+
60
+ ```bash
61
+ irb
62
+ ```
63
+
64
+ Now you can load the SDK in the IRB
65
+
66
+ ```ruby
67
+ require 'shell_data_reporting_ap_is'
68
+ include ShellDataReportingApIs
69
+ ```
70
+
71
+ ### 2. Use IRB within SDK
72
+
73
+ Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and navigate to the root folder of SDK.
74
+
75
+ ```
76
+ cd path/to/shell_data_reporting_ap_is
77
+ ```
78
+
79
+ Now you can start the preconfigured irb console by running the following command
80
+
81
+ ```bash
82
+ ruby bin/console
83
+ ```
84
+
85
+ **_Note:_** This automatically loads the SDK from lib/
51
86
 
52
87
  ## Test the SDK
53
88
 
@@ -59,13 +94,13 @@ rake
59
94
 
60
95
  ## Initialize the API Client
61
96
 
62
- **_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/2.0.0/doc/client.md)
97
+ **_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/3.0.0/doc/client.md)
63
98
 
64
99
  The following parameters are configurable for the API Client:
65
100
 
66
101
  | Parameter | Type | Description |
67
102
  | --- | --- | --- |
68
- | environment | `Environment` | The API environment. <br> **Default: `Environment.SIT`** |
103
+ | environment | [`Environment`](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/3.0.0/README.md#environments) | The API environment. <br> **Default: `Environment.SIT`** |
69
104
  | connection | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
70
105
  | adapter | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
71
106
  | timeout | `Float` | The value to use for connection timeout. <br> **Default: 60** |
@@ -75,11 +110,13 @@ The following parameters are configurable for the API Client:
75
110
  | retry_statuses | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
76
111
  | retry_methods | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put]** |
77
112
  | http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
78
- | proxy_settings | [`ProxySettings`](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/2.0.0/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
79
- | client_credentials_auth_credentials | [`ClientCredentialsAuthCredentials`](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/2.0.0/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant |
113
+ | proxy_settings | [`ProxySettings`](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/3.0.0/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
114
+ | client_credentials_auth_credentials | [`ClientCredentialsAuthCredentials`](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/3.0.0/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant |
80
115
 
81
116
  The API client can be initialized as follows:
82
117
 
118
+ ### Code-Based Client Initialization
119
+
83
120
  ```ruby
84
121
  require 'shell_data_reporting_ap_is'
85
122
  include ShellDataReportingApIs
@@ -93,6 +130,18 @@ client = Client.new(
93
130
  )
94
131
  ```
95
132
 
133
+ ### Environment-Based Client Initialization
134
+
135
+ ```ruby
136
+ require 'shell_data_reporting_ap_is'
137
+ include ShellDataReportingApIs
138
+
139
+ # Create client from environment
140
+ client = Client.from_env
141
+ ```
142
+
143
+ See the [`Environment-Based Client Initialization`](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/3.0.0/doc/environment-based-client-initialization.md) section for details.
144
+
96
145
  ## Environments
97
146
 
98
147
  The SDK can be configured to use a different environment for making API calls. Available environments are:
@@ -102,33 +151,34 @@ The SDK can be configured to use a different environment for making API calls. A
102
151
  | Name | Description |
103
152
  | --- | --- |
104
153
  | SIT | **Default** |
105
- | Production | - |
154
+ | PRODUCTION | - |
106
155
 
107
156
  ## Authorization
108
157
 
109
158
  This API uses the following authentication schemes.
110
159
 
111
- * [`BearerToken (OAuth 2 Client Credentials Grant)`](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/2.0.0/doc/auth/oauth-2-client-credentials-grant.md)
160
+ * [`BearerToken (OAuth 2 Client Credentials Grant)`](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/3.0.0/doc/auth/oauth-2-client-credentials-grant.md)
112
161
 
113
162
  ## List of APIs
114
163
 
115
- * [Customer](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/2.0.0/doc/controllers/customer.md)
116
- * [Transaction](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/2.0.0/doc/controllers/transaction.md)
117
- * [Invoice](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/2.0.0/doc/controllers/invoice.md)
164
+ * [Customer](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/3.0.0/doc/controllers/customer.md)
165
+ * [Transaction](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/3.0.0/doc/controllers/transaction.md)
166
+ * [Invoice](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/3.0.0/doc/controllers/invoice.md)
118
167
 
119
168
  ## SDK Infrastructure
120
169
 
121
170
  ### Configuration
122
171
 
123
- * [ProxySettings](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/2.0.0/doc/proxy-settings.md)
172
+ * [ProxySettings](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/3.0.0/doc/proxy-settings.md)
173
+ * [Environment-Based Client Initialization](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/3.0.0/doc/environment-based-client-initialization.md)
124
174
 
125
175
  ### HTTP
126
176
 
127
- * [HttpResponse](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/2.0.0/doc/http-response.md)
128
- * [HttpRequest](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/2.0.0/doc/http-request.md)
177
+ * [HttpResponse](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/3.0.0/doc/http-response.md)
178
+ * [HttpRequest](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/3.0.0/doc/http-request.md)
129
179
 
130
180
  ### Utilities
131
181
 
132
- * [ApiHelper](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/2.0.0/doc/api-helper.md)
133
- * [DateTimeHelper](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/2.0.0/doc/date-time-helper.md)
182
+ * [ApiHelper](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/3.0.0/doc/api-helper.md)
183
+ * [DateTimeHelper](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/3.0.0/doc/date-time-helper.md)
134
184
 
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Load the lib folder into Ruby's load path
4
+ $LOAD_PATH.unshift(File.expand_path('../lib', __dir__))
5
+
6
+ # Require the gem
7
+ require 'shell_data_reporting_ap_is'
8
+
9
+ puts 'ShellDataReportingApIs SDK loaded!'
10
+ puts 'You can now create a client with: client = ShellDataReportingApIs::Client.new'
11
+ puts 'Or use from_env: client = ShellDataReportingApIs::Client.from_env'
12
+
13
+ # Start an interactive IRB session
14
+ require 'irb'
15
+ IRB.start
@@ -8,6 +8,10 @@ module ShellDataReportingApIs
8
8
  class Client
9
9
  include CoreLibrary
10
10
  attr_reader :config, :auth_managers
11
+
12
+ def user_agent_detail
13
+ config.user_agent_detail
14
+ end
11
15
 
12
16
  # Returns the configured authentication BearerToken instance.
13
17
  def bearer_token
@@ -43,8 +47,9 @@ module ShellDataReportingApIs
43
47
  max_retries: 0, retry_interval: 1, backoff_factor: 2,
44
48
  retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
45
49
  retry_methods: %i[get put], http_callback: nil, proxy_settings: nil,
46
- environment: Environment::SIT, client_credentials_auth_credentials: nil,
47
- config: nil
50
+ environment: Environment::SIT, o_auth_client_id: nil,
51
+ o_auth_client_secret: nil, o_auth_token: nil,
52
+ client_credentials_auth_credentials: nil, config: nil
48
53
  )
49
54
  @config = if config.nil?
50
55
  Configuration.new(
@@ -54,6 +59,9 @@ module ShellDataReportingApIs
54
59
  retry_statuses: retry_statuses,
55
60
  retry_methods: retry_methods, http_callback: http_callback,
56
61
  proxy_settings: proxy_settings, environment: environment,
62
+ o_auth_client_id: o_auth_client_id,
63
+ o_auth_client_secret: o_auth_client_secret,
64
+ o_auth_token: o_auth_token,
57
65
  client_credentials_auth_credentials: client_credentials_auth_credentials
58
66
  )
59
67
  else
@@ -79,5 +87,12 @@ module ShellDataReportingApIs
79
87
  http_client_config.client_credentials_auth_credentials, global_config
80
88
  )
81
89
  end
90
+
91
+ # Creates a client directly from environment variables.
92
+ def self.from_env(**overrides)
93
+ default_config = Configuration.build_default_config_from_env
94
+ new_config = default_config.clone_with(**overrides)
95
+ new(config: new_config)
96
+ end
82
97
  end
83
98
  end
@@ -10,6 +10,21 @@ module ShellDataReportingApIs
10
10
  SIT = 'SIT'.freeze,
11
11
  PRODUCTION = 'Production'.freeze
12
12
  ].freeze
13
+
14
+ # Converts a string or symbol into a valid Environment constant.
15
+ def self.from_value(value, default_value = SIT)
16
+ return default_value if value.nil?
17
+
18
+ str = value.to_s.strip.downcase
19
+ case str
20
+ when 'sit' then SIT
21
+ when 'production' then PRODUCTION
22
+
23
+ else
24
+ warn "[Environment] Unknown environment '#{value}', falling back to #{default_value} "
25
+ default_value
26
+ end
27
+ end
13
28
  end
14
29
 
15
30
  # An enum for API servers.
@@ -18,11 +33,38 @@ module ShellDataReportingApIs
18
33
  OAUTH_SERVER = 'OAuth Server'.freeze,
19
34
  SHELL = 'Shell'.freeze
20
35
  ].freeze
36
+
37
+ # Converts a string or symbol into a valid Server constant.
38
+ def self.from_value(value, default_value = OAUTH_SERVER)
39
+ return default_value if value.nil?
40
+
41
+ str = value.to_s.strip.downcase
42
+ case str
43
+ when 'oauth_server' then OAUTH_SERVER
44
+ when 'shell' then SHELL
45
+
46
+ else
47
+ warn "[Server] Unknown server '#{value}', falling back to #{default_value} "
48
+ default_value
49
+ end
50
+ end
21
51
  end
22
52
 
23
53
  # All configuration including auth info and base URI for the API access
24
54
  # are configured in this class.
25
55
  class Configuration < CoreLibrary::HttpClientConfiguration
56
+ def o_auth_client_id
57
+ @client_credentials_auth_credentials.o_auth_client_id
58
+ end
59
+
60
+ def o_auth_client_secret
61
+ @client_credentials_auth_credentials.o_auth_client_secret
62
+ end
63
+
64
+ def o_auth_token
65
+ @client_credentials_auth_credentials.o_auth_token
66
+ end
67
+
26
68
  # The attribute readers for properties.
27
69
  attr_reader :environment, :client_credentials_auth_credentials
28
70
 
@@ -35,7 +77,9 @@ module ShellDataReportingApIs
35
77
  max_retries: 0, retry_interval: 1, backoff_factor: 2,
36
78
  retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
37
79
  retry_methods: %i[get put], http_callback: nil, proxy_settings: nil,
38
- environment: Environment::SIT, client_credentials_auth_credentials: nil
80
+ environment: Environment::SIT, o_auth_client_id: nil,
81
+ o_auth_client_secret: nil, o_auth_token: nil,
82
+ client_credentials_auth_credentials: nil
39
83
  )
40
84
  super connection: connection, adapter: adapter, timeout: timeout,
41
85
  max_retries: max_retries, retry_interval: retry_interval,
@@ -46,11 +90,24 @@ module ShellDataReportingApIs
46
90
  # Current API environment
47
91
  @environment = String(environment)
48
92
 
49
- # The object holding OAuth 2 Client Credentials Grant credentials
50
- @client_credentials_auth_credentials = client_credentials_auth_credentials
93
+ # OAuth 2 Client ID
94
+ @o_auth_client_id = o_auth_client_id
95
+
96
+ # OAuth 2 Client Secret
97
+ @o_auth_client_secret = o_auth_client_secret
98
+
99
+ # Object for storing information about the OAuth token
100
+ @o_auth_token = if o_auth_token.is_a? OAuthToken
101
+ OAuthToken.from_hash o_auth_token.to_hash
102
+ else
103
+ o_auth_token
104
+ end
51
105
 
52
106
  # Initializing OAuth 2 Client Credentials Grant credentials with the provided auth parameters
53
- @client_credentials_auth_credentials = client_credentials_auth_credentials
107
+ @client_credentials_auth_credentials = create_auth_credentials_object(
108
+ o_auth_client_id, o_auth_client_secret, o_auth_token,
109
+ client_credentials_auth_credentials
110
+ )
54
111
 
55
112
  # The Http Client to use for making requests.
56
113
  set_http_client CoreLibrary::FaradayClient.new(self)
@@ -59,7 +116,8 @@ module ShellDataReportingApIs
59
116
  def clone_with(connection: nil, adapter: nil, timeout: nil,
60
117
  max_retries: nil, retry_interval: nil, backoff_factor: nil,
61
118
  retry_statuses: nil, retry_methods: nil, http_callback: nil,
62
- proxy_settings: nil, environment: nil,
119
+ proxy_settings: nil, environment: nil, o_auth_client_id: nil,
120
+ o_auth_client_secret: nil, o_auth_token: nil,
63
121
  client_credentials_auth_credentials: nil)
64
122
  connection ||= self.connection
65
123
  adapter ||= self.adapter
@@ -72,7 +130,10 @@ module ShellDataReportingApIs
72
130
  http_callback ||= self.http_callback
73
131
  proxy_settings ||= self.proxy_settings
74
132
  environment ||= self.environment
75
- client_credentials_auth_credentials ||= self.client_credentials_auth_credentials
133
+ client_credentials_auth_credentials = create_auth_credentials_object(
134
+ o_auth_client_id, o_auth_client_secret, o_auth_token,
135
+ client_credentials_auth_credentials || self.client_credentials_auth_credentials
136
+ )
76
137
 
77
138
  Configuration.new(
78
139
  connection: connection, adapter: adapter, timeout: timeout,
@@ -84,6 +145,30 @@ module ShellDataReportingApIs
84
145
  )
85
146
  end
86
147
 
148
+ def create_auth_credentials_object(o_auth_client_id, o_auth_client_secret,
149
+ o_auth_token,
150
+ client_credentials_auth_credentials)
151
+ return client_credentials_auth_credentials if o_auth_client_id.nil? &&
152
+ o_auth_client_secret.nil? &&
153
+ o_auth_token.nil?
154
+
155
+ warn('The \'o_auth_client_id\', \'o_auth_client_secret\', \'o_auth_token'\
156
+ '\' params are deprecated. Use \'client_credentials_auth_credential'\
157
+ 's\' param instead.')
158
+
159
+ unless client_credentials_auth_credentials.nil?
160
+ return client_credentials_auth_credentials.clone_with(
161
+ o_auth_client_id: o_auth_client_id,
162
+ o_auth_client_secret: o_auth_client_secret,
163
+ o_auth_token: o_auth_token
164
+ )
165
+ end
166
+
167
+ ClientCredentialsAuthCredentials.new(
168
+ o_auth_client_id: o_auth_client_id,
169
+ o_auth_client_secret: o_auth_client_secret, o_auth_token: o_auth_token
170
+ )
171
+ end
87
172
 
88
173
  # All the environments the SDK can run in.
89
174
  ENVIRONMENTS = {
@@ -104,5 +189,46 @@ module ShellDataReportingApIs
104
189
  def get_base_uri(server = Server::SHELL)
105
190
  ENVIRONMENTS[environment][server].clone
106
191
  end
192
+
193
+ # Builds a Configuration instance using environment variables.
194
+ def self.build_default_config_from_env
195
+ # === Core environment ===
196
+ environment = Environment.from_value(ENV.fetch('ENVIRONMENT', 'sit'))
197
+ timeout = (ENV['TIMEOUT'] || 60).to_f
198
+ max_retries = (ENV['MAX_RETRIES'] || 0).to_i
199
+ retry_interval = (ENV['RETRY_INTERVAL'] || 1).to_f
200
+ backoff_factor = (ENV['BACKOFF_FACTOR'] || 2).to_f
201
+ retry_statuses = ENV.fetch('RETRY_STATUSES',
202
+ '[408, 413, 429, 500, 502, 503, 504, 521, 522, 524]').gsub(/[\[\]]/, '')
203
+ .split(',')
204
+ .map(&:strip)
205
+ .map do |item|
206
+ item.match?(/\A\d+\z/) ? item.to_i : item.downcase
207
+ end
208
+ retry_methods = ENV.fetch('RETRY_METHODS', '%i[get put]').gsub(/[\[\]]/, '')
209
+ .split(',')
210
+ .map(&:strip)
211
+ .map do |item|
212
+ item.match?(/\A\d+\z/) ? item.to_i : item.downcase
213
+ end
214
+
215
+ # === Authentication credentials ===
216
+ client_credentials_auth_credentials = ClientCredentialsAuthCredentials.from_env
217
+
218
+ # === Proxy settings ===
219
+ proxy_settings = ProxySettings.from_env
220
+
221
+ Configuration.new(
222
+ environment: environment,
223
+ timeout: timeout,
224
+ max_retries: max_retries,
225
+ retry_interval: retry_interval,
226
+ backoff_factor: backoff_factor,
227
+ retry_statuses: retry_statuses,
228
+ retry_methods: retry_methods,
229
+ client_credentials_auth_credentials: client_credentials_auth_credentials,
230
+ proxy_settings: proxy_settings
231
+ )
232
+ end
107
233
  end
108
234
  end