crowdin-api 1.13.0 → 1.15.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/.rubocop.yml +4 -0
- data/.rubocop_todo.yml +1 -0
- data/AGENTS.md +63 -0
- data/CLAUDE.md +1 -0
- data/Gemfile.lock +1 -1
- data/README.md +23 -1
- data/lib/crowdin-api/api_resources/advisor.rb +86 -0
- data/lib/crowdin-api/api_resources/ai.rb +974 -0
- data/lib/crowdin-api/api_resources/applications.rb +252 -15
- data/lib/crowdin-api/api_resources/bundles.rb +45 -29
- data/lib/crowdin-api/api_resources/clients.rb +23 -0
- data/lib/crowdin-api/api_resources/custom_spellcheckers.rb +36 -0
- data/lib/crowdin-api/api_resources/dictionaries.rb +5 -5
- data/lib/crowdin-api/api_resources/distributions.rb +15 -15
- data/lib/crowdin-api/api_resources/external_qa_checks.rb +36 -0
- data/lib/crowdin-api/api_resources/fields.rb +78 -0
- data/lib/crowdin-api/api_resources/glossaries.rb +62 -50
- data/lib/crowdin-api/api_resources/integrations.rb +201 -0
- data/lib/crowdin-api/api_resources/labels.rb +32 -0
- data/lib/crowdin-api/api_resources/languages.rb +16 -0
- data/lib/crowdin-api/api_resources/machine_translation_engines.rb +17 -0
- data/lib/crowdin-api/api_resources/notifications.rb +15 -6
- data/lib/crowdin-api/api_resources/organization.rb +33 -0
- data/lib/crowdin-api/api_resources/organization_webhooks.rb +71 -0
- data/lib/crowdin-api/api_resources/placeholders.rb +182 -0
- data/lib/crowdin-api/api_resources/projects.rb +137 -41
- data/lib/crowdin-api/api_resources/reports.rb +310 -26
- data/lib/crowdin-api/api_resources/screenshots.rb +48 -0
- data/lib/crowdin-api/api_resources/security_logs.rb +63 -0
- data/lib/crowdin-api/api_resources/source_files.rb +370 -65
- data/lib/crowdin-api/api_resources/source_strings.rb +62 -0
- data/lib/crowdin-api/api_resources/storages.rb +11 -11
- data/lib/crowdin-api/api_resources/string_comments.rb +46 -0
- data/lib/crowdin-api/api_resources/string_corrections.rb +21 -6
- data/lib/crowdin-api/api_resources/string_translations.rb +96 -0
- data/lib/crowdin-api/api_resources/style_guides.rb +71 -0
- data/lib/crowdin-api/api_resources/tasks.rb +140 -10
- data/lib/crowdin-api/api_resources/teams.rb +99 -0
- data/lib/crowdin-api/api_resources/translation_memory.rb +138 -0
- data/lib/crowdin-api/api_resources/translation_status.rb +65 -0
- data/lib/crowdin-api/api_resources/translations.rb +122 -2
- data/lib/crowdin-api/api_resources/users.rb +136 -6
- data/lib/crowdin-api/api_resources/vendors.rb +2 -0
- data/lib/crowdin-api/api_resources/webhooks.rb +16 -0
- data/lib/crowdin-api/api_resources/workflows.rb +24 -0
- data/lib/crowdin-api/client/client.rb +3 -8
- data/lib/crowdin-api/client/version.rb +1 -1
- data/lib/crowdin-api/core/graphql_extensions.rb +22 -0
- data/lib/crowdin-api/core/request.rb +1 -1
- data/lib/crowdin-api.rb +4 -1
- data/spec/api_resources/advisor_spec.rb +45 -0
- data/spec/api_resources/ai_spec.rb +863 -0
- data/spec/api_resources/applications_spec.rb +138 -0
- data/spec/api_resources/bundles_spec.rb +8 -0
- data/spec/api_resources/clients_spec.rb +13 -0
- data/spec/api_resources/custom_spellcheckers_spec.rb +21 -0
- data/spec/api_resources/external_qa_checks_spec.rb +21 -0
- data/spec/api_resources/fields_spec.rb +45 -0
- data/spec/api_resources/glossaries_spec.rb +18 -0
- data/spec/api_resources/integrations_spec.rb +117 -0
- data/spec/api_resources/organization_spec.rb +21 -0
- data/spec/api_resources/organization_webhooks_spec.rb +45 -0
- data/spec/api_resources/placeholders_spec.rb +103 -0
- data/spec/api_resources/projects_spec.rb +58 -0
- data/spec/api_resources/reports_spec.rb +221 -0
- data/spec/api_resources/security_logs_spec.rb +39 -0
- data/spec/api_resources/source_files_spec.rb +182 -0
- data/spec/api_resources/source_strings_spec.rb +26 -0
- data/spec/api_resources/string_comments_spec.rb +18 -0
- data/spec/api_resources/string_corrections_spec.rb +25 -19
- data/spec/api_resources/string_translations_spec.rb +26 -0
- data/spec/api_resources/style_guides_spec.rb +45 -0
- data/spec/api_resources/tasks_spec.rb +60 -0
- data/spec/api_resources/teams_spec.rb +42 -0
- data/spec/api_resources/translation_memory_spec.rb +58 -0
- data/spec/api_resources/translation_status_spec.rb +26 -0
- data/spec/api_resources/translations_spec.rb +42 -0
- data/spec/api_resources/users_spec.rb +84 -0
- data/spec/api_resources/workflows_spec.rb +10 -0
- data/spec/unit/client_spec.rb +47 -0
- metadata +28 -1
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
module Crowdin
|
|
4
4
|
module ApiResources
|
|
5
5
|
module Tasks
|
|
6
|
+
# @param query [Hash] Request Query Parameters
|
|
7
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.tasks.getMany API Documentation}
|
|
8
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.tasks.getMany Enterprise API Documentation}
|
|
6
9
|
def list_tasks(query = {}, project_id = config.project_id)
|
|
7
10
|
project_id || raise_project_id_is_required_error
|
|
8
11
|
|
|
@@ -15,6 +18,9 @@ module Crowdin
|
|
|
15
18
|
Web::SendRequest.new(request).perform
|
|
16
19
|
end
|
|
17
20
|
|
|
21
|
+
# @param query [Hash] Request Body
|
|
22
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.tasks.post API Documentation}
|
|
23
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.tasks.post Enterprise API Documentation}
|
|
18
24
|
def add_task(query = {}, project_id = config.project_id)
|
|
19
25
|
project_id || raise_project_id_is_required_error
|
|
20
26
|
|
|
@@ -27,6 +33,10 @@ module Crowdin
|
|
|
27
33
|
Web::SendRequest.new(request).perform
|
|
28
34
|
end
|
|
29
35
|
|
|
36
|
+
# @param task_id [Integer] Task Identifier
|
|
37
|
+
# @param destination [String] Destination of File
|
|
38
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.tasks.exports.post API Documentation}
|
|
39
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.tasks.exports.post Enterprise API Documentation}
|
|
30
40
|
def export_task_strings(task_id = nil, destination = nil, project_id = config.project_id)
|
|
31
41
|
task_id || raise_parameter_is_required_error(:task_id)
|
|
32
42
|
project_id || raise_project_id_is_required_error
|
|
@@ -39,6 +49,9 @@ module Crowdin
|
|
|
39
49
|
Web::SendRequest.new(request, destination).perform
|
|
40
50
|
end
|
|
41
51
|
|
|
52
|
+
# @param task_id [Integer] Task Identifier
|
|
53
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.tasks.get API Documentation}
|
|
54
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.tasks.get Enterprise API Documentation}
|
|
42
55
|
def get_task(task_id = nil, project_id = config.project_id)
|
|
43
56
|
task_id || raise_parameter_is_required_error(:task_id)
|
|
44
57
|
project_id || raise_project_id_is_required_error
|
|
@@ -51,6 +64,9 @@ module Crowdin
|
|
|
51
64
|
Web::SendRequest.new(request).perform
|
|
52
65
|
end
|
|
53
66
|
|
|
67
|
+
# @param task_id [Integer] Task Identifier
|
|
68
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.tasks.delete API Documentation}
|
|
69
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.tasks.delete Enterprise API Documentation}
|
|
54
70
|
def delete_task(task_id = nil, project_id = config.project_id)
|
|
55
71
|
task_id || raise_parameter_is_required_error(:task_id)
|
|
56
72
|
project_id || raise_project_id_is_required_error
|
|
@@ -63,6 +79,10 @@ module Crowdin
|
|
|
63
79
|
Web::SendRequest.new(request).perform
|
|
64
80
|
end
|
|
65
81
|
|
|
82
|
+
# @param task_id [Integer] Task Identifier
|
|
83
|
+
# @param query [Hash] Request Body
|
|
84
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.tasks.patch API Documentation}
|
|
85
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.tasks.patch Enterprise API Documentation}
|
|
66
86
|
def edit_task(task_id = nil, query = {}, project_id = config.project_id)
|
|
67
87
|
task_id || raise_parameter_is_required_error(:task_id)
|
|
68
88
|
project_id || raise_project_id_is_required_error
|
|
@@ -76,6 +96,9 @@ module Crowdin
|
|
|
76
96
|
Web::SendRequest.new(request).perform
|
|
77
97
|
end
|
|
78
98
|
|
|
99
|
+
# @param query [Hash] Request Query Parameters
|
|
100
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.user.tasks.getMany API Documentation}
|
|
101
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.user.tasks.getMany Enterprise API Documentation}
|
|
79
102
|
def list_user_tasks(query = {})
|
|
80
103
|
request = Web::Request.new(
|
|
81
104
|
connection,
|
|
@@ -86,6 +109,10 @@ module Crowdin
|
|
|
86
109
|
Web::SendRequest.new(request).perform
|
|
87
110
|
end
|
|
88
111
|
|
|
112
|
+
# @param task_id [Integer] Task Identifier
|
|
113
|
+
# @param query [Hash] Request Body
|
|
114
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.user.tasks.patch API Documentation}
|
|
115
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.user.tasks.patch Enterprise API Documentation}
|
|
89
116
|
def edit_task_archived_status(task_id = nil, query = {})
|
|
90
117
|
task_id || raise_parameter_is_required_error(:task_id)
|
|
91
118
|
|
|
@@ -98,8 +125,10 @@ module Crowdin
|
|
|
98
125
|
Web::SendRequest.new(request).perform
|
|
99
126
|
end
|
|
100
127
|
|
|
101
|
-
#
|
|
102
|
-
#
|
|
128
|
+
# @param task_id [Integer] Task Identifier
|
|
129
|
+
# @param query [Hash] Request Query Parameters
|
|
130
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.tasks.comments.getMany API Documentation}
|
|
131
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.tasks.comments.getMany Enterprise API Documentation}
|
|
103
132
|
def list_task_comments(task_id = nil, query = {}, project_id = config.project_id)
|
|
104
133
|
project_id || raise_project_id_is_required_error
|
|
105
134
|
task_id || raise_parameter_is_required_error(:task_id)
|
|
@@ -113,8 +142,10 @@ module Crowdin
|
|
|
113
142
|
Web::SendRequest.new(request).perform
|
|
114
143
|
end
|
|
115
144
|
|
|
116
|
-
#
|
|
117
|
-
#
|
|
145
|
+
# @param task_id [Integer] Task Identifier
|
|
146
|
+
# @param comment_id [Integer] Unique identifier for the task comment
|
|
147
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.tasks.comments.get API Documentation}
|
|
148
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.tasks.comments.get Enterprise API Documentation}
|
|
118
149
|
def get_task_comment(task_id = nil, comment_id = nil, project_id = config.project_id)
|
|
119
150
|
project_id || raise_project_id_is_required_error
|
|
120
151
|
task_id || raise_parameter_is_required_error(:task_id)
|
|
@@ -128,8 +159,10 @@ module Crowdin
|
|
|
128
159
|
Web::SendRequest.new(request).perform
|
|
129
160
|
end
|
|
130
161
|
|
|
131
|
-
#
|
|
132
|
-
#
|
|
162
|
+
# @param task_id [Integer] Task Identifier
|
|
163
|
+
# @param body [Hash] Request Body
|
|
164
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.tasks.comments.post API Documentation}
|
|
165
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.tasks.comments.post Enterprise API Documentation}
|
|
133
166
|
def add_task_comment(task_id = nil, body = {}, project_id = config.project_id)
|
|
134
167
|
project_id || raise_project_id_is_required_error
|
|
135
168
|
task_id || raise_parameter_is_required_error(:task_id)
|
|
@@ -143,8 +176,11 @@ module Crowdin
|
|
|
143
176
|
Web::SendRequest.new(request).perform
|
|
144
177
|
end
|
|
145
178
|
|
|
146
|
-
#
|
|
147
|
-
#
|
|
179
|
+
# @param task_id [Integer] Task Identifier
|
|
180
|
+
# @param comment_id [Integer] Unique identifier for the task comment
|
|
181
|
+
# @param body [Hash] Request Body
|
|
182
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.tasks.comments.patch API Documentation}
|
|
183
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.tasks.comments.patch Enterprise API Documentation}
|
|
148
184
|
def edit_task_comment(task_id = nil, comment_id = nil, body = {}, project_id = config.project_id)
|
|
149
185
|
project_id || raise_project_id_is_required_error
|
|
150
186
|
task_id || raise_parameter_is_required_error(:task_id)
|
|
@@ -159,8 +195,10 @@ module Crowdin
|
|
|
159
195
|
Web::SendRequest.new(request).perform
|
|
160
196
|
end
|
|
161
197
|
|
|
162
|
-
#
|
|
163
|
-
#
|
|
198
|
+
# @param task_id [Integer] Task Identifier
|
|
199
|
+
# @param comment_id [Integer] Unique identifier for the task comment
|
|
200
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.tasks.comments.delete API Documentation}
|
|
201
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.tasks.comments.delete Enterprise API Documentation}
|
|
164
202
|
def delete_task_comment(task_id = nil, comment_id = nil, project_id = config.project_id)
|
|
165
203
|
project_id || raise_project_id_is_required_error
|
|
166
204
|
task_id || raise_parameter_is_required_error(:task_id)
|
|
@@ -173,6 +211,98 @@ module Crowdin
|
|
|
173
211
|
)
|
|
174
212
|
Web::SendRequest.new(request).perform
|
|
175
213
|
end
|
|
214
|
+
|
|
215
|
+
# @param query [Hash] Request Query Parameters
|
|
216
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.tasks.settings-templates.getMany API Documentation}
|
|
217
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.tasks.settings-templates.getMany Enterprise API Documentation}
|
|
218
|
+
def list_project_task_settings_templates(query = {}, project_id = config.project_id)
|
|
219
|
+
project_id || raise_project_id_is_required_error
|
|
220
|
+
|
|
221
|
+
request = Web::Request.new(
|
|
222
|
+
connection,
|
|
223
|
+
:get,
|
|
224
|
+
"#{config.target_api_url}/projects/#{project_id}/tasks/settings-templates",
|
|
225
|
+
{ params: query }
|
|
226
|
+
)
|
|
227
|
+
Web::SendRequest.new(request).perform
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
# @param body [Hash] Request Body
|
|
231
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.tasks.settings-templates.post API Documentation}
|
|
232
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.tasks.settings-templates.post Enterprise API Documentation}
|
|
233
|
+
def add_project_task_settings_template(body = {}, project_id = config.project_id)
|
|
234
|
+
project_id || raise_project_id_is_required_error
|
|
235
|
+
|
|
236
|
+
request = Web::Request.new(
|
|
237
|
+
connection,
|
|
238
|
+
:post,
|
|
239
|
+
"#{config.target_api_url}/projects/#{project_id}/tasks/settings-templates",
|
|
240
|
+
{ params: body }
|
|
241
|
+
)
|
|
242
|
+
Web::SendRequest.new(request).perform
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
# @param task_settings_template_id [Integer] Task Settings Template Identifier
|
|
246
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.tasks.settings-templates.delete API Documentation}
|
|
247
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.tasks.settings-templates.delete Enterprise API Documentation}
|
|
248
|
+
def delete_project_task_settings_template(task_settings_template_id, project_id = config.project_id)
|
|
249
|
+
project_id || raise_project_id_is_required_error
|
|
250
|
+
|
|
251
|
+
request = Web::Request.new(
|
|
252
|
+
connection,
|
|
253
|
+
:delete,
|
|
254
|
+
"#{config.target_api_url}/projects/#{project_id}/tasks/settings-templates/#{task_settings_template_id}"
|
|
255
|
+
)
|
|
256
|
+
Web::SendRequest.new(request).perform
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
# @param task_settings_template_id [Integer] Task Settings Template Identifier
|
|
260
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.tasks.settings-templates.get API Documentation}
|
|
261
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.tasks.settings-templates.get Enterprise API Documentation}
|
|
262
|
+
def get_project_task_settings_template(task_settings_template_id, project_id = config.project_id)
|
|
263
|
+
project_id || raise_project_id_is_required_error
|
|
264
|
+
|
|
265
|
+
request = Web::Request.new(
|
|
266
|
+
connection,
|
|
267
|
+
:get,
|
|
268
|
+
"#{config.target_api_url}/projects/#{project_id}/tasks/settings-templates/#{task_settings_template_id}"
|
|
269
|
+
)
|
|
270
|
+
Web::SendRequest.new(request).perform
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
# @param task_settings_template_id [Integer] Task Settings Template Identifier
|
|
274
|
+
# @param body [Array] Request Body
|
|
275
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.tasks.settings-templates.patch API Documentation}
|
|
276
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.tasks.settings-templates.patch Enterprise API Documentation}
|
|
277
|
+
def edit_project_task_settings_template(task_settings_template_id, body = [], project_id = config.project_id)
|
|
278
|
+
project_id || raise_project_id_is_required_error
|
|
279
|
+
|
|
280
|
+
request = Web::Request.new(
|
|
281
|
+
connection,
|
|
282
|
+
:patch,
|
|
283
|
+
"#{config.target_api_url}/projects/#{project_id}/tasks/settings-templates/#{task_settings_template_id}",
|
|
284
|
+
{ params: body }
|
|
285
|
+
)
|
|
286
|
+
Web::SendRequest.new(request).perform
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
# @param query [Hash] Request Query Parameters
|
|
290
|
+
# @param user_id [Integer] User Identifier (Crowdin only)
|
|
291
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.users.tasks.getMany API Documentation}
|
|
292
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.tasks.getMany Enterprise API Documentation}
|
|
293
|
+
def list_specific_user_tasks(query = {}, user_id = nil)
|
|
294
|
+
enterprise_mode? || user_id || raise_parameter_is_required_error(:user_id)
|
|
295
|
+
|
|
296
|
+
endpoint = 'tasks'
|
|
297
|
+
endpoint = "users/#{user_id}/#{endpoint}" unless enterprise_mode?
|
|
298
|
+
request = Web::Request.new(
|
|
299
|
+
connection,
|
|
300
|
+
:get,
|
|
301
|
+
"#{config.target_api_url}/#{endpoint}",
|
|
302
|
+
{ params: query }
|
|
303
|
+
)
|
|
304
|
+
Web::SendRequest.new(request).perform
|
|
305
|
+
end
|
|
176
306
|
end
|
|
177
307
|
end
|
|
178
308
|
end
|
|
@@ -5,6 +5,8 @@ module Crowdin
|
|
|
5
5
|
module Teams
|
|
6
6
|
# -- For Enterprise mode only --
|
|
7
7
|
|
|
8
|
+
# @param query [Hash] Request Body
|
|
9
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.teams.post Enterprise API Documentation}
|
|
8
10
|
def add_team_to_project(query = {}, project_id = config.project_id)
|
|
9
11
|
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
10
12
|
project_id || raise_project_id_is_required_error
|
|
@@ -18,6 +20,8 @@ module Crowdin
|
|
|
18
20
|
Web::SendRequest.new(request).perform
|
|
19
21
|
end
|
|
20
22
|
|
|
23
|
+
# @param query [Hash] Request Query Parameters
|
|
24
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.teams.getMany Enterprise API Documentation}
|
|
21
25
|
def list_teams(query = {})
|
|
22
26
|
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
23
27
|
|
|
@@ -30,6 +34,8 @@ module Crowdin
|
|
|
30
34
|
Web::SendRequest.new(request).perform
|
|
31
35
|
end
|
|
32
36
|
|
|
37
|
+
# @param query [Hash] Request Body
|
|
38
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.teams.post Enterprise API Documentation}
|
|
33
39
|
def add_team(query = {})
|
|
34
40
|
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
35
41
|
|
|
@@ -42,6 +48,9 @@ module Crowdin
|
|
|
42
48
|
Web::SendRequest.new(request).perform
|
|
43
49
|
end
|
|
44
50
|
|
|
51
|
+
# @param team_id [Integer] Team Identifier
|
|
52
|
+
# @param query [Hash] Request Query Parameters
|
|
53
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.teams.get Enterprise API Documentation}
|
|
45
54
|
def get_team(team_id = nil, query = {})
|
|
46
55
|
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
47
56
|
team_id || raise_parameter_is_required_error(:team_id)
|
|
@@ -55,6 +64,8 @@ module Crowdin
|
|
|
55
64
|
Web::SendRequest.new(request).perform
|
|
56
65
|
end
|
|
57
66
|
|
|
67
|
+
# @param team_id [Integer] Team Identifier
|
|
68
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.teams.delete Enterprise API Documentation}
|
|
58
69
|
def delete_team(team_id = nil)
|
|
59
70
|
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
60
71
|
team_id || raise_parameter_is_required_error(:team_id)
|
|
@@ -67,6 +78,9 @@ module Crowdin
|
|
|
67
78
|
Web::SendRequest.new(request).perform
|
|
68
79
|
end
|
|
69
80
|
|
|
81
|
+
# @param team_id [Integer] Team Identifier
|
|
82
|
+
# @param query [Hash] Request Body
|
|
83
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.teams.patch Enterprise API Documentation}
|
|
70
84
|
def edit_team(team_id = nil, query = {})
|
|
71
85
|
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
72
86
|
team_id || raise_parameter_is_required_error(:team_id)
|
|
@@ -80,6 +94,9 @@ module Crowdin
|
|
|
80
94
|
Web::SendRequest.new(request).perform
|
|
81
95
|
end
|
|
82
96
|
|
|
97
|
+
# @param team_id [Integer] Team Identifier
|
|
98
|
+
# @param query [Hash] Request Query Parameters
|
|
99
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.teams.members.getMany Enterprise API Documentation}
|
|
83
100
|
def team_members_list(team_id = nil, query = {})
|
|
84
101
|
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
85
102
|
team_id || raise_parameter_is_required_error(:team_id)
|
|
@@ -93,6 +110,9 @@ module Crowdin
|
|
|
93
110
|
Web::SendRequest.new(request).perform
|
|
94
111
|
end
|
|
95
112
|
|
|
113
|
+
# @param team_id [Integer] Team Identifier
|
|
114
|
+
# @param query [Hash] Request Body
|
|
115
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.teams.members.post Enterprise API Documentation}
|
|
96
116
|
def add_team_members(team_id = nil, query = {})
|
|
97
117
|
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
98
118
|
team_id || raise_parameter_is_required_error(:team_id)
|
|
@@ -106,6 +126,8 @@ module Crowdin
|
|
|
106
126
|
Web::SendRequest.new(request).perform
|
|
107
127
|
end
|
|
108
128
|
|
|
129
|
+
# @param team_id [Integer] Team Identifier
|
|
130
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.teams.members.deleteMany Enterprise API Documentation}
|
|
109
131
|
def delete_all_team_members(team_id = nil)
|
|
110
132
|
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
111
133
|
team_id || raise_parameter_is_required_error(:team_id)
|
|
@@ -118,6 +140,9 @@ module Crowdin
|
|
|
118
140
|
Web::SendRequest.new(request).perform
|
|
119
141
|
end
|
|
120
142
|
|
|
143
|
+
# @param team_id [Integer] Team Identifier
|
|
144
|
+
# @param member_id [Integer] Team Member Identifier
|
|
145
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.teams.members.delete Enterprise API Documentation}
|
|
121
146
|
def delete_team_member(team_id = nil, member_id = nil)
|
|
122
147
|
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
123
148
|
team_id || raise_parameter_is_required_error(:team_id)
|
|
@@ -130,6 +155,80 @@ module Crowdin
|
|
|
130
155
|
)
|
|
131
156
|
Web::SendRequest.new(request).perform
|
|
132
157
|
end
|
|
158
|
+
|
|
159
|
+
# @param group_id [Integer] Group Identifier
|
|
160
|
+
# @param query [Hash] Request Query Parameters
|
|
161
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.groups.teams.getMany Enterprise API Documentation}
|
|
162
|
+
def list_group_teams(group_id, query = {})
|
|
163
|
+
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
164
|
+
|
|
165
|
+
request = Web::Request.new(
|
|
166
|
+
connection,
|
|
167
|
+
:get,
|
|
168
|
+
"#{config.target_api_url}/groups/#{group_id}/teams",
|
|
169
|
+
{ params: query }
|
|
170
|
+
)
|
|
171
|
+
Web::SendRequest.new(request).perform
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# @param group_id [Integer] Group Identifier
|
|
175
|
+
# @param body [Array] Request Body
|
|
176
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.groups.teams.patch Enterprise API Documentation}
|
|
177
|
+
def update_group_teams(group_id, body = [])
|
|
178
|
+
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
179
|
+
|
|
180
|
+
request = Web::Request.new(
|
|
181
|
+
connection,
|
|
182
|
+
:patch,
|
|
183
|
+
"#{config.target_api_url}/groups/#{group_id}/teams",
|
|
184
|
+
{ params: body }
|
|
185
|
+
)
|
|
186
|
+
Web::SendRequest.new(request).perform
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# @param group_id [Integer] Group Identifier
|
|
190
|
+
# @param team_id [Integer] Team Identifier
|
|
191
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.groups.teams.get Enterprise API Documentation}
|
|
192
|
+
def get_group_team(group_id, team_id)
|
|
193
|
+
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
194
|
+
|
|
195
|
+
request = Web::Request.new(
|
|
196
|
+
connection,
|
|
197
|
+
:get,
|
|
198
|
+
"#{config.target_api_url}/groups/#{group_id}/teams/#{team_id}"
|
|
199
|
+
)
|
|
200
|
+
Web::SendRequest.new(request).perform
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
# @param team_id [Integer] Team Identifier
|
|
204
|
+
# @param query [Hash] Request Query Parameters
|
|
205
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.teams.projects.permissions.getMany Enterprise API Documentation}
|
|
206
|
+
def list_team_projects_permissions(team_id, query = {})
|
|
207
|
+
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
208
|
+
|
|
209
|
+
request = Web::Request.new(
|
|
210
|
+
connection,
|
|
211
|
+
:get,
|
|
212
|
+
"#{config.target_api_url}/teams/#{team_id}/projects/permissions",
|
|
213
|
+
{ params: query }
|
|
214
|
+
)
|
|
215
|
+
Web::SendRequest.new(request).perform
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# @param team_id [Integer] Team Identifier
|
|
219
|
+
# @param body [Array] Request Body
|
|
220
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.teams.projects.permissions.patch Enterprise API Documentation}
|
|
221
|
+
def edit_team_projects_permissions(team_id, body = [])
|
|
222
|
+
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
223
|
+
|
|
224
|
+
request = Web::Request.new(
|
|
225
|
+
connection,
|
|
226
|
+
:patch,
|
|
227
|
+
"#{config.target_api_url}/teams/#{team_id}/projects/permissions",
|
|
228
|
+
{ params: body }
|
|
229
|
+
)
|
|
230
|
+
Web::SendRequest.new(request).perform
|
|
231
|
+
end
|
|
133
232
|
end
|
|
134
233
|
end
|
|
135
234
|
end
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
module Crowdin
|
|
4
4
|
module ApiResources
|
|
5
5
|
module TranslationMemory
|
|
6
|
+
# @param query [Hash] Request Query Parameters
|
|
7
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.tms.getMany API Documentation}
|
|
8
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.tms.getMany Enterprise API Documentation}
|
|
6
9
|
def list_tms(query = {})
|
|
7
10
|
request = Web::Request.new(
|
|
8
11
|
connection,
|
|
@@ -13,6 +16,9 @@ module Crowdin
|
|
|
13
16
|
Web::SendRequest.new(request).perform
|
|
14
17
|
end
|
|
15
18
|
|
|
19
|
+
# @param query [Hash] Request Body
|
|
20
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.tms.post API Documentation}
|
|
21
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.tms.post Enterprise API Documentation}
|
|
16
22
|
def add_tm(query = {})
|
|
17
23
|
request = Web::Request.new(
|
|
18
24
|
connection,
|
|
@@ -23,6 +29,9 @@ module Crowdin
|
|
|
23
29
|
Web::SendRequest.new(request).perform
|
|
24
30
|
end
|
|
25
31
|
|
|
32
|
+
# @param tm_id [Integer] TM Identifier
|
|
33
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.tms.get API Documentation}
|
|
34
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.tms.get Enterprise API Documentation}
|
|
26
35
|
def get_tm(tm_id = nil)
|
|
27
36
|
tm_id || raise_parameter_is_required_error(:tm_id)
|
|
28
37
|
|
|
@@ -34,6 +43,9 @@ module Crowdin
|
|
|
34
43
|
Web::SendRequest.new(request).perform
|
|
35
44
|
end
|
|
36
45
|
|
|
46
|
+
# @param tm_id [Integer] TM Identifier
|
|
47
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.tms.delete API Documentation}
|
|
48
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.tms.delete Enterprise API Documentation}
|
|
37
49
|
def delete_tm(tm_id = nil)
|
|
38
50
|
tm_id || raise_parameter_is_required_error(:tm_id)
|
|
39
51
|
|
|
@@ -45,6 +57,10 @@ module Crowdin
|
|
|
45
57
|
Web::SendRequest.new(request).perform
|
|
46
58
|
end
|
|
47
59
|
|
|
60
|
+
# @param tm_id [Integer] TM Identifier
|
|
61
|
+
# @param query [Hash] Request Body
|
|
62
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.tms.patch API Documentation}
|
|
63
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.tms.patch Enterprise API Documentation}
|
|
48
64
|
def edit_tm(tm_id = nil, query = {})
|
|
49
65
|
tm_id || raise_parameter_is_required_error(:tm_id)
|
|
50
66
|
|
|
@@ -57,6 +73,9 @@ module Crowdin
|
|
|
57
73
|
Web::SendRequest.new(request).perform
|
|
58
74
|
end
|
|
59
75
|
|
|
76
|
+
# @param tm_id [Integer] TM Identifier
|
|
77
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.tms.segments.clear API Documentation}
|
|
78
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.tms.segments.clear Enterprise API Documentation}
|
|
60
79
|
def clear_tm(tm_id = nil)
|
|
61
80
|
tm_id || raise_parameter_is_required_error(:tm_id)
|
|
62
81
|
|
|
@@ -68,6 +87,9 @@ module Crowdin
|
|
|
68
87
|
Web::SendRequest.new(request).perform
|
|
69
88
|
end
|
|
70
89
|
|
|
90
|
+
# @param tm_id [Integer] TM Identifier
|
|
91
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.tms.exports.post API Documentation}
|
|
92
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.tms.exports.post Enterprise API Documentation}
|
|
71
93
|
def export_tm(tm_id = nil)
|
|
72
94
|
tm_id || raise_parameter_is_required_error(:tm_id)
|
|
73
95
|
|
|
@@ -79,6 +101,10 @@ module Crowdin
|
|
|
79
101
|
Web::SendRequest.new(request).perform
|
|
80
102
|
end
|
|
81
103
|
|
|
104
|
+
# @param tm_id [Integer] TM Identifier
|
|
105
|
+
# @param export_id [String] Export Identifier, consists of 36 characters
|
|
106
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.tms.exports.get API Documentation}
|
|
107
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.tms.exports.get Enterprise API Documentation}
|
|
82
108
|
def check_tm_export_status(tm_id = nil, export_id = nil)
|
|
83
109
|
tm_id || raise_parameter_is_required_error(:tm_id)
|
|
84
110
|
export_id || raise_parameter_is_required_error(:export_id)
|
|
@@ -91,6 +117,11 @@ module Crowdin
|
|
|
91
117
|
Web::SendRequest.new(request).perform
|
|
92
118
|
end
|
|
93
119
|
|
|
120
|
+
# @param tm_id [Integer] TM Identifier
|
|
121
|
+
# @param export_id [String] Export Identifier, consists of 36 characters
|
|
122
|
+
# @param destination [String] Destination of File
|
|
123
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.tms.exports.download.download API Documentation}
|
|
124
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.tms.exports.download.download Enterprise API Documentation}
|
|
94
125
|
def download_tm(tm_id = nil, export_id = nil, destination = nil)
|
|
95
126
|
tm_id || raise_parameter_is_required_error(:tm_id)
|
|
96
127
|
export_id || raise_parameter_is_required_error(:export_id)
|
|
@@ -103,6 +134,10 @@ module Crowdin
|
|
|
103
134
|
Web::SendRequest.new(request, destination).perform
|
|
104
135
|
end
|
|
105
136
|
|
|
137
|
+
# @param tm_id [Integer] TM Identifier
|
|
138
|
+
# @param query [Hash] Request Body
|
|
139
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.tms.imports.post API Documentation}
|
|
140
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.tms.imports.post Enterprise API Documentation}
|
|
106
141
|
def import_tm(tm_id = nil, query = {})
|
|
107
142
|
tm_id || raise_parameter_is_required_error(:tm_id)
|
|
108
143
|
|
|
@@ -115,6 +150,10 @@ module Crowdin
|
|
|
115
150
|
Web::SendRequest.new(request).perform
|
|
116
151
|
end
|
|
117
152
|
|
|
153
|
+
# @param tm_id [Integer] TM Identifier
|
|
154
|
+
# @param import_id [String] Import Identifier, consists of 36 characters
|
|
155
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.tms.imports.get API Documentation}
|
|
156
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.tms.imports.get Enterprise API Documentation}
|
|
118
157
|
def check_tm_import_status(tm_id = nil, import_id = nil)
|
|
119
158
|
tm_id || raise_parameter_is_required_error(:tm_id)
|
|
120
159
|
import_id || raise_parameter_is_required_error(:import_id)
|
|
@@ -127,6 +166,9 @@ module Crowdin
|
|
|
127
166
|
Web::SendRequest.new(request).perform
|
|
128
167
|
end
|
|
129
168
|
|
|
169
|
+
# @param query [Hash] Request Body
|
|
170
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.tms.concordance.post API Documentation}
|
|
171
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.tms.concordance.post Enterprise API Documentation}
|
|
130
172
|
def search_tms_concordance(project_id = nil, query = {})
|
|
131
173
|
project_id || raise_project_id_is_required_error
|
|
132
174
|
|
|
@@ -142,6 +184,102 @@ module Crowdin
|
|
|
142
184
|
)
|
|
143
185
|
Web::SendRequest.new(request).perform
|
|
144
186
|
end
|
|
187
|
+
|
|
188
|
+
# @param body [Hash] Request Body
|
|
189
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.tms.concordance.post API Documentation}
|
|
190
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.tms.concordance.post Enterprise API Documentation}
|
|
191
|
+
def concordance_search_in_tms(body = {})
|
|
192
|
+
request = Web::Request.new(
|
|
193
|
+
connection,
|
|
194
|
+
:post,
|
|
195
|
+
"#{config.target_api_url}/tms/concordance",
|
|
196
|
+
{ params: body }
|
|
197
|
+
)
|
|
198
|
+
Web::SendRequest.new(request).perform
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# @param tm_id [Integer] TM Identifier
|
|
202
|
+
# @param query [Hash] Request Query Parameters
|
|
203
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.tms.segments.getMany API Documentation}
|
|
204
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.tms.segments.getMany Enterprise API Documentation}
|
|
205
|
+
def list_tm_segments(tm_id, query = {})
|
|
206
|
+
request = Web::Request.new(
|
|
207
|
+
connection,
|
|
208
|
+
:get,
|
|
209
|
+
"#{config.target_api_url}/tms/#{tm_id}/segments",
|
|
210
|
+
{ params: query }
|
|
211
|
+
)
|
|
212
|
+
Web::SendRequest.new(request).perform
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# @param tm_id [Integer] TM Identifier
|
|
216
|
+
# @param body [Array] Request Body
|
|
217
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.tms.segments.patchBatch API Documentation}
|
|
218
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.tms.segments.patchBatch Enterprise API Documentation}
|
|
219
|
+
def tm_segment_batch_operations(tm_id, body = [])
|
|
220
|
+
request = Web::Request.new(
|
|
221
|
+
connection,
|
|
222
|
+
:patch,
|
|
223
|
+
"#{config.target_api_url}/tms/#{tm_id}/segments",
|
|
224
|
+
{ params: body }
|
|
225
|
+
)
|
|
226
|
+
Web::SendRequest.new(request).perform
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# @param tm_id [Integer] TM Identifier
|
|
230
|
+
# @param body [Hash] Request Body
|
|
231
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.tms.segments.post API Documentation}
|
|
232
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.tms.segments.post Enterprise API Documentation}
|
|
233
|
+
def create_tm_segment(tm_id, body = {})
|
|
234
|
+
request = Web::Request.new(
|
|
235
|
+
connection,
|
|
236
|
+
:post,
|
|
237
|
+
"#{config.target_api_url}/tms/#{tm_id}/segments",
|
|
238
|
+
{ params: body }
|
|
239
|
+
)
|
|
240
|
+
Web::SendRequest.new(request).perform
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# @param tm_id [Integer] TM Identifier
|
|
244
|
+
# @param segment_id [Integer] TM Segment Identifier
|
|
245
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.tms.segments.delete API Documentation}
|
|
246
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.tms.segments.delete Enterprise API Documentation}
|
|
247
|
+
def delete_tm_segment(tm_id, segment_id)
|
|
248
|
+
request = Web::Request.new(
|
|
249
|
+
connection,
|
|
250
|
+
:delete,
|
|
251
|
+
"#{config.target_api_url}/tms/#{tm_id}/segments/#{segment_id}"
|
|
252
|
+
)
|
|
253
|
+
Web::SendRequest.new(request).perform
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
# @param tm_id [Integer] TM Identifier
|
|
257
|
+
# @param segment_id [Integer] TM Segment Identifier
|
|
258
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.tms.segments.get API Documentation}
|
|
259
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.tms.segments.get Enterprise API Documentation}
|
|
260
|
+
def get_tm_segment(tm_id, segment_id)
|
|
261
|
+
request = Web::Request.new(
|
|
262
|
+
connection,
|
|
263
|
+
:get,
|
|
264
|
+
"#{config.target_api_url}/tms/#{tm_id}/segments/#{segment_id}"
|
|
265
|
+
)
|
|
266
|
+
Web::SendRequest.new(request).perform
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
# @param tm_id [Integer] TM Identifier
|
|
270
|
+
# @param segment_id [Integer] TM Segment Identifier
|
|
271
|
+
# @param body [Array] Request Body
|
|
272
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.tms.segments.patch API Documentation}
|
|
273
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.tms.segments.patch Enterprise API Documentation}
|
|
274
|
+
def edit_tm_segment(tm_id, segment_id, body = [])
|
|
275
|
+
request = Web::Request.new(
|
|
276
|
+
connection,
|
|
277
|
+
:patch,
|
|
278
|
+
"#{config.target_api_url}/tms/#{tm_id}/segments/#{segment_id}",
|
|
279
|
+
{ params: body }
|
|
280
|
+
)
|
|
281
|
+
Web::SendRequest.new(request).perform
|
|
282
|
+
end
|
|
145
283
|
end
|
|
146
284
|
end
|
|
147
285
|
end
|