phrase 4.26.0 → 4.28.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/CHANGELOG.md +18 -0
- data/README.md +14 -3
- data/docs/CheckIssue.md +33 -0
- data/docs/ChecksApi.md +146 -0
- data/docs/JobCreateParameters.md +1 -1
- data/docs/KeyCreateParameters.md +1 -1
- data/docs/KeyUpdateParameters.md +1 -1
- data/docs/Locale.md +6 -0
- data/docs/LocaleCreateParameters.md +2 -0
- data/docs/LocaleDetails.md +6 -0
- data/docs/LocaleUpdateParameters.md +2 -0
- data/docs/MachineTranslationApi.md +263 -0
- data/docs/MachineTranslationLocaleProviderMapping.md +21 -0
- data/docs/MachineTranslationLocaleProviderMappingsCreateParameters.md +21 -0
- data/docs/MachineTranslationSettings.md +23 -0
- data/docs/MachineTranslationSettingsUpdateParameters.md +17 -0
- data/docs/MemberUpdateParameters.md +2 -2
- data/docs/MembersApi.md +1 -1
- data/docs/ProjectCreateParameters.md +9 -3
- data/docs/ProjectDetails.md +5 -1
- data/docs/ProjectUpdateParameters.md +9 -3
- data/docs/ProjectsApi.md +1 -1
- data/docs/ScreenshotUpdateParameters.md +1 -1
- data/docs/SpacesApi.md +3 -1
- data/docs/Upload.md +3 -1
- data/docs/UploadsApi.md +4 -4
- data/lib/phrase/api/checks_api.rb +174 -0
- data/lib/phrase/api/machine_translation_api.rb +302 -0
- data/lib/phrase/api/members_api.rb +2 -2
- data/lib/phrase/api/projects_api.rb +2 -2
- data/lib/phrase/api/spaces_api.rb +3 -0
- data/lib/phrase/api/uploads_api.rb +6 -6
- data/lib/phrase/models/check_issue.rb +319 -0
- data/lib/phrase/models/job_create_parameters.rb +1 -1
- data/lib/phrase/models/locale.rb +31 -1
- data/lib/phrase/models/locale_create_parameters.rb +11 -1
- data/lib/phrase/models/locale_details.rb +31 -1
- data/lib/phrase/models/locale_update_parameters.rb +11 -1
- data/lib/phrase/models/machine_translation_locale_provider_mapping.rb +217 -0
- data/lib/phrase/models/machine_translation_locale_provider_mappings_create_parameters.rb +232 -0
- data/lib/phrase/models/machine_translation_settings.rb +230 -0
- data/lib/phrase/models/machine_translation_settings_update_parameters.rb +198 -0
- data/lib/phrase/models/member_update_parameters.rb +2 -2
- data/lib/phrase/models/project_create_parameters.rb +48 -2
- data/lib/phrase/models/project_details.rb +53 -1
- data/lib/phrase/models/project_update_parameters.rb +48 -2
- data/lib/phrase/models/upload.rb +13 -1
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +7 -0
- data/spec/api/checks_api_spec.rb +56 -0
- data/spec/api/machine_translation_api_spec.rb +79 -0
- data/spec/api/members_api_spec.rb +1 -1
- data/spec/api/projects_api_spec.rb +1 -1
- data/spec/api/spaces_api_spec.rb +1 -0
- data/spec/models/check_issue_spec.rb +85 -0
- data/spec/models/locale_create_parameters_spec.rb +6 -0
- data/spec/models/locale_details_spec.rb +18 -0
- data/spec/models/locale_spec.rb +18 -0
- data/spec/models/locale_update_parameters_spec.rb +6 -0
- data/spec/models/machine_translation_locale_provider_mapping_spec.rb +41 -0
- data/spec/models/machine_translation_locale_provider_mappings_create_parameters_spec.rb +41 -0
- data/spec/models/machine_translation_settings_spec.rb +47 -0
- data/spec/models/machine_translation_settings_update_parameters_spec.rb +29 -0
- data/spec/models/project_create_parameters_spec.rb +22 -0
- data/spec/models/project_details_spec.rb +16 -0
- data/spec/models/project_update_parameters_spec.rb +22 -0
- data/spec/models/upload_spec.rb +6 -0
- metadata +292 -264
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
require 'cgi'
|
|
2
|
+
|
|
3
|
+
module Phrase
|
|
4
|
+
class MachineTranslationApi
|
|
5
|
+
attr_accessor :api_client
|
|
6
|
+
|
|
7
|
+
def initialize(api_client = ApiClient.default)
|
|
8
|
+
@api_client = api_client
|
|
9
|
+
end
|
|
10
|
+
# Create a locale provider mapping
|
|
11
|
+
# Creates a locale-pair-specific machine translation provider override for the account. When a mapping exists for a given source/target locale pair, that provider is used instead of the account default. Only one mapping may exist per source/target locale pair; attempting to create a duplicate returns a validation error. The source and target locale codes must differ.
|
|
12
|
+
# @param account_id [String] Account ID
|
|
13
|
+
# @param machine_translation_locale_provider_mappings_create_parameters [MachineTranslationLocaleProviderMappingsCreateParameters]
|
|
14
|
+
# @param [Hash] opts the optional parameters
|
|
15
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
16
|
+
# @return [MachineTranslationLocaleProviderMapping]
|
|
17
|
+
def machine_translation_locale_provider_mappings_create(account_id, machine_translation_locale_provider_mappings_create_parameters, opts = {})
|
|
18
|
+
data, _status_code, _headers = machine_translation_locale_provider_mappings_create_with_http_info(account_id, machine_translation_locale_provider_mappings_create_parameters, opts)
|
|
19
|
+
data
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Create a locale provider mapping
|
|
23
|
+
# Creates a locale-pair-specific machine translation provider override for the account. When a mapping exists for a given source/target locale pair, that provider is used instead of the account default. Only one mapping may exist per source/target locale pair; attempting to create a duplicate returns a validation error. The source and target locale codes must differ.
|
|
24
|
+
# @param account_id [String] Account ID
|
|
25
|
+
# @param machine_translation_locale_provider_mappings_create_parameters [MachineTranslationLocaleProviderMappingsCreateParameters]
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
28
|
+
# @return [Array<(Response<(MachineTranslationLocaleProviderMapping)>, Integer, Hash)>] Response<(MachineTranslationLocaleProviderMapping)> data, response status code and response headers
|
|
29
|
+
def machine_translation_locale_provider_mappings_create_with_http_info(account_id, machine_translation_locale_provider_mappings_create_parameters, opts = {})
|
|
30
|
+
if @api_client.config.debugging
|
|
31
|
+
@api_client.config.logger.debug 'Calling API: MachineTranslationApi.machine_translation_locale_provider_mappings_create ...'
|
|
32
|
+
end
|
|
33
|
+
# verify the required parameter 'account_id' is set
|
|
34
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
35
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling MachineTranslationApi.machine_translation_locale_provider_mappings_create"
|
|
36
|
+
end
|
|
37
|
+
# verify the required parameter 'machine_translation_locale_provider_mappings_create_parameters' is set
|
|
38
|
+
if @api_client.config.client_side_validation && machine_translation_locale_provider_mappings_create_parameters.nil?
|
|
39
|
+
fail ArgumentError, "Missing the required parameter 'machine_translation_locale_provider_mappings_create_parameters' when calling MachineTranslationApi.machine_translation_locale_provider_mappings_create"
|
|
40
|
+
end
|
|
41
|
+
# resource path
|
|
42
|
+
local_var_path = '/accounts/{account_id}/machine_translation_locale_provider_mappings'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s))
|
|
43
|
+
|
|
44
|
+
# query parameters
|
|
45
|
+
query_params = opts[:query_params] || {}
|
|
46
|
+
|
|
47
|
+
# header parameters
|
|
48
|
+
header_params = opts[:header_params] || {}
|
|
49
|
+
# HTTP header 'Accept' (if needed)
|
|
50
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
51
|
+
# HTTP header 'Content-Type'
|
|
52
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
53
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
|
54
|
+
|
|
55
|
+
# form parameters
|
|
56
|
+
form_params = opts[:form_params] || {}
|
|
57
|
+
|
|
58
|
+
# http body (model)
|
|
59
|
+
post_body = opts[:body] || @api_client.object_to_http_body(machine_translation_locale_provider_mappings_create_parameters)
|
|
60
|
+
|
|
61
|
+
# return_type
|
|
62
|
+
return_type = opts[:return_type] || 'MachineTranslationLocaleProviderMapping'
|
|
63
|
+
|
|
64
|
+
# auth_names
|
|
65
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
|
66
|
+
|
|
67
|
+
new_options = opts.merge(
|
|
68
|
+
:header_params => header_params,
|
|
69
|
+
:query_params => query_params,
|
|
70
|
+
:form_params => form_params,
|
|
71
|
+
:body => post_body,
|
|
72
|
+
:auth_names => auth_names,
|
|
73
|
+
:return_type => return_type
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
77
|
+
if @api_client.config.debugging
|
|
78
|
+
@api_client.config.logger.debug "API called: MachineTranslationApi#machine_translation_locale_provider_mappings_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
79
|
+
end
|
|
80
|
+
response = ::Phrase::Response.new(data, headers)
|
|
81
|
+
return response, status_code, headers
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Delete a locale provider mapping
|
|
85
|
+
# Removes the machine translation provider override for the specified source and target locale pair. The mapping is identified by locale codes supplied as query parameters rather than a path ID.
|
|
86
|
+
# @param account_id [String] Account ID
|
|
87
|
+
# @param source_locale_code [String] The locale code of the source language of the mapping to delete.
|
|
88
|
+
# @param target_locale_code [String] The locale code of the target language of the mapping to delete.
|
|
89
|
+
# @param [Hash] opts the optional parameters
|
|
90
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
91
|
+
# @return [nil]
|
|
92
|
+
def machine_translation_locale_provider_mappings_destroy(account_id, source_locale_code, target_locale_code, opts = {})
|
|
93
|
+
data, _status_code, _headers = machine_translation_locale_provider_mappings_destroy_with_http_info(account_id, source_locale_code, target_locale_code, opts)
|
|
94
|
+
data
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Delete a locale provider mapping
|
|
98
|
+
# Removes the machine translation provider override for the specified source and target locale pair. The mapping is identified by locale codes supplied as query parameters rather than a path ID.
|
|
99
|
+
# @param account_id [String] Account ID
|
|
100
|
+
# @param source_locale_code [String] The locale code of the source language of the mapping to delete.
|
|
101
|
+
# @param target_locale_code [String] The locale code of the target language of the mapping to delete.
|
|
102
|
+
# @param [Hash] opts the optional parameters
|
|
103
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
104
|
+
# @return [Array<(Response, Integer, Hash)>] Response<(nil, response status code and response headers
|
|
105
|
+
def machine_translation_locale_provider_mappings_destroy_with_http_info(account_id, source_locale_code, target_locale_code, opts = {})
|
|
106
|
+
if @api_client.config.debugging
|
|
107
|
+
@api_client.config.logger.debug 'Calling API: MachineTranslationApi.machine_translation_locale_provider_mappings_destroy ...'
|
|
108
|
+
end
|
|
109
|
+
# verify the required parameter 'account_id' is set
|
|
110
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
111
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling MachineTranslationApi.machine_translation_locale_provider_mappings_destroy"
|
|
112
|
+
end
|
|
113
|
+
# verify the required parameter 'source_locale_code' is set
|
|
114
|
+
if @api_client.config.client_side_validation && source_locale_code.nil?
|
|
115
|
+
fail ArgumentError, "Missing the required parameter 'source_locale_code' when calling MachineTranslationApi.machine_translation_locale_provider_mappings_destroy"
|
|
116
|
+
end
|
|
117
|
+
# verify the required parameter 'target_locale_code' is set
|
|
118
|
+
if @api_client.config.client_side_validation && target_locale_code.nil?
|
|
119
|
+
fail ArgumentError, "Missing the required parameter 'target_locale_code' when calling MachineTranslationApi.machine_translation_locale_provider_mappings_destroy"
|
|
120
|
+
end
|
|
121
|
+
# resource path
|
|
122
|
+
local_var_path = '/accounts/{account_id}/machine_translation_locale_provider_mappings'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s))
|
|
123
|
+
|
|
124
|
+
# query parameters
|
|
125
|
+
query_params = opts[:query_params] || {}
|
|
126
|
+
query_params[:'source_locale_code'] = source_locale_code
|
|
127
|
+
query_params[:'target_locale_code'] = target_locale_code
|
|
128
|
+
|
|
129
|
+
# header parameters
|
|
130
|
+
header_params = opts[:header_params] || {}
|
|
131
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
|
132
|
+
|
|
133
|
+
# form parameters
|
|
134
|
+
form_params = opts[:form_params] || {}
|
|
135
|
+
|
|
136
|
+
# http body (model)
|
|
137
|
+
post_body = opts[:body]
|
|
138
|
+
|
|
139
|
+
# return_type
|
|
140
|
+
return_type = opts[:return_type]
|
|
141
|
+
|
|
142
|
+
# auth_names
|
|
143
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
|
144
|
+
|
|
145
|
+
new_options = opts.merge(
|
|
146
|
+
:header_params => header_params,
|
|
147
|
+
:query_params => query_params,
|
|
148
|
+
:form_params => form_params,
|
|
149
|
+
:body => post_body,
|
|
150
|
+
:auth_names => auth_names,
|
|
151
|
+
:return_type => return_type
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
155
|
+
if @api_client.config.debugging
|
|
156
|
+
@api_client.config.logger.debug "API called: MachineTranslationApi#machine_translation_locale_provider_mappings_destroy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
157
|
+
end
|
|
158
|
+
response = ::Phrase::Response.new(data, headers)
|
|
159
|
+
return response, status_code, headers
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Get machine translation settings
|
|
163
|
+
# Returns the machine translation configuration for the account, including the default translation service, current machine translation unit usage, and any locale-pair-specific provider mappings.
|
|
164
|
+
# @param account_id [String] Account ID
|
|
165
|
+
# @param [Hash] opts the optional parameters
|
|
166
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
167
|
+
# @return [MachineTranslationSettings]
|
|
168
|
+
def machine_translation_settings_show(account_id, opts = {})
|
|
169
|
+
data, _status_code, _headers = machine_translation_settings_show_with_http_info(account_id, opts)
|
|
170
|
+
data
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Get machine translation settings
|
|
174
|
+
# Returns the machine translation configuration for the account, including the default translation service, current machine translation unit usage, and any locale-pair-specific provider mappings.
|
|
175
|
+
# @param account_id [String] Account ID
|
|
176
|
+
# @param [Hash] opts the optional parameters
|
|
177
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
178
|
+
# @return [Array<(Response<(MachineTranslationSettings)>, Integer, Hash)>] Response<(MachineTranslationSettings)> data, response status code and response headers
|
|
179
|
+
def machine_translation_settings_show_with_http_info(account_id, opts = {})
|
|
180
|
+
if @api_client.config.debugging
|
|
181
|
+
@api_client.config.logger.debug 'Calling API: MachineTranslationApi.machine_translation_settings_show ...'
|
|
182
|
+
end
|
|
183
|
+
# verify the required parameter 'account_id' is set
|
|
184
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
185
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling MachineTranslationApi.machine_translation_settings_show"
|
|
186
|
+
end
|
|
187
|
+
# resource path
|
|
188
|
+
local_var_path = '/accounts/{account_id}/machine_translation_settings'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s))
|
|
189
|
+
|
|
190
|
+
# query parameters
|
|
191
|
+
query_params = opts[:query_params] || {}
|
|
192
|
+
|
|
193
|
+
# header parameters
|
|
194
|
+
header_params = opts[:header_params] || {}
|
|
195
|
+
# HTTP header 'Accept' (if needed)
|
|
196
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
197
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
|
198
|
+
|
|
199
|
+
# form parameters
|
|
200
|
+
form_params = opts[:form_params] || {}
|
|
201
|
+
|
|
202
|
+
# http body (model)
|
|
203
|
+
post_body = opts[:body]
|
|
204
|
+
|
|
205
|
+
# return_type
|
|
206
|
+
return_type = opts[:return_type] || 'MachineTranslationSettings'
|
|
207
|
+
|
|
208
|
+
# auth_names
|
|
209
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
|
210
|
+
|
|
211
|
+
new_options = opts.merge(
|
|
212
|
+
:header_params => header_params,
|
|
213
|
+
:query_params => query_params,
|
|
214
|
+
:form_params => form_params,
|
|
215
|
+
:body => post_body,
|
|
216
|
+
:auth_names => auth_names,
|
|
217
|
+
:return_type => return_type
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
221
|
+
if @api_client.config.debugging
|
|
222
|
+
@api_client.config.logger.debug "API called: MachineTranslationApi#machine_translation_settings_show\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
223
|
+
end
|
|
224
|
+
response = ::Phrase::Response.new(data, headers)
|
|
225
|
+
return response, status_code, headers
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Update machine translation settings
|
|
229
|
+
# Sets the default machine translation service for the account. Requires write access to the account's machine translation settings. Passing an empty or absent value for `default_service` resets the account to its plan default (Microsoft Translate).
|
|
230
|
+
# @param account_id [String] Account ID
|
|
231
|
+
# @param machine_translation_settings_update_parameters [MachineTranslationSettingsUpdateParameters]
|
|
232
|
+
# @param [Hash] opts the optional parameters
|
|
233
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
234
|
+
# @return [MachineTranslationSettings]
|
|
235
|
+
def machine_translation_settings_update(account_id, machine_translation_settings_update_parameters, opts = {})
|
|
236
|
+
data, _status_code, _headers = machine_translation_settings_update_with_http_info(account_id, machine_translation_settings_update_parameters, opts)
|
|
237
|
+
data
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
# Update machine translation settings
|
|
241
|
+
# Sets the default machine translation service for the account. Requires write access to the account's machine translation settings. Passing an empty or absent value for `default_service` resets the account to its plan default (Microsoft Translate).
|
|
242
|
+
# @param account_id [String] Account ID
|
|
243
|
+
# @param machine_translation_settings_update_parameters [MachineTranslationSettingsUpdateParameters]
|
|
244
|
+
# @param [Hash] opts the optional parameters
|
|
245
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
246
|
+
# @return [Array<(Response<(MachineTranslationSettings)>, Integer, Hash)>] Response<(MachineTranslationSettings)> data, response status code and response headers
|
|
247
|
+
def machine_translation_settings_update_with_http_info(account_id, machine_translation_settings_update_parameters, opts = {})
|
|
248
|
+
if @api_client.config.debugging
|
|
249
|
+
@api_client.config.logger.debug 'Calling API: MachineTranslationApi.machine_translation_settings_update ...'
|
|
250
|
+
end
|
|
251
|
+
# verify the required parameter 'account_id' is set
|
|
252
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
253
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling MachineTranslationApi.machine_translation_settings_update"
|
|
254
|
+
end
|
|
255
|
+
# verify the required parameter 'machine_translation_settings_update_parameters' is set
|
|
256
|
+
if @api_client.config.client_side_validation && machine_translation_settings_update_parameters.nil?
|
|
257
|
+
fail ArgumentError, "Missing the required parameter 'machine_translation_settings_update_parameters' when calling MachineTranslationApi.machine_translation_settings_update"
|
|
258
|
+
end
|
|
259
|
+
# resource path
|
|
260
|
+
local_var_path = '/accounts/{account_id}/machine_translation_settings'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s))
|
|
261
|
+
|
|
262
|
+
# query parameters
|
|
263
|
+
query_params = opts[:query_params] || {}
|
|
264
|
+
|
|
265
|
+
# header parameters
|
|
266
|
+
header_params = opts[:header_params] || {}
|
|
267
|
+
# HTTP header 'Accept' (if needed)
|
|
268
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
269
|
+
# HTTP header 'Content-Type'
|
|
270
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
271
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
|
272
|
+
|
|
273
|
+
# form parameters
|
|
274
|
+
form_params = opts[:form_params] || {}
|
|
275
|
+
|
|
276
|
+
# http body (model)
|
|
277
|
+
post_body = opts[:body] || @api_client.object_to_http_body(machine_translation_settings_update_parameters)
|
|
278
|
+
|
|
279
|
+
# return_type
|
|
280
|
+
return_type = opts[:return_type] || 'MachineTranslationSettings'
|
|
281
|
+
|
|
282
|
+
# auth_names
|
|
283
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
|
284
|
+
|
|
285
|
+
new_options = opts.merge(
|
|
286
|
+
:header_params => header_params,
|
|
287
|
+
:query_params => query_params,
|
|
288
|
+
:form_params => form_params,
|
|
289
|
+
:body => post_body,
|
|
290
|
+
:auth_names => auth_names,
|
|
291
|
+
:return_type => return_type
|
|
292
|
+
)
|
|
293
|
+
|
|
294
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
295
|
+
if @api_client.config.debugging
|
|
296
|
+
@api_client.config.logger.debug "API called: MachineTranslationApi#machine_translation_settings_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
297
|
+
end
|
|
298
|
+
response = ::Phrase::Response.new(data, headers)
|
|
299
|
+
return response, status_code, headers
|
|
300
|
+
end
|
|
301
|
+
end
|
|
302
|
+
end
|
|
@@ -152,7 +152,7 @@ module Phrase
|
|
|
152
152
|
end
|
|
153
153
|
|
|
154
154
|
# Update a member
|
|
155
|
-
# Update user permissions in the account. Developers and translators need `project_ids` and `locale_ids` assigned to access them. Access token scope must include `team.manage`.
|
|
155
|
+
# Update user permissions in the account. Developers and translators need `project_ids` and `locale_ids` assigned to access them. To grant account-wide language access instead of access scoped to specific projects, use `default_locale_codes`. Access token scope must include `team.manage`.
|
|
156
156
|
# @param account_id [String] Account ID
|
|
157
157
|
# @param id [String] ID
|
|
158
158
|
# @param member_update_parameters [MemberUpdateParameters]
|
|
@@ -165,7 +165,7 @@ module Phrase
|
|
|
165
165
|
end
|
|
166
166
|
|
|
167
167
|
# Update a member
|
|
168
|
-
# Update user permissions in the account. Developers and translators need `project_ids` and `locale_ids` assigned to access them. Access token scope must include `team.manage`.
|
|
168
|
+
# Update user permissions in the account. Developers and translators need `project_ids` and `locale_ids` assigned to access them. To grant account-wide language access instead of access scoped to specific projects, use `default_locale_codes`. Access token scope must include `team.manage`.
|
|
169
169
|
# @param account_id [String] Account ID
|
|
170
170
|
# @param id [String] ID
|
|
171
171
|
# @param member_update_parameters [MemberUpdateParameters]
|
|
@@ -208,7 +208,7 @@ module Phrase
|
|
|
208
208
|
end
|
|
209
209
|
|
|
210
210
|
# Update a project
|
|
211
|
-
# Update an existing project.
|
|
211
|
+
# Update an existing project, including its review workflow, pre-translation/autotranslate rules, and machine-translation configuration (see workflow, machine_translation_enabled, and the autotranslate_* fields below).
|
|
212
212
|
# @param id [String] ID
|
|
213
213
|
# @param project_update_parameters [ProjectUpdateParameters]
|
|
214
214
|
# @param [Hash] opts the optional parameters
|
|
@@ -220,7 +220,7 @@ module Phrase
|
|
|
220
220
|
end
|
|
221
221
|
|
|
222
222
|
# Update a project
|
|
223
|
-
# Update an existing project.
|
|
223
|
+
# Update an existing project, including its review workflow, pre-translation/autotranslate rules, and machine-translation configuration (see workflow, machine_translation_enabled, and the autotranslate_* fields below).
|
|
224
224
|
# @param id [String] ID
|
|
225
225
|
# @param project_update_parameters [ProjectUpdateParameters]
|
|
226
226
|
# @param [Hash] opts the optional parameters
|
|
@@ -310,6 +310,7 @@ module Phrase
|
|
|
310
310
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
311
311
|
# @option opts [Integer] :page Page number
|
|
312
312
|
# @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
|
|
313
|
+
# @option opts [String] :q Filter results by name. Supports the prefix-match syntax `name:<value>`, which returns only spaces whose names begin with `<value>`. Other query formats are ignored; omitting `q` returns all accessible spaces.
|
|
313
314
|
# @return [Array<Space>]
|
|
314
315
|
def spaces_list(account_id, opts = {})
|
|
315
316
|
data, _status_code, _headers = spaces_list_with_http_info(account_id, opts)
|
|
@@ -323,6 +324,7 @@ module Phrase
|
|
|
323
324
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
324
325
|
# @option opts [Integer] :page Page number
|
|
325
326
|
# @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
|
|
327
|
+
# @option opts [String] :q Filter results by name. Supports the prefix-match syntax `name:<value>`, which returns only spaces whose names begin with `<value>`. Other query formats are ignored; omitting `q` returns all accessible spaces.
|
|
326
328
|
# @return [Array<(Response<(Array<Space>)>, Integer, Hash)>] Response<(Array<Space>)> data, response status code and response headers
|
|
327
329
|
def spaces_list_with_http_info(account_id, opts = {})
|
|
328
330
|
if @api_client.config.debugging
|
|
@@ -339,6 +341,7 @@ module Phrase
|
|
|
339
341
|
query_params = opts[:query_params] || {}
|
|
340
342
|
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
341
343
|
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
|
344
|
+
query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
|
|
342
345
|
|
|
343
346
|
# header parameters
|
|
344
347
|
header_params = opts[:header_params] || {}
|
|
@@ -8,10 +8,10 @@ module Phrase
|
|
|
8
8
|
@api_client = api_client
|
|
9
9
|
end
|
|
10
10
|
# Upload a new file
|
|
11
|
-
# Upload a new language file. Creates necessary resources in your project. Note: be aware of [upload limits](https://support.phrase.com/hc/en-us/articles/8548271212188-Phrase-Strings-Limits#file-size-upload-limits-0-0).
|
|
11
|
+
# Upload a new language file. Creates necessary resources in your project. The upload is processed asynchronously: this endpoint returns `201 Created` once the file has been accepted and enqueued, not once processing has finished. Poll `GET /projects/{project_id}/uploads/{id}` and check the `state` field — `error` means processing failed (for example, an unparseable file or a `file_format` that doesn't match the file's actual content). Note: be aware of [upload limits](https://support.phrase.com/hc/en-us/articles/8548271212188-Phrase-Strings-Limits#file-size-upload-limits-0-0).
|
|
12
12
|
# @param project_id [String] Project ID
|
|
13
13
|
# @param file [File] File to be imported
|
|
14
|
-
# @param file_format [String] File format.
|
|
14
|
+
# @param file_format [String] File format of the uploaded file, given as a format's `api_name`. See our [Formats API Endpoint](/en/api/strings/formats/list-formats) for the full list of supported formats. Optional. When omitted, Phrase tries to auto-detect the format from the file's content. This is not always possible for JSON files, since several JSON-based formats (e.g. `json`, `simple_json`, `nested_json`) share the same structure.
|
|
15
15
|
# @param locale_id [String] Locale of the file's content. Can be the name or id of the locale. Preferred is id.
|
|
16
16
|
# @param [Hash] opts the optional parameters
|
|
17
17
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
@@ -42,10 +42,10 @@ module Phrase
|
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
# Upload a new file
|
|
45
|
-
# Upload a new language file. Creates necessary resources in your project. Note: be aware of [upload limits](https://support.phrase.com/hc/en-us/articles/8548271212188-Phrase-Strings-Limits#file-size-upload-limits-0-0).
|
|
45
|
+
# Upload a new language file. Creates necessary resources in your project. The upload is processed asynchronously: this endpoint returns `201 Created` once the file has been accepted and enqueued, not once processing has finished. Poll `GET /projects/{project_id}/uploads/{id}` and check the `state` field — `error` means processing failed (for example, an unparseable file or a `file_format` that doesn't match the file's actual content). Note: be aware of [upload limits](https://support.phrase.com/hc/en-us/articles/8548271212188-Phrase-Strings-Limits#file-size-upload-limits-0-0).
|
|
46
46
|
# @param project_id [String] Project ID
|
|
47
47
|
# @param file [File] File to be imported
|
|
48
|
-
# @param file_format [String] File format.
|
|
48
|
+
# @param file_format [String] File format of the uploaded file, given as a format's `api_name`. See our [Formats API Endpoint](/en/api/strings/formats/list-formats) for the full list of supported formats. Optional. When omitted, Phrase tries to auto-detect the format from the file's content. This is not always possible for JSON files, since several JSON-based formats (e.g. `json`, `simple_json`, `nested_json`) share the same structure.
|
|
49
49
|
# @param locale_id [String] Locale of the file's content. Can be the name or id of the locale. Preferred is id.
|
|
50
50
|
# @param [Hash] opts the optional parameters
|
|
51
51
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
@@ -157,7 +157,7 @@ module Phrase
|
|
|
157
157
|
end
|
|
158
158
|
|
|
159
159
|
# Get a single upload
|
|
160
|
-
# View details and summary for a single upload.
|
|
160
|
+
# View details and summary for a single upload. Use this endpoint to poll for the outcome of an upload created via `POST /projects/{project_id}/uploads` — check the `state` field.
|
|
161
161
|
# @param project_id [String] Project ID
|
|
162
162
|
# @param id [String] ID
|
|
163
163
|
# @param [Hash] opts the optional parameters
|
|
@@ -170,7 +170,7 @@ module Phrase
|
|
|
170
170
|
end
|
|
171
171
|
|
|
172
172
|
# Get a single upload
|
|
173
|
-
# View details and summary for a single upload.
|
|
173
|
+
# View details and summary for a single upload. Use this endpoint to poll for the outcome of an upload created via `POST /projects/{project_id}/uploads` — check the `state` field.
|
|
174
174
|
# @param project_id [String] Project ID
|
|
175
175
|
# @param id [String] ID
|
|
176
176
|
# @param [Hash] opts the optional parameters
|