data-and-reporting-sdk 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (178) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +104 -0
  4. data/lib/shell_data_reporting_ap_is/api_helper.rb +10 -0
  5. data/lib/shell_data_reporting_ap_is/client.rb +84 -0
  6. data/lib/shell_data_reporting_ap_is/configuration.rb +110 -0
  7. data/lib/shell_data_reporting_ap_is/controllers/base_controller.rb +66 -0
  8. data/lib/shell_data_reporting_ap_is/controllers/customer_controller.rb +478 -0
  9. data/lib/shell_data_reporting_ap_is/controllers/invoice_controller.rb +470 -0
  10. data/lib/shell_data_reporting_ap_is/controllers/o_auth_authorization_controller.rb +42 -0
  11. data/lib/shell_data_reporting_ap_is/controllers/transaction_controller.rb +878 -0
  12. data/lib/shell_data_reporting_ap_is/exceptions/api_exception.rb +10 -0
  13. data/lib/shell_data_reporting_ap_is/exceptions/default_error_exception.rb +32 -0
  14. data/lib/shell_data_reporting_ap_is/exceptions/error_object_exception.rb +54 -0
  15. data/lib/shell_data_reporting_ap_is/exceptions/error_user_access_error1_exception.rb +32 -0
  16. data/lib/shell_data_reporting_ap_is/exceptions/o_auth_provider_exception.rb +48 -0
  17. data/lib/shell_data_reporting_ap_is/http/auth/basic_auth.rb +50 -0
  18. data/lib/shell_data_reporting_ap_is/http/auth/bearer_token.rb +89 -0
  19. data/lib/shell_data_reporting_ap_is/http/http_call_back.rb +10 -0
  20. data/lib/shell_data_reporting_ap_is/http/http_method_enum.rb +10 -0
  21. data/lib/shell_data_reporting_ap_is/http/http_request.rb +10 -0
  22. data/lib/shell_data_reporting_ap_is/http/http_response.rb +10 -0
  23. data/lib/shell_data_reporting_ap_is/models/account_access.rb +128 -0
  24. data/lib/shell_data_reporting_ap_is/models/account_request.rb +252 -0
  25. data/lib/shell_data_reporting_ap_is/models/account_response.rb +111 -0
  26. data/lib/shell_data_reporting_ap_is/models/account_response_accounts_items.rb +750 -0
  27. data/lib/shell_data_reporting_ap_is/models/accounts.rb +65 -0
  28. data/lib/shell_data_reporting_ap_is/models/address.rb +174 -0
  29. data/lib/shell_data_reporting_ap_is/models/associated_account.rb +98 -0
  30. data/lib/shell_data_reporting_ap_is/models/audit_request.rb +256 -0
  31. data/lib/shell_data_reporting_ap_is/models/audit_response.rb +111 -0
  32. data/lib/shell_data_reporting_ap_is/models/audit_response_audits_items.rb +450 -0
  33. data/lib/shell_data_reporting_ap_is/models/bank_account.rb +192 -0
  34. data/lib/shell_data_reporting_ap_is/models/base_model.rb +62 -0
  35. data/lib/shell_data_reporting_ap_is/models/bonus_configuration.rb +419 -0
  36. data/lib/shell_data_reporting_ap_is/models/bonus_history.rb +444 -0
  37. data/lib/shell_data_reporting_ap_is/models/card_day_time_restrictions.rb +159 -0
  38. data/lib/shell_data_reporting_ap_is/models/card_exceptions.rb +268 -0
  39. data/lib/shell_data_reporting_ap_is/models/card_group_request.rb +178 -0
  40. data/lib/shell_data_reporting_ap_is/models/card_group_response.rb +109 -0
  41. data/lib/shell_data_reporting_ap_is/models/card_group_response_card_groups_items.rb +301 -0
  42. data/lib/shell_data_reporting_ap_is/models/card_type_request.rb +145 -0
  43. data/lib/shell_data_reporting_ap_is/models/card_type_response.rb +79 -0
  44. data/lib/shell_data_reporting_ap_is/models/card_type_response_customer_card_types_items.rb +470 -0
  45. data/lib/shell_data_reporting_ap_is/models/card_type_response_error.rb +60 -0
  46. data/lib/shell_data_reporting_ap_is/models/card_usage_restrictions.rb +281 -0
  47. data/lib/shell_data_reporting_ap_is/models/card_usage_summary_request.rb +159 -0
  48. data/lib/shell_data_reporting_ap_is/models/card_usage_summary_response.rb +79 -0
  49. data/lib/shell_data_reporting_ap_is/models/col_co_access.rb +88 -0
  50. data/lib/shell_data_reporting_ap_is/models/current_volume.rb +99 -0
  51. data/lib/shell_data_reporting_ap_is/models/customer_contract.rb +63 -0
  52. data/lib/shell_data_reporting_ap_is/models/customer_detail_request.rb +123 -0
  53. data/lib/shell_data_reporting_ap_is/models/customer_detail_response.rb +437 -0
  54. data/lib/shell_data_reporting_ap_is/models/customer_price_list_request.rb +200 -0
  55. data/lib/shell_data_reporting_ap_is/models/customer_price_list_response.rb +82 -0
  56. data/lib/shell_data_reporting_ap_is/models/default_error_fault.rb +60 -0
  57. data/lib/shell_data_reporting_ap_is/models/default_error_fault_detail.rb +50 -0
  58. data/lib/shell_data_reporting_ap_is/models/delivery_addresses.rb +258 -0
  59. data/lib/shell_data_reporting_ap_is/models/eid_access.rb +75 -0
  60. data/lib/shell_data_reporting_ap_is/models/eid_document.rb +166 -0
  61. data/lib/shell_data_reporting_ap_is/models/eid_document_response.rb +140 -0
  62. data/lib/shell_data_reporting_ap_is/models/eid_download_req.rb +86 -0
  63. data/lib/shell_data_reporting_ap_is/models/eid_download_request.rb +50 -0
  64. data/lib/shell_data_reporting_ap_is/models/eid_search_req.rb +160 -0
  65. data/lib/shell_data_reporting_ap_is/models/eid_search_request.rb +70 -0
  66. data/lib/shell_data_reporting_ap_is/models/error_details.rb +81 -0
  67. data/lib/shell_data_reporting_ap_is/models/error_status.rb +60 -0
  68. data/lib/shell_data_reporting_ap_is/models/error_user_access.rb +50 -0
  69. data/lib/shell_data_reporting_ap_is/models/error_user_access_error.rb +60 -0
  70. data/lib/shell_data_reporting_ap_is/models/exception_product.rb +65 -0
  71. data/lib/shell_data_reporting_ap_is/models/exception_site_location.rb +63 -0
  72. data/lib/shell_data_reporting_ap_is/models/fee_item.rb +977 -0
  73. data/lib/shell_data_reporting_ap_is/models/fee_item_summary_all_of0.rb +194 -0
  74. data/lib/shell_data_reporting_ap_is/models/fee_rule_location.rb +153 -0
  75. data/lib/shell_data_reporting_ap_is/models/fee_rule_product.rb +98 -0
  76. data/lib/shell_data_reporting_ap_is/models/fee_rule_tier.rb +74 -0
  77. data/lib/shell_data_reporting_ap_is/models/fee_summary_response.rb +85 -0
  78. data/lib/shell_data_reporting_ap_is/models/fees_fee_rule_tiers.rb +124 -0
  79. data/lib/shell_data_reporting_ap_is/models/finance_currency.rb +98 -0
  80. data/lib/shell_data_reporting_ap_is/models/fuel_consumption_card.rb +73 -0
  81. data/lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb +267 -0
  82. data/lib/shell_data_reporting_ap_is/models/fuel_consumption_request.rb +197 -0
  83. data/lib/shell_data_reporting_ap_is/models/fuel_consumption_response.rb +79 -0
  84. data/lib/shell_data_reporting_ap_is/models/invoice_dates_data.rb +62 -0
  85. data/lib/shell_data_reporting_ap_is/models/invoice_dates_request.rb +50 -0
  86. data/lib/shell_data_reporting_ap_is/models/invoice_dates_request_filters.rb +146 -0
  87. data/lib/shell_data_reporting_ap_is/models/invoice_dates_response_data.rb +80 -0
  88. data/lib/shell_data_reporting_ap_is/models/invoice_distribution_method.rb +99 -0
  89. data/lib/shell_data_reporting_ap_is/models/invoice_download_req.rb +99 -0
  90. data/lib/shell_data_reporting_ap_is/models/invoice_download_request.rb +50 -0
  91. data/lib/shell_data_reporting_ap_is/models/invoice_search_additional_document.rb +80 -0
  92. data/lib/shell_data_reporting_ap_is/models/invoice_search_details.rb +913 -0
  93. data/lib/shell_data_reporting_ap_is/models/invoice_search_request.rb +91 -0
  94. data/lib/shell_data_reporting_ap_is/models/invoice_search_request_filters.rb +344 -0
  95. data/lib/shell_data_reporting_ap_is/models/invoice_search_response.rb +127 -0
  96. data/lib/shell_data_reporting_ap_is/models/invoice_summary_details.rb +129 -0
  97. data/lib/shell_data_reporting_ap_is/models/invoice_summary_request.rb +50 -0
  98. data/lib/shell_data_reporting_ap_is/models/invoice_summary_request_filters.rb +345 -0
  99. data/lib/shell_data_reporting_ap_is/models/invoice_summary_response.rb +79 -0
  100. data/lib/shell_data_reporting_ap_is/models/invoices_summaries.rb +221 -0
  101. data/lib/shell_data_reporting_ap_is/models/last_statement_of_account.rb +421 -0
  102. data/lib/shell_data_reporting_ap_is/models/logged_in_user_request.rb +107 -0
  103. data/lib/shell_data_reporting_ap_is/models/logged_in_user_response.rb +394 -0
  104. data/lib/shell_data_reporting_ap_is/models/monthly_invoice_trend.rb +112 -0
  105. data/lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb +360 -0
  106. data/lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request_accounts_items.rb +84 -0
  107. data/lib/shell_data_reporting_ap_is/models/multi_priced_transaction_response.rb +110 -0
  108. data/lib/shell_data_reporting_ap_is/models/multi_priced_transaction_response_transactions_items.rb +1724 -0
  109. data/lib/shell_data_reporting_ap_is/models/o_auth_provider_error_enum.rb +45 -0
  110. data/lib/shell_data_reporting_ap_is/models/o_auth_token.rb +100 -0
  111. data/lib/shell_data_reporting_ap_is/models/past_statement_of_accounts.rb +502 -0
  112. data/lib/shell_data_reporting_ap_is/models/payer_access.rb +147 -0
  113. data/lib/shell_data_reporting_ap_is/models/payer_details.rb +1412 -0
  114. data/lib/shell_data_reporting_ap_is/models/payer_request.rb +126 -0
  115. data/lib/shell_data_reporting_ap_is/models/payer_response.rb +115 -0
  116. data/lib/shell_data_reporting_ap_is/models/payers.rb +109 -0
  117. data/lib/shell_data_reporting_ap_is/models/payments_since_last_soa.rb +322 -0
  118. data/lib/shell_data_reporting_ap_is/models/pin_advice_types.rb +80 -0
  119. data/lib/shell_data_reporting_ap_is/models/price_list.rb +485 -0
  120. data/lib/shell_data_reporting_ap_is/models/price_trans_summary_request.rb +477 -0
  121. data/lib/shell_data_reporting_ap_is/models/price_transaction_request.rb +572 -0
  122. data/lib/shell_data_reporting_ap_is/models/priced_request_data.rb +485 -0
  123. data/lib/shell_data_reporting_ap_is/models/priced_response_data.rb +2132 -0
  124. data/lib/shell_data_reporting_ap_is/models/priced_trans_summary_response.rb +79 -0
  125. data/lib/shell_data_reporting_ap_is/models/priced_trans_summary_response_transactions_summary_items.rb +242 -0
  126. data/lib/shell_data_reporting_ap_is/models/priced_transaction_items_location_items.rb +67 -0
  127. data/lib/shell_data_reporting_ap_is/models/priced_transaction_req_v2_invoice_status_enum.rb +27 -0
  128. data/lib/shell_data_reporting_ap_is/models/priced_transaction_req_v2_period_enum.rb +27 -0
  129. data/lib/shell_data_reporting_ap_is/models/priced_transaction_req_v2_sort_order_enum.rb +37 -0
  130. data/lib/shell_data_reporting_ap_is/models/priced_transaction_request_v2.rb +72 -0
  131. data/lib/shell_data_reporting_ap_is/models/priced_transaction_resp_v2_refund_flag_enum.rb +23 -0
  132. data/lib/shell_data_reporting_ap_is/models/priced_transaction_response.rb +59 -0
  133. data/lib/shell_data_reporting_ap_is/models/priced_transaction_response_transactions_items.rb +1719 -0
  134. data/lib/shell_data_reporting_ap_is/models/priced_transaction_response_v2.rb +110 -0
  135. data/lib/shell_data_reporting_ap_is/models/pricing_current_volume.rb +115 -0
  136. data/lib/shell_data_reporting_ap_is/models/pricing_history.rb +105 -0
  137. data/lib/shell_data_reporting_ap_is/models/purchase_categories.rb +114 -0
  138. data/lib/shell_data_reporting_ap_is/models/recent_transaction_req.rb +217 -0
  139. data/lib/shell_data_reporting_ap_is/models/recent_transaction_request.rb +66 -0
  140. data/lib/shell_data_reporting_ap_is/models/recent_transactions.rb +918 -0
  141. data/lib/shell_data_reporting_ap_is/models/recent_transactions_response.rb +110 -0
  142. data/lib/shell_data_reporting_ap_is/models/role.rb +102 -0
  143. data/lib/shell_data_reporting_ap_is/models/search_doc_req.rb +269 -0
  144. data/lib/shell_data_reporting_ap_is/models/search_documents_invoice.rb +204 -0
  145. data/lib/shell_data_reporting_ap_is/models/search_documents_request.rb +70 -0
  146. data/lib/shell_data_reporting_ap_is/models/search_documents_response.rb +122 -0
  147. data/lib/shell_data_reporting_ap_is/models/search_soa_req.rb +197 -0
  148. data/lib/shell_data_reporting_ap_is/models/search_statement_of_account.rb +220 -0
  149. data/lib/shell_data_reporting_ap_is/models/search_statement_of_account_request.rb +70 -0
  150. data/lib/shell_data_reporting_ap_is/models/search_statement_of_account_response.rb +120 -0
  151. data/lib/shell_data_reporting_ap_is/models/site_location.rb +67 -0
  152. data/lib/shell_data_reporting_ap_is/models/statement_of_account_request.rb +50 -0
  153. data/lib/shell_data_reporting_ap_is/models/statement_of_account_request_filters.rb +197 -0
  154. data/lib/shell_data_reporting_ap_is/models/statement_of_account_resp.rb +138 -0
  155. data/lib/shell_data_reporting_ap_is/models/statement_of_account_response.rb +80 -0
  156. data/lib/shell_data_reporting_ap_is/models/tier.rb +167 -0
  157. data/lib/shell_data_reporting_ap_is/models/transaction_exceptions.rb +1267 -0
  158. data/lib/shell_data_reporting_ap_is/models/transaction_exceptions_request.rb +267 -0
  159. data/lib/shell_data_reporting_ap_is/models/transaction_exceptions_response.rb +100 -0
  160. data/lib/shell_data_reporting_ap_is/models/transaction_fees_request.rb +348 -0
  161. data/lib/shell_data_reporting_ap_is/models/transaction_fees_response.rb +111 -0
  162. data/lib/shell_data_reporting_ap_is/models/update_odometer.rb +62 -0
  163. data/lib/shell_data_reporting_ap_is/models/update_odometer_reference.rb +67 -0
  164. data/lib/shell_data_reporting_ap_is/models/update_odometer_request.rb +146 -0
  165. data/lib/shell_data_reporting_ap_is/models/update_odometer_response.rb +93 -0
  166. data/lib/shell_data_reporting_ap_is/models/usage_summary.rb +202 -0
  167. data/lib/shell_data_reporting_ap_is/models/volume_based_bonus_request.rb +118 -0
  168. data/lib/shell_data_reporting_ap_is/models/volume_based_bonus_response.rb +120 -0
  169. data/lib/shell_data_reporting_ap_is/models/volume_based_pricing_request.rb +103 -0
  170. data/lib/shell_data_reporting_ap_is/models/volume_based_pricing_response.rb +120 -0
  171. data/lib/shell_data_reporting_ap_is/utilities/date_time_helper.rb +11 -0
  172. data/lib/shell_data_reporting_ap_is/utilities/file_wrapper.rb +16 -0
  173. data/lib/shell_data_reporting_ap_is.rb +229 -0
  174. data/test/controllers/controller_test_base.rb +34 -0
  175. data/test/controllers/test_invoice_controller.rb +398 -0
  176. data/test/controllers/test_transaction_controller.rb +235 -0
  177. data/test/http_response_catcher.rb +19 -0
  178. metadata +302 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 7b2e3ac6fdcee464dda4b015df821bd82659abbfac4adccd37a85e0c5da9d99a
4
+ data.tar.gz: ac9d67d4238e3837cce64b4b40eafc7a255ebc3544a62ea30c09ed4e777e57e0
5
+ SHA512:
6
+ metadata.gz: 833fef79a392f620cd7fd9912c529ec0b943978aca14e34da469acccc5f119ad19132ed5adc45ce46df3470477de1d020a80f0dacfbf5f263fc56d6b168caeac
7
+ data.tar.gz: eb08d34e5e367da1d11abb93a37b4fa9c96507031bc3fe3b1d2569d14142fe53eccb566fd9e47425bf822437d6996bd797980001fd1764acb8a25228074982d5
data/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ License:
2
+ ========
3
+ The MIT License (MIT)
4
+ http://opensource.org/licenses/MIT
5
+
6
+ Copyright (c) 2014 - 2024 APIMATIC Limited
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in
16
+ all copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ THE SOFTWARE.
25
+
26
+ Trade Mark:
27
+ ==========
28
+ APIMATIC is a trade mark for APIMATIC Limited
data/README.md ADDED
@@ -0,0 +1,104 @@
1
+
2
+ # Getting Started with Shell Data & Reporting APIs
3
+
4
+ ## Introduction
5
+
6
+ Data And Reporting product consists of API's which provides details of transaction and invoice informations about shell cards.
7
+ The Shell Card Transaction and Invoice API is REST-based and employs Basic authentication in Version 1 and Oauth authentication in Version 2 end points. The API endpoints accept JSON-encoded request bodies, return JSON-encoded responses and use standard HTTP response codes.
8
+ All resources are located in the Shell Card Platform. The Shell Card Platform is the overall platform that encompasses all the internal Shell systems used to manage resources.
9
+ All endpoints use the `POST` verb for retrieving, updating, creating and deleting resources in the Shell Card Platform. The endpoints that retrieve resources from the Shell Card Platform allow flexible search parameters in the API request body.
10
+
11
+ Go to the Shell Developer Portal: [https://developer.shell.com](https://developer.shell.com)
12
+
13
+ ## Install the Package
14
+
15
+ Install the gem from the command line:
16
+
17
+ ```ruby
18
+ gem install data-and-reporting-sdk -v 1.0.0
19
+ ```
20
+
21
+ Or add the gem to your Gemfile and run `bundle`:
22
+
23
+ ```ruby
24
+ gem 'data-and-reporting-sdk', '1.0.0'
25
+ ```
26
+
27
+ For additional gem details, see the [RubyGems page for the data-and-reporting-sdk gem](https://rubygems.org/gems/data-and-reporting-sdk/versions/1.0.0).
28
+
29
+ ## Test the SDK
30
+
31
+ To run the tests, navigate to the root directory of the SDK in your terminal and execute the following command:
32
+
33
+ ```
34
+ rake
35
+ ```
36
+
37
+ ## Initialize the API Client
38
+
39
+ **_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/1.0.0/doc/client.md)
40
+
41
+ The following parameters are configurable for the API Client:
42
+
43
+ | Parameter | Type | Description |
44
+ | --- | --- | --- |
45
+ | `environment` | `Environment` | The API environment. <br> **Default: `Environment.SIT`** |
46
+ | `connection` | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
47
+ | `adapter` | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
48
+ | `timeout` | `Float` | The value to use for connection timeout. <br> **Default: 60** |
49
+ | `max_retries` | `Integer` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
50
+ | `retry_interval` | `Float` | Pause in seconds between retries. <br> **Default: 1** |
51
+ | `backoff_factor` | `Float` | The amount to multiply each successive retry's interval amount by in order to provide backoff. <br> **Default: 2** |
52
+ | `retry_statuses` | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
53
+ | `retry_methods` | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put]** |
54
+ | `http_callback` | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
55
+ | `basic_auth_credentials` | [`BasicAuthCredentials`](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/1.0.0/doc/$a/https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/1.0.0/basic-authentication.md) | The credential object for Basic Authentication |
56
+ | `bearer_token_credentials` | [`BearerTokenCredentials`](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/1.0.0/doc/$a/https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/1.0.0/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant |
57
+
58
+ The API client can be initialized as follows:
59
+
60
+ ```ruby
61
+ client = ShellDataReportingApIs::Client.new(
62
+ basic_auth_credentials: BasicAuthCredentials.new(
63
+ username: 'Username',
64
+ password: 'Password'
65
+ ),
66
+ bearer_token_credentials: BearerTokenCredentials.new(
67
+ o_auth_client_id: 'OAuthClientId',
68
+ o_auth_client_secret: 'OAuthClientSecret'
69
+ ),
70
+ environment: Environment::SIT
71
+ )
72
+ ```
73
+
74
+ ## Environments
75
+
76
+ The SDK can be configured to use a different environment for making API calls. Available environments are:
77
+
78
+ ### Fields
79
+
80
+ | Name | Description |
81
+ | --- | --- |
82
+ | SIT | **Default** |
83
+ | Production | - |
84
+
85
+ ## Authorization
86
+
87
+ This API uses the following authentication schemes.
88
+
89
+ * [`BasicAuth (Basic Authentication)`](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/1.0.0/doc/$a/https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/1.0.0/basic-authentication.md)
90
+ * [`BearerToken (OAuth 2 Client Credentials Grant)`](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/1.0.0/doc/$a/https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/1.0.0/oauth-2-client-credentials-grant.md)
91
+
92
+ ## List of APIs
93
+
94
+ * [O Auth Authorization](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/1.0.0/doc/controllers/o-auth-authorization.md)
95
+ * [Customer](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/1.0.0/doc/controllers/customer.md)
96
+ * [Transaction](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/1.0.0/doc/controllers/transaction.md)
97
+ * [Invoice](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/1.0.0/doc/controllers/invoice.md)
98
+
99
+ ## Classes Documentation
100
+
101
+ * [Utility Classes](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/1.0.0/doc/utility-classes.md)
102
+ * [HttpResponse](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/1.0.0/doc/http-response.md)
103
+ * [HttpRequest](https://www.github.com/sdks-io/data-and-reporting-ruby-sdk/tree/1.0.0/doc/http-request.md)
104
+
@@ -0,0 +1,10 @@
1
+ # shell_data_reporting_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module ShellDataReportingApIs
7
+ # API utility class
8
+ class APIHelper < CoreLibrary::ApiHelper
9
+ end
10
+ end
@@ -0,0 +1,84 @@
1
+ # shell_data_reporting_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module ShellDataReportingApIs
7
+ # shell_data_reporting_ap_is client class.
8
+ class Client
9
+ include CoreLibrary
10
+ attr_reader :config, :auth_managers
11
+
12
+ # Returns the configured authentication BearerToken instance.
13
+ def bearer_token
14
+ @auth_managers['BearerToken']
15
+ end
16
+
17
+ # Access to customer controller.
18
+ # @return [CustomerController] Returns the controller instance.
19
+ def customer
20
+ @customer ||= CustomerController.new @global_configuration
21
+ end
22
+
23
+ # Access to transaction controller.
24
+ # @return [TransactionController] Returns the controller instance.
25
+ def transaction
26
+ @transaction ||= TransactionController.new @global_configuration
27
+ end
28
+
29
+ # Access to invoice controller.
30
+ # @return [InvoiceController] Returns the controller instance.
31
+ def invoice
32
+ @invoice ||= InvoiceController.new @global_configuration
33
+ end
34
+
35
+ # Access to o_auth_authorization controller.
36
+ # @return [OAuthAuthorizationController] Returns the controller instance.
37
+ def o_auth_authorization
38
+ @o_auth_authorization ||= OAuthAuthorizationController.new @global_configuration
39
+ end
40
+
41
+ def initialize(
42
+ connection: nil, adapter: :net_http_persistent, timeout: 60,
43
+ max_retries: 0, retry_interval: 1, backoff_factor: 2,
44
+ retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
45
+ retry_methods: %i[get put], http_callback: nil,
46
+ environment: Environment::SIT, basic_auth_credentials: nil,
47
+ bearer_token_credentials: nil, config: nil
48
+ )
49
+ @config = if config.nil?
50
+ Configuration.new(
51
+ connection: connection, adapter: adapter, timeout: timeout,
52
+ max_retries: max_retries, retry_interval: retry_interval,
53
+ backoff_factor: backoff_factor,
54
+ retry_statuses: retry_statuses,
55
+ retry_methods: retry_methods, http_callback: http_callback,
56
+ environment: environment,
57
+ basic_auth_credentials: basic_auth_credentials,
58
+ bearer_token_credentials: bearer_token_credentials
59
+ )
60
+ else
61
+ config
62
+ end
63
+
64
+ @global_configuration = GlobalConfiguration.new(client_configuration: @config)
65
+ .base_uri_executor(@config.method(:get_base_uri))
66
+ .global_errors(BaseController::GLOBAL_ERRORS)
67
+ .user_agent(BaseController.user_agent)
68
+
69
+ initialize_auth_managers(@global_configuration)
70
+ @global_configuration = @global_configuration.auth_managers(@auth_managers)
71
+ end
72
+
73
+ # Initializes the auth managers hash used for authenticating API calls.
74
+ # @param [GlobalConfiguration] global_config The global configuration of the SDK)
75
+ def initialize_auth_managers(global_config)
76
+ @auth_managers = {}
77
+ http_client_config = global_config.client_configuration
78
+ %w[BasicAuth BearerToken].each { |auth| @auth_managers[auth] = nil }
79
+ @auth_managers['BasicAuth'] = BasicAuth.new(http_client_config.basic_auth_credentials)
80
+ @auth_managers['BearerToken'] = BearerToken.new(http_client_config.bearer_token_credentials,
81
+ global_config)
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,110 @@
1
+ # shell_data_reporting_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module ShellDataReportingApIs
7
+ # An enum for SDK environments.
8
+ class Environment
9
+ ENVIRONMENT = [
10
+ SIT = 'SIT'.freeze,
11
+ PRODUCTION = 'Production'.freeze
12
+ ].freeze
13
+ end
14
+
15
+ # An enum for API servers.
16
+ class Server
17
+ SERVER = [
18
+ OAUTH_SERVER = 'OAuth Server'.freeze,
19
+ SHELL = 'Shell'.freeze
20
+ ].freeze
21
+ end
22
+
23
+ # All configuration including auth info and base URI for the API access
24
+ # are configured in this class.
25
+ class Configuration < CoreLibrary::HttpClientConfiguration
26
+ # The attribute readers for properties.
27
+ attr_reader :environment, :basic_auth_credentials, :bearer_token_credentials
28
+
29
+ class << self
30
+ attr_reader :environments
31
+ end
32
+
33
+ def initialize(
34
+ connection: nil, adapter: :net_http_persistent, timeout: 60,
35
+ max_retries: 0, retry_interval: 1, backoff_factor: 2,
36
+ retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
37
+ retry_methods: %i[get put], http_callback: nil,
38
+ environment: Environment::SIT, basic_auth_credentials: nil,
39
+ bearer_token_credentials: nil
40
+ )
41
+
42
+ super connection: connection, adapter: adapter, timeout: timeout,
43
+ max_retries: max_retries, retry_interval: retry_interval,
44
+ backoff_factor: backoff_factor, retry_statuses: retry_statuses,
45
+ retry_methods: retry_methods, http_callback: http_callback
46
+
47
+ # Current API environment
48
+ @environment = String(environment)
49
+
50
+ # The object holding Basic Authentication credentials
51
+ @basic_auth_credentials = basic_auth_credentials
52
+
53
+ # The object holding OAuth 2 Client Credentials Grant credentials
54
+ @bearer_token_credentials = bearer_token_credentials
55
+
56
+ # The Http Client to use for making requests.
57
+ set_http_client CoreLibrary::FaradayClient.new(self)
58
+ end
59
+
60
+ def clone_with(connection: nil, adapter: nil, timeout: nil,
61
+ max_retries: nil, retry_interval: nil, backoff_factor: nil,
62
+ retry_statuses: nil, retry_methods: nil, http_callback: nil,
63
+ environment: nil, basic_auth_credentials: nil,
64
+ bearer_token_credentials: nil)
65
+ connection ||= self.connection
66
+ adapter ||= self.adapter
67
+ timeout ||= self.timeout
68
+ max_retries ||= self.max_retries
69
+ retry_interval ||= self.retry_interval
70
+ backoff_factor ||= self.backoff_factor
71
+ retry_statuses ||= self.retry_statuses
72
+ retry_methods ||= self.retry_methods
73
+ http_callback ||= self.http_callback
74
+ environment ||= self.environment
75
+ basic_auth_credentials ||= self.basic_auth_credentials
76
+ bearer_token_credentials ||= self.bearer_token_credentials
77
+
78
+ Configuration.new(connection: connection, adapter: adapter,
79
+ timeout: timeout, max_retries: max_retries,
80
+ retry_interval: retry_interval,
81
+ backoff_factor: backoff_factor,
82
+ retry_statuses: retry_statuses,
83
+ retry_methods: retry_methods,
84
+ http_callback: http_callback, environment: environment,
85
+ basic_auth_credentials: basic_auth_credentials,
86
+ bearer_token_credentials: bearer_token_credentials)
87
+ end
88
+
89
+
90
+ # All the environments the SDK can run in.
91
+ ENVIRONMENTS = {
92
+ Environment::SIT => {
93
+ Server::OAUTH_SERVER => 'https://api-test.shell.com',
94
+ Server::SHELL => 'https://api-test.shell.com/test'
95
+ },
96
+ Environment::PRODUCTION => {
97
+ Server::OAUTH_SERVER => 'https://api.shell.com',
98
+ Server::SHELL => 'https://api.shell.com'
99
+ }
100
+ }.freeze
101
+
102
+ # Generates the appropriate base URI for the environment and the server.
103
+ # @param [Configuration::Server] server The server enum for which the base URI is
104
+ # required.
105
+ # @return [String] The base URI.
106
+ def get_base_uri(server = Server::SHELL)
107
+ ENVIRONMENTS[environment][server].clone
108
+ end
109
+ end
110
+ end
@@ -0,0 +1,66 @@
1
+ # shell_data_reporting_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module ShellDataReportingApIs
7
+ # BaseController.
8
+ class BaseController
9
+ include CoreLibrary
10
+ attr_accessor :config, :http_call_back
11
+
12
+ def self.user_agent
13
+ 'APIMATIC 3.0'
14
+ end
15
+
16
+
17
+ GLOBAL_ERRORS = {
18
+ 'default' => ErrorCase.new
19
+ .error_message('HTTP response not OK.')
20
+ .exception_type(APIException)
21
+ }.freeze
22
+
23
+ # Initialization constructor.
24
+ # @param [GlobalConfiguration] global_configuration The instance of GlobalConfiguration.
25
+ def initialize(global_configuration)
26
+ @global_configuration = global_configuration
27
+ @config = @global_configuration.client_configuration
28
+ @http_call_back = @config.http_callback
29
+ @api_call = ApiCall.new(@global_configuration)
30
+ end
31
+
32
+ # Creates a new builder for the Api Call instance.
33
+ # @return [ApiCall] The instance of ApiCall.
34
+ def new_api_call_builder
35
+ @api_call.new_builder
36
+ end
37
+
38
+ # Creates a new instance of the request builder.
39
+ # @param [String] http_method The HTTP method to use in the request.
40
+ # @param [String] path The endpoint path to use in the request.
41
+ # @param [String] server The server to extract the base uri for the request.
42
+ # @return [RequestBuilder] The instance of RequestBuilder.
43
+ def new_request_builder(http_method, path, server)
44
+ RequestBuilder.new
45
+ .http_method(http_method)
46
+ .path(path)
47
+ .server(server)
48
+ end
49
+
50
+ # Creates a new instance of the response handler.
51
+ # @return [ResponseHandler] The instance of ResponseHandler.
52
+ def new_response_handler
53
+ ResponseHandler.new
54
+ end
55
+
56
+ # Creates a new instance of the parameter.
57
+ # @param [String|optional] key The key of the parameter.
58
+ # @param [Object] value The value of the parameter.
59
+ # @return [Parameter] The instance of Parameter.
60
+ def new_parameter(value, key: nil)
61
+ Parameter.new
62
+ .key(key)
63
+ .value(value)
64
+ end
65
+ end
66
+ end