wesley-key-sdk 3.0.7 → 4.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +156 -132
  3. data/bin/console +4 -4
  4. data/lib/webhooks_and_callbacks_api/api_helper.rb +10 -0
  5. data/lib/{cypress_test_api/controllers/base_controller.rb → webhooks_and_callbacks_api/apis/base_api.rb} +17 -10
  6. data/lib/webhooks_and_callbacks_api/apis/orders_api.rb +34 -0
  7. data/lib/webhooks_and_callbacks_api/client.rb +76 -0
  8. data/lib/{cypress_test_api → webhooks_and_callbacks_api}/configuration.rb +61 -46
  9. data/lib/webhooks_and_callbacks_api/events/callbacks/callbacks_a_handler.rb +66 -0
  10. data/lib/webhooks_and_callbacks_api/events/callbacks/callbacks_b_handler.rb +78 -0
  11. data/lib/webhooks_and_callbacks_api/events/signature_verification_failure.rb +33 -0
  12. data/lib/webhooks_and_callbacks_api/events/signature_verification_result.rb +14 -0
  13. data/lib/webhooks_and_callbacks_api/events/unknown_event.rb +32 -0
  14. data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_a_handler.rb +67 -0
  15. data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_b_handler.rb +86 -0
  16. data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_c_handler.rb +79 -0
  17. data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_handler.rb +67 -0
  18. data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_no_verification_handler.rb +39 -0
  19. data/lib/{cypress_test_api → webhooks_and_callbacks_api}/exceptions/api_exception.rb +4 -4
  20. data/lib/webhooks_and_callbacks_api/exceptions/error_exception.rb +57 -0
  21. data/lib/webhooks_and_callbacks_api/http/api_response.rb +19 -0
  22. data/lib/webhooks_and_callbacks_api/http/auth/api_key.rb +52 -0
  23. data/lib/webhooks_and_callbacks_api/http/auth/bearer_auth.rb +53 -0
  24. data/lib/webhooks_and_callbacks_api/http/http_call_back.rb +10 -0
  25. data/lib/webhooks_and_callbacks_api/http/http_method_enum.rb +10 -0
  26. data/lib/webhooks_and_callbacks_api/http/http_request.rb +10 -0
  27. data/lib/webhooks_and_callbacks_api/http/http_response.rb +10 -0
  28. data/lib/{cypress_test_api → webhooks_and_callbacks_api}/http/proxy_settings.rb +4 -4
  29. data/lib/webhooks_and_callbacks_api/logging/configuration/api_logging_configuration.rb +186 -0
  30. data/lib/webhooks_and_callbacks_api/logging/sdk_logger.rb +17 -0
  31. data/lib/webhooks_and_callbacks_api/models/address.rb +114 -0
  32. data/lib/webhooks_and_callbacks_api/models/audit_log_event.rb +115 -0
  33. data/lib/{cypress_test_api → webhooks_and_callbacks_api}/models/base_model.rb +4 -4
  34. data/lib/webhooks_and_callbacks_api/models/create_order_request.rb +131 -0
  35. data/lib/webhooks_and_callbacks_api/models/delivery_details.rb +104 -0
  36. data/lib/webhooks_and_callbacks_api/models/email_notification_callback.rb +97 -0
  37. data/lib/webhooks_and_callbacks_api/models/event.rb +52 -0
  38. data/lib/webhooks_and_callbacks_api/models/event_type.rb +26 -0
  39. data/lib/webhooks_and_callbacks_api/models/event_type1.rb +26 -0
  40. data/lib/webhooks_and_callbacks_api/models/event_type2.rb +26 -0
  41. data/lib/webhooks_and_callbacks_api/models/event_type3.rb +26 -0
  42. data/lib/webhooks_and_callbacks_api/models/fulfillment_callback.rb +411 -0
  43. data/lib/webhooks_and_callbacks_api/models/fulfillment_status.rb +40 -0
  44. data/lib/webhooks_and_callbacks_api/models/fulfillment_statuss.rb +40 -0
  45. data/lib/webhooks_and_callbacks_api/models/inventory_stock_decrease_event.rb +90 -0
  46. data/lib/webhooks_and_callbacks_api/models/inventory_stock_depleted_event.rb +90 -0
  47. data/lib/webhooks_and_callbacks_api/models/inventory_stock_increase_event.rb +90 -0
  48. data/lib/webhooks_and_callbacks_api/models/notification_callback.rb +119 -0
  49. data/lib/{cypress_test_api/models/o_auth_scope_o_auth_acg_enum.rb → webhooks_and_callbacks_api/models/oauth_scope_oauth_acg.rb} +19 -19
  50. data/lib/webhooks_and_callbacks_api/models/order.rb +161 -0
  51. data/lib/webhooks_and_callbacks_api/models/order_created_event.rb +314 -0
  52. data/lib/webhooks_and_callbacks_api/models/order_item.rb +102 -0
  53. data/lib/webhooks_and_callbacks_api/models/order_updated_event.rb +100 -0
  54. data/lib/webhooks_and_callbacks_api/models/package.rb +95 -0
  55. data/lib/webhooks_and_callbacks_api/models/payment_callback.rb +167 -0
  56. data/lib/webhooks_and_callbacks_api/models/payment_completed_event.rb +98 -0
  57. data/lib/webhooks_and_callbacks_api/models/payment_status.rb +40 -0
  58. data/lib/webhooks_and_callbacks_api/models/payment_status_created_event.rb +89 -0
  59. data/lib/webhooks_and_callbacks_api/models/payment_status_updated_event.rb +89 -0
  60. data/lib/webhooks_and_callbacks_api/models/primitive_collection_event.rb +98 -0
  61. data/lib/webhooks_and_callbacks_api/models/root_level_primitive_one_of_event_request.rb +40 -0
  62. data/lib/webhooks_and_callbacks_api/models/root_level_primitive_one_of_event_request1.rb +40 -0
  63. data/lib/webhooks_and_callbacks_api/models/sms_notification_callback.rb +95 -0
  64. data/lib/webhooks_and_callbacks_api/models/status.rb +44 -0
  65. data/lib/webhooks_and_callbacks_api/models/status1.rb +36 -0
  66. data/lib/webhooks_and_callbacks_api/models/status2.rb +36 -0
  67. data/lib/webhooks_and_callbacks_api/models/system_alert_notification_event.rb +90 -0
  68. data/lib/webhooks_and_callbacks_api/models/system_maintenance_notification_event.rb +90 -0
  69. data/lib/webhooks_and_callbacks_api/models/system_performance_notification_event.rb +90 -0
  70. data/lib/webhooks_and_callbacks_api/models/user_action_notification_event.rb +90 -0
  71. data/lib/webhooks_and_callbacks_api/models/user_preference_notification_event.rb +90 -0
  72. data/lib/webhooks_and_callbacks_api/models/user_status_notification_event.rb +90 -0
  73. data/lib/webhooks_and_callbacks_api/models/webhook.rb +142 -0
  74. data/lib/webhooks_and_callbacks_api/models/webhook_registration.rb +103 -0
  75. data/lib/webhooks_and_callbacks_api/models/webhook_update.rb +105 -0
  76. data/lib/webhooks_and_callbacks_api/utilities/date_time_helper.rb +11 -0
  77. data/lib/{cypress_test_api → webhooks_and_callbacks_api}/utilities/file_wrapper.rb +4 -4
  78. data/lib/webhooks_and_callbacks_api/utilities/union_type_lookup.rb +172 -0
  79. data/lib/webhooks_and_callbacks_api.rb +122 -0
  80. metadata +78 -64
  81. data/lib/cypress_test_api/api_helper.rb +0 -10
  82. data/lib/cypress_test_api/client.rb +0 -58
  83. data/lib/cypress_test_api/controllers/api_controller.rb +0 -102
  84. data/lib/cypress_test_api/http/http_call_back.rb +0 -10
  85. data/lib/cypress_test_api/http/http_method_enum.rb +0 -10
  86. data/lib/cypress_test_api/http/http_request.rb +0 -10
  87. data/lib/cypress_test_api/http/http_response.rb +0 -10
  88. data/lib/cypress_test_api/models/custom_enum.rb +0 -40
  89. data/lib/cypress_test_api/models/deer.rb +0 -68
  90. data/lib/cypress_test_api/models/item.rb +0 -166
  91. data/lib/cypress_test_api/models/item_response.rb +0 -80
  92. data/lib/cypress_test_api/models/lion.rb +0 -68
  93. data/lib/cypress_test_api/models/message.rb +0 -68
  94. data/lib/cypress_test_api/models/message2.rb +0 -71
  95. data/lib/cypress_test_api/models/multiple_arrays_request.rb +0 -70
  96. data/lib/cypress_test_api/models/nac_tag.rb +0 -265
  97. data/lib/cypress_test_api/models/response_http400.rb +0 -62
  98. data/lib/cypress_test_api/models/response_http404.rb +0 -62
  99. data/lib/cypress_test_api/models/status11_enum.rb +0 -40
  100. data/lib/cypress_test_api/models/status1_enum.rb +0 -40
  101. data/lib/cypress_test_api/models/status_enum.rb +0 -40
  102. data/lib/cypress_test_api/models/tokens_request.rb +0 -60
  103. data/lib/cypress_test_api/utilities/date_time_helper.rb +0 -11
  104. data/lib/cypress_test_api.rb +0 -55
  105. data/test/controllers/controller_test_base.rb +0 -23
  106. data/test/controllers/test_api_controller.rb +0 -40
  107. data/test/http_response_catcher.rb +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 784656e06493786bdbd19fb9edb6c3937440703f401e611933de3aa5974cd64e
4
- data.tar.gz: ef76250bba23b0a785aaca63c02cf83dc271fc29fd7346f83a248e24221ff13a
3
+ metadata.gz: 652b3d8c0bcd744134cd8fd75b9f16e6b8a8839fcaf4157bac5cb623cbb0920d
4
+ data.tar.gz: 8766ff7d24d3165448c491b1ef34683d1eed1bfcb5d30badc45e9f5f56b6b1d4
5
5
  SHA512:
6
- metadata.gz: fc1de4713f9f89bc8dd517e1350676182f963069cf431639e87ab5befc55cdf39fbedec5bc37db700ffdfabac478ba15ebd107df8e94c8dc5da45085102f5021
7
- data.tar.gz: 955843f36310a6a95479a3a7eb523c41c0acba470583c4d259eb3f6cd40e4e607bef83c33f8a81e7f1fe9ae8bfd772e6b9cd160ff2bb0579e784d5bf8cce79a2
6
+ metadata.gz: 310f1ef0edc523114ee0c04fe3bce8ef3d6cbcfaf3dba7a20211d8d58fce1b7e7e7a4c10cb8b634d0a055e7516a5464e1b0620b2e3385d48b9919db98e6a2824
7
+ data.tar.gz: c20f2ee17ab64d19ce313cfcf50f110461c4cc619638d0c433ff1d8f152da3abe0dc82dc6c8509bf6ead3ab33be2da7048bef3efc55f25b8d8f92797d9dcdac2
data/README.md CHANGED
@@ -1,144 +1,168 @@
1
-
2
- # Getting Started with Cypress Test API
3
-
4
- ## Introduction
5
-
6
- This is a sample API to demonstrate an OpenAPI spec with multiple endpoints and a custom model.
7
-
8
- ## Install the Package
9
-
10
- Install the gem from the command line:
11
-
12
- ```bash
13
- gem install wesley-key-sdk -v 3.0.7
14
- ```
15
-
16
- Or add the gem to your Gemfile and run `bundle`:
17
-
18
- ```ruby
19
- gem 'wesley-key-sdk', '3.0.7'
20
- ```
21
-
22
- For additional gem details, see the [RubyGems page for the wesley-key-sdk gem](https://rubygems.org/gems/wesley-key-sdk/versions/3.0.7).
23
-
24
- ## IRB Console Usage
25
-
26
- You can explore the SDK interactively using IRB in two ways
27
-
28
- ### 1. Use IRB with Installed Gem
29
-
30
- Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and type the following command to start the irb console.
31
-
32
- ```bash
33
- irb
34
- ```
35
-
36
- Now you can load the SDK in the IRB
37
-
38
- ```ruby
39
- require 'cypress_test_api'
40
- include CypressTestApi
41
- ```
42
-
43
- ### 2. Use IRB within SDK
44
-
45
- Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and navigate to the root folder of SDK.
46
-
47
- ```
48
- cd path/to/cypress_test_api
49
- ```
50
-
51
- Now you can start the preconfigured irb console by running the following command
52
-
53
- ```bash
54
- ruby bin/console
55
- ```
56
-
57
- **_Note:_** This automatically loads the SDK from lib/
58
-
59
- ## Test the SDK
60
-
61
- To run the tests, navigate to the root directory of the SDK in your terminal and execute the following command:
62
-
63
- ```
64
- rake
65
- ```
66
-
67
- ## Initialize the API Client
68
-
69
- **_Note:_** Documentation for the client can be found [here.](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/3.0.7/doc/client.md)
70
-
71
- The following parameters are configurable for the API Client:
72
-
73
- | Parameter | Type | Description |
74
- | --- | --- | --- |
75
- | default_host | `String` | *Default*: `'www.example.com'` |
76
- | environment | [`Environment`](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/3.0.7/README.md#environments) | The API environment. <br> **Default: `Environment.PRODUCTION`** |
77
- | connection | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
78
- | adapter | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
79
- | timeout | `Float` | The value to use for connection timeout. <br> **Default: 60** |
80
- | max_retries | `Integer` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
81
- | retry_interval | `Float` | Pause in seconds between retries. <br> **Default: 1** |
82
- | backoff_factor | `Float` | The amount to multiply each successive retry's interval amount by in order to provide backoff. <br> **Default: 2** |
83
- | retry_statuses | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
84
- | retry_methods | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put]** |
85
- | http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
86
- | proxy_settings | [`ProxySettings`](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/3.0.7/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
87
-
88
- The API client can be initialized as follows:
89
-
90
- ### Code-Based Client Initialization
91
-
92
- ```ruby
93
- require 'cypress_test_api'
94
- include CypressTestApi
1
+
2
+ # Getting Started with Webhooks and Callbacks API
3
+
4
+ ## Introduction
5
+
6
+ A comprehensive API demonstrating webhooks and callbacks patterns.
7
+
8
+ ### Webhooks
9
+
10
+ Webhooks allow your application to receive real-time notifications when certain events occur.
11
+
12
+ ### Callbacks
13
+
14
+ Callbacks are used for asynchronous operations where the API will call back to your provided URL when the operation completes.
15
+
16
+ ## Install the Package
17
+
18
+ Install the gem from the command line:
19
+
20
+ ```bash
21
+ gem install wesley-key-sdk -v 4.3.1
22
+ ```
23
+
24
+ Or add the gem to your Gemfile and run `bundle`:
25
+
26
+ ```ruby
27
+ gem 'wesley-key-sdk', '4.3.1'
28
+ ```
29
+
30
+ For additional gem details, see the [RubyGems page for the wesley-key-sdk gem](https://rubygems.org/gems/wesley-key-sdk/versions/4.3.1).
31
+
32
+ ## IRB Console Usage
33
+
34
+ You can explore the SDK interactively using IRB in two ways
35
+
36
+ ### 1. Use IRB with Installed Gem
37
+
38
+ Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and type the following command to start the irb console.
39
+
40
+ ```bash
41
+ irb
42
+ ```
43
+
44
+ Now you can load the SDK in the IRB
45
+
46
+ ```ruby
47
+ require 'webhooks_and_callbacks_api'
48
+ include WebhooksAndCallbacksApi
49
+ ```
50
+
51
+ ### 2. Use IRB within SDK
52
+
53
+ Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and navigate to the root folder of SDK.
54
+
55
+ ```
56
+ cd path/to/webhooks_and_callbacks_api
57
+ ```
58
+
59
+ Now you can start the preconfigured irb console by running the following command
60
+
61
+ ```bash
62
+ ruby bin/console
63
+ ```
64
+
65
+ **_Note:_** This automatically loads the SDK from lib/
66
+
67
+ ## Initialize the API Client
68
+
69
+ **_Note:_** Documentation for the client can be found [here.](doc/client.md)
70
+
71
+ The following parameters are configurable for the API Client:
72
+
73
+ | Parameter | Type | Description |
74
+ | --- | --- | --- |
75
+ | connection | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
76
+ | adapter | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
77
+ | timeout | `Float` | The value to use for connection timeout. <br> **Default: 50** |
78
+ | max_retries | `Integer` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
79
+ | retry_interval | `Float` | Pause in seconds between retries. <br> **Default: 1** |
80
+ | backoff_factor | `Float` | The amount to multiply each successive retry's interval amount by in order to provide backoff. <br> **Default: 2** |
81
+ | retry_statuses | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
82
+ | retry_methods | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put get put]** |
83
+ | http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
84
+ | proxy_settings | [`ProxySettings`](doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
85
+ | logging_configuration | [`LoggingConfiguration`](doc/logging-configuration.md) | The SDK logging configuration for API calls |
86
+ | api_key_credentials | [`ApiKeyCredentials`](doc/auth/custom-header-signature.md) | The credential object for Custom Header Signature |
87
+ | bearer_auth_credentials | [`BearerAuthCredentials`](doc/auth/oauth-2-bearer-token.md) | The credential object for OAuth 2 Bearer token |
88
+
89
+ The API client can be initialized as follows:
90
+
91
+ ### Code-Based Client Initialization
92
+
93
+ ```ruby
94
+ require 'webhooks_and_callbacks_api'
95
+ include WebhooksAndCallbacksApi
95
96
 
96
97
  client = Client.new(
97
- environment: Environment::PRODUCTION,
98
- default_host: 'www.example.com'
99
- )
100
- ```
101
-
102
- ### Environment-Based Client Initialization
103
-
104
- ```ruby
105
- require 'cypress_test_api'
106
- include CypressTestApi
98
+ api_key_credentials: ApiKeyCredentials.new(
99
+ x_api_key: 'X-API-Key'
100
+ ),
101
+ bearer_auth_credentials: BearerAuthCredentials.new(
102
+ access_token: 'AccessToken'
103
+ ),
104
+ logging_configuration: LoggingConfiguration.new(
105
+ log_level: Logger::INFO,
106
+ request_logging_config: RequestLoggingConfiguration.new(
107
+ log_body: true
108
+ ),
109
+ response_logging_config: ResponseLoggingConfiguration.new(
110
+ log_headers: true
111
+ )
112
+ )
113
+ )
114
+ ```
115
+
116
+ ### Environment-Based Client Initialization
117
+
118
+ ```ruby
119
+ require 'webhooks_and_callbacks_api'
120
+ include WebhooksAndCallbacksApi
107
121
 
108
122
  # Create client from environment
109
- client = Client.from_env
110
- ```
111
-
112
- See the [`Environment-Based Client Initialization`](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/3.0.7/doc/environment-based-client-initialization.md) section for details.
113
-
114
- ## Environments
115
-
116
- The SDK can be configured to use a different environment for making API calls. Available environments are:
117
-
118
- ### Fields
119
-
120
- | Name | Description |
121
- | --- | --- |
122
- | PRODUCTION | **Default** |
123
-
124
- ## List of APIs
125
-
126
- * [API](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/3.0.7/doc/controllers/api.md)
127
-
128
- ## SDK Infrastructure
129
-
123
+ client = Client.from_env
124
+ ```
125
+
126
+ See the [`Environment-Based Client Initialization`](doc/environment-based-client-initialization.md) section for details.
127
+
128
+ ## Authorization
129
+
130
+ This API uses the following authentication schemes.
131
+
132
+ * [`ApiKey (Custom Header Signature)`](doc/auth/custom-header-signature.md)
133
+ * [`BearerAuth (OAuth 2 Bearer token)`](doc/auth/oauth-2-bearer-token.md)
134
+
135
+ ## List of APIs
136
+
137
+ * [Orders](doc/controllers/orders.md)
138
+
139
+ ## Webhooks
140
+
141
+ * [Webhooks](doc/events/webhooks/webhooks-handler.md)
142
+ * [Webhooks A](doc/events/webhooks/webhooks-a-handler.md)
143
+ * [Webhooks B](doc/events/webhooks/webhooks-b-handler.md)
144
+ * [Webhooks C](doc/events/webhooks/webhooks-c-handler.md)
145
+ * [Webhooks No Verification](doc/events/webhooks/webhooks-no-verification-handler.md)
146
+
147
+ ## SDK Infrastructure
148
+
130
149
  ### Configuration
131
150
 
132
- * [ProxySettings](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/3.0.7/doc/proxy-settings.md)
133
- * [Environment-Based Client Initialization](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/3.0.7/doc/environment-based-client-initialization.md)
151
+ * [ProxySettings](doc/proxy-settings.md)
152
+ * [Environment-Based Client Initialization](doc/environment-based-client-initialization.md)
153
+ * [AbstractLogger](doc/abstract-logger.md)
154
+ * [LoggingConfiguration](doc/logging-configuration.md)
155
+ * [RequestLoggingConfiguration](doc/request-logging-configuration.md)
156
+ * [ResponseLoggingConfiguration](doc/response-logging-configuration.md)
134
157
 
135
158
  ### HTTP
136
159
 
137
- * [HttpResponse](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/3.0.7/doc/http-response.md)
138
- * [HttpRequest](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/3.0.7/doc/http-request.md)
160
+ * [HttpResponse](doc/http-response.md)
161
+ * [HttpRequest](doc/http-request.md)
139
162
 
140
163
  ### Utilities
141
164
 
142
- * [ApiHelper](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/3.0.7/doc/api-helper.md)
143
- * [DateTimeHelper](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/3.0.7/doc/date-time-helper.md)
144
-
165
+ * [ApiResponse](doc/api-response.md)
166
+ * [ApiHelper](doc/api-helper.md)
167
+ * [DateTimeHelper](doc/date-time-helper.md)
168
+
data/bin/console CHANGED
@@ -4,11 +4,11 @@
4
4
  $LOAD_PATH.unshift(File.expand_path('../lib', __dir__))
5
5
 
6
6
  # Require the gem
7
- require 'cypress_test_api'
7
+ require 'webhooks_and_callbacks_api'
8
8
 
9
- puts 'CypressTestApi SDK loaded!'
10
- puts 'You can now create a client with: client = CypressTestApi::Client.new'
11
- puts 'Or use from_env: client = CypressTestApi::Client.from_env'
9
+ puts 'WebhooksAndCallbacksApi SDK loaded!'
10
+ puts 'You can now create a client with: client = WebhooksAndCallbacksApi::Client.new'
11
+ puts 'Or use from_env: client = WebhooksAndCallbacksApi::Client.from_env'
12
12
 
13
13
  # Start an interactive IRB session
14
14
  require 'irb'
@@ -0,0 +1,10 @@
1
+ # webhooks_and_callbacks_api
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module WebhooksAndCallbacksApi
7
+ # API utility class
8
+ class APIHelper < CoreLibrary::ApiHelper
9
+ end
10
+ end
@@ -1,23 +1,30 @@
1
- # cypress_test_api
1
+ # webhooks_and_callbacks_api
2
2
  #
3
- # This file was automatically generated by APIMATIC v3.0
4
- # ( https://www.apimatic.io ).
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
5
 
6
- module CypressTestApi
7
- # BaseController.
8
- class BaseController
6
+ module WebhooksAndCallbacksApi
7
+ # BaseApi.
8
+ class BaseApi
9
9
  include CoreLibrary
10
10
  attr_accessor :config, :http_call_back
11
11
 
12
- def self.user_agent
13
- 'APIMATIC 3.0'
12
+ def self.user_agent
13
+ 'Ruby-SDK/4.3.1 (OS: {os-info}, Engine: {engine}/{engine-version})'
14
14
  end
15
15
 
16
+ def self.user_agent_parameters
17
+ {
18
+ '{engine}' => { 'value' => RUBY_ENGINE, 'encode' => false },
19
+ '{engine-version}' => { 'value' => RUBY_ENGINE_VERSION, 'encode' => false },
20
+ '{os-info}' => { 'value' => RUBY_PLATFORM, 'encode' => false }
21
+ }
22
+ end
16
23
 
17
- GLOBAL_ERRORS = {
24
+ GLOBAL_ERRORS = {
18
25
  'default' => ErrorCase.new
19
26
  .error_message('HTTP response not OK.')
20
- .exception_type(APIException)
27
+ .exception_type(APIException)
21
28
  }.freeze
22
29
 
23
30
  # Initialization constructor.
@@ -0,0 +1,34 @@
1
+ # webhooks_and_callbacks_api
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module WebhooksAndCallbacksApi
7
+ # OrdersApi
8
+ class OrdersApi < BaseApi
9
+ # Creates a new order and triggers callbacks for payment processing
10
+ # @param [CreateOrderRequest] body Required parameter: TODO: type
11
+ # description here
12
+ # @return [ApiResponse] Complete http response with raw body and status code.
13
+ def create_order(body)
14
+ @api_call
15
+ .request(new_request_builder(HttpMethodEnum::POST,
16
+ '/orders',
17
+ Server::DEFAULT)
18
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
19
+ .body_param(new_parameter(body)
20
+ .is_required(true))
21
+ .header_param(new_parameter('application/json', key: 'accept'))
22
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
23
+ .auth(Or.new('ApiKey', 'BearerAuth')))
24
+ .response(new_response_handler
25
+ .deserializer(APIHelper.method(:custom_type_deserializer))
26
+ .deserialize_into(Order.method(:from_hash))
27
+ .is_api_response(true)
28
+ .local_error('400',
29
+ 'Invalid request',
30
+ ErrorException))
31
+ .execute
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,76 @@
1
+ # webhooks_and_callbacks_api
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module WebhooksAndCallbacksApi
7
+ # webhooks_and_callbacks_api client class.
8
+ class Client
9
+ include CoreLibrary
10
+ attr_reader :config, :auth_managers
11
+
12
+ def user_agent_detail
13
+ config.user_agent_detail
14
+ end
15
+
16
+ # Access to orders controller.
17
+ # @return [OrdersApi] Returns the controller instance.
18
+ def orders
19
+ @orders ||= OrdersApi.new @global_configuration
20
+ end
21
+
22
+ def initialize(
23
+ connection: nil, adapter: :net_http_persistent, timeout: 50,
24
+ max_retries: 0, retry_interval: 1, backoff_factor: 2,
25
+ retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
26
+ retry_methods: %i[get put get put], http_callback: nil,
27
+ proxy_settings: nil, logging_configuration: nil,
28
+ environment: Environment::PRODUCTION, api_key_credentials: nil,
29
+ bearer_auth_credentials: nil, config: nil
30
+ )
31
+ @config = if config.nil?
32
+ Configuration.new(
33
+ connection: connection, adapter: adapter, timeout: timeout,
34
+ max_retries: max_retries, retry_interval: retry_interval,
35
+ backoff_factor: backoff_factor,
36
+ retry_statuses: retry_statuses,
37
+ retry_methods: retry_methods, http_callback: http_callback,
38
+ proxy_settings: proxy_settings,
39
+ logging_configuration: logging_configuration,
40
+ environment: environment,
41
+ api_key_credentials: api_key_credentials,
42
+ bearer_auth_credentials: bearer_auth_credentials
43
+ )
44
+ else
45
+ config
46
+ end
47
+ user_agent_params = BaseApi.user_agent_parameters
48
+
49
+ @global_configuration = GlobalConfiguration.new(client_configuration: @config)
50
+ .base_uri_executor(@config.method(:get_base_uri))
51
+ .global_errors(BaseApi::GLOBAL_ERRORS)
52
+ .user_agent(BaseApi.user_agent,
53
+ agent_parameters: user_agent_params)
54
+
55
+ initialize_auth_managers(@global_configuration)
56
+ @global_configuration = @global_configuration.auth_managers(@auth_managers)
57
+ end
58
+
59
+ # Initializes the auth managers hash used for authenticating API calls.
60
+ # @param [GlobalConfiguration] global_config The global configuration of the SDK)
61
+ def initialize_auth_managers(global_config)
62
+ @auth_managers = {}
63
+ http_client_config = global_config.client_configuration
64
+ %w[ApiKey BearerAuth].each { |auth| @auth_managers[auth] = nil }
65
+ @auth_managers['ApiKey'] = ApiKey.new(http_client_config.api_key_credentials)
66
+ @auth_managers['BearerAuth'] = BearerAuth.new(http_client_config.bearer_auth_credentials)
67
+ end
68
+
69
+ # Creates a client directly from environment variables.
70
+ def self.from_env(**overrides)
71
+ default_config = Configuration.build_default_config_from_env
72
+ new_config = default_config.clone_with(**overrides)
73
+ new(config: new_config)
74
+ end
75
+ end
76
+ end