phrase 2.23.0 → 2.25.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 +19 -0
- data/README.md +23 -3
- data/docs/KeyCreateParameters.md +1 -1
- data/docs/KeyLink.md +29 -0
- data/docs/KeyLinksBatchDestroyParameters.md +17 -0
- data/docs/KeyLinksCreateParameters.md +17 -0
- data/docs/KeyLinksIndex400Response.md +17 -0
- data/docs/KeyUpdateParameters.md +1 -1
- data/docs/LinkedKeysApi.md +270 -0
- data/docs/ProjectCreateParameters.md +1 -1
- data/docs/ProjectUpdateParameters.md +1 -1
- data/docs/RepoSync.md +33 -0
- data/docs/RepoSyncEvent.md +27 -0
- data/docs/RepoSyncEventErrorsInner.md +16 -0
- data/docs/RepoSyncExport.md +17 -0
- data/docs/RepoSyncImport.md +17 -0
- data/docs/RepoSyncsApi.md +454 -0
- data/docs/ScreenshotUpdateParameters.md +1 -1
- data/lib/phrase/api/linked_keys_api.rb +323 -0
- data/lib/phrase/api/repo_syncs_api.rb +508 -0
- data/lib/phrase/models/key_link.rb +290 -0
- data/lib/phrase/models/key_links_batch_destroy_parameters.rb +204 -0
- data/lib/phrase/models/key_links_create_parameters.rb +204 -0
- data/lib/phrase/models/key_links_index400_response.rb +196 -0
- data/lib/phrase/models/repo_sync.rb +268 -0
- data/lib/phrase/models/repo_sync_event.rb +292 -0
- data/lib/phrase/models/repo_sync_event_errors_inner.rb +207 -0
- data/lib/phrase/models/repo_sync_export.rb +196 -0
- data/lib/phrase/models/repo_sync_import.rb +196 -0
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +11 -0
- data/spec/api/linked_keys_api_spec.rb +83 -0
- data/spec/api/repo_syncs_api_spec.rb +120 -0
- data/spec/models/key_link_spec.rb +65 -0
- data/spec/models/key_links_batch_destroy_parameters_spec.rb +29 -0
- data/spec/models/key_links_create_parameters_spec.rb +29 -0
- data/spec/models/key_links_index400_response_spec.rb +29 -0
- data/spec/models/repo_sync_event_errors_inner_spec.rb +23 -0
- data/spec/models/repo_sync_event_spec.rb +67 -0
- data/spec/models/repo_sync_export_spec.rb +29 -0
- data/spec/models/repo_sync_import_spec.rb +29 -0
- data/spec/models/repo_sync_spec.rb +77 -0
- metadata +267 -223
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
require 'cgi'
|
|
2
|
+
|
|
3
|
+
module Phrase
|
|
4
|
+
class LinkedKeysApi
|
|
5
|
+
attr_accessor :api_client
|
|
6
|
+
|
|
7
|
+
def initialize(api_client = ApiClient.default)
|
|
8
|
+
@api_client = api_client
|
|
9
|
+
end
|
|
10
|
+
# Batch unlink child keys from a parent key
|
|
11
|
+
# Unlinks multiple child keys from a given parent key in a single operation.
|
|
12
|
+
# @param project_id [String] Project ID
|
|
13
|
+
# @param id [String] Parent Translation Key ID
|
|
14
|
+
# @param key_links_batch_destroy_parameters [KeyLinksBatchDestroyParameters]
|
|
15
|
+
# @param [Hash] opts the optional parameters
|
|
16
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
17
|
+
# @option opts [Boolean] :unlink_parent Whether to unlink the parent key as well and unmark it as linked-key.
|
|
18
|
+
# @return [nil]
|
|
19
|
+
def key_links_batch_destroy(project_id, id, key_links_batch_destroy_parameters, opts = {})
|
|
20
|
+
data, _status_code, _headers = key_links_batch_destroy_with_http_info(project_id, id, key_links_batch_destroy_parameters, opts)
|
|
21
|
+
data
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Batch unlink child keys from a parent key
|
|
25
|
+
# Unlinks multiple child keys from a given parent key in a single operation.
|
|
26
|
+
# @param project_id [String] Project ID
|
|
27
|
+
# @param id [String] Parent Translation Key ID
|
|
28
|
+
# @param key_links_batch_destroy_parameters [KeyLinksBatchDestroyParameters]
|
|
29
|
+
# @param [Hash] opts the optional parameters
|
|
30
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
31
|
+
# @option opts [Boolean] :unlink_parent Whether to unlink the parent key as well and unmark it as linked-key.
|
|
32
|
+
# @return [Array<(Response, Integer, Hash)>] Response<(nil, response status code and response headers
|
|
33
|
+
def key_links_batch_destroy_with_http_info(project_id, id, key_links_batch_destroy_parameters, opts = {})
|
|
34
|
+
if @api_client.config.debugging
|
|
35
|
+
@api_client.config.logger.debug 'Calling API: LinkedKeysApi.key_links_batch_destroy ...'
|
|
36
|
+
end
|
|
37
|
+
# verify the required parameter 'project_id' is set
|
|
38
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
|
39
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling LinkedKeysApi.key_links_batch_destroy"
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'id' is set
|
|
42
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling LinkedKeysApi.key_links_batch_destroy"
|
|
44
|
+
end
|
|
45
|
+
# verify the required parameter 'key_links_batch_destroy_parameters' is set
|
|
46
|
+
if @api_client.config.client_side_validation && key_links_batch_destroy_parameters.nil?
|
|
47
|
+
fail ArgumentError, "Missing the required parameter 'key_links_batch_destroy_parameters' when calling LinkedKeysApi.key_links_batch_destroy"
|
|
48
|
+
end
|
|
49
|
+
# resource path
|
|
50
|
+
local_var_path = '/projects/{project_id}/keys/{id}/key_links'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
51
|
+
|
|
52
|
+
# query parameters
|
|
53
|
+
query_params = opts[:query_params] || {}
|
|
54
|
+
query_params[:'unlink_parent'] = opts[:'unlink_parent'] if !opts[:'unlink_parent'].nil?
|
|
55
|
+
|
|
56
|
+
# header parameters
|
|
57
|
+
header_params = opts[:header_params] || {}
|
|
58
|
+
# HTTP header 'Accept' (if needed)
|
|
59
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
60
|
+
# HTTP header 'Content-Type'
|
|
61
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
62
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
|
63
|
+
|
|
64
|
+
# form parameters
|
|
65
|
+
form_params = opts[:form_params] || {}
|
|
66
|
+
|
|
67
|
+
# http body (model)
|
|
68
|
+
post_body = opts[:body] || @api_client.object_to_http_body(key_links_batch_destroy_parameters)
|
|
69
|
+
|
|
70
|
+
# return_type
|
|
71
|
+
return_type = opts[:return_type]
|
|
72
|
+
|
|
73
|
+
# auth_names
|
|
74
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
|
75
|
+
|
|
76
|
+
new_options = opts.merge(
|
|
77
|
+
:header_params => header_params,
|
|
78
|
+
:query_params => query_params,
|
|
79
|
+
:form_params => form_params,
|
|
80
|
+
:body => post_body,
|
|
81
|
+
:auth_names => auth_names,
|
|
82
|
+
:return_type => return_type
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
86
|
+
if @api_client.config.debugging
|
|
87
|
+
@api_client.config.logger.debug "API called: LinkedKeysApi#key_links_batch_destroy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
88
|
+
end
|
|
89
|
+
response = ::Phrase::Response.new(data, headers)
|
|
90
|
+
return response, status_code, headers
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Link child keys to a parent key
|
|
94
|
+
# Creates links between a given parent key and one or more child keys.
|
|
95
|
+
# @param project_id [String] Project ID
|
|
96
|
+
# @param id [String] Parent Translation Key ID
|
|
97
|
+
# @param key_links_create_parameters [KeyLinksCreateParameters]
|
|
98
|
+
# @param [Hash] opts the optional parameters
|
|
99
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
100
|
+
# @return [KeyLink]
|
|
101
|
+
def key_links_create(project_id, id, key_links_create_parameters, opts = {})
|
|
102
|
+
data, _status_code, _headers = key_links_create_with_http_info(project_id, id, key_links_create_parameters, opts)
|
|
103
|
+
data
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Link child keys to a parent key
|
|
107
|
+
# Creates links between a given parent key and one or more child keys.
|
|
108
|
+
# @param project_id [String] Project ID
|
|
109
|
+
# @param id [String] Parent Translation Key ID
|
|
110
|
+
# @param key_links_create_parameters [KeyLinksCreateParameters]
|
|
111
|
+
# @param [Hash] opts the optional parameters
|
|
112
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
113
|
+
# @return [Array<(Response<(KeyLink)>, Integer, Hash)>] Response<(KeyLink)> data, response status code and response headers
|
|
114
|
+
def key_links_create_with_http_info(project_id, id, key_links_create_parameters, opts = {})
|
|
115
|
+
if @api_client.config.debugging
|
|
116
|
+
@api_client.config.logger.debug 'Calling API: LinkedKeysApi.key_links_create ...'
|
|
117
|
+
end
|
|
118
|
+
# verify the required parameter 'project_id' is set
|
|
119
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
|
120
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling LinkedKeysApi.key_links_create"
|
|
121
|
+
end
|
|
122
|
+
# verify the required parameter 'id' is set
|
|
123
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
124
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling LinkedKeysApi.key_links_create"
|
|
125
|
+
end
|
|
126
|
+
# verify the required parameter 'key_links_create_parameters' is set
|
|
127
|
+
if @api_client.config.client_side_validation && key_links_create_parameters.nil?
|
|
128
|
+
fail ArgumentError, "Missing the required parameter 'key_links_create_parameters' when calling LinkedKeysApi.key_links_create"
|
|
129
|
+
end
|
|
130
|
+
# resource path
|
|
131
|
+
local_var_path = '/projects/{project_id}/keys/{id}/key_links'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
132
|
+
|
|
133
|
+
# query parameters
|
|
134
|
+
query_params = opts[:query_params] || {}
|
|
135
|
+
|
|
136
|
+
# header parameters
|
|
137
|
+
header_params = opts[:header_params] || {}
|
|
138
|
+
# HTTP header 'Accept' (if needed)
|
|
139
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
140
|
+
# HTTP header 'Content-Type'
|
|
141
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
142
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
|
143
|
+
|
|
144
|
+
# form parameters
|
|
145
|
+
form_params = opts[:form_params] || {}
|
|
146
|
+
|
|
147
|
+
# http body (model)
|
|
148
|
+
post_body = opts[:body] || @api_client.object_to_http_body(key_links_create_parameters)
|
|
149
|
+
|
|
150
|
+
# return_type
|
|
151
|
+
return_type = opts[:return_type] || 'KeyLink'
|
|
152
|
+
|
|
153
|
+
# auth_names
|
|
154
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
|
155
|
+
|
|
156
|
+
new_options = opts.merge(
|
|
157
|
+
:header_params => header_params,
|
|
158
|
+
:query_params => query_params,
|
|
159
|
+
:form_params => form_params,
|
|
160
|
+
:body => post_body,
|
|
161
|
+
:auth_names => auth_names,
|
|
162
|
+
:return_type => return_type
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
166
|
+
if @api_client.config.debugging
|
|
167
|
+
@api_client.config.logger.debug "API called: LinkedKeysApi#key_links_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
168
|
+
end
|
|
169
|
+
response = ::Phrase::Response.new(data, headers)
|
|
170
|
+
return response, status_code, headers
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Unlink a child key from a parent key
|
|
174
|
+
# Unlinks a single child key from a given parent key.
|
|
175
|
+
# @param project_id [String] Project ID
|
|
176
|
+
# @param id [String] Parent Translation Key ID
|
|
177
|
+
# @param child_key_id [String] The ID of the child key to unlink.
|
|
178
|
+
# @param [Hash] opts the optional parameters
|
|
179
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
180
|
+
# @return [nil]
|
|
181
|
+
def key_links_destroy(project_id, id, child_key_id, opts = {})
|
|
182
|
+
data, _status_code, _headers = key_links_destroy_with_http_info(project_id, id, child_key_id, opts)
|
|
183
|
+
data
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Unlink a child key from a parent key
|
|
187
|
+
# Unlinks a single child key from a given parent key.
|
|
188
|
+
# @param project_id [String] Project ID
|
|
189
|
+
# @param id [String] Parent Translation Key ID
|
|
190
|
+
# @param child_key_id [String] The ID of the child key to unlink.
|
|
191
|
+
# @param [Hash] opts the optional parameters
|
|
192
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
193
|
+
# @return [Array<(Response, Integer, Hash)>] Response<(nil, response status code and response headers
|
|
194
|
+
def key_links_destroy_with_http_info(project_id, id, child_key_id, opts = {})
|
|
195
|
+
if @api_client.config.debugging
|
|
196
|
+
@api_client.config.logger.debug 'Calling API: LinkedKeysApi.key_links_destroy ...'
|
|
197
|
+
end
|
|
198
|
+
# verify the required parameter 'project_id' is set
|
|
199
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
|
200
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling LinkedKeysApi.key_links_destroy"
|
|
201
|
+
end
|
|
202
|
+
# verify the required parameter 'id' is set
|
|
203
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
204
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling LinkedKeysApi.key_links_destroy"
|
|
205
|
+
end
|
|
206
|
+
# verify the required parameter 'child_key_id' is set
|
|
207
|
+
if @api_client.config.client_side_validation && child_key_id.nil?
|
|
208
|
+
fail ArgumentError, "Missing the required parameter 'child_key_id' when calling LinkedKeysApi.key_links_destroy"
|
|
209
|
+
end
|
|
210
|
+
# resource path
|
|
211
|
+
local_var_path = '/projects/{project_id}/keys/{id}/key_links/{child_key_id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'child_key_id' + '}', CGI.escape(child_key_id.to_s))
|
|
212
|
+
|
|
213
|
+
# query parameters
|
|
214
|
+
query_params = opts[:query_params] || {}
|
|
215
|
+
|
|
216
|
+
# header parameters
|
|
217
|
+
header_params = opts[:header_params] || {}
|
|
218
|
+
# HTTP header 'Accept' (if needed)
|
|
219
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
220
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
|
221
|
+
|
|
222
|
+
# form parameters
|
|
223
|
+
form_params = opts[:form_params] || {}
|
|
224
|
+
|
|
225
|
+
# http body (model)
|
|
226
|
+
post_body = opts[:body]
|
|
227
|
+
|
|
228
|
+
# return_type
|
|
229
|
+
return_type = opts[:return_type]
|
|
230
|
+
|
|
231
|
+
# auth_names
|
|
232
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
|
233
|
+
|
|
234
|
+
new_options = opts.merge(
|
|
235
|
+
:header_params => header_params,
|
|
236
|
+
:query_params => query_params,
|
|
237
|
+
:form_params => form_params,
|
|
238
|
+
:body => post_body,
|
|
239
|
+
:auth_names => auth_names,
|
|
240
|
+
:return_type => return_type
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
244
|
+
if @api_client.config.debugging
|
|
245
|
+
@api_client.config.logger.debug "API called: LinkedKeysApi#key_links_destroy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
246
|
+
end
|
|
247
|
+
response = ::Phrase::Response.new(data, headers)
|
|
248
|
+
return response, status_code, headers
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
# Retrieve all child keys linked to a specific parent key
|
|
252
|
+
# Returns detailed information about a parent key, including its linked child keys.
|
|
253
|
+
# @param project_id [String] Project ID
|
|
254
|
+
# @param id [String] Parent Translation Key ID
|
|
255
|
+
# @param [Hash] opts the optional parameters
|
|
256
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
257
|
+
# @return [KeyLink]
|
|
258
|
+
def key_links_index(project_id, id, opts = {})
|
|
259
|
+
data, _status_code, _headers = key_links_index_with_http_info(project_id, id, opts)
|
|
260
|
+
data
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
# Retrieve all child keys linked to a specific parent key
|
|
264
|
+
# Returns detailed information about a parent key, including its linked child keys.
|
|
265
|
+
# @param project_id [String] Project ID
|
|
266
|
+
# @param id [String] Parent Translation Key ID
|
|
267
|
+
# @param [Hash] opts the optional parameters
|
|
268
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
269
|
+
# @return [Array<(Response<(KeyLink)>, Integer, Hash)>] Response<(KeyLink)> data, response status code and response headers
|
|
270
|
+
def key_links_index_with_http_info(project_id, id, opts = {})
|
|
271
|
+
if @api_client.config.debugging
|
|
272
|
+
@api_client.config.logger.debug 'Calling API: LinkedKeysApi.key_links_index ...'
|
|
273
|
+
end
|
|
274
|
+
# verify the required parameter 'project_id' is set
|
|
275
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
|
276
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling LinkedKeysApi.key_links_index"
|
|
277
|
+
end
|
|
278
|
+
# verify the required parameter 'id' is set
|
|
279
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
280
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling LinkedKeysApi.key_links_index"
|
|
281
|
+
end
|
|
282
|
+
# resource path
|
|
283
|
+
local_var_path = '/projects/{project_id}/keys/{id}/key_links'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
284
|
+
|
|
285
|
+
# query parameters
|
|
286
|
+
query_params = opts[:query_params] || {}
|
|
287
|
+
|
|
288
|
+
# header parameters
|
|
289
|
+
header_params = opts[:header_params] || {}
|
|
290
|
+
# HTTP header 'Accept' (if needed)
|
|
291
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
292
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
|
293
|
+
|
|
294
|
+
# form parameters
|
|
295
|
+
form_params = opts[:form_params] || {}
|
|
296
|
+
|
|
297
|
+
# http body (model)
|
|
298
|
+
post_body = opts[:body]
|
|
299
|
+
|
|
300
|
+
# return_type
|
|
301
|
+
return_type = opts[:return_type] || 'KeyLink'
|
|
302
|
+
|
|
303
|
+
# auth_names
|
|
304
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
|
305
|
+
|
|
306
|
+
new_options = opts.merge(
|
|
307
|
+
:header_params => header_params,
|
|
308
|
+
:query_params => query_params,
|
|
309
|
+
:form_params => form_params,
|
|
310
|
+
:body => post_body,
|
|
311
|
+
:auth_names => auth_names,
|
|
312
|
+
:return_type => return_type
|
|
313
|
+
)
|
|
314
|
+
|
|
315
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
316
|
+
if @api_client.config.debugging
|
|
317
|
+
@api_client.config.logger.debug "API called: LinkedKeysApi#key_links_index\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
318
|
+
end
|
|
319
|
+
response = ::Phrase::Response.new(data, headers)
|
|
320
|
+
return response, status_code, headers
|
|
321
|
+
end
|
|
322
|
+
end
|
|
323
|
+
end
|