growwer 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +57 -4
  3. data/docs/AccountApi.md +1 -1
  4. data/docs/AdvanceTestOrderRequest.md +18 -0
  5. data/docs/BalanceLowEventData.md +20 -0
  6. data/docs/BalanceLowEventDataWallet.md +20 -0
  7. data/docs/CatalogueApi.md +2 -2
  8. data/docs/CreateWebhookRequest.md +24 -0
  9. data/docs/GetMe200Response.md +3 -1
  10. data/docs/ListWebhookDeliveries200Response.md +20 -0
  11. data/docs/ListWebhooks200Response.md +20 -0
  12. data/docs/OrderEventData.md +18 -0
  13. data/docs/TestHelpersApi.md +222 -0
  14. data/docs/TopUpTestWallet200Response.md +20 -0
  15. data/docs/TopUpTestWalletRequest.md +18 -0
  16. data/docs/UpdateWebhookRequest.md +26 -0
  17. data/docs/Webhook.md +38 -0
  18. data/docs/WebhookDelivery.md +32 -0
  19. data/docs/WebhookDeliveryAttempt.md +26 -0
  20. data/docs/WebhookEvent.md +28 -0
  21. data/docs/WebhookEventData.md +51 -0
  22. data/docs/WebhookEventType.md +15 -0
  23. data/docs/WebhookTestEventData.md +18 -0
  24. data/docs/WebhookWithSecret.md +40 -0
  25. data/docs/WebhooksApi.md +662 -0
  26. data/growwer.gemspec +1 -1
  27. data/lib/growwer/api/account_api.rb +3 -3
  28. data/lib/growwer/api/buyer_orders_api.rb +1 -1
  29. data/lib/growwer/api/buyer_wallet_api.rb +1 -1
  30. data/lib/growwer/api/catalogue_api.rb +5 -5
  31. data/lib/growwer/api/files_api.rb +1 -1
  32. data/lib/growwer/api/managed_services_api.rb +1 -1
  33. data/lib/growwer/api/projects_api.rb +1 -1
  34. data/lib/growwer/api/saved_filters_api.rb +1 -1
  35. data/lib/growwer/api/seller_account_api.rb +1 -1
  36. data/lib/growwer/api/seller_medias_api.rb +1 -1
  37. data/lib/growwer/api/seller_orders_api.rb +1 -1
  38. data/lib/growwer/api/seller_wallet_api.rb +1 -1
  39. data/lib/growwer/api/test_helpers_api.rb +254 -0
  40. data/lib/growwer/api/webhooks_api.rb +707 -0
  41. data/lib/growwer/api_client.rb +2 -2
  42. data/lib/growwer/api_error.rb +1 -1
  43. data/lib/growwer/api_model_base.rb +1 -1
  44. data/lib/growwer/configuration.rb +1 -1
  45. data/lib/growwer/models/advance_test_order_request.rb +189 -0
  46. data/lib/growwer/models/balance.rb +1 -1
  47. data/lib/growwer/models/balance_low_event_data.rb +192 -0
  48. data/lib/growwer/models/balance_low_event_data_wallet.rb +192 -0
  49. data/lib/growwer/models/catalogue_media.rb +1 -1
  50. data/lib/growwer/models/catalogue_media_flash_offer.rb +1 -1
  51. data/lib/growwer/models/catalogue_media_metrics.rb +1 -1
  52. data/lib/growwer/models/catalogue_offer.rb +1 -1
  53. data/lib/growwer/models/catalogue_offer_or_null.rb +1 -1
  54. data/lib/growwer/models/catalogue_post_offer.rb +1 -1
  55. data/lib/growwer/models/catalogue_post_offer_all_of_extras.rb +1 -1
  56. data/lib/growwer/models/catalogue_post_offer_all_of_extras_sensitive_topic.rb +1 -1
  57. data/lib/growwer/models/code_name.rb +1 -1
  58. data/lib/growwer/models/count_saved_filter_medias200_response.rb +1 -1
  59. data/lib/growwer/models/create_project_request.rb +1 -1
  60. data/lib/growwer/models/create_saved_filter_request.rb +1 -1
  61. data/lib/growwer/models/create_seller_media_request.rb +1 -1
  62. data/lib/growwer/models/create_seller_media_request_post_offer.rb +1 -1
  63. data/lib/growwer/models/create_webhook_request.rb +248 -0
  64. data/lib/growwer/models/error.rb +1 -1
  65. data/lib/growwer/models/get_buyer_wallet200_response.rb +1 -1
  66. data/lib/growwer/models/get_me200_response.rb +57 -20
  67. data/lib/growwer/models/get_me200_response_buyer.rb +1 -1
  68. data/lib/growwer/models/get_me200_response_catalogue.rb +1 -1
  69. data/lib/growwer/models/get_me200_response_managed_service.rb +1 -1
  70. data/lib/growwer/models/get_me200_response_seller.rb +2 -1
  71. data/lib/growwer/models/get_seller_wallet200_response.rb +1 -1
  72. data/lib/growwer/models/get_vocabulary200_response.rb +1 -1
  73. data/lib/growwer/models/get_vocabulary200_response_topics_inner.rb +1 -1
  74. data/lib/growwer/models/invoice.rb +1 -1
  75. data/lib/growwer/models/link_addition_order_briefing.rb +1 -1
  76. data/lib/growwer/models/link_addition_order_briefing_request.rb +1 -1
  77. data/lib/growwer/models/list_buyer_transactions200_response.rb +1 -1
  78. data/lib/growwer/models/list_flash_offers200_response.rb +1 -1
  79. data/lib/growwer/models/list_invoices200_response.rb +1 -1
  80. data/lib/growwer/models/list_managed_service_campaigns200_response.rb +1 -1
  81. data/lib/growwer/models/list_managed_service_proposals200_response.rb +1 -1
  82. data/lib/growwer/models/list_orders200_response.rb +1 -1
  83. data/lib/growwer/models/list_projects200_response.rb +1 -1
  84. data/lib/growwer/models/list_saved_filters200_response.rb +1 -1
  85. data/lib/growwer/models/list_seller_medias200_response.rb +1 -1
  86. data/lib/growwer/models/list_seller_orders200_response.rb +1 -1
  87. data/lib/growwer/models/list_seller_transactions200_response.rb +1 -1
  88. data/lib/growwer/models/list_webhook_deliveries200_response.rb +192 -0
  89. data/lib/growwer/models/list_webhooks200_response.rb +192 -0
  90. data/lib/growwer/models/list_withdrawals200_response.rb +1 -1
  91. data/lib/growwer/models/managed_service_campaign.rb +1 -1
  92. data/lib/growwer/models/managed_service_campaign_project.rb +1 -1
  93. data/lib/growwer/models/managed_service_campaign_proposal_counts.rb +1 -1
  94. data/lib/growwer/models/managed_service_campaign_strategy.rb +1 -1
  95. data/lib/growwer/models/managed_service_proposal.rb +1 -1
  96. data/lib/growwer/models/managed_service_proposal_briefing.rb +1 -1
  97. data/lib/growwer/models/managed_service_proposal_briefing_links_inner.rb +1 -1
  98. data/lib/growwer/models/managed_service_proposal_media.rb +1 -1
  99. data/lib/growwer/models/managed_service_proposal_review.rb +1 -1
  100. data/lib/growwer/models/managed_service_proposal_review_request.rb +1 -1
  101. data/lib/growwer/models/managed_service_proposal_review_request_reviews_inner.rb +1 -1
  102. data/lib/growwer/models/managed_service_proposals_estimate.rb +1 -1
  103. data/lib/growwer/models/managed_service_proposals_estimate_request.rb +1 -1
  104. data/lib/growwer/models/managed_service_request.rb +1 -1
  105. data/lib/growwer/models/managed_service_request_sent.rb +1 -1
  106. data/lib/growwer/models/money.rb +1 -1
  107. data/lib/growwer/models/money_or_null.rb +1 -1
  108. data/lib/growwer/models/order.rb +1 -1
  109. data/lib/growwer/models/order_action_reason.rb +1 -1
  110. data/lib/growwer/models/order_briefing.rb +1 -1
  111. data/lib/growwer/models/order_channel.rb +1 -1
  112. data/lib/growwer/models/order_create_request.rb +1 -1
  113. data/lib/growwer/models/order_delivery.rb +1 -1
  114. data/lib/growwer/models/order_draft.rb +1 -1
  115. data/lib/growwer/models/order_estimate.rb +1 -1
  116. data/lib/growwer/models/order_estimate_request.rb +1 -1
  117. data/lib/growwer/models/order_estimate_request_briefing.rb +1 -1
  118. data/lib/growwer/models/order_event_data.rb +165 -0
  119. data/lib/growwer/models/order_link.rb +1 -1
  120. data/lib/growwer/models/order_link_request.rb +1 -1
  121. data/lib/growwer/models/order_media.rb +1 -1
  122. data/lib/growwer/models/order_project.rb +1 -1
  123. data/lib/growwer/models/order_state_history_inner.rb +1 -1
  124. data/lib/growwer/models/order_state_history_inner_reason.rb +1 -1
  125. data/lib/growwer/models/post_order_briefing.rb +1 -1
  126. data/lib/growwer/models/post_order_briefing_request.rb +1 -1
  127. data/lib/growwer/models/project.rb +1 -1
  128. data/lib/growwer/models/project_catalogue_media.rb +1 -1
  129. data/lib/growwer/models/project_catalogue_media_all_of_project.rb +1 -1
  130. data/lib/growwer/models/project_catalogue_media_all_of_project_ai_keywords.rb +1 -1
  131. data/lib/growwer/models/put_seller_holiday200_response.rb +1 -1
  132. data/lib/growwer/models/put_seller_holiday_request.rb +1 -1
  133. data/lib/growwer/models/request_medias201_response.rb +1 -1
  134. data/lib/growwer/models/request_medias_request.rb +1 -1
  135. data/lib/growwer/models/saved_filter.rb +1 -1
  136. data/lib/growwer/models/saved_filter_notifications.rb +1 -1
  137. data/lib/growwer/models/seller_fees.rb +1 -1
  138. data/lib/growwer/models/seller_fees_or_null.rb +1 -1
  139. data/lib/growwer/models/seller_media.rb +1 -1
  140. data/lib/growwer/models/seller_media_flash_offer.rb +1 -1
  141. data/lib/growwer/models/seller_media_link_addition_offer.rb +1 -1
  142. data/lib/growwer/models/seller_media_link_addition_offer_pricing_options_inner.rb +1 -1
  143. data/lib/growwer/models/seller_media_post_offer.rb +1 -1
  144. data/lib/growwer/models/seller_media_post_offer_pricing_options_inner.rb +1 -1
  145. data/lib/growwer/models/seller_order.rb +1 -1
  146. data/lib/growwer/models/seller_order_briefing.rb +1 -1
  147. data/lib/growwer/models/seller_order_channel.rb +1 -1
  148. data/lib/growwer/models/seller_order_draft.rb +1 -1
  149. data/lib/growwer/models/seller_order_draft_file.rb +1 -1
  150. data/lib/growwer/models/seller_order_post_delivery.rb +1 -1
  151. data/lib/growwer/models/seller_order_project.rb +1 -1
  152. data/lib/growwer/models/seller_order_refutation.rb +1 -1
  153. data/lib/growwer/models/seller_order_rejection.rb +1 -1
  154. data/lib/growwer/models/seller_order_rejection_reason.rb +1 -1
  155. data/lib/growwer/models/seller_post_order_briefing.rb +1 -1
  156. data/lib/growwer/models/seller_transaction.rb +1 -1
  157. data/lib/growwer/models/top_up_test_wallet200_response.rb +191 -0
  158. data/lib/growwer/models/top_up_test_wallet_request.rb +165 -0
  159. data/lib/growwer/models/transaction.rb +1 -1
  160. data/lib/growwer/models/update_project_request.rb +1 -1
  161. data/lib/growwer/models/update_seller_media_request.rb +1 -1
  162. data/lib/growwer/models/update_seller_media_request_extra_services_inner.rb +1 -1
  163. data/lib/growwer/models/update_seller_media_request_link_addition_offer.rb +1 -1
  164. data/lib/growwer/models/update_seller_media_request_link_addition_offer_pricing_options_inner.rb +1 -1
  165. data/lib/growwer/models/update_seller_media_request_post_offer.rb +1 -1
  166. data/lib/growwer/models/update_seller_media_request_post_offer_pricing_options_inner.rb +1 -1
  167. data/lib/growwer/models/update_webhook_request.rb +245 -0
  168. data/lib/growwer/models/upload_file201_response.rb +1 -1
  169. data/lib/growwer/models/webhook.rb +395 -0
  170. data/lib/growwer/models/webhook_delivery.rb +365 -0
  171. data/lib/growwer/models/webhook_delivery_attempt.rb +264 -0
  172. data/lib/growwer/models/webhook_event.rb +324 -0
  173. data/lib/growwer/models/webhook_event_data.rb +104 -0
  174. data/lib/growwer/models/webhook_event_type.rb +46 -0
  175. data/lib/growwer/models/webhook_test_event_data.rb +166 -0
  176. data/lib/growwer/models/webhook_with_secret.rb +413 -0
  177. data/lib/growwer/models/withdrawal.rb +1 -1
  178. data/lib/growwer/version.rb +2 -2
  179. data/lib/growwer.rb +21 -1
  180. data/spec/api/test_helpers_api_spec.rb +74 -0
  181. data/spec/api/webhooks_api_spec.rb +154 -0
  182. data/spec/models/advance_test_order_request_spec.rb +40 -0
  183. data/spec/models/balance_low_event_data_spec.rb +42 -0
  184. data/spec/models/balance_low_event_data_wallet_spec.rb +42 -0
  185. data/spec/models/create_webhook_request_spec.rb +54 -0
  186. data/spec/models/list_webhook_deliveries200_response_spec.rb +42 -0
  187. data/spec/models/list_webhooks200_response_spec.rb +42 -0
  188. data/spec/models/order_event_data_spec.rb +36 -0
  189. data/spec/models/top_up_test_wallet200_response_spec.rb +42 -0
  190. data/spec/models/top_up_test_wallet_request_spec.rb +36 -0
  191. data/spec/models/update_webhook_request_spec.rb +60 -0
  192. data/spec/models/webhook_delivery_attempt_spec.rb +64 -0
  193. data/spec/models/webhook_delivery_spec.rb +86 -0
  194. data/spec/models/webhook_event_data_spec.rb +32 -0
  195. data/spec/models/webhook_event_spec.rb +78 -0
  196. data/spec/models/webhook_event_type_spec.rb +30 -0
  197. data/spec/models/webhook_spec.rb +100 -0
  198. data/spec/models/webhook_test_event_data_spec.rb +36 -0
  199. data/spec/models/webhook_with_secret_spec.rb +106 -0
  200. data/spec/spec_helper.rb +1 -1
  201. metadata +82 -2
@@ -0,0 +1,662 @@
1
+ # Growwer::WebhooksApi
2
+
3
+ All URIs are relative to *https://tool.growwer.com*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**create_webhook**](WebhooksApi.md#create_webhook) | **POST** /api/v1/webhooks | Create a webhook subscription |
8
+ | [**delete_webhook**](WebhooksApi.md#delete_webhook) | **DELETE** /api/v1/webhooks/{id} | Delete a webhook subscription |
9
+ | [**get_webhook**](WebhooksApi.md#get_webhook) | **GET** /api/v1/webhooks/{id} | Get a webhook subscription |
10
+ | [**list_webhook_deliveries**](WebhooksApi.md#list_webhook_deliveries) | **GET** /api/v1/webhooks/{id}/deliveries | List the deliveries of a webhook subscription |
11
+ | [**list_webhooks**](WebhooksApi.md#list_webhooks) | **GET** /api/v1/webhooks | List your webhook subscriptions |
12
+ | [**redeliver_webhook**](WebhooksApi.md#redeliver_webhook) | **POST** /api/v1/webhooks/{id}/deliveries/{deliveryId}/redeliver | Redeliver a webhook event |
13
+ | [**rotate_webhook_secret**](WebhooksApi.md#rotate_webhook_secret) | **POST** /api/v1/webhooks/{id}/rotate-secret | Rotate a webhook secret |
14
+ | [**send_webhook_test**](WebhooksApi.md#send_webhook_test) | **POST** /api/v1/webhooks/{id}/test | Send a test event |
15
+ | [**update_webhook**](WebhooksApi.md#update_webhook) | **PATCH** /api/v1/webhooks/{id} | Edit a webhook subscription |
16
+
17
+
18
+ ## create_webhook
19
+
20
+ > <WebhookWithSecret> create_webhook(idempotency_key, create_webhook_request)
21
+
22
+ Create a webhook subscription
23
+
24
+ Subscribes an HTTPS URL to the events you list. Growwer then POSTs each event to it, signed as Standard Webhooks signs (`webhook-id`, `webhook-timestamp`, `webhook-signature`) with the `secret` this answer carries. The secret is shown only here and on POST /webhooks/{id}/rotate-secret: store it now. A replay of this request under its `Idempotency-Key` answers the subscription without it. The URL must be HTTPS and its host must resolve to public addresses only: a loopback, private, link-local, multicast or metadata address is refused with 422 `webhook_url_not_public`, a host that does not resolve with 422 `webhook_url_unresolvable`. `lowBalanceThreshold` is required with `balance.low` and refused without it. An account has at most 20 subscriptions per mode. A test key subscribes in test mode: its subscriptions get the events of its test orders and test wallet, never live ones.
25
+
26
+ ### Examples
27
+
28
+ ```ruby
29
+ require 'time'
30
+ require 'growwer'
31
+ # setup authorization
32
+ Growwer.configure do |config|
33
+ # Configure Bearer authorization: apiKey
34
+ config.access_token = 'YOUR_BEARER_TOKEN'
35
+ end
36
+
37
+ api_instance = Growwer::WebhooksApi.new
38
+ idempotency_key = 'idempotency_key_example' # String | A new key for each write, reused only to retry that same write. 1 to 255 printable ASCII characters without spaces (`!` to `~`); any other value answers 400 `invalid_idempotency_key`.
39
+ create_webhook_request = Growwer::CreateWebhookRequest.new({url: 'url_example', events: [Growwer::WebhookEventType::ORDER_CREATED]}) # CreateWebhookRequest |
40
+
41
+ begin
42
+ # Create a webhook subscription
43
+ result = api_instance.create_webhook(idempotency_key, create_webhook_request)
44
+ p result
45
+ rescue Growwer::ApiError => e
46
+ puts "Error when calling WebhooksApi->create_webhook: #{e}"
47
+ end
48
+ ```
49
+
50
+ #### Using the create_webhook_with_http_info variant
51
+
52
+ This returns an Array which contains the response data, status code and headers.
53
+
54
+ > <Array(<WebhookWithSecret>, Integer, Hash)> create_webhook_with_http_info(idempotency_key, create_webhook_request)
55
+
56
+ ```ruby
57
+ begin
58
+ # Create a webhook subscription
59
+ data, status_code, headers = api_instance.create_webhook_with_http_info(idempotency_key, create_webhook_request)
60
+ p status_code # => 2xx
61
+ p headers # => { ... }
62
+ p data # => <WebhookWithSecret>
63
+ rescue Growwer::ApiError => e
64
+ puts "Error when calling WebhooksApi->create_webhook_with_http_info: #{e}"
65
+ end
66
+ ```
67
+
68
+ ### Parameters
69
+
70
+ | Name | Type | Description | Notes |
71
+ | ---- | ---- | ----------- | ----- |
72
+ | **idempotency_key** | **String** | A new key for each write, reused only to retry that same write. 1 to 255 printable ASCII characters without spaces (&#x60;!&#x60; to &#x60;~&#x60;); any other value answers 400 &#x60;invalid_idempotency_key&#x60;. | |
73
+ | **create_webhook_request** | [**CreateWebhookRequest**](CreateWebhookRequest.md) | | |
74
+
75
+ ### Return type
76
+
77
+ [**WebhookWithSecret**](WebhookWithSecret.md)
78
+
79
+ ### Authorization
80
+
81
+ [apiKey](../README.md#apiKey)
82
+
83
+ ### HTTP request headers
84
+
85
+ - **Content-Type**: application/json
86
+ - **Accept**: application/json
87
+
88
+
89
+ ## delete_webhook
90
+
91
+ > delete_webhook(id, idempotency_key)
92
+
93
+ Delete a webhook subscription
94
+
95
+ Deletes one of your webhook subscriptions and its delivery log. Deliveries still pending are not sent.
96
+
97
+ ### Examples
98
+
99
+ ```ruby
100
+ require 'time'
101
+ require 'growwer'
102
+ # setup authorization
103
+ Growwer.configure do |config|
104
+ # Configure Bearer authorization: apiKey
105
+ config.access_token = 'YOUR_BEARER_TOKEN'
106
+ end
107
+
108
+ api_instance = Growwer::WebhooksApi.new
109
+ id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String | The subscription.
110
+ idempotency_key = 'idempotency_key_example' # String | A new key for each write, reused only to retry that same write. 1 to 255 printable ASCII characters without spaces (`!` to `~`); any other value answers 400 `invalid_idempotency_key`.
111
+
112
+ begin
113
+ # Delete a webhook subscription
114
+ api_instance.delete_webhook(id, idempotency_key)
115
+ rescue Growwer::ApiError => e
116
+ puts "Error when calling WebhooksApi->delete_webhook: #{e}"
117
+ end
118
+ ```
119
+
120
+ #### Using the delete_webhook_with_http_info variant
121
+
122
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
123
+
124
+ > <Array(nil, Integer, Hash)> delete_webhook_with_http_info(id, idempotency_key)
125
+
126
+ ```ruby
127
+ begin
128
+ # Delete a webhook subscription
129
+ data, status_code, headers = api_instance.delete_webhook_with_http_info(id, idempotency_key)
130
+ p status_code # => 2xx
131
+ p headers # => { ... }
132
+ p data # => nil
133
+ rescue Growwer::ApiError => e
134
+ puts "Error when calling WebhooksApi->delete_webhook_with_http_info: #{e}"
135
+ end
136
+ ```
137
+
138
+ ### Parameters
139
+
140
+ | Name | Type | Description | Notes |
141
+ | ---- | ---- | ----------- | ----- |
142
+ | **id** | **String** | The subscription. | |
143
+ | **idempotency_key** | **String** | A new key for each write, reused only to retry that same write. 1 to 255 printable ASCII characters without spaces (&#x60;!&#x60; to &#x60;~&#x60;); any other value answers 400 &#x60;invalid_idempotency_key&#x60;. | |
144
+
145
+ ### Return type
146
+
147
+ nil (empty response body)
148
+
149
+ ### Authorization
150
+
151
+ [apiKey](../README.md#apiKey)
152
+
153
+ ### HTTP request headers
154
+
155
+ - **Content-Type**: Not defined
156
+ - **Accept**: application/json
157
+
158
+
159
+ ## get_webhook
160
+
161
+ > <Webhook> get_webhook(id)
162
+
163
+ Get a webhook subscription
164
+
165
+ One of your webhook subscriptions, without its secret. A subscription of the other mode is not found.
166
+
167
+ ### Examples
168
+
169
+ ```ruby
170
+ require 'time'
171
+ require 'growwer'
172
+ # setup authorization
173
+ Growwer.configure do |config|
174
+ # Configure Bearer authorization: apiKey
175
+ config.access_token = 'YOUR_BEARER_TOKEN'
176
+ end
177
+
178
+ api_instance = Growwer::WebhooksApi.new
179
+ id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String | The subscription.
180
+
181
+ begin
182
+ # Get a webhook subscription
183
+ result = api_instance.get_webhook(id)
184
+ p result
185
+ rescue Growwer::ApiError => e
186
+ puts "Error when calling WebhooksApi->get_webhook: #{e}"
187
+ end
188
+ ```
189
+
190
+ #### Using the get_webhook_with_http_info variant
191
+
192
+ This returns an Array which contains the response data, status code and headers.
193
+
194
+ > <Array(<Webhook>, Integer, Hash)> get_webhook_with_http_info(id)
195
+
196
+ ```ruby
197
+ begin
198
+ # Get a webhook subscription
199
+ data, status_code, headers = api_instance.get_webhook_with_http_info(id)
200
+ p status_code # => 2xx
201
+ p headers # => { ... }
202
+ p data # => <Webhook>
203
+ rescue Growwer::ApiError => e
204
+ puts "Error when calling WebhooksApi->get_webhook_with_http_info: #{e}"
205
+ end
206
+ ```
207
+
208
+ ### Parameters
209
+
210
+ | Name | Type | Description | Notes |
211
+ | ---- | ---- | ----------- | ----- |
212
+ | **id** | **String** | The subscription. | |
213
+
214
+ ### Return type
215
+
216
+ [**Webhook**](Webhook.md)
217
+
218
+ ### Authorization
219
+
220
+ [apiKey](../README.md#apiKey)
221
+
222
+ ### HTTP request headers
223
+
224
+ - **Content-Type**: Not defined
225
+ - **Accept**: application/json
226
+
227
+
228
+ ## list_webhook_deliveries
229
+
230
+ > <ListWebhookDeliveries200Response> list_webhook_deliveries(id, opts)
231
+
232
+ List the deliveries of a webhook subscription
233
+
234
+ The events sent to the subscription in the last 30 days, newest first, each with its status and its latest 10 attempts: when, the status code your endpoint answered, how long it took and the start of its response body. Older deliveries are deleted.
235
+
236
+ ### Examples
237
+
238
+ ```ruby
239
+ require 'time'
240
+ require 'growwer'
241
+ # setup authorization
242
+ Growwer.configure do |config|
243
+ # Configure Bearer authorization: apiKey
244
+ config.access_token = 'YOUR_BEARER_TOKEN'
245
+ end
246
+
247
+ api_instance = Growwer::WebhooksApi.new
248
+ id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String | The subscription.
249
+ opts = {
250
+ limit: 56, # Integer | Deliveries per page, 1 to 100.
251
+ offset: 56 # Integer | Deliveries to skip.
252
+ }
253
+
254
+ begin
255
+ # List the deliveries of a webhook subscription
256
+ result = api_instance.list_webhook_deliveries(id, opts)
257
+ p result
258
+ rescue Growwer::ApiError => e
259
+ puts "Error when calling WebhooksApi->list_webhook_deliveries: #{e}"
260
+ end
261
+ ```
262
+
263
+ #### Using the list_webhook_deliveries_with_http_info variant
264
+
265
+ This returns an Array which contains the response data, status code and headers.
266
+
267
+ > <Array(<ListWebhookDeliveries200Response>, Integer, Hash)> list_webhook_deliveries_with_http_info(id, opts)
268
+
269
+ ```ruby
270
+ begin
271
+ # List the deliveries of a webhook subscription
272
+ data, status_code, headers = api_instance.list_webhook_deliveries_with_http_info(id, opts)
273
+ p status_code # => 2xx
274
+ p headers # => { ... }
275
+ p data # => <ListWebhookDeliveries200Response>
276
+ rescue Growwer::ApiError => e
277
+ puts "Error when calling WebhooksApi->list_webhook_deliveries_with_http_info: #{e}"
278
+ end
279
+ ```
280
+
281
+ ### Parameters
282
+
283
+ | Name | Type | Description | Notes |
284
+ | ---- | ---- | ----------- | ----- |
285
+ | **id** | **String** | The subscription. | |
286
+ | **limit** | **Integer** | Deliveries per page, 1 to 100. | [optional][default to 20] |
287
+ | **offset** | **Integer** | Deliveries to skip. | [optional][default to 0] |
288
+
289
+ ### Return type
290
+
291
+ [**ListWebhookDeliveries200Response**](ListWebhookDeliveries200Response.md)
292
+
293
+ ### Authorization
294
+
295
+ [apiKey](../README.md#apiKey)
296
+
297
+ ### HTTP request headers
298
+
299
+ - **Content-Type**: Not defined
300
+ - **Accept**: application/json
301
+
302
+
303
+ ## list_webhooks
304
+
305
+ > <ListWebhooks200Response> list_webhooks(opts)
306
+
307
+ List your webhook subscriptions
308
+
309
+ Your webhook subscriptions in the mode of the key, newest first, disabled ones included. A live key lists the live ones and a test key the test ones.
310
+
311
+ ### Examples
312
+
313
+ ```ruby
314
+ require 'time'
315
+ require 'growwer'
316
+ # setup authorization
317
+ Growwer.configure do |config|
318
+ # Configure Bearer authorization: apiKey
319
+ config.access_token = 'YOUR_BEARER_TOKEN'
320
+ end
321
+
322
+ api_instance = Growwer::WebhooksApi.new
323
+ opts = {
324
+ limit: 56, # Integer | Subscriptions per page, 1 to 100.
325
+ offset: 56 # Integer | Subscriptions to skip.
326
+ }
327
+
328
+ begin
329
+ # List your webhook subscriptions
330
+ result = api_instance.list_webhooks(opts)
331
+ p result
332
+ rescue Growwer::ApiError => e
333
+ puts "Error when calling WebhooksApi->list_webhooks: #{e}"
334
+ end
335
+ ```
336
+
337
+ #### Using the list_webhooks_with_http_info variant
338
+
339
+ This returns an Array which contains the response data, status code and headers.
340
+
341
+ > <Array(<ListWebhooks200Response>, Integer, Hash)> list_webhooks_with_http_info(opts)
342
+
343
+ ```ruby
344
+ begin
345
+ # List your webhook subscriptions
346
+ data, status_code, headers = api_instance.list_webhooks_with_http_info(opts)
347
+ p status_code # => 2xx
348
+ p headers # => { ... }
349
+ p data # => <ListWebhooks200Response>
350
+ rescue Growwer::ApiError => e
351
+ puts "Error when calling WebhooksApi->list_webhooks_with_http_info: #{e}"
352
+ end
353
+ ```
354
+
355
+ ### Parameters
356
+
357
+ | Name | Type | Description | Notes |
358
+ | ---- | ---- | ----------- | ----- |
359
+ | **limit** | **Integer** | Subscriptions per page, 1 to 100. | [optional][default to 20] |
360
+ | **offset** | **Integer** | Subscriptions to skip. | [optional][default to 0] |
361
+
362
+ ### Return type
363
+
364
+ [**ListWebhooks200Response**](ListWebhooks200Response.md)
365
+
366
+ ### Authorization
367
+
368
+ [apiKey](../README.md#apiKey)
369
+
370
+ ### HTTP request headers
371
+
372
+ - **Content-Type**: Not defined
373
+ - **Accept**: application/json
374
+
375
+
376
+ ## redeliver_webhook
377
+
378
+ > <WebhookDelivery> redeliver_webhook(id, delivery_id, idempotency_key)
379
+
380
+ Redeliver a webhook event
381
+
382
+ Queues a delivery that has succeeded or failed again, in a new round of retries, and answers it. It sends the same event with the same `webhook-id`, so a consumer that dedupes by it handles it once. Deliveries are kept 30 days. A delivery still pending, being sent or waiting for its next retry, answers 409 `webhook_delivery_pending` and takes none of the hour's sends; so does a redelivery while the subscription has 10 test events and redeliveries pending, its limit for a redelivery, given in `details.limit`. The pending deliveries of events never redelivered do not count. A subscription takes at most 10 test events and redeliveries an hour: past them it answers 429 `webhook_send_limit_reached` with `Retry-After`. A disabled subscription answers 409 `webhook_disabled`.
383
+
384
+ ### Examples
385
+
386
+ ```ruby
387
+ require 'time'
388
+ require 'growwer'
389
+ # setup authorization
390
+ Growwer.configure do |config|
391
+ # Configure Bearer authorization: apiKey
392
+ config.access_token = 'YOUR_BEARER_TOKEN'
393
+ end
394
+
395
+ api_instance = Growwer::WebhooksApi.new
396
+ id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String | The subscription.
397
+ delivery_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String | The delivery.
398
+ idempotency_key = 'idempotency_key_example' # String | A new key for each write, reused only to retry that same write. 1 to 255 printable ASCII characters without spaces (`!` to `~`); any other value answers 400 `invalid_idempotency_key`.
399
+
400
+ begin
401
+ # Redeliver a webhook event
402
+ result = api_instance.redeliver_webhook(id, delivery_id, idempotency_key)
403
+ p result
404
+ rescue Growwer::ApiError => e
405
+ puts "Error when calling WebhooksApi->redeliver_webhook: #{e}"
406
+ end
407
+ ```
408
+
409
+ #### Using the redeliver_webhook_with_http_info variant
410
+
411
+ This returns an Array which contains the response data, status code and headers.
412
+
413
+ > <Array(<WebhookDelivery>, Integer, Hash)> redeliver_webhook_with_http_info(id, delivery_id, idempotency_key)
414
+
415
+ ```ruby
416
+ begin
417
+ # Redeliver a webhook event
418
+ data, status_code, headers = api_instance.redeliver_webhook_with_http_info(id, delivery_id, idempotency_key)
419
+ p status_code # => 2xx
420
+ p headers # => { ... }
421
+ p data # => <WebhookDelivery>
422
+ rescue Growwer::ApiError => e
423
+ puts "Error when calling WebhooksApi->redeliver_webhook_with_http_info: #{e}"
424
+ end
425
+ ```
426
+
427
+ ### Parameters
428
+
429
+ | Name | Type | Description | Notes |
430
+ | ---- | ---- | ----------- | ----- |
431
+ | **id** | **String** | The subscription. | |
432
+ | **delivery_id** | **String** | The delivery. | |
433
+ | **idempotency_key** | **String** | A new key for each write, reused only to retry that same write. 1 to 255 printable ASCII characters without spaces (&#x60;!&#x60; to &#x60;~&#x60;); any other value answers 400 &#x60;invalid_idempotency_key&#x60;. | |
434
+
435
+ ### Return type
436
+
437
+ [**WebhookDelivery**](WebhookDelivery.md)
438
+
439
+ ### Authorization
440
+
441
+ [apiKey](../README.md#apiKey)
442
+
443
+ ### HTTP request headers
444
+
445
+ - **Content-Type**: Not defined
446
+ - **Accept**: application/json
447
+
448
+
449
+ ## rotate_webhook_secret
450
+
451
+ > <WebhookWithSecret> rotate_webhook_secret(id, idempotency_key)
452
+
453
+ Rotate a webhook secret
454
+
455
+ Gives the subscription a new signing secret and answers it: it is shown only here, so store it now. For 24 hours, until `previousSecretExpiresAt`, every delivery carries two signatures in `webhook-signature`, one with each secret, so you can switch without missing an event; after that only the new secret signs. A replay of this request under its `Idempotency-Key` answers the subscription without the secret.
456
+
457
+ ### Examples
458
+
459
+ ```ruby
460
+ require 'time'
461
+ require 'growwer'
462
+ # setup authorization
463
+ Growwer.configure do |config|
464
+ # Configure Bearer authorization: apiKey
465
+ config.access_token = 'YOUR_BEARER_TOKEN'
466
+ end
467
+
468
+ api_instance = Growwer::WebhooksApi.new
469
+ id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String | The subscription.
470
+ idempotency_key = 'idempotency_key_example' # String | A new key for each write, reused only to retry that same write. 1 to 255 printable ASCII characters without spaces (`!` to `~`); any other value answers 400 `invalid_idempotency_key`.
471
+
472
+ begin
473
+ # Rotate a webhook secret
474
+ result = api_instance.rotate_webhook_secret(id, idempotency_key)
475
+ p result
476
+ rescue Growwer::ApiError => e
477
+ puts "Error when calling WebhooksApi->rotate_webhook_secret: #{e}"
478
+ end
479
+ ```
480
+
481
+ #### Using the rotate_webhook_secret_with_http_info variant
482
+
483
+ This returns an Array which contains the response data, status code and headers.
484
+
485
+ > <Array(<WebhookWithSecret>, Integer, Hash)> rotate_webhook_secret_with_http_info(id, idempotency_key)
486
+
487
+ ```ruby
488
+ begin
489
+ # Rotate a webhook secret
490
+ data, status_code, headers = api_instance.rotate_webhook_secret_with_http_info(id, idempotency_key)
491
+ p status_code # => 2xx
492
+ p headers # => { ... }
493
+ p data # => <WebhookWithSecret>
494
+ rescue Growwer::ApiError => e
495
+ puts "Error when calling WebhooksApi->rotate_webhook_secret_with_http_info: #{e}"
496
+ end
497
+ ```
498
+
499
+ ### Parameters
500
+
501
+ | Name | Type | Description | Notes |
502
+ | ---- | ---- | ----------- | ----- |
503
+ | **id** | **String** | The subscription. | |
504
+ | **idempotency_key** | **String** | A new key for each write, reused only to retry that same write. 1 to 255 printable ASCII characters without spaces (&#x60;!&#x60; to &#x60;~&#x60;); any other value answers 400 &#x60;invalid_idempotency_key&#x60;. | |
505
+
506
+ ### Return type
507
+
508
+ [**WebhookWithSecret**](WebhookWithSecret.md)
509
+
510
+ ### Authorization
511
+
512
+ [apiKey](../README.md#apiKey)
513
+
514
+ ### HTTP request headers
515
+
516
+ - **Content-Type**: Not defined
517
+ - **Accept**: application/json
518
+
519
+
520
+ ## send_webhook_test
521
+
522
+ > <WebhookDelivery> send_webhook_test(id, idempotency_key)
523
+
524
+ Send a test event
525
+
526
+ Queues a `webhook.test` event for the subscription, whatever events it lists, and answers its delivery: follow it on GET /webhooks/{id}/deliveries. It is signed, retried and logged as any event. It normally supersedes the subscription's earlier test events still pending: their deliveries fail and are not retried, so a test right after fixing the endpoint does not wait behind them; one that cannot be failed then is failed by the next test. A subscription takes at most 10 test events and redeliveries an hour: past them it answers 429 `webhook_send_limit_reached` with `Retry-After`. A disabled subscription answers 409 `webhook_disabled`. A test event that cannot be recorded answers 503 `webhook_test_unavailable`: nothing was sent, the attempt counts toward the hourly limit, and a retry needs a new `Idempotency-Key`.
527
+
528
+ ### Examples
529
+
530
+ ```ruby
531
+ require 'time'
532
+ require 'growwer'
533
+ # setup authorization
534
+ Growwer.configure do |config|
535
+ # Configure Bearer authorization: apiKey
536
+ config.access_token = 'YOUR_BEARER_TOKEN'
537
+ end
538
+
539
+ api_instance = Growwer::WebhooksApi.new
540
+ id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String | The subscription.
541
+ idempotency_key = 'idempotency_key_example' # String | A new key for each write, reused only to retry that same write. 1 to 255 printable ASCII characters without spaces (`!` to `~`); any other value answers 400 `invalid_idempotency_key`.
542
+
543
+ begin
544
+ # Send a test event
545
+ result = api_instance.send_webhook_test(id, idempotency_key)
546
+ p result
547
+ rescue Growwer::ApiError => e
548
+ puts "Error when calling WebhooksApi->send_webhook_test: #{e}"
549
+ end
550
+ ```
551
+
552
+ #### Using the send_webhook_test_with_http_info variant
553
+
554
+ This returns an Array which contains the response data, status code and headers.
555
+
556
+ > <Array(<WebhookDelivery>, Integer, Hash)> send_webhook_test_with_http_info(id, idempotency_key)
557
+
558
+ ```ruby
559
+ begin
560
+ # Send a test event
561
+ data, status_code, headers = api_instance.send_webhook_test_with_http_info(id, idempotency_key)
562
+ p status_code # => 2xx
563
+ p headers # => { ... }
564
+ p data # => <WebhookDelivery>
565
+ rescue Growwer::ApiError => e
566
+ puts "Error when calling WebhooksApi->send_webhook_test_with_http_info: #{e}"
567
+ end
568
+ ```
569
+
570
+ ### Parameters
571
+
572
+ | Name | Type | Description | Notes |
573
+ | ---- | ---- | ----------- | ----- |
574
+ | **id** | **String** | The subscription. | |
575
+ | **idempotency_key** | **String** | A new key for each write, reused only to retry that same write. 1 to 255 printable ASCII characters without spaces (&#x60;!&#x60; to &#x60;~&#x60;); any other value answers 400 &#x60;invalid_idempotency_key&#x60;. | |
576
+
577
+ ### Return type
578
+
579
+ [**WebhookDelivery**](WebhookDelivery.md)
580
+
581
+ ### Authorization
582
+
583
+ [apiKey](../README.md#apiKey)
584
+
585
+ ### HTTP request headers
586
+
587
+ - **Content-Type**: Not defined
588
+ - **Accept**: application/json
589
+
590
+
591
+ ## update_webhook
592
+
593
+ > <Webhook> update_webhook(id, idempotency_key, update_webhook_request)
594
+
595
+ Edit a webhook subscription
596
+
597
+ Changes only the fields you send. A new `url` is checked as on create. Dropping `balance.low` from `events` drops the threshold with it. `enabled: false` disables the subscription, which then gets no events; `enabled: true` enables it again, including one Growwer disabled because its endpoint answered 410 or failed for 5 days, and forgets its failures.
598
+
599
+ ### Examples
600
+
601
+ ```ruby
602
+ require 'time'
603
+ require 'growwer'
604
+ # setup authorization
605
+ Growwer.configure do |config|
606
+ # Configure Bearer authorization: apiKey
607
+ config.access_token = 'YOUR_BEARER_TOKEN'
608
+ end
609
+
610
+ api_instance = Growwer::WebhooksApi.new
611
+ id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String | The subscription.
612
+ idempotency_key = 'idempotency_key_example' # String | A new key for each write, reused only to retry that same write. 1 to 255 printable ASCII characters without spaces (`!` to `~`); any other value answers 400 `invalid_idempotency_key`.
613
+ update_webhook_request = Growwer::UpdateWebhookRequest.new # UpdateWebhookRequest |
614
+
615
+ begin
616
+ # Edit a webhook subscription
617
+ result = api_instance.update_webhook(id, idempotency_key, update_webhook_request)
618
+ p result
619
+ rescue Growwer::ApiError => e
620
+ puts "Error when calling WebhooksApi->update_webhook: #{e}"
621
+ end
622
+ ```
623
+
624
+ #### Using the update_webhook_with_http_info variant
625
+
626
+ This returns an Array which contains the response data, status code and headers.
627
+
628
+ > <Array(<Webhook>, Integer, Hash)> update_webhook_with_http_info(id, idempotency_key, update_webhook_request)
629
+
630
+ ```ruby
631
+ begin
632
+ # Edit a webhook subscription
633
+ data, status_code, headers = api_instance.update_webhook_with_http_info(id, idempotency_key, update_webhook_request)
634
+ p status_code # => 2xx
635
+ p headers # => { ... }
636
+ p data # => <Webhook>
637
+ rescue Growwer::ApiError => e
638
+ puts "Error when calling WebhooksApi->update_webhook_with_http_info: #{e}"
639
+ end
640
+ ```
641
+
642
+ ### Parameters
643
+
644
+ | Name | Type | Description | Notes |
645
+ | ---- | ---- | ----------- | ----- |
646
+ | **id** | **String** | The subscription. | |
647
+ | **idempotency_key** | **String** | A new key for each write, reused only to retry that same write. 1 to 255 printable ASCII characters without spaces (&#x60;!&#x60; to &#x60;~&#x60;); any other value answers 400 &#x60;invalid_idempotency_key&#x60;. | |
648
+ | **update_webhook_request** | [**UpdateWebhookRequest**](UpdateWebhookRequest.md) | | |
649
+
650
+ ### Return type
651
+
652
+ [**Webhook**](Webhook.md)
653
+
654
+ ### Authorization
655
+
656
+ [apiKey](../README.md#apiKey)
657
+
658
+ ### HTTP request headers
659
+
660
+ - **Content-Type**: application/json
661
+ - **Accept**: application/json
662
+
data/growwer.gemspec CHANGED
@@ -3,7 +3,7 @@
3
3
  =begin
4
4
  #Growwer API
5
5
 
6
- #The Growwer customer API. Authenticate every call with an API key created on your profile page, sent as `Authorization: Bearer <key>`. A read key can call every GET operation; writes need a read and write key and an `Idempotency-Key` header. Idempotency: use a new `Idempotency-Key` (1 to 255 printable ASCII characters without spaces) for each operation and reuse it only to retry that same operation. Keys belong to your account, not to one API key. - A successful write is stored for 30 days: a retry with the same key and the same request replays its response with `Idempotent-Replayed: true` and does nothing again. - A refused write (4xx) has no effect and releases its key: once you fix the cause, retry with the same key and the write runs. - A failed write (5xx) may have taken effect, so it is never run again under its key: a retry gets 409 `idempotency_outcome_unknown`. Check whether it took effect before retrying with a new key. - A retry while the first request is still running gets 409 `idempotency_request_in_progress`. A request still running after 5 minutes is treated as failed: a retry gets 409 `idempotency_outcome_unknown`. - The same key with a different request (method, path, query or body) gets 409 `idempotency_key_reused`. A write without the header gets 400 `idempotency_key_required`. Every response carries `X-Request-Id`. Errors share one shape, `{code, message, requestId, details?}`. Money is integer cents plus a currency code and dates are ISO-8601.
6
+ #The Growwer customer API. Authenticate every call with an API key created on your profile page, sent as `Authorization: Bearer <key>`. A read key can call every GET operation; writes need a read and write key and an `Idempotency-Key` header. Idempotency: use a new `Idempotency-Key` (1 to 255 printable ASCII characters without spaces) for each operation and reuse it only to retry that same operation. Keys belong to your account, not to one API key. - A successful write is stored for 30 days: a retry with the same key and the same request replays its response with `Idempotent-Replayed: true` and does nothing again. - A refused write (4xx) has no effect and releases its key: once you fix the cause, retry with the same key and the write runs. - A failed write (5xx) may have taken effect, so it is never run again under its key: a retry gets 409 `idempotency_outcome_unknown`. Check whether it took effect before retrying with a new key. - A retry while the first request is still running gets 409 `idempotency_request_in_progress`. A request still running after 5 minutes is treated as failed: a retry gets 409 `idempotency_outcome_unknown`. - The same key with a different request (method, path, query or body) gets 409 `idempotency_key_reused`. A write without the header gets 400 `idempotency_key_required`. Test mode: a test key (`gw_sk_test_` plus 43 characters) works on your account's test data alone, apart from the real catalogue: test projects, orders and files, and a test wallet that starts at 1,000.00 EUR. Every response to a test key carries `Growwer-Mode: test`, and an id of the other mode answers 404 as a missing object would. - A test order is validated and debited from the test wallet as a live one is. A simulated seller accepts it a minute later and delivers it two minutes after that; you approve the delivery or request an update. - The Test helpers top the test wallet up, move a test order on at once and reset your test data. A live key on them gets 403 `test_mode_only`. - A test key on the seller and managed service operations, on a project's catalogue writes and on media requests gets 403 `not_available_in_test_mode`. - Idempotency keys are scoped per mode: the same `Idempotency-Key` sent with a live and a test key never replays the other mode's response. Webhooks: a subscription receives the events of its mode, signed as Standard Webhooks. A subscription created with a live key gets the events of your orders and your wallet; one created with a test key gets those of your test orders and test wallet, with `mode: test`, and never a live event. `x-webhooks` lists every event Growwer POSTs and its payload; the WebhookEvent schema describes the headers, the signature and the retries. Every response carries `X-Request-Id`. Errors share one shape, `{code, message, requestId, details?}`. Money is integer cents plus a currency code and dates are ISO-8601.
7
7
 
8
8
  The version of the OpenAPI document: 1
9
9
  Contact: support@growwer.com