phrase 2.7.2 → 2.8.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.
- checksums.yaml +4 -4
- data/README.md +39 -13
- data/docs/BitbucketSyncApi.md +9 -9
- data/docs/BranchMergeParameters.md +2 -2
- data/docs/GitHubSyncApi.md +8 -8
- data/docs/GitLabSyncApi.md +8 -8
- data/docs/LocaleCreateParameters.md +3 -3
- data/docs/LocaleUpdateParameters.md +3 -3
- data/docs/LocalesApi.md +4 -4
- data/docs/ProjectCreateParameters.md +4 -4
- data/docs/ProjectUpdateParameters.md +4 -4
- data/docs/TeamsApi.md +3 -3
- data/docs/TranslationCreateParameters.md +1 -1
- data/docs/TranslationUpdateParameters.md +1 -1
- data/docs/WebhookDeliveriesApi.md +206 -0
- data/docs/WebhookDelivery.md +29 -0
- data/lib/phrase/api/bitbucket_sync_api.rb +10 -10
- data/lib/phrase/api/git_hub_sync_api.rb +8 -8
- data/lib/phrase/api/git_lab_sync_api.rb +10 -10
- data/lib/phrase/api/locales_api.rb +4 -4
- data/lib/phrase/api/teams_api.rb +3 -3
- data/lib/phrase/api/webhook_deliveries_api.rb +241 -0
- data/lib/phrase/models/branch_merge_parameters.rb +1 -1
- data/lib/phrase/models/locale_create_parameters.rb +3 -3
- data/lib/phrase/models/locale_update_parameters.rb +3 -3
- data/lib/phrase/models/project_create_parameters.rb +4 -4
- data/lib/phrase/models/project_update_parameters.rb +4 -4
- data/lib/phrase/models/translation_create_parameters.rb +1 -1
- data/lib/phrase/models/translation_update_parameters.rb +1 -1
- data/lib/phrase/models/webhook_delivery.rb +248 -0
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +2 -0
- data/phrase.gemspec +2 -2
- data/spec/api/bitbucket_sync_api_spec.rb +5 -5
- data/spec/api/git_hub_sync_api_spec.rb +4 -4
- data/spec/api/git_lab_sync_api_spec.rb +5 -5
- data/spec/api/locales_api_spec.rb +2 -2
- data/spec/api/webhook_deliveries_api_spec.rb +68 -0
- data/spec/models/webhook_delivery_spec.rb +65 -0
- metadata +212 -204
@@ -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
|
@@ -2,7 +2,7 @@ require 'date'
|
|
2
2
|
|
3
3
|
module Phrase
|
4
4
|
class BranchMergeParameters
|
5
|
-
# strategy used for merge blocking,
|
5
|
+
# strategy used for merge blocking, use_main or use_branch
|
6
6
|
attr_accessor :strategy
|
7
7
|
|
8
8
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -14,7 +14,7 @@ module Phrase
|
|
14
14
|
# Indicates whether locale is the default locale. If set to true, the previous default locale the project is no longer the default locale.
|
15
15
|
attr_accessor :default
|
16
16
|
|
17
|
-
# Indicates whether locale is a main locale. Main locales are part of the <a href=\"https://
|
17
|
+
# Indicates whether locale is a main locale. Main locales are part of the <a href=\"https://support.phrase.com/hc/en-us/articles/5784094755484\" target=\"_blank\">Verification System</a> feature.
|
18
18
|
attr_accessor :main
|
19
19
|
|
20
20
|
# Indicates whether locale is a RTL (Right-to-Left) locale.
|
@@ -26,10 +26,10 @@ module Phrase
|
|
26
26
|
# Fallback locale for empty translations. Can be a locale name or id.
|
27
27
|
attr_accessor :fallback_locale_id
|
28
28
|
|
29
|
-
# Indicates that new translations for this locale should be marked as unverified. Part of the <a href=\"https://
|
29
|
+
# Indicates that new translations for this locale should be marked as unverified. Part of the <a href=\"https://support.phrase.com/hc/en-us/articles/5784094755484\" target=\"_blank\">Advanced Workflows</a> feature.
|
30
30
|
attr_accessor :unverify_new_translations
|
31
31
|
|
32
|
-
# Indicates that updated translations for this locale should be marked as unverified. Part of the <a href=\"https://
|
32
|
+
# Indicates that updated translations for this locale should be marked as unverified. Part of the <a href=\"https://support.phrase.com/hc/en-us/articles/5784094755484\" target=\"_blank\">Advanced Workflows</a> feature.
|
33
33
|
attr_accessor :unverify_updated_translations
|
34
34
|
|
35
35
|
# If set, translations for this locale will be fetched automatically, right after creation.
|
@@ -14,7 +14,7 @@ module Phrase
|
|
14
14
|
# Indicates whether locale is the default locale. If set to true, the previous default locale the project is no longer the default locale.
|
15
15
|
attr_accessor :default
|
16
16
|
|
17
|
-
# Indicates whether locale is a main locale. Main locales are part of the <a href=\"https://
|
17
|
+
# Indicates whether locale is a main locale. Main locales are part of the <a href=\"https://support.phrase.com/hc/en-us/articles/5784094755484\" target=\"_blank\">Verification System</a> feature.
|
18
18
|
attr_accessor :main
|
19
19
|
|
20
20
|
# Indicates whether locale is a RTL (Right-to-Left) locale.
|
@@ -26,10 +26,10 @@ module Phrase
|
|
26
26
|
# Fallback locale for empty translations. Can be a locale name or id.
|
27
27
|
attr_accessor :fallback_locale_id
|
28
28
|
|
29
|
-
# Indicates that new translations for this locale should be marked as unverified. Part of the <a href=\"https://
|
29
|
+
# Indicates that new translations for this locale should be marked as unverified. Part of the <a href=\"https://support.phrase.com/hc/en-us/articles/5784094755484\" target=\"_blank\">Advanced Workflows</a> feature.
|
30
30
|
attr_accessor :unverify_new_translations
|
31
31
|
|
32
|
-
# Indicates that updated translations for this locale should be marked as unverified. Part of the <a href=\"https://
|
32
|
+
# Indicates that updated translations for this locale should be marked as unverified. Part of the <a href=\"https://support.phrase.com/hc/en-us/articles/5784094755484\" target=\"_blank\">Advanced Workflows</a> feature.
|
33
33
|
attr_accessor :unverify_updated_translations
|
34
34
|
|
35
35
|
# If set, translations for this locale will be fetched automatically, right after creation.
|
@@ -5,7 +5,7 @@ module Phrase
|
|
5
5
|
# Name of the project
|
6
6
|
attr_accessor :name
|
7
7
|
|
8
|
-
# Main file format specified by its API Extension name. Used for locale downloads if no format is specified. For API Extension names of available file formats see <a href=\"https://
|
8
|
+
# Main file format specified by its API Extension name. Used for locale downloads if no format is specified. For API Extension names of available file formats see <a href=\"https://support.phrase.com/hc/en-us/articles/5784070560412\">Format Guide</a> or our <a href=\"#formats\">Formats API Endpoint</a>.
|
9
9
|
attr_accessor :main_format
|
10
10
|
|
11
11
|
# Indicates whether the project should share the account's translation memory
|
@@ -23,7 +23,7 @@ module Phrase
|
|
23
23
|
# When a source project ID is given, a clone of that project will be created, including all locales, keys and translations as well as the main project settings if they are not defined otherwise through the params.
|
24
24
|
attr_accessor :source_project_id
|
25
25
|
|
26
|
-
# (Optional) Review Workflow. \"simple\" / \"review\". <a href=\"https://
|
26
|
+
# (Optional) Review Workflow. \"simple\" / \"review\". <a href=\"https://support.phrase.com/hc/en-us/articles/5784094755484\">Read more</a>
|
27
27
|
attr_accessor :workflow
|
28
28
|
|
29
29
|
# (Optional) Enable machine translation support in the project. Required for Autopilot and Smart Suggest
|
@@ -38,13 +38,13 @@ module Phrase
|
|
38
38
|
# (Optional) Otherwise, translators are not allowed to edit translations other than strings
|
39
39
|
attr_accessor :enable_all_data_type_translation_keys_for_translators
|
40
40
|
|
41
|
-
# (Optional) We can validate and highlight your ICU messages. <a href=\"https://
|
41
|
+
# (Optional) We can validate and highlight your ICU messages. <a href=\"https://support.phrase.com/hc/en-us/articles/5822319545116\">Read more</a>
|
42
42
|
attr_accessor :enable_icu_message_format
|
43
43
|
|
44
44
|
# (Optional) Displays the input fields for the 'ZERO' plural form for every key as well although only some languages require the 'ZERO' explicitly.
|
45
45
|
attr_accessor :zero_plural_form_enabled
|
46
46
|
|
47
|
-
# (Optional) Autopilot, requires machine_translation_enabled. <a href=\"https://
|
47
|
+
# (Optional) Autopilot, requires machine_translation_enabled. <a href=\"https://support.phrase.com/hc/en-us/articles/5822187934364\">Read more</a>
|
48
48
|
attr_accessor :autotranslate_enabled
|
49
49
|
|
50
50
|
# (Optional) Requires autotranslate_enabled to be true
|
@@ -8,7 +8,7 @@ module Phrase
|
|
8
8
|
# (Optional) Name of the project
|
9
9
|
attr_accessor :name
|
10
10
|
|
11
|
-
# (Optional) Main file format specified by its API Extension name. Used for locale downloads if no format is specified. For API Extension names of available file formats see <a href=\"https://
|
11
|
+
# (Optional) Main file format specified by its API Extension name. Used for locale downloads if no format is specified. For API Extension names of available file formats see <a href=\"https://support.phrase.com/hc/en-us/articles/5784070560412\">Format Guide</a> or our <a href=\"#formats\">Formats API Endpoint</a>.
|
12
12
|
attr_accessor :main_format
|
13
13
|
|
14
14
|
# (Optional) Indicates whether the project should share the account's translation memory
|
@@ -20,7 +20,7 @@ module Phrase
|
|
20
20
|
# (Optional) Indicates whether the project image should be deleted.
|
21
21
|
attr_accessor :remove_project_image
|
22
22
|
|
23
|
-
# (Optional) Review Workflow. \"simple\" / \"review\". <a href=\"https://
|
23
|
+
# (Optional) Review Workflow. \"simple\" / \"review\". <a href=\"https://support.phrase.com/hc/en-us/articles/5784094755484\">Read more</a>
|
24
24
|
attr_accessor :workflow
|
25
25
|
|
26
26
|
# (Optional) Enable machine translation support in the project. Required for Autopilot and Smart Suggest
|
@@ -35,13 +35,13 @@ module Phrase
|
|
35
35
|
# (Optional) Otherwise, translators are not allowed to edit translations other than strings
|
36
36
|
attr_accessor :enable_all_data_type_translation_keys_for_translators
|
37
37
|
|
38
|
-
# (Optional) We can validate and highlight your ICU messages. <a href=\"https://
|
38
|
+
# (Optional) We can validate and highlight your ICU messages. <a href=\"https://support.phrase.com/hc/en-us/articles/5822319545116\">Read more</a>
|
39
39
|
attr_accessor :enable_icu_message_format
|
40
40
|
|
41
41
|
# (Optional) Displays the input fields for the 'ZERO' plural form for every key as well although only some languages require the 'ZERO' explicitly.
|
42
42
|
attr_accessor :zero_plural_form_enabled
|
43
43
|
|
44
|
-
# (Optional) Autopilot, requires machine_translation_enabled. <a href=\"https://
|
44
|
+
# (Optional) Autopilot, requires machine_translation_enabled. <a href=\"https://support.phrase.com/hc/en-us/articles/5822187934364\">Read more</a>
|
45
45
|
attr_accessor :autotranslate_enabled
|
46
46
|
|
47
47
|
# (Optional) Requires autotranslate_enabled to be true
|
@@ -17,7 +17,7 @@ module Phrase
|
|
17
17
|
# Plural suffix. Can be one of: zero, one, two, few, many, other. Must be specified if the key associated to the translation is pluralized.
|
18
18
|
attr_accessor :plural_suffix
|
19
19
|
|
20
|
-
# Indicates whether translation is unverified. Part of the <a href=\"https://
|
20
|
+
# Indicates whether translation is unverified. Part of the <a href=\"https://support.phrase.com/hc/en-us/articles/5784094755484\" target=\"_blank\">Advanced Workflows</a> feature.
|
21
21
|
attr_accessor :unverified
|
22
22
|
|
23
23
|
# Indicates whether translation is excluded.
|
@@ -11,7 +11,7 @@ module Phrase
|
|
11
11
|
# Plural suffix. Can be one of: zero, one, two, few, many, other. Must be specified if the key associated to the translation is pluralized.
|
12
12
|
attr_accessor :plural_suffix
|
13
13
|
|
14
|
-
# Indicates whether translation is unverified. Part of the <a href=\"https://
|
14
|
+
# Indicates whether translation is unverified. Part of the <a href=\"https://support.phrase.com/hc/en-us/articles/5784094755484\" target=\"_blank\">Advanced Workflows</a> feature.
|
15
15
|
attr_accessor :unverified
|
16
16
|
|
17
17
|
# Indicates whether translation is excluded.
|
@@ -0,0 +1,248 @@
|
|
1
|
+
require 'date'
|
2
|
+
|
3
|
+
module Phrase
|
4
|
+
class WebhookDelivery
|
5
|
+
attr_accessor :id
|
6
|
+
|
7
|
+
attr_accessor :webhook_id
|
8
|
+
|
9
|
+
attr_accessor :response_status_code
|
10
|
+
|
11
|
+
attr_accessor :delivered_at
|
12
|
+
|
13
|
+
attr_accessor :duration_ms
|
14
|
+
|
15
|
+
attr_accessor :created_at
|
16
|
+
|
17
|
+
attr_accessor :updated_at
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
:'id' => :'id',
|
23
|
+
:'webhook_id' => :'webhook_id',
|
24
|
+
:'response_status_code' => :'response_status_code',
|
25
|
+
:'delivered_at' => :'delivered_at',
|
26
|
+
:'duration_ms' => :'duration_ms',
|
27
|
+
:'created_at' => :'created_at',
|
28
|
+
:'updated_at' => :'updated_at'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.openapi_types
|
34
|
+
{
|
35
|
+
:'id' => :'String',
|
36
|
+
:'webhook_id' => :'String',
|
37
|
+
:'response_status_code' => :'Integer',
|
38
|
+
:'delivered_at' => :'DateTime',
|
39
|
+
:'duration_ms' => :'Integer',
|
40
|
+
:'created_at' => :'DateTime',
|
41
|
+
:'updated_at' => :'DateTime'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# List of attributes with nullable: true
|
46
|
+
def self.openapi_nullable
|
47
|
+
Set.new([
|
48
|
+
])
|
49
|
+
end
|
50
|
+
|
51
|
+
# Initializes the object
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
53
|
+
def initialize(attributes = {})
|
54
|
+
if (!attributes.is_a?(Hash))
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::WebhookDelivery` initialize method"
|
56
|
+
end
|
57
|
+
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
60
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::WebhookDelivery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
62
|
+
end
|
63
|
+
h[k.to_sym] = v
|
64
|
+
}
|
65
|
+
|
66
|
+
if attributes.key?(:'id')
|
67
|
+
self.id = attributes[:'id']
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.key?(:'webhook_id')
|
71
|
+
self.webhook_id = attributes[:'webhook_id']
|
72
|
+
end
|
73
|
+
|
74
|
+
if attributes.key?(:'response_status_code')
|
75
|
+
self.response_status_code = attributes[:'response_status_code']
|
76
|
+
end
|
77
|
+
|
78
|
+
if attributes.key?(:'delivered_at')
|
79
|
+
self.delivered_at = attributes[:'delivered_at']
|
80
|
+
end
|
81
|
+
|
82
|
+
if attributes.key?(:'duration_ms')
|
83
|
+
self.duration_ms = attributes[:'duration_ms']
|
84
|
+
end
|
85
|
+
|
86
|
+
if attributes.key?(:'created_at')
|
87
|
+
self.created_at = attributes[:'created_at']
|
88
|
+
end
|
89
|
+
|
90
|
+
if attributes.key?(:'updated_at')
|
91
|
+
self.updated_at = attributes[:'updated_at']
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
96
|
+
# @return Array for valid properties with the reasons
|
97
|
+
def list_invalid_properties
|
98
|
+
invalid_properties = Array.new
|
99
|
+
invalid_properties
|
100
|
+
end
|
101
|
+
|
102
|
+
# Check to see if the all the properties in the model are valid
|
103
|
+
# @return true if the model is valid
|
104
|
+
def valid?
|
105
|
+
true
|
106
|
+
end
|
107
|
+
|
108
|
+
# Checks equality by comparing each attribute.
|
109
|
+
# @param [Object] Object to be compared
|
110
|
+
def ==(o)
|
111
|
+
return true if self.equal?(o)
|
112
|
+
self.class == o.class &&
|
113
|
+
id == o.id &&
|
114
|
+
webhook_id == o.webhook_id &&
|
115
|
+
response_status_code == o.response_status_code &&
|
116
|
+
delivered_at == o.delivered_at &&
|
117
|
+
duration_ms == o.duration_ms &&
|
118
|
+
created_at == o.created_at &&
|
119
|
+
updated_at == o.updated_at
|
120
|
+
end
|
121
|
+
|
122
|
+
# @see the `==` method
|
123
|
+
# @param [Object] Object to be compared
|
124
|
+
def eql?(o)
|
125
|
+
self == o
|
126
|
+
end
|
127
|
+
|
128
|
+
# Calculates hash code according to all attributes.
|
129
|
+
# @return [Integer] Hash code
|
130
|
+
def hash
|
131
|
+
[id, webhook_id, response_status_code, delivered_at, duration_ms, created_at, updated_at].hash
|
132
|
+
end
|
133
|
+
|
134
|
+
# Builds the object from hash
|
135
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
136
|
+
# @return [Object] Returns the model itself
|
137
|
+
def self.build_from_hash(attributes)
|
138
|
+
new.build_from_hash(attributes)
|
139
|
+
end
|
140
|
+
|
141
|
+
# Builds the object from hash
|
142
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
143
|
+
# @return [Object] Returns the model itself
|
144
|
+
def build_from_hash(attributes)
|
145
|
+
return nil unless attributes.is_a?(Hash)
|
146
|
+
self.class.openapi_types.each_pair do |key, type|
|
147
|
+
if type =~ /\AArray<(.*)>/i
|
148
|
+
# check to ensure the input is an array given that the attribute
|
149
|
+
# is documented as an array but the input is not
|
150
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
151
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
152
|
+
end
|
153
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
154
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
155
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
156
|
+
end
|
157
|
+
|
158
|
+
self
|
159
|
+
end
|
160
|
+
|
161
|
+
# Deserializes the data based on type
|
162
|
+
# @param string type Data type
|
163
|
+
# @param string value Value to be deserialized
|
164
|
+
# @return [Object] Deserialized data
|
165
|
+
def _deserialize(type, value)
|
166
|
+
case type.to_sym
|
167
|
+
when :DateTime
|
168
|
+
DateTime.parse(value)
|
169
|
+
when :Date
|
170
|
+
Date.parse(value)
|
171
|
+
when :String
|
172
|
+
value.to_s
|
173
|
+
when :Integer
|
174
|
+
value.to_i
|
175
|
+
when :Float
|
176
|
+
value.to_f
|
177
|
+
when :Boolean
|
178
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
179
|
+
true
|
180
|
+
else
|
181
|
+
false
|
182
|
+
end
|
183
|
+
when :Object
|
184
|
+
# generic object (usually a Hash), return directly
|
185
|
+
value
|
186
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
187
|
+
inner_type = Regexp.last_match[:inner_type]
|
188
|
+
value.map { |v| _deserialize(inner_type, v) }
|
189
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
190
|
+
k_type = Regexp.last_match[:k_type]
|
191
|
+
v_type = Regexp.last_match[:v_type]
|
192
|
+
{}.tap do |hash|
|
193
|
+
value.each do |k, v|
|
194
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
195
|
+
end
|
196
|
+
end
|
197
|
+
else # model
|
198
|
+
Phrase.const_get(type).build_from_hash(value)
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
# Returns the string representation of the object
|
203
|
+
# @return [String] String presentation of the object
|
204
|
+
def to_s
|
205
|
+
to_hash.to_s
|
206
|
+
end
|
207
|
+
|
208
|
+
# to_body is an alias to to_hash (backward compatibility)
|
209
|
+
# @return [Hash] Returns the object in the form of hash
|
210
|
+
def to_body
|
211
|
+
to_hash
|
212
|
+
end
|
213
|
+
|
214
|
+
# Returns the object in the form of hash
|
215
|
+
# @return [Hash] Returns the object in the form of hash
|
216
|
+
def to_hash
|
217
|
+
hash = {}
|
218
|
+
self.class.attribute_map.each_pair do |attr, param|
|
219
|
+
value = self.send(attr)
|
220
|
+
if value.nil?
|
221
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
222
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
223
|
+
end
|
224
|
+
|
225
|
+
hash[param] = _to_hash(value)
|
226
|
+
end
|
227
|
+
hash
|
228
|
+
end
|
229
|
+
|
230
|
+
# Outputs non-array value in the form of hash
|
231
|
+
# For object, use to_hash. Otherwise, just return the value
|
232
|
+
# @param [Object] value Any valid value
|
233
|
+
# @return [Hash] Returns the value in the form of hash
|
234
|
+
def _to_hash(value)
|
235
|
+
if value.is_a?(Array)
|
236
|
+
value.compact.map { |v| _to_hash(v) }
|
237
|
+
elsif value.is_a?(Hash)
|
238
|
+
{}.tap do |hash|
|
239
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
240
|
+
end
|
241
|
+
elsif value.respond_to? :to_hash
|
242
|
+
value.to_hash
|
243
|
+
else
|
244
|
+
value
|
245
|
+
end
|
246
|
+
end
|
247
|
+
end
|
248
|
+
end
|
data/lib/phrase/version.rb
CHANGED
data/lib/phrase.rb
CHANGED
@@ -199,6 +199,7 @@ require 'phrase/models/variable_create_parameters'
|
|
199
199
|
require 'phrase/models/variable_update_parameters'
|
200
200
|
require 'phrase/models/webhook'
|
201
201
|
require 'phrase/models/webhook_create_parameters'
|
202
|
+
require 'phrase/models/webhook_delivery'
|
202
203
|
require 'phrase/models/webhook_update_parameters'
|
203
204
|
|
204
205
|
# APIs
|
@@ -243,6 +244,7 @@ require 'phrase/api/uploads_api'
|
|
243
244
|
require 'phrase/api/users_api'
|
244
245
|
require 'phrase/api/variables_api'
|
245
246
|
require 'phrase/api/versions_history_api'
|
247
|
+
require 'phrase/api/webhook_deliveries_api'
|
246
248
|
require 'phrase/api/webhooks_api'
|
247
249
|
|
248
250
|
module Phrase
|