card-management-sdk 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (198) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +88 -0
  4. data/lib/shell_card_management_ap_is/api_helper.rb +10 -0
  5. data/lib/shell_card_management_ap_is/client.rb +85 -0
  6. data/lib/shell_card_management_ap_is/configuration.rb +117 -0
  7. data/lib/shell_card_management_ap_is/controllers/base_controller.rb +66 -0
  8. data/lib/shell_card_management_ap_is/controllers/card_controller.rb +1047 -0
  9. data/lib/shell_card_management_ap_is/controllers/customer_controller.rb +538 -0
  10. data/lib/shell_card_management_ap_is/controllers/o_auth_authorization_controller.rb +42 -0
  11. data/lib/shell_card_management_ap_is/controllers/restriction_controller.rb +496 -0
  12. data/lib/shell_card_management_ap_is/exceptions/api_exception.rb +10 -0
  13. data/lib/shell_card_management_ap_is/exceptions/default_error_exception.rb +32 -0
  14. data/lib/shell_card_management_ap_is/exceptions/error_object_exception.rb +54 -0
  15. data/lib/shell_card_management_ap_is/exceptions/error_user_access_error1_exception.rb +32 -0
  16. data/lib/shell_card_management_ap_is/exceptions/o_auth_provider_exception.rb +48 -0
  17. data/lib/shell_card_management_ap_is/http/auth/basic_auth.rb +50 -0
  18. data/lib/shell_card_management_ap_is/http/auth/bearer_token.rb +89 -0
  19. data/lib/shell_card_management_ap_is/http/http_call_back.rb +10 -0
  20. data/lib/shell_card_management_ap_is/http/http_method_enum.rb +10 -0
  21. data/lib/shell_card_management_ap_is/http/http_request.rb +10 -0
  22. data/lib/shell_card_management_ap_is/http/http_response.rb +10 -0
  23. data/lib/shell_card_management_ap_is/models/account_access.rb +128 -0
  24. data/lib/shell_card_management_ap_is/models/account_request.rb +252 -0
  25. data/lib/shell_card_management_ap_is/models/account_response.rb +111 -0
  26. data/lib/shell_card_management_ap_is/models/account_response_accounts_items.rb +750 -0
  27. data/lib/shell_card_management_ap_is/models/account_restriction_request.rb +131 -0
  28. data/lib/shell_card_management_ap_is/models/account_restriction_response.rb +60 -0
  29. data/lib/shell_card_management_ap_is/models/account_velocity_limit.rb +145 -0
  30. data/lib/shell_card_management_ap_is/models/accounts.rb +65 -0
  31. data/lib/shell_card_management_ap_is/models/address.rb +174 -0
  32. data/lib/shell_card_management_ap_is/models/audit_request.rb +256 -0
  33. data/lib/shell_card_management_ap_is/models/audit_response.rb +111 -0
  34. data/lib/shell_card_management_ap_is/models/audit_response_audits_items.rb +450 -0
  35. data/lib/shell_card_management_ap_is/models/auto_renew_card_request.rb +111 -0
  36. data/lib/shell_card_management_ap_is/models/auto_renew_card_request_auto_renew_cards_items.rb +98 -0
  37. data/lib/shell_card_management_ap_is/models/auto_renew_card_response.rb +92 -0
  38. data/lib/shell_card_management_ap_is/models/auto_renew_card_response_data_items.rb +64 -0
  39. data/lib/shell_card_management_ap_is/models/bank_account.rb +192 -0
  40. data/lib/shell_card_management_ap_is/models/base_model.rb +62 -0
  41. data/lib/shell_card_management_ap_is/models/bundle_restriction.rb +166 -0
  42. data/lib/shell_card_management_ap_is/models/cancel_card_request.rb +107 -0
  43. data/lib/shell_card_management_ap_is/models/cancel_card_response.rb +127 -0
  44. data/lib/shell_card_management_ap_is/models/card.rb +696 -0
  45. data/lib/shell_card_management_ap_is/models/card_block_schedule.rb +65 -0
  46. data/lib/shell_card_management_ap_is/models/card_day_time_restrictions.rb +159 -0
  47. data/lib/shell_card_management_ap_is/models/card_delivery_contact.rb +230 -0
  48. data/lib/shell_card_management_ap_is/models/card_detail.rb +661 -0
  49. data/lib/shell_card_management_ap_is/models/card_detail_auto_renew_enum.rb +28 -0
  50. data/lib/shell_card_management_ap_is/models/card_details_request.rb +260 -0
  51. data/lib/shell_card_management_ap_is/models/card_details_response.rb +1058 -0
  52. data/lib/shell_card_management_ap_is/models/card_details_response_card_block_schedules_items_all_of0.rb +60 -0
  53. data/lib/shell_card_management_ap_is/models/card_details_response_card_delivery_address.rb +227 -0
  54. data/lib/shell_card_management_ap_is/models/card_details_response_fuel_sets_items.rb +58 -0
  55. data/lib/shell_card_management_ap_is/models/card_details_response_international_pos_language_code_enum.rb +118 -0
  56. data/lib/shell_card_management_ap_is/models/card_details_response_international_pos_language_id_enum.rb +118 -0
  57. data/lib/shell_card_management_ap_is/models/card_details_response_local_pos_language_code_enum.rb +118 -0
  58. data/lib/shell_card_management_ap_is/models/card_details_response_local_pos_language_id_enum.rb +118 -0
  59. data/lib/shell_card_management_ap_is/models/card_details_response_non_fuel_sets_items.rb +58 -0
  60. data/lib/shell_card_management_ap_is/models/card_details_response_pin_delivery_address.rb +231 -0
  61. data/lib/shell_card_management_ap_is/models/card_details_response_pin_type_enum.rb +23 -0
  62. data/lib/shell_card_management_ap_is/models/card_details_response_reissue_setting_enum.rb +26 -0
  63. data/lib/shell_card_management_ap_is/models/card_details_response_renewed_card_reissue_setting_enum.rb +25 -0
  64. data/lib/shell_card_management_ap_is/models/card_details_response_status_id_enum.rb +83 -0
  65. data/lib/shell_card_management_ap_is/models/card_group_request.rb +178 -0
  66. data/lib/shell_card_management_ap_is/models/card_group_response.rb +109 -0
  67. data/lib/shell_card_management_ap_is/models/card_group_response_card_groups_items.rb +301 -0
  68. data/lib/shell_card_management_ap_is/models/card_move_request.rb +163 -0
  69. data/lib/shell_card_management_ap_is/models/card_move_request_cards_items.rb +80 -0
  70. data/lib/shell_card_management_ap_is/models/card_move_response.rb +112 -0
  71. data/lib/shell_card_management_ap_is/models/card_move_response_error_cards_items.rb +112 -0
  72. data/lib/shell_card_management_ap_is/models/card_move_response_successful_requests_items.rb +97 -0
  73. data/lib/shell_card_management_ap_is/models/card_search_response.rb +126 -0
  74. data/lib/shell_card_management_ap_is/models/card_summary_request.rb +52 -0
  75. data/lib/shell_card_management_ap_is/models/card_summary_response.rb +82 -0
  76. data/lib/shell_card_management_ap_is/models/card_type_request.rb +145 -0
  77. data/lib/shell_card_management_ap_is/models/card_type_response.rb +79 -0
  78. data/lib/shell_card_management_ap_is/models/card_type_response_customer_card_types_items.rb +470 -0
  79. data/lib/shell_card_management_ap_is/models/card_type_response_error.rb +60 -0
  80. data/lib/shell_card_management_ap_is/models/card_usage_restrictions.rb +281 -0
  81. data/lib/shell_card_management_ap_is/models/col_co_access.rb +88 -0
  82. data/lib/shell_card_management_ap_is/models/create_bundle_request.rb +167 -0
  83. data/lib/shell_card_management_ap_is/models/create_bundle_request_restrictions.rb +147 -0
  84. data/lib/shell_card_management_ap_is/models/create_bundle_response.rb +98 -0
  85. data/lib/shell_card_management_ap_is/models/create_bundle_response_data_items.rb +125 -0
  86. data/lib/shell_card_management_ap_is/models/create_bundle_response_data_items_cards_items.rb +50 -0
  87. data/lib/shell_card_management_ap_is/models/create_card_group_request.rb +161 -0
  88. data/lib/shell_card_management_ap_is/models/create_card_group_request_cards_items.rb +84 -0
  89. data/lib/shell_card_management_ap_is/models/create_card_group_response.rb +130 -0
  90. data/lib/shell_card_management_ap_is/models/create_card_group_response_error_cards_items.rb +81 -0
  91. data/lib/shell_card_management_ap_is/models/create_card_group_response_successful_requests_items.rb +71 -0
  92. data/lib/shell_card_management_ap_is/models/create_card_response.rb +65 -0
  93. data/lib/shell_card_management_ap_is/models/customer_contract.rb +63 -0
  94. data/lib/shell_card_management_ap_is/models/customer_detail_request.rb +123 -0
  95. data/lib/shell_card_management_ap_is/models/customer_detail_response.rb +437 -0
  96. data/lib/shell_card_management_ap_is/models/day_time_restrictions.rb +162 -0
  97. data/lib/shell_card_management_ap_is/models/default_error_fault.rb +60 -0
  98. data/lib/shell_card_management_ap_is/models/default_error_fault_detail.rb +50 -0
  99. data/lib/shell_card_management_ap_is/models/delete_bundle_request.rb +126 -0
  100. data/lib/shell_card_management_ap_is/models/delete_bundle_response.rb +60 -0
  101. data/lib/shell_card_management_ap_is/models/delivery_address_update.rb +112 -0
  102. data/lib/shell_card_management_ap_is/models/delivery_address_update_references.rb +102 -0
  103. data/lib/shell_card_management_ap_is/models/delivery_address_update_request.rb +129 -0
  104. data/lib/shell_card_management_ap_is/models/delivery_address_update_response.rb +94 -0
  105. data/lib/shell_card_management_ap_is/models/delivery_addresses.rb +258 -0
  106. data/lib/shell_card_management_ap_is/models/eid_access.rb +75 -0
  107. data/lib/shell_card_management_ap_is/models/error_details.rb +81 -0
  108. data/lib/shell_card_management_ap_is/models/error_status.rb +60 -0
  109. data/lib/shell_card_management_ap_is/models/error_user_access.rb +50 -0
  110. data/lib/shell_card_management_ap_is/models/error_user_access_error.rb +60 -0
  111. data/lib/shell_card_management_ap_is/models/finance_currency.rb +98 -0
  112. data/lib/shell_card_management_ap_is/models/generate_pin_key_response.rb +60 -0
  113. data/lib/shell_card_management_ap_is/models/invoice_distribution_method.rb +99 -0
  114. data/lib/shell_card_management_ap_is/models/location_restrictions.rb +125 -0
  115. data/lib/shell_card_management_ap_is/models/location_restrictions_country_restrictions.rb +65 -0
  116. data/lib/shell_card_management_ap_is/models/location_restrictions_network_restrictions_items.rb +77 -0
  117. data/lib/shell_card_management_ap_is/models/location_restrictions_partner_site_restrictions_items.rb +95 -0
  118. data/lib/shell_card_management_ap_is/models/location_restrictions_shell_site_restrictions_items.rb +95 -0
  119. data/lib/shell_card_management_ap_is/models/logged_in_user_request.rb +107 -0
  120. data/lib/shell_card_management_ap_is/models/logged_in_user_response.rb +394 -0
  121. data/lib/shell_card_management_ap_is/models/o_auth_provider_error_enum.rb +45 -0
  122. data/lib/shell_card_management_ap_is/models/o_auth_token.rb +100 -0
  123. data/lib/shell_card_management_ap_is/models/order_card_enquiry.rb +502 -0
  124. data/lib/shell_card_management_ap_is/models/order_card_enquiry_req.rb +208 -0
  125. data/lib/shell_card_management_ap_is/models/order_card_enquiry_req_reference_type_enum.rb +32 -0
  126. data/lib/shell_card_management_ap_is/models/order_card_enquiry_request.rb +51 -0
  127. data/lib/shell_card_management_ap_is/models/order_card_enquiry_response.rb +79 -0
  128. data/lib/shell_card_management_ap_is/models/order_card_request.rb +60 -0
  129. data/lib/shell_card_management_ap_is/models/order_card_response.rb +90 -0
  130. data/lib/shell_card_management_ap_is/models/payer_access.rb +147 -0
  131. data/lib/shell_card_management_ap_is/models/payer_details.rb +1412 -0
  132. data/lib/shell_card_management_ap_is/models/payer_request.rb +126 -0
  133. data/lib/shell_card_management_ap_is/models/payer_response.rb +115 -0
  134. data/lib/shell_card_management_ap_is/models/payers.rb +109 -0
  135. data/lib/shell_card_management_ap_is/models/pin_advice_types.rb +80 -0
  136. data/lib/shell_card_management_ap_is/models/pin_delivery_contact.rb +242 -0
  137. data/lib/shell_card_management_ap_is/models/pin_delivery_details.rb +169 -0
  138. data/lib/shell_card_management_ap_is/models/pin_reminder_card_details.rb +137 -0
  139. data/lib/shell_card_management_ap_is/models/pin_reminder_reference.rb +99 -0
  140. data/lib/shell_card_management_ap_is/models/pin_reminder_request.rb +135 -0
  141. data/lib/shell_card_management_ap_is/models/pin_reminder_response.rb +90 -0
  142. data/lib/shell_card_management_ap_is/models/product_all_of0.rb +62 -0
  143. data/lib/shell_card_management_ap_is/models/product_group.rb +116 -0
  144. data/lib/shell_card_management_ap_is/models/product_restrictions.rb +66 -0
  145. data/lib/shell_card_management_ap_is/models/purchase_categories.rb +114 -0
  146. data/lib/shell_card_management_ap_is/models/purchase_category1_all_of0.rb +140 -0
  147. data/lib/shell_card_management_ap_is/models/purchase_category_request.rb +114 -0
  148. data/lib/shell_card_management_ap_is/models/purchase_category_response.rb +69 -0
  149. data/lib/shell_card_management_ap_is/models/replace_card_settings.rb +641 -0
  150. data/lib/shell_card_management_ap_is/models/restriction_card_request.rb +115 -0
  151. data/lib/shell_card_management_ap_is/models/restriction_card_request_cards_items.rb +220 -0
  152. data/lib/shell_card_management_ap_is/models/restriction_card_response.rb +91 -0
  153. data/lib/shell_card_management_ap_is/models/restriction_card_response_data_items.rb +240 -0
  154. data/lib/shell_card_management_ap_is/models/restriction_search_card_request.rb +50 -0
  155. data/lib/shell_card_management_ap_is/models/restriction_search_card_request_filters.rb +177 -0
  156. data/lib/shell_card_management_ap_is/models/restriction_search_card_request_filters_cards_items.rb +63 -0
  157. data/lib/shell_card_management_ap_is/models/restriction_search_card_response.rb +79 -0
  158. data/lib/shell_card_management_ap_is/models/restriction_search_card_response_data_items.rb +514 -0
  159. data/lib/shell_card_management_ap_is/models/role.rb +102 -0
  160. data/lib/shell_card_management_ap_is/models/schedule_card_block_cards_items.rb +249 -0
  161. data/lib/shell_card_management_ap_is/models/schedule_card_block_request.rb +77 -0
  162. data/lib/shell_card_management_ap_is/models/schedule_card_block_response.rb +91 -0
  163. data/lib/shell_card_management_ap_is/models/schedule_card_block_response_data_items.rb +89 -0
  164. data/lib/shell_card_management_ap_is/models/search_account_limit_request.rb +50 -0
  165. data/lib/shell_card_management_ap_is/models/search_account_limit_request_filters.rb +118 -0
  166. data/lib/shell_card_management_ap_is/models/search_account_limit_response.rb +70 -0
  167. data/lib/shell_card_management_ap_is/models/search_account_limit_response_data.rb +106 -0
  168. data/lib/shell_card_management_ap_is/models/search_card.rb +66 -0
  169. data/lib/shell_card_management_ap_is/models/search_card_request.rb +72 -0
  170. data/lib/shell_card_management_ap_is/models/search_card_response_restrictions.rb +99 -0
  171. data/lib/shell_card_management_ap_is/models/search_product_restriction.rb +78 -0
  172. data/lib/shell_card_management_ap_is/models/search_request.rb +724 -0
  173. data/lib/shell_card_management_ap_is/models/submitted_card.rb +183 -0
  174. data/lib/shell_card_management_ap_is/models/summary_of_bundle_request.rb +50 -0
  175. data/lib/shell_card_management_ap_is/models/summary_of_bundle_response.rb +79 -0
  176. data/lib/shell_card_management_ap_is/models/summary_of_bundle_response_data_items.rb +123 -0
  177. data/lib/shell_card_management_ap_is/models/summary_of_bundle_response_data_items_card_bundles_items.rb +86 -0
  178. data/lib/shell_card_management_ap_is/models/summary_request.rb +598 -0
  179. data/lib/shell_card_management_ap_is/models/summary_response.rb +184 -0
  180. data/lib/shell_card_management_ap_is/models/summaryof_bundle.rb +126 -0
  181. data/lib/shell_card_management_ap_is/models/update_bundle_request.rb +194 -0
  182. data/lib/shell_card_management_ap_is/models/update_bundle_response.rb +70 -0
  183. data/lib/shell_card_management_ap_is/models/update_card.rb +316 -0
  184. data/lib/shell_card_management_ap_is/models/update_card_group_request.rb +258 -0
  185. data/lib/shell_card_management_ap_is/models/update_card_group_response.rb +130 -0
  186. data/lib/shell_card_management_ap_is/models/update_card_group_response_move_card_references_items.rb +77 -0
  187. data/lib/shell_card_management_ap_is/models/update_card_renewal_address.rb +163 -0
  188. data/lib/shell_card_management_ap_is/models/update_card_status_request.rb +124 -0
  189. data/lib/shell_card_management_ap_is/models/update_card_status_response.rb +133 -0
  190. data/lib/shell_card_management_ap_is/models/update_m_pay_reg_status_request.rb +112 -0
  191. data/lib/shell_card_management_ap_is/models/update_m_pay_reg_status_request_m_pay_requests_items.rb +105 -0
  192. data/lib/shell_card_management_ap_is/models/update_m_pay_reg_status_response.rb +60 -0
  193. data/lib/shell_card_management_ap_is/models/url_enum.rb +23 -0
  194. data/lib/shell_card_management_ap_is/models/usage_restrictions.rb +311 -0
  195. data/lib/shell_card_management_ap_is/utilities/date_time_helper.rb +11 -0
  196. data/lib/shell_card_management_ap_is/utilities/file_wrapper.rb +16 -0
  197. data/lib/shell_card_management_ap_is.rb +288 -0
  198. metadata +283 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: a32008a1f6836380d63cf65c64b2605fba5595f32ebddd8d37890832aba819fe
4
+ data.tar.gz: 5dbed5478ee18be88200e22310f862769246d67be84970305b0eb42d43cebe79
5
+ SHA512:
6
+ metadata.gz: e53ecdad02ce9a0e77167c27f80d4225a6a697fb8d05986030af55681b391b2068d1e2224b073e15f2d7a4a70259206dce19f56ac0b41ceb5484d67f5970e985
7
+ data.tar.gz: 55a21a6eb4f7d3e4bbb1318df5179b70176aca596b3e028f2c1d6123cdf1075a6adc8e66e8db7a3d097ac5d757c012e6afbc861f1a1d7fc6d4a37e6dbc207173
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,88 @@
1
+
2
+ # Getting Started with Shell Card Management APIs
3
+
4
+ ## Introduction
5
+
6
+ The Shell Card Management API is REST-based and employs OAUTH 2.0,Basic and ApiKey authentication.
7
+ 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
+ The internal workings of the platform are not important when interacting with the API. However, it is worth noting that the platform uses a microservice architecture to communicate with various backend systems and some API calls are processed asynchronously.
10
+ 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.
11
+
12
+ Go to the Shell Developer Portal: [https://developer.shell.com](https://developer.shell.com)
13
+
14
+ ## Install the Package
15
+
16
+ Install the gem from the command line:
17
+
18
+ ```ruby
19
+ gem install card-management-sdk -v 1.0.0
20
+ ```
21
+
22
+ Or add the gem to your Gemfile and run `bundle`:
23
+
24
+ ```ruby
25
+ gem 'card-management-sdk', '1.0.0'
26
+ ```
27
+
28
+ For additional gem details, see the [RubyGems page for the card-management-sdk gem](https://rubygems.org/gems/card-management-sdk/versions/1.0.0).
29
+
30
+ ## Initialize the API Client
31
+
32
+ **_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/card-management-ruby-sdk/tree/1.0.0/doc/client.md)
33
+
34
+ The following parameters are configurable for the API Client:
35
+
36
+ | Parameter | Type | Description |
37
+ | --- | --- | --- |
38
+ | `url` | `UrlEnum` | This variable specifies the type of environment. Environments:<br><br>* `api.shell.com` - Production<br>* `api-test.shell.com` - SIT<br>*Default*: `UrlEnum::ENUM_APITESTSHELLCOMTEST` |
39
+ | `environment` | `Environment` | The API environment. <br> **Default: `Environment.PRODUCTION`** |
40
+ | `connection` | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
41
+ | `adapter` | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
42
+ | `timeout` | `Float` | The value to use for connection timeout. <br> **Default: 60** |
43
+ | `max_retries` | `Integer` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
44
+ | `retry_interval` | `Float` | Pause in seconds between retries. <br> **Default: 1** |
45
+ | `backoff_factor` | `Float` | The amount to multiply each successive retry's interval amount by in order to provide backoff. <br> **Default: 2** |
46
+ | `retry_statuses` | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
47
+ | `retry_methods` | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put]** |
48
+ | `http_callback` | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
49
+ | `basic_auth_credentials` | [`BasicAuthCredentials`](https://www.github.com/sdks-io/card-management-ruby-sdk/tree/1.0.0/doc/$a/https://www.github.com/sdks-io/card-management-ruby-sdk/tree/1.0.0/basic-authentication.md) | The credential object for Basic Authentication |
50
+ | `bearer_token_credentials` | [`BearerTokenCredentials`](https://www.github.com/sdks-io/card-management-ruby-sdk/tree/1.0.0/doc/$a/https://www.github.com/sdks-io/card-management-ruby-sdk/tree/1.0.0/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant |
51
+
52
+ The API client can be initialized as follows:
53
+
54
+ ```ruby
55
+ client = ShellCardManagementApIs::Client.new(
56
+ basic_auth_credentials: BasicAuthCredentials.new(
57
+ username: 'Username',
58
+ password: 'Password'
59
+ ),
60
+ bearer_token_credentials: BearerTokenCredentials.new(
61
+ o_auth_client_id: 'OAuthClientId',
62
+ o_auth_client_secret: 'OAuthClientSecret'
63
+ ),
64
+ environment: Environment::PRODUCTION,
65
+ url: UrlEnum::ENUM_APITESTSHELLCOMTEST
66
+ )
67
+ ```
68
+
69
+ ## Authorization
70
+
71
+ This API uses the following authentication schemes.
72
+
73
+ * [`BasicAuth (Basic Authentication)`](https://www.github.com/sdks-io/card-management-ruby-sdk/tree/1.0.0/doc/$a/https://www.github.com/sdks-io/card-management-ruby-sdk/tree/1.0.0/basic-authentication.md)
74
+ * [`BearerToken (OAuth 2 Client Credentials Grant)`](https://www.github.com/sdks-io/card-management-ruby-sdk/tree/1.0.0/doc/$a/https://www.github.com/sdks-io/card-management-ruby-sdk/tree/1.0.0/oauth-2-client-credentials-grant.md)
75
+
76
+ ## List of APIs
77
+
78
+ * [O Auth Authorization](https://www.github.com/sdks-io/card-management-ruby-sdk/tree/1.0.0/doc/controllers/o-auth-authorization.md)
79
+ * [Customer](https://www.github.com/sdks-io/card-management-ruby-sdk/tree/1.0.0/doc/controllers/customer.md)
80
+ * [Restriction](https://www.github.com/sdks-io/card-management-ruby-sdk/tree/1.0.0/doc/controllers/restriction.md)
81
+ * [Card](https://www.github.com/sdks-io/card-management-ruby-sdk/tree/1.0.0/doc/controllers/card.md)
82
+
83
+ ## Classes Documentation
84
+
85
+ * [Utility Classes](https://www.github.com/sdks-io/card-management-ruby-sdk/tree/1.0.0/doc/utility-classes.md)
86
+ * [HttpResponse](https://www.github.com/sdks-io/card-management-ruby-sdk/tree/1.0.0/doc/http-response.md)
87
+ * [HttpRequest](https://www.github.com/sdks-io/card-management-ruby-sdk/tree/1.0.0/doc/http-request.md)
88
+
@@ -0,0 +1,10 @@
1
+ # shell_card_management_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module ShellCardManagementApIs
7
+ # API utility class
8
+ class APIHelper < CoreLibrary::ApiHelper
9
+ end
10
+ end
@@ -0,0 +1,85 @@
1
+ # shell_card_management_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module ShellCardManagementApIs
7
+ # shell_card_management_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 restriction controller.
24
+ # @return [RestrictionController] Returns the controller instance.
25
+ def restriction
26
+ @restriction ||= RestrictionController.new @global_configuration
27
+ end
28
+
29
+ # Access to card controller.
30
+ # @return [CardController] Returns the controller instance.
31
+ def card
32
+ @card ||= CardController.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::PRODUCTION,
47
+ url: UrlEnum::ENUM_APITESTSHELLCOMTEST, basic_auth_credentials: nil,
48
+ bearer_token_credentials: nil, config: nil
49
+ )
50
+ @config = if config.nil?
51
+ Configuration.new(
52
+ connection: connection, adapter: adapter, timeout: timeout,
53
+ max_retries: max_retries, retry_interval: retry_interval,
54
+ backoff_factor: backoff_factor,
55
+ retry_statuses: retry_statuses,
56
+ retry_methods: retry_methods, http_callback: http_callback,
57
+ environment: environment, url: url,
58
+ basic_auth_credentials: basic_auth_credentials,
59
+ bearer_token_credentials: bearer_token_credentials
60
+ )
61
+ else
62
+ config
63
+ end
64
+
65
+ @global_configuration = GlobalConfiguration.new(client_configuration: @config)
66
+ .base_uri_executor(@config.method(:get_base_uri))
67
+ .global_errors(BaseController::GLOBAL_ERRORS)
68
+ .user_agent(BaseController.user_agent)
69
+
70
+ initialize_auth_managers(@global_configuration)
71
+ @global_configuration = @global_configuration.auth_managers(@auth_managers)
72
+ end
73
+
74
+ # Initializes the auth managers hash used for authenticating API calls.
75
+ # @param [GlobalConfiguration] global_config The global configuration of the SDK)
76
+ def initialize_auth_managers(global_config)
77
+ @auth_managers = {}
78
+ http_client_config = global_config.client_configuration
79
+ %w[BasicAuth BearerToken].each { |auth| @auth_managers[auth] = nil }
80
+ @auth_managers['BasicAuth'] = BasicAuth.new(http_client_config.basic_auth_credentials)
81
+ @auth_managers['BearerToken'] = BearerToken.new(http_client_config.bearer_token_credentials,
82
+ global_config)
83
+ end
84
+ end
85
+ end
@@ -0,0 +1,117 @@
1
+ # shell_card_management_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module ShellCardManagementApIs
7
+ # An enum for SDK environments.
8
+ class Environment
9
+ ENVIRONMENT = [
10
+ PRODUCTION = 'production'.freeze
11
+ ].freeze
12
+ end
13
+
14
+ # An enum for API servers.
15
+ class Server
16
+ SERVER = [
17
+ DEFAULT = 'default'.freeze,
18
+ ACCESS_TOKEN_SERVER = 'access token server'.freeze
19
+ ].freeze
20
+ end
21
+
22
+ # All configuration including auth info and base URI for the API access
23
+ # are configured in this class.
24
+ class Configuration < CoreLibrary::HttpClientConfiguration
25
+ # The attribute readers for properties.
26
+ attr_reader :environment, :url, :basic_auth_credentials,
27
+ :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::PRODUCTION,
39
+ url: UrlEnum::ENUM_APITESTSHELLCOMTEST, basic_auth_credentials: nil,
40
+ bearer_token_credentials: nil
41
+ )
42
+
43
+ super connection: connection, adapter: adapter, timeout: timeout,
44
+ max_retries: max_retries, retry_interval: retry_interval,
45
+ backoff_factor: backoff_factor, retry_statuses: retry_statuses,
46
+ retry_methods: retry_methods, http_callback: http_callback
47
+
48
+ # Current API environment
49
+ @environment = String(environment)
50
+
51
+ # This variable specifies the type of environment. Environments: * `api.shell.com` - Production * `api-test.shell.com` - SIT
52
+ @url = url
53
+
54
+ # The object holding Basic Authentication credentials
55
+ @basic_auth_credentials = basic_auth_credentials
56
+
57
+ # The object holding OAuth 2 Client Credentials Grant credentials
58
+ @bearer_token_credentials = bearer_token_credentials
59
+
60
+ # The Http Client to use for making requests.
61
+ set_http_client CoreLibrary::FaradayClient.new(self)
62
+ end
63
+
64
+ def clone_with(connection: nil, adapter: nil, timeout: nil,
65
+ max_retries: nil, retry_interval: nil, backoff_factor: nil,
66
+ retry_statuses: nil, retry_methods: nil, http_callback: nil,
67
+ environment: nil, url: nil, basic_auth_credentials: nil,
68
+ bearer_token_credentials: nil)
69
+ connection ||= self.connection
70
+ adapter ||= self.adapter
71
+ timeout ||= self.timeout
72
+ max_retries ||= self.max_retries
73
+ retry_interval ||= self.retry_interval
74
+ backoff_factor ||= self.backoff_factor
75
+ retry_statuses ||= self.retry_statuses
76
+ retry_methods ||= self.retry_methods
77
+ http_callback ||= self.http_callback
78
+ environment ||= self.environment
79
+ url ||= self.url
80
+ basic_auth_credentials ||= self.basic_auth_credentials
81
+ bearer_token_credentials ||= self.bearer_token_credentials
82
+
83
+ Configuration.new(connection: connection, adapter: adapter,
84
+ timeout: timeout, max_retries: max_retries,
85
+ retry_interval: retry_interval,
86
+ backoff_factor: backoff_factor,
87
+ retry_statuses: retry_statuses,
88
+ retry_methods: retry_methods,
89
+ http_callback: http_callback, environment: environment,
90
+ url: url,
91
+ basic_auth_credentials: basic_auth_credentials,
92
+ bearer_token_credentials: bearer_token_credentials)
93
+ end
94
+
95
+
96
+ # All the environments the SDK can run in.
97
+ ENVIRONMENTS = {
98
+ Environment::PRODUCTION => {
99
+ Server::DEFAULT => 'https://{url}',
100
+ Server::ACCESS_TOKEN_SERVER => 'https://api-test.shell.com/v1/oauth'
101
+ }
102
+ }.freeze
103
+
104
+ # Generates the appropriate base URI for the environment and the server.
105
+ # @param [Configuration::Server] server The server enum for which the base URI is
106
+ # required.
107
+ # @return [String] The base URI.
108
+ def get_base_uri(server = Server::DEFAULT)
109
+ parameters = {
110
+ 'url' => { 'value' => url, 'encode' => false }
111
+ }
112
+ APIHelper.append_url_with_template_parameters(
113
+ ENVIRONMENTS[environment][server], parameters
114
+ )
115
+ end
116
+ end
117
+ end
@@ -0,0 +1,66 @@
1
+ # shell_card_management_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module ShellCardManagementApIs
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