phrase 2.7.2 → 2.8.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.
- checksums.yaml +4 -4
- data/README.md +7 -3
- data/docs/WebhookDeliveriesApi.md +206 -0
- data/docs/WebhookDelivery.md +29 -0
- data/lib/phrase/api/webhook_deliveries_api.rb +241 -0
- data/lib/phrase/models/webhook_delivery.rb +248 -0
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +2 -0
- data/spec/api/webhook_deliveries_api_spec.rb +68 -0
- data/spec/models/webhook_delivery_spec.rb +65 -0
- metadata +211 -203
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bb4fc7c6855bcfd49fc954eafb1934a07e0d6aebee908d470df181533cd61e2
|
4
|
+
data.tar.gz: 4d5c2ec6151ceadb08ddb5d7d1f28c830896a7ea7271f61cc3ba3cd459bb21d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e306daabbd11fc612258f771889b906412d20e6e575ca067aeec9dfa003e9dcf61158b2b9d0cd023052c63d9e199b1a0ff60e6a08a0b7d5e78a3d88183c3939
|
7
|
+
data.tar.gz: 95193d84b529261332602a1427cfed5cd70b0869215294553e292426aae8f0bc8f678eabb3bd8081b3b8a3bf0498311f6054a0bb226da7429199a1d40b8714f5
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ Phrase is a translation management platform for software projects. You can colla
|
|
7
7
|
## This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
8
8
|
|
9
9
|
- API version: 2.0.0
|
10
|
-
- Package version: 2.
|
10
|
+
- Package version: 2.8.0
|
11
11
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
12
12
|
For more information, please visit [https://developers.phrase.com/api/](https://developers.phrase.com/api/)
|
13
13
|
|
@@ -56,10 +56,10 @@ gem build phrase.gemspec
|
|
56
56
|
Then install the gem locally:
|
57
57
|
|
58
58
|
```shell
|
59
|
-
gem install ./phrase-2.
|
59
|
+
gem install ./phrase-2.8.0.gem
|
60
60
|
```
|
61
61
|
|
62
|
-
(for development, run `gem install --dev ./phrase-2.
|
62
|
+
(for development, run `gem install --dev ./phrase-2.8.0.gem` to install the development dependencies)
|
63
63
|
|
64
64
|
## Getting Started
|
65
65
|
|
@@ -324,6 +324,9 @@ Class | Method | HTTP request | Description
|
|
324
324
|
*Phrase::VariablesApi* | [**variables_list**](docs/VariablesApi.md#variables_list) | **GET** /projects/{project_id}/variables | List variables
|
325
325
|
*Phrase::VersionsHistoryApi* | [**version_show**](docs/VersionsHistoryApi.md#version_show) | **GET** /projects/{project_id}/translations/{translation_id}/versions/{id} | Get a single version
|
326
326
|
*Phrase::VersionsHistoryApi* | [**versions_list**](docs/VersionsHistoryApi.md#versions_list) | **GET** /projects/{project_id}/translations/{translation_id}/versions | List all versions
|
327
|
+
*Phrase::WebhookDeliveriesApi* | [**webhook_deliveries_list**](docs/WebhookDeliveriesApi.md#webhook_deliveries_list) | **GET** /projects/{project_id}/webhooks/{webhook_id}/deliveries | List webhook deliveries
|
328
|
+
*Phrase::WebhookDeliveriesApi* | [**webhook_deliveries_redeliver**](docs/WebhookDeliveriesApi.md#webhook_deliveries_redeliver) | **POST** /projects/{project_id}/webhooks/{webhook_id}/deliveries/{id}/redeliver | Redeliver a single webhook delivery
|
329
|
+
*Phrase::WebhookDeliveriesApi* | [**webhook_deliveries_show**](docs/WebhookDeliveriesApi.md#webhook_deliveries_show) | **GET** /projects/{project_id}/webhooks/{webhook_id}/deliveries/{id} | Get a single webhook delivery
|
327
330
|
*Phrase::WebhooksApi* | [**webhook_create**](docs/WebhooksApi.md#webhook_create) | **POST** /projects/{project_id}/webhooks | Create a webhook
|
328
331
|
*Phrase::WebhooksApi* | [**webhook_delete**](docs/WebhooksApi.md#webhook_delete) | **DELETE** /projects/{project_id}/webhooks/{id} | Delete a webhook
|
329
332
|
*Phrase::WebhooksApi* | [**webhook_show**](docs/WebhooksApi.md#webhook_show) | **GET** /projects/{project_id}/webhooks/{id} | Get a single webhook
|
@@ -525,6 +528,7 @@ Class | Method | HTTP request | Description
|
|
525
528
|
- [Phrase::VariableUpdateParameters](docs/VariableUpdateParameters.md)
|
526
529
|
- [Phrase::Webhook](docs/Webhook.md)
|
527
530
|
- [Phrase::WebhookCreateParameters](docs/WebhookCreateParameters.md)
|
531
|
+
- [Phrase::WebhookDelivery](docs/WebhookDelivery.md)
|
528
532
|
- [Phrase::WebhookUpdateParameters](docs/WebhookUpdateParameters.md)
|
529
533
|
|
530
534
|
|
@@ -0,0 +1,206 @@
|
|
1
|
+
# Phrase::WebhookDeliveriesApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://api.phrase.com/v2*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**webhook_deliveries_list**](WebhookDeliveriesApi.md#webhook_deliveries_list) | **GET** /projects/{project_id}/webhooks/{webhook_id}/deliveries | List webhook deliveries
|
8
|
+
[**webhook_deliveries_redeliver**](WebhookDeliveriesApi.md#webhook_deliveries_redeliver) | **POST** /projects/{project_id}/webhooks/{webhook_id}/deliveries/{id}/redeliver | Redeliver a single webhook delivery
|
9
|
+
[**webhook_deliveries_show**](WebhookDeliveriesApi.md#webhook_deliveries_show) | **GET** /projects/{project_id}/webhooks/{webhook_id}/deliveries/{id} | Get a single webhook delivery
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
## webhook_deliveries_list
|
14
|
+
|
15
|
+
> Array<WebhookDelivery> webhook_deliveries_list(project_id, webhook_id, opts)
|
16
|
+
|
17
|
+
List webhook deliveries
|
18
|
+
|
19
|
+
List all webhook deliveries for the given webhook_id.
|
20
|
+
|
21
|
+
### Example
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
# load the gem
|
25
|
+
require 'phrase'
|
26
|
+
# setup authorization
|
27
|
+
Phrase.configure do |config|
|
28
|
+
# Configure HTTP basic authorization: Basic
|
29
|
+
config.username = 'YOUR USERNAME'
|
30
|
+
config.password = 'YOUR PASSWORD'
|
31
|
+
|
32
|
+
# Configure API key authorization: Token
|
33
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
34
|
+
config.api_key_prefix['Authorization'] = 'token'
|
35
|
+
end
|
36
|
+
|
37
|
+
api_instance = Phrase::WebhookDeliveriesApi.new
|
38
|
+
project_id = 'project_id_example' # String | Project ID
|
39
|
+
webhook_id = 'webhook_id_example' # String | Webhook ID
|
40
|
+
opts = {
|
41
|
+
x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
|
42
|
+
response_status_codes: 'response_status_codes_example' # String | List of Response Status Codes
|
43
|
+
}
|
44
|
+
|
45
|
+
begin
|
46
|
+
#List webhook deliveries
|
47
|
+
result = api_instance.webhook_deliveries_list(project_id, webhook_id, opts)
|
48
|
+
pp result
|
49
|
+
rescue Phrase::ApiError => e
|
50
|
+
puts "Exception when calling WebhookDeliveriesApi->webhook_deliveries_list: #{e}"
|
51
|
+
end
|
52
|
+
```
|
53
|
+
|
54
|
+
### Parameters
|
55
|
+
|
56
|
+
|
57
|
+
Name | Type | Description | Notes
|
58
|
+
------------- | ------------- | ------------- | -------------
|
59
|
+
**project_id** | **String**| Project ID |
|
60
|
+
**webhook_id** | **String**| Webhook ID |
|
61
|
+
**x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
|
62
|
+
**response_status_codes** | **String**| List of Response Status Codes | [optional]
|
63
|
+
|
64
|
+
### Return type
|
65
|
+
|
66
|
+
Response<([**Array<WebhookDelivery>**](WebhookDelivery.md))>
|
67
|
+
|
68
|
+
### Authorization
|
69
|
+
|
70
|
+
[Basic](../README.md#Basic), [Token](../README.md#Token)
|
71
|
+
|
72
|
+
### HTTP request headers
|
73
|
+
|
74
|
+
- **Content-Type**: Not defined
|
75
|
+
- **Accept**: application/json
|
76
|
+
|
77
|
+
|
78
|
+
## webhook_deliveries_redeliver
|
79
|
+
|
80
|
+
> WebhookDelivery webhook_deliveries_redeliver(project_id, webhook_id, id, opts)
|
81
|
+
|
82
|
+
Redeliver a single webhook delivery
|
83
|
+
|
84
|
+
Trigger an individual webhook delivery to be redelivered.
|
85
|
+
|
86
|
+
### Example
|
87
|
+
|
88
|
+
```ruby
|
89
|
+
# load the gem
|
90
|
+
require 'phrase'
|
91
|
+
# setup authorization
|
92
|
+
Phrase.configure do |config|
|
93
|
+
# Configure HTTP basic authorization: Basic
|
94
|
+
config.username = 'YOUR USERNAME'
|
95
|
+
config.password = 'YOUR PASSWORD'
|
96
|
+
|
97
|
+
# Configure API key authorization: Token
|
98
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
99
|
+
config.api_key_prefix['Authorization'] = 'token'
|
100
|
+
end
|
101
|
+
|
102
|
+
api_instance = Phrase::WebhookDeliveriesApi.new
|
103
|
+
project_id = 'project_id_example' # String | Project ID
|
104
|
+
webhook_id = 'webhook_id_example' # String | Webhook ID
|
105
|
+
id = 'id_example' # String | ID
|
106
|
+
opts = {
|
107
|
+
x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
|
108
|
+
}
|
109
|
+
|
110
|
+
begin
|
111
|
+
#Redeliver a single webhook delivery
|
112
|
+
result = api_instance.webhook_deliveries_redeliver(project_id, webhook_id, id, opts)
|
113
|
+
pp result
|
114
|
+
rescue Phrase::ApiError => e
|
115
|
+
puts "Exception when calling WebhookDeliveriesApi->webhook_deliveries_redeliver: #{e}"
|
116
|
+
end
|
117
|
+
```
|
118
|
+
|
119
|
+
### Parameters
|
120
|
+
|
121
|
+
|
122
|
+
Name | Type | Description | Notes
|
123
|
+
------------- | ------------- | ------------- | -------------
|
124
|
+
**project_id** | **String**| Project ID |
|
125
|
+
**webhook_id** | **String**| Webhook ID |
|
126
|
+
**id** | **String**| ID |
|
127
|
+
**x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
|
128
|
+
|
129
|
+
### Return type
|
130
|
+
|
131
|
+
Response<([**WebhookDelivery**](WebhookDelivery.md))>
|
132
|
+
|
133
|
+
### Authorization
|
134
|
+
|
135
|
+
[Basic](../README.md#Basic), [Token](../README.md#Token)
|
136
|
+
|
137
|
+
### HTTP request headers
|
138
|
+
|
139
|
+
- **Content-Type**: Not defined
|
140
|
+
- **Accept**: application/json
|
141
|
+
|
142
|
+
|
143
|
+
## webhook_deliveries_show
|
144
|
+
|
145
|
+
> WebhookDelivery webhook_deliveries_show(project_id, webhook_id, id, opts)
|
146
|
+
|
147
|
+
Get a single webhook delivery
|
148
|
+
|
149
|
+
Get all information about a single webhook delivery for the given ID.
|
150
|
+
|
151
|
+
### Example
|
152
|
+
|
153
|
+
```ruby
|
154
|
+
# load the gem
|
155
|
+
require 'phrase'
|
156
|
+
# setup authorization
|
157
|
+
Phrase.configure do |config|
|
158
|
+
# Configure HTTP basic authorization: Basic
|
159
|
+
config.username = 'YOUR USERNAME'
|
160
|
+
config.password = 'YOUR PASSWORD'
|
161
|
+
|
162
|
+
# Configure API key authorization: Token
|
163
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
164
|
+
config.api_key_prefix['Authorization'] = 'token'
|
165
|
+
end
|
166
|
+
|
167
|
+
api_instance = Phrase::WebhookDeliveriesApi.new
|
168
|
+
project_id = 'project_id_example' # String | Project ID
|
169
|
+
webhook_id = 'webhook_id_example' # String | Webhook ID
|
170
|
+
id = 'id_example' # String | ID
|
171
|
+
opts = {
|
172
|
+
x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
|
173
|
+
}
|
174
|
+
|
175
|
+
begin
|
176
|
+
#Get a single webhook delivery
|
177
|
+
result = api_instance.webhook_deliveries_show(project_id, webhook_id, id, opts)
|
178
|
+
pp result
|
179
|
+
rescue Phrase::ApiError => e
|
180
|
+
puts "Exception when calling WebhookDeliveriesApi->webhook_deliveries_show: #{e}"
|
181
|
+
end
|
182
|
+
```
|
183
|
+
|
184
|
+
### Parameters
|
185
|
+
|
186
|
+
|
187
|
+
Name | Type | Description | Notes
|
188
|
+
------------- | ------------- | ------------- | -------------
|
189
|
+
**project_id** | **String**| Project ID |
|
190
|
+
**webhook_id** | **String**| Webhook ID |
|
191
|
+
**id** | **String**| ID |
|
192
|
+
**x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
|
193
|
+
|
194
|
+
### Return type
|
195
|
+
|
196
|
+
Response<([**WebhookDelivery**](WebhookDelivery.md))>
|
197
|
+
|
198
|
+
### Authorization
|
199
|
+
|
200
|
+
[Basic](../README.md#Basic), [Token](../README.md#Token)
|
201
|
+
|
202
|
+
### HTTP request headers
|
203
|
+
|
204
|
+
- **Content-Type**: Not defined
|
205
|
+
- **Accept**: application/json
|
206
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# Phrase::WebhookDelivery
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**id** | **String** | | [optional]
|
8
|
+
**webhook_id** | **String** | | [optional]
|
9
|
+
**response_status_code** | **Integer** | | [optional]
|
10
|
+
**delivered_at** | **DateTime** | | [optional]
|
11
|
+
**duration_ms** | **Integer** | | [optional]
|
12
|
+
**created_at** | **DateTime** | | [optional]
|
13
|
+
**updated_at** | **DateTime** | | [optional]
|
14
|
+
|
15
|
+
## Code Sample
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
require 'Phrase'
|
19
|
+
|
20
|
+
instance = Phrase::WebhookDelivery.new(id: null,
|
21
|
+
webhook_id: null,
|
22
|
+
response_status_code: null,
|
23
|
+
delivered_at: null,
|
24
|
+
duration_ms: null,
|
25
|
+
created_at: null,
|
26
|
+
updated_at: null)
|
27
|
+
```
|
28
|
+
|
29
|
+
|
@@ -0,0 +1,241 @@
|
|
1
|
+
require 'cgi'
|
2
|
+
|
3
|
+
module Phrase
|
4
|
+
class WebhookDeliveriesApi
|
5
|
+
attr_accessor :api_client
|
6
|
+
|
7
|
+
def initialize(api_client = ApiClient.default)
|
8
|
+
@api_client = api_client
|
9
|
+
end
|
10
|
+
# List webhook deliveries
|
11
|
+
# List all webhook deliveries for the given webhook_id.
|
12
|
+
# @param project_id [String] Project ID
|
13
|
+
# @param webhook_id [String] Webhook ID
|
14
|
+
# @param [Hash] opts the optional parameters
|
15
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
16
|
+
# @option opts [String] :response_status_codes List of Response Status Codes
|
17
|
+
# @return [Array<WebhookDelivery>]
|
18
|
+
def webhook_deliveries_list(project_id, webhook_id, opts = {})
|
19
|
+
data, _status_code, _headers = webhook_deliveries_list_with_http_info(project_id, webhook_id, opts)
|
20
|
+
data
|
21
|
+
end
|
22
|
+
|
23
|
+
# List webhook deliveries
|
24
|
+
# List all webhook deliveries for the given webhook_id.
|
25
|
+
# @param project_id [String] Project ID
|
26
|
+
# @param webhook_id [String] Webhook ID
|
27
|
+
# @param [Hash] opts the optional parameters
|
28
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
29
|
+
# @option opts [String] :response_status_codes List of Response Status Codes
|
30
|
+
# @return [Array<(Response<(Array<WebhookDelivery>)>, Integer, Hash)>] Response<(Array<WebhookDelivery>)> data, response status code and response headers
|
31
|
+
def webhook_deliveries_list_with_http_info(project_id, webhook_id, opts = {})
|
32
|
+
if @api_client.config.debugging
|
33
|
+
@api_client.config.logger.debug 'Calling API: WebhookDeliveriesApi.webhook_deliveries_list ...'
|
34
|
+
end
|
35
|
+
# verify the required parameter 'project_id' is set
|
36
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
37
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling WebhookDeliveriesApi.webhook_deliveries_list"
|
38
|
+
end
|
39
|
+
# verify the required parameter 'webhook_id' is set
|
40
|
+
if @api_client.config.client_side_validation && webhook_id.nil?
|
41
|
+
fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhookDeliveriesApi.webhook_deliveries_list"
|
42
|
+
end
|
43
|
+
# resource path
|
44
|
+
local_var_path = '/projects/{project_id}/webhooks/{webhook_id}/deliveries'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'webhook_id' + '}', CGI.escape(webhook_id.to_s))
|
45
|
+
|
46
|
+
# query parameters
|
47
|
+
query_params = opts[:query_params] || {}
|
48
|
+
query_params[:'response_status_codes'] = opts[:'response_status_codes'] if !opts[:'response_status_codes'].nil?
|
49
|
+
|
50
|
+
# header parameters
|
51
|
+
header_params = opts[:header_params] || {}
|
52
|
+
# HTTP header 'Accept' (if needed)
|
53
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
54
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
55
|
+
|
56
|
+
# form parameters
|
57
|
+
form_params = opts[:form_params] || {}
|
58
|
+
|
59
|
+
# http body (model)
|
60
|
+
post_body = opts[:body]
|
61
|
+
|
62
|
+
# return_type
|
63
|
+
return_type = opts[:return_type] || 'Array<WebhookDelivery>'
|
64
|
+
|
65
|
+
# auth_names
|
66
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
67
|
+
|
68
|
+
new_options = opts.merge(
|
69
|
+
:header_params => header_params,
|
70
|
+
:query_params => query_params,
|
71
|
+
:form_params => form_params,
|
72
|
+
:body => post_body,
|
73
|
+
:auth_names => auth_names,
|
74
|
+
:return_type => return_type
|
75
|
+
)
|
76
|
+
|
77
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
78
|
+
if @api_client.config.debugging
|
79
|
+
@api_client.config.logger.debug "API called: WebhookDeliveriesApi#webhook_deliveries_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
80
|
+
end
|
81
|
+
response = ::Phrase::Response.new(data, headers)
|
82
|
+
return response, status_code, headers
|
83
|
+
end
|
84
|
+
|
85
|
+
# Redeliver a single webhook delivery
|
86
|
+
# Trigger an individual webhook delivery to be redelivered.
|
87
|
+
# @param project_id [String] Project ID
|
88
|
+
# @param webhook_id [String] Webhook ID
|
89
|
+
# @param id [String] ID
|
90
|
+
# @param [Hash] opts the optional parameters
|
91
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
92
|
+
# @return [WebhookDelivery]
|
93
|
+
def webhook_deliveries_redeliver(project_id, webhook_id, id, opts = {})
|
94
|
+
data, _status_code, _headers = webhook_deliveries_redeliver_with_http_info(project_id, webhook_id, id, opts)
|
95
|
+
data
|
96
|
+
end
|
97
|
+
|
98
|
+
# Redeliver a single webhook delivery
|
99
|
+
# Trigger an individual webhook delivery to be redelivered.
|
100
|
+
# @param project_id [String] Project ID
|
101
|
+
# @param webhook_id [String] Webhook ID
|
102
|
+
# @param id [String] ID
|
103
|
+
# @param [Hash] opts the optional parameters
|
104
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
105
|
+
# @return [Array<(Response<(WebhookDelivery)>, Integer, Hash)>] Response<(WebhookDelivery)> data, response status code and response headers
|
106
|
+
def webhook_deliveries_redeliver_with_http_info(project_id, webhook_id, id, opts = {})
|
107
|
+
if @api_client.config.debugging
|
108
|
+
@api_client.config.logger.debug 'Calling API: WebhookDeliveriesApi.webhook_deliveries_redeliver ...'
|
109
|
+
end
|
110
|
+
# verify the required parameter 'project_id' is set
|
111
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
112
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling WebhookDeliveriesApi.webhook_deliveries_redeliver"
|
113
|
+
end
|
114
|
+
# verify the required parameter 'webhook_id' is set
|
115
|
+
if @api_client.config.client_side_validation && webhook_id.nil?
|
116
|
+
fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhookDeliveriesApi.webhook_deliveries_redeliver"
|
117
|
+
end
|
118
|
+
# verify the required parameter 'id' is set
|
119
|
+
if @api_client.config.client_side_validation && id.nil?
|
120
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling WebhookDeliveriesApi.webhook_deliveries_redeliver"
|
121
|
+
end
|
122
|
+
# resource path
|
123
|
+
local_var_path = '/projects/{project_id}/webhooks/{webhook_id}/deliveries/{id}/redeliver'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'webhook_id' + '}', CGI.escape(webhook_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
124
|
+
|
125
|
+
# query parameters
|
126
|
+
query_params = opts[:query_params] || {}
|
127
|
+
|
128
|
+
# header parameters
|
129
|
+
header_params = opts[:header_params] || {}
|
130
|
+
# HTTP header 'Accept' (if needed)
|
131
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
132
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
133
|
+
|
134
|
+
# form parameters
|
135
|
+
form_params = opts[:form_params] || {}
|
136
|
+
|
137
|
+
# http body (model)
|
138
|
+
post_body = opts[:body]
|
139
|
+
|
140
|
+
# return_type
|
141
|
+
return_type = opts[:return_type] || 'WebhookDelivery'
|
142
|
+
|
143
|
+
# auth_names
|
144
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
145
|
+
|
146
|
+
new_options = opts.merge(
|
147
|
+
:header_params => header_params,
|
148
|
+
:query_params => query_params,
|
149
|
+
:form_params => form_params,
|
150
|
+
:body => post_body,
|
151
|
+
:auth_names => auth_names,
|
152
|
+
:return_type => return_type
|
153
|
+
)
|
154
|
+
|
155
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
156
|
+
if @api_client.config.debugging
|
157
|
+
@api_client.config.logger.debug "API called: WebhookDeliveriesApi#webhook_deliveries_redeliver\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
158
|
+
end
|
159
|
+
response = ::Phrase::Response.new(data, headers)
|
160
|
+
return response, status_code, headers
|
161
|
+
end
|
162
|
+
|
163
|
+
# Get a single webhook delivery
|
164
|
+
# Get all information about a single webhook delivery for the given ID.
|
165
|
+
# @param project_id [String] Project ID
|
166
|
+
# @param webhook_id [String] Webhook ID
|
167
|
+
# @param id [String] ID
|
168
|
+
# @param [Hash] opts the optional parameters
|
169
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
170
|
+
# @return [WebhookDelivery]
|
171
|
+
def webhook_deliveries_show(project_id, webhook_id, id, opts = {})
|
172
|
+
data, _status_code, _headers = webhook_deliveries_show_with_http_info(project_id, webhook_id, id, opts)
|
173
|
+
data
|
174
|
+
end
|
175
|
+
|
176
|
+
# Get a single webhook delivery
|
177
|
+
# Get all information about a single webhook delivery for the given ID.
|
178
|
+
# @param project_id [String] Project ID
|
179
|
+
# @param webhook_id [String] Webhook ID
|
180
|
+
# @param id [String] ID
|
181
|
+
# @param [Hash] opts the optional parameters
|
182
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
183
|
+
# @return [Array<(Response<(WebhookDelivery)>, Integer, Hash)>] Response<(WebhookDelivery)> data, response status code and response headers
|
184
|
+
def webhook_deliveries_show_with_http_info(project_id, webhook_id, id, opts = {})
|
185
|
+
if @api_client.config.debugging
|
186
|
+
@api_client.config.logger.debug 'Calling API: WebhookDeliveriesApi.webhook_deliveries_show ...'
|
187
|
+
end
|
188
|
+
# verify the required parameter 'project_id' is set
|
189
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
190
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling WebhookDeliveriesApi.webhook_deliveries_show"
|
191
|
+
end
|
192
|
+
# verify the required parameter 'webhook_id' is set
|
193
|
+
if @api_client.config.client_side_validation && webhook_id.nil?
|
194
|
+
fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhookDeliveriesApi.webhook_deliveries_show"
|
195
|
+
end
|
196
|
+
# verify the required parameter 'id' is set
|
197
|
+
if @api_client.config.client_side_validation && id.nil?
|
198
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling WebhookDeliveriesApi.webhook_deliveries_show"
|
199
|
+
end
|
200
|
+
# resource path
|
201
|
+
local_var_path = '/projects/{project_id}/webhooks/{webhook_id}/deliveries/{id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'webhook_id' + '}', CGI.escape(webhook_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
202
|
+
|
203
|
+
# query parameters
|
204
|
+
query_params = opts[:query_params] || {}
|
205
|
+
|
206
|
+
# header parameters
|
207
|
+
header_params = opts[:header_params] || {}
|
208
|
+
# HTTP header 'Accept' (if needed)
|
209
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
210
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
211
|
+
|
212
|
+
# form parameters
|
213
|
+
form_params = opts[:form_params] || {}
|
214
|
+
|
215
|
+
# http body (model)
|
216
|
+
post_body = opts[:body]
|
217
|
+
|
218
|
+
# return_type
|
219
|
+
return_type = opts[:return_type] || 'WebhookDelivery'
|
220
|
+
|
221
|
+
# auth_names
|
222
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
223
|
+
|
224
|
+
new_options = opts.merge(
|
225
|
+
:header_params => header_params,
|
226
|
+
:query_params => query_params,
|
227
|
+
:form_params => form_params,
|
228
|
+
:body => post_body,
|
229
|
+
:auth_names => auth_names,
|
230
|
+
:return_type => return_type
|
231
|
+
)
|
232
|
+
|
233
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
234
|
+
if @api_client.config.debugging
|
235
|
+
@api_client.config.logger.debug "API called: WebhookDeliveriesApi#webhook_deliveries_show\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
236
|
+
end
|
237
|
+
response = ::Phrase::Response.new(data, headers)
|
238
|
+
return response, status_code, headers
|
239
|
+
end
|
240
|
+
end
|
241
|
+
end
|