crowdin-api 1.14.0 → 1.15.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/.github/workflows/docs.yml +1 -0
- data/.rubocop.yml +4 -0
- data/.rubocop_todo.yml +1 -0
- data/AGENTS.md +63 -0
- data/CLAUDE.md +1 -0
- data/Gemfile.lock +7 -7
- data/README.md +1 -1
- data/crowdin-api.gemspec +1 -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 +247 -10
- 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/version.rb +1 -1
- data/lib/crowdin-api/core/request.rb +1 -1
- data/lib/crowdin-api.rb +3 -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
- metadata +29 -3
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
module Crowdin
|
|
4
4
|
module ApiResources
|
|
5
5
|
module SourceFiles
|
|
6
|
-
# @param query [Hash] Request
|
|
7
|
-
# * {https://
|
|
8
|
-
# * {https://
|
|
6
|
+
# @param query [Hash] Request Query Parameters
|
|
7
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.branches.getMany API Documentation}
|
|
8
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.branches.getMany Enterprise API Documentation}
|
|
9
9
|
def list_branches(query = {}, project_id = config.project_id)
|
|
10
10
|
project_id || raise_project_id_is_required_error
|
|
11
11
|
|
|
@@ -19,8 +19,8 @@ module Crowdin
|
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
# @param query [Hash] Request Body
|
|
22
|
-
# * {https://
|
|
23
|
-
# * {https://
|
|
22
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.branches.post API Documentation}
|
|
23
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.branches.post Enterprise API Documentation}
|
|
24
24
|
def add_branch(query = {}, project_id = config.project_id)
|
|
25
25
|
project_id || raise_project_id_is_required_error
|
|
26
26
|
|
|
@@ -33,9 +33,9 @@ module Crowdin
|
|
|
33
33
|
Web::SendRequest.new(request).perform
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
-
# @param branch_id [Integer] Branch
|
|
37
|
-
# * {https://
|
|
38
|
-
# * {https://
|
|
36
|
+
# @param branch_id [Integer] Branch Identifier
|
|
37
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.branches.get API Documentation}
|
|
38
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.branches.get Enterprise API Documentation}
|
|
39
39
|
def get_branch(branch_id = nil, project_id = config.project_id)
|
|
40
40
|
branch_id || raise_parameter_is_required_error(:branch_id)
|
|
41
41
|
project_id || raise_project_id_is_required_error
|
|
@@ -48,25 +48,27 @@ module Crowdin
|
|
|
48
48
|
Web::SendRequest.new(request).perform
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
-
# @param branch_id [
|
|
52
|
-
#
|
|
53
|
-
# * {https://
|
|
54
|
-
|
|
51
|
+
# @param branch_id [Integer] Branch Identifier
|
|
52
|
+
# @param async [Boolean] Delete asynchronously; poll #check_delete_branch_job_status for the result
|
|
53
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.branches.delete API Documentation}
|
|
54
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.branches.delete Enterprise API Documentation}
|
|
55
|
+
def delete_branch(branch_id = nil, project_id = config.project_id, async: false)
|
|
55
56
|
branch_id || raise_parameter_is_required_error(:branch_id)
|
|
56
57
|
project_id || raise_project_id_is_required_error
|
|
57
58
|
|
|
58
59
|
request = Web::Request.new(
|
|
59
60
|
connection,
|
|
60
61
|
:delete,
|
|
61
|
-
"#{config.target_api_url}/projects/#{project_id}/branches/#{branch_id}"
|
|
62
|
+
"#{config.target_api_url}/projects/#{project_id}/branches/#{branch_id}",
|
|
63
|
+
{ headers: async ? { Prefer: 'respond-async' } : {} }
|
|
62
64
|
)
|
|
63
65
|
Web::SendRequest.new(request).perform
|
|
64
66
|
end
|
|
65
67
|
|
|
68
|
+
# @param branch_id [Integer] Branch Identifier
|
|
66
69
|
# @param query [Hash] Request Body
|
|
67
|
-
#
|
|
68
|
-
# * {https://
|
|
69
|
-
# * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.branches.patch Enterprise API Documentation}
|
|
70
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.branches.patch API Documentation}
|
|
71
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.branches.patch Enterprise API Documentation}
|
|
70
72
|
def edit_branch(branch_id = nil, query = {}, project_id = config.project_id)
|
|
71
73
|
branch_id || raise_parameter_is_required_error(:branch_id)
|
|
72
74
|
project_id || raise_project_id_is_required_error
|
|
@@ -80,9 +82,9 @@ module Crowdin
|
|
|
80
82
|
Web::SendRequest.new(request).perform
|
|
81
83
|
end
|
|
82
84
|
|
|
83
|
-
# @param query [Hash] Request
|
|
84
|
-
# * {https://
|
|
85
|
-
# * {https://
|
|
85
|
+
# @param query [Hash] Request Query Parameters
|
|
86
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.directories.getMany API Documentation}
|
|
87
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.directories.getMany Enterprise API Documentation}
|
|
86
88
|
def list_directories(query = {}, project_id = config.project_id)
|
|
87
89
|
project_id || raise_project_id_is_required_error
|
|
88
90
|
|
|
@@ -96,8 +98,8 @@ module Crowdin
|
|
|
96
98
|
end
|
|
97
99
|
|
|
98
100
|
# @param query [Hash] Request Body
|
|
99
|
-
# * {https://
|
|
100
|
-
# * {https://
|
|
101
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.directories.post API Documentation}
|
|
102
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.directories.post Enterprise API Documentation}
|
|
101
103
|
def add_directory(query = {}, project_id = config.project_id)
|
|
102
104
|
project_id || raise_project_id_is_required_error
|
|
103
105
|
|
|
@@ -110,9 +112,9 @@ module Crowdin
|
|
|
110
112
|
Web::SendRequest.new(request).perform
|
|
111
113
|
end
|
|
112
114
|
|
|
113
|
-
# @param directory_id [Integer] Directory
|
|
114
|
-
# * {https://
|
|
115
|
-
# * {https://
|
|
115
|
+
# @param directory_id [Integer] Directory Identifier
|
|
116
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.directories.get API Documentation}
|
|
117
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.directories.get Enterprise API Documentation}
|
|
116
118
|
def get_directory(directory_id = nil, project_id = config.project_id)
|
|
117
119
|
directory_id || raise_parameter_is_required_error(:directory_id)
|
|
118
120
|
project_id || raise_project_id_is_required_error
|
|
@@ -125,25 +127,27 @@ module Crowdin
|
|
|
125
127
|
Web::SendRequest.new(request).perform
|
|
126
128
|
end
|
|
127
129
|
|
|
128
|
-
# @param directory_id [Integer] Directory
|
|
129
|
-
#
|
|
130
|
-
# * {https://
|
|
131
|
-
|
|
130
|
+
# @param directory_id [Integer] Directory Identifier
|
|
131
|
+
# @param async [Boolean] Delete asynchronously; poll #check_delete_directory_job_status for the result
|
|
132
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.directories.delete API Documentation}
|
|
133
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.directories.delete Enterprise API Documentation}
|
|
134
|
+
def delete_directory(directory_id = nil, project_id = config.project_id, async: false)
|
|
132
135
|
directory_id || raise_parameter_is_required_error(:directory_id)
|
|
133
136
|
project_id || raise_project_id_is_required_error
|
|
134
137
|
|
|
135
138
|
request = Web::Request.new(
|
|
136
139
|
connection,
|
|
137
140
|
:delete,
|
|
138
|
-
"#{config.target_api_url}/projects/#{project_id}/directories/#{directory_id}"
|
|
141
|
+
"#{config.target_api_url}/projects/#{project_id}/directories/#{directory_id}",
|
|
142
|
+
{ headers: async ? { Prefer: 'respond-async' } : {} }
|
|
139
143
|
)
|
|
140
144
|
Web::SendRequest.new(request).perform
|
|
141
145
|
end
|
|
142
146
|
|
|
147
|
+
# @param directory_id [Integer] Directory Identifier
|
|
143
148
|
# @param query [Hash] Request Body
|
|
144
|
-
#
|
|
145
|
-
# * {https://
|
|
146
|
-
# * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.directories.patch Enterprise API Documentation}
|
|
149
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.directories.patch API Documentation}
|
|
150
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.directories.patch Enterprise API Documentation}
|
|
147
151
|
def edit_directory(directory_id = nil, query = {}, project_id = config.project_id)
|
|
148
152
|
directory_id || raise_parameter_is_required_error(:directory_id)
|
|
149
153
|
project_id || raise_project_id_is_required_error
|
|
@@ -157,9 +161,9 @@ module Crowdin
|
|
|
157
161
|
Web::SendRequest.new(request).perform
|
|
158
162
|
end
|
|
159
163
|
|
|
160
|
-
# @param query [Hash] Request
|
|
161
|
-
# * {https://
|
|
162
|
-
# * {https://
|
|
164
|
+
# @param query [Hash] Request Query Parameters
|
|
165
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.files.getMany API Documentation}
|
|
166
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.files.getMany Enterprise API Documentation}
|
|
163
167
|
def list_files(query = {}, project_id = config.project_id)
|
|
164
168
|
project_id || raise_project_id_is_required_error
|
|
165
169
|
|
|
@@ -173,8 +177,8 @@ module Crowdin
|
|
|
173
177
|
end
|
|
174
178
|
|
|
175
179
|
# @param query [Hash] Request Body
|
|
176
|
-
# * {https://
|
|
177
|
-
# * {https://
|
|
180
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.files.post API Documentation}
|
|
181
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.files.post Enterprise API Documentation}
|
|
178
182
|
def add_file(query = {}, project_id = config.project_id)
|
|
179
183
|
project_id || raise_project_id_is_required_error
|
|
180
184
|
|
|
@@ -187,9 +191,9 @@ module Crowdin
|
|
|
187
191
|
Web::SendRequest.new(request).perform
|
|
188
192
|
end
|
|
189
193
|
|
|
190
|
-
# @param file_id [Integer] File
|
|
191
|
-
# * {https://
|
|
192
|
-
# * {https://
|
|
194
|
+
# @param file_id [Integer] File Identifier
|
|
195
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.files.get API Documentation}
|
|
196
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.files.get Enterprise API Documentation}
|
|
193
197
|
def get_file(file_id = nil, project_id = config.project_id)
|
|
194
198
|
file_id || raise_parameter_is_required_error(:file_id)
|
|
195
199
|
project_id || raise_project_id_is_required_error
|
|
@@ -202,10 +206,10 @@ module Crowdin
|
|
|
202
206
|
Web::SendRequest.new(request).perform
|
|
203
207
|
end
|
|
204
208
|
|
|
209
|
+
# @param file_id [Integer] File Identifier
|
|
205
210
|
# @param query [Hash] Request Body
|
|
206
|
-
#
|
|
207
|
-
# * {https://
|
|
208
|
-
# * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.files.put Enterprise API Documentation}
|
|
211
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.files.put API Documentation}
|
|
212
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.files.put Enterprise API Documentation}
|
|
209
213
|
def update_or_restore_file(file_id = nil, query = {}, project_id = config.project_id)
|
|
210
214
|
file_id || raise_parameter_is_required_error(:file_id)
|
|
211
215
|
project_id || raise_project_id_is_required_error
|
|
@@ -219,25 +223,27 @@ module Crowdin
|
|
|
219
223
|
Web::SendRequest.new(request).perform
|
|
220
224
|
end
|
|
221
225
|
|
|
222
|
-
# @param file_id [Integer] File
|
|
223
|
-
#
|
|
224
|
-
# * {https://
|
|
225
|
-
|
|
226
|
+
# @param file_id [Integer] File Identifier
|
|
227
|
+
# @param async [Boolean] Delete asynchronously; poll #check_delete_file_job_status for the result
|
|
228
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.files.delete API Documentation}
|
|
229
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.files.delete Enterprise API Documentation}
|
|
230
|
+
def delete_file(file_id = nil, project_id = config.project_id, async: false)
|
|
226
231
|
file_id || raise_parameter_is_required_error(:file_id)
|
|
227
232
|
project_id || raise_project_id_is_required_error
|
|
228
233
|
|
|
229
234
|
request = Web::Request.new(
|
|
230
235
|
connection,
|
|
231
236
|
:delete,
|
|
232
|
-
"#{config.target_api_url}/projects/#{project_id}/files/#{file_id}"
|
|
237
|
+
"#{config.target_api_url}/projects/#{project_id}/files/#{file_id}",
|
|
238
|
+
{ headers: async ? { Prefer: 'respond-async' } : {} }
|
|
233
239
|
)
|
|
234
240
|
Web::SendRequest.new(request).perform
|
|
235
241
|
end
|
|
236
242
|
|
|
243
|
+
# @param file_id [Integer] File Identifier
|
|
237
244
|
# @param query [Hash] Request Body
|
|
238
|
-
#
|
|
239
|
-
# * {https://
|
|
240
|
-
# * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.files.patch Enterprise API Documentation}
|
|
245
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.files.patch API Documentation}
|
|
246
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.files.patch Enterprise API Documentation}
|
|
241
247
|
def edit_file(file_id = nil, query = {}, project_id = config.project_id)
|
|
242
248
|
file_id || raise_parameter_is_required_error(:file_id)
|
|
243
249
|
project_id || raise_project_id_is_required_error
|
|
@@ -251,10 +257,10 @@ module Crowdin
|
|
|
251
257
|
Web::SendRequest.new(request).perform
|
|
252
258
|
end
|
|
253
259
|
|
|
254
|
-
# @param file_id [Integer] File
|
|
260
|
+
# @param file_id [Integer] File Identifier
|
|
255
261
|
# @param destination [String] Destination of File
|
|
256
|
-
# * {https://
|
|
257
|
-
# * {https://
|
|
262
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.files.download.get API Documentation}
|
|
263
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.files.download.get Enterprise API Documentation}
|
|
258
264
|
def download_file(file_id = nil, destination = nil, project_id = config.project_id)
|
|
259
265
|
file_id || raise_parameter_is_required_error(:file_id)
|
|
260
266
|
project_id || raise_project_id_is_required_error
|
|
@@ -267,10 +273,10 @@ module Crowdin
|
|
|
267
273
|
Web::SendRequest.new(request, destination).perform
|
|
268
274
|
end
|
|
269
275
|
|
|
270
|
-
# @param file_id [Integer] File
|
|
276
|
+
# @param file_id [Integer] File Identifier
|
|
271
277
|
# @param destination [String] Destination of File
|
|
272
|
-
# * {https://
|
|
273
|
-
# * {https://
|
|
278
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.files.preview.get API Documentation}
|
|
279
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.files.preview.get Enterprise API Documentation}
|
|
274
280
|
def download_file_preview(file_id = nil, destination = nil, project_id = config.project_id)
|
|
275
281
|
file_id || raise_parameter_is_required_error(:file_id)
|
|
276
282
|
project_id || raise_project_id_is_required_error
|
|
@@ -283,10 +289,10 @@ module Crowdin
|
|
|
283
289
|
Web::SendRequest.new(request, destination).perform
|
|
284
290
|
end
|
|
285
291
|
|
|
286
|
-
# @param
|
|
287
|
-
# @param
|
|
288
|
-
# * {https://
|
|
289
|
-
# * {https://
|
|
292
|
+
# @param file_id [Integer] File Identifier
|
|
293
|
+
# @param query [Hash] Request Query Parameters
|
|
294
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.files.revisions.getMany API Documentation}
|
|
295
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.files.revisions.getMany Enterprise API Documentation}
|
|
290
296
|
def list_file_revisions(file_id = nil, query = {}, project_id = config.project_id)
|
|
291
297
|
file_id || raise_parameter_is_required_error(:file_id)
|
|
292
298
|
project_id || raise_project_id_is_required_error
|
|
@@ -300,10 +306,10 @@ module Crowdin
|
|
|
300
306
|
Web::SendRequest.new(request).perform
|
|
301
307
|
end
|
|
302
308
|
|
|
303
|
-
# @param
|
|
304
|
-
# @param
|
|
305
|
-
# * {https://
|
|
306
|
-
# * {https://
|
|
309
|
+
# @param file_id [Integer] File Identifier
|
|
310
|
+
# @param revision_id [Integer] Revision Identifier
|
|
311
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.files.revisions.get API Documentation}
|
|
312
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.files.revisions.get Enterprise API Documentation}
|
|
307
313
|
def get_file_revision(file_id = nil, revision_id = nil, project_id = config.project_id)
|
|
308
314
|
file_id || raise_parameter_is_required_error(:file_id)
|
|
309
315
|
revision_id || raise_parameter_is_required_error(:revision_id)
|
|
@@ -316,6 +322,305 @@ module Crowdin
|
|
|
316
322
|
)
|
|
317
323
|
Web::SendRequest.new(request).perform
|
|
318
324
|
end
|
|
325
|
+
|
|
326
|
+
# @param query [Hash] Request Query Parameters
|
|
327
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.branches.getMany API Documentation}
|
|
328
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.branches.getMany Enterprise API Documentation}
|
|
329
|
+
def search_branches(query = {})
|
|
330
|
+
request = Web::Request.new(
|
|
331
|
+
connection,
|
|
332
|
+
:get,
|
|
333
|
+
"#{config.target_api_url}/branches",
|
|
334
|
+
{ params: query }
|
|
335
|
+
)
|
|
336
|
+
Web::SendRequest.new(request).perform
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
# @param query [Hash] Request Query Parameters
|
|
340
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.directories.getMany API Documentation}
|
|
341
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.directories.getMany Enterprise API Documentation}
|
|
342
|
+
def search_directories(query = {})
|
|
343
|
+
request = Web::Request.new(
|
|
344
|
+
connection,
|
|
345
|
+
:get,
|
|
346
|
+
"#{config.target_api_url}/directories",
|
|
347
|
+
{ params: query }
|
|
348
|
+
)
|
|
349
|
+
Web::SendRequest.new(request).perform
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
# @param query [Hash] Request Query Parameters
|
|
353
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.files.getMany API Documentation}
|
|
354
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.files.getMany Enterprise API Documentation}
|
|
355
|
+
def search_files(query = {})
|
|
356
|
+
request = Web::Request.new(
|
|
357
|
+
connection,
|
|
358
|
+
:get,
|
|
359
|
+
"#{config.target_api_url}/files",
|
|
360
|
+
{ params: query }
|
|
361
|
+
)
|
|
362
|
+
Web::SendRequest.new(request).perform
|
|
363
|
+
end
|
|
364
|
+
|
|
365
|
+
# @param branch_id [Integer] Source Branch Identifier
|
|
366
|
+
# @param body [Hash] Request Body
|
|
367
|
+
# * {https://support.crowdin.com/developer/api/v2/string-based/#operation/api.projects.branches.clones.post API Documentation}
|
|
368
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/string-based/#operation/api.projects.branches.clones.post Enterprise API Documentation}
|
|
369
|
+
def clone_branch(branch_id, body = {}, project_id = config.project_id)
|
|
370
|
+
project_id || raise_project_id_is_required_error
|
|
371
|
+
|
|
372
|
+
request = Web::Request.new(
|
|
373
|
+
connection,
|
|
374
|
+
:post,
|
|
375
|
+
"#{config.target_api_url}/projects/#{project_id}/branches/#{branch_id}/clones",
|
|
376
|
+
{ params: body }
|
|
377
|
+
)
|
|
378
|
+
Web::SendRequest.new(request).perform
|
|
379
|
+
end
|
|
380
|
+
|
|
381
|
+
# @param branch_id [Integer] Source Branch Identifier
|
|
382
|
+
# @param clone_id [String] Clone Branch Identifier, consists of 36 characters
|
|
383
|
+
# * {https://support.crowdin.com/developer/api/v2/string-based/#operation/api.projects.branches.clones.get API Documentation}
|
|
384
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/string-based/#operation/api.projects.branches.clones.get Enterprise API Documentation}
|
|
385
|
+
def check_branch_clone_status(branch_id, clone_id, project_id = config.project_id)
|
|
386
|
+
project_id || raise_project_id_is_required_error
|
|
387
|
+
|
|
388
|
+
request = Web::Request.new(
|
|
389
|
+
connection,
|
|
390
|
+
:get,
|
|
391
|
+
"#{config.target_api_url}/projects/#{project_id}/branches/#{branch_id}/clones/#{clone_id}"
|
|
392
|
+
)
|
|
393
|
+
Web::SendRequest.new(request).perform
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
# @param branch_id [Integer] Source Branch Identifier
|
|
397
|
+
# @param clone_id [String] Clone Branch Identifier, consists of 36 characters
|
|
398
|
+
# * {https://support.crowdin.com/developer/api/v2/string-based/#operation/api.projects.branches.clones.branch.get API Documentation}
|
|
399
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/string-based/#operation/api.projects.branches.clones.branch.get Enterprise API Documentation}
|
|
400
|
+
def get_cloned_branch(branch_id, clone_id, project_id = config.project_id)
|
|
401
|
+
project_id || raise_project_id_is_required_error
|
|
402
|
+
|
|
403
|
+
request = Web::Request.new(
|
|
404
|
+
connection,
|
|
405
|
+
:get,
|
|
406
|
+
"#{config.target_api_url}/projects/#{project_id}/branches/#{branch_id}/clones/#{clone_id}/branch"
|
|
407
|
+
)
|
|
408
|
+
Web::SendRequest.new(request).perform
|
|
409
|
+
end
|
|
410
|
+
|
|
411
|
+
# @param branch_id [Integer] Branch Identifier
|
|
412
|
+
# @param job_identifier [String] jobIdentifier
|
|
413
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.branches.jobs.get API Documentation}
|
|
414
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.branches.jobs.get Enterprise API Documentation}
|
|
415
|
+
def check_delete_branch_job_status(branch_id, job_identifier, project_id = config.project_id)
|
|
416
|
+
project_id || raise_project_id_is_required_error
|
|
417
|
+
|
|
418
|
+
request = Web::Request.new(
|
|
419
|
+
connection,
|
|
420
|
+
:get,
|
|
421
|
+
"#{config.target_api_url}/projects/#{project_id}/branches/#{branch_id}/jobs/#{job_identifier}"
|
|
422
|
+
)
|
|
423
|
+
Web::SendRequest.new(request).perform
|
|
424
|
+
end
|
|
425
|
+
|
|
426
|
+
# @param branch_id [Integer] Branch Identifier
|
|
427
|
+
# @param body [Hash] Request Body
|
|
428
|
+
# * {https://support.crowdin.com/developer/api/v2/string-based/#operation/api.projects.branches.merges.post API Documentation}
|
|
429
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/string-based/#operation/api.projects.branches.merges.post Enterprise API Documentation}
|
|
430
|
+
def merge_branch(branch_id, body = {}, project_id = config.project_id)
|
|
431
|
+
project_id || raise_project_id_is_required_error
|
|
432
|
+
|
|
433
|
+
request = Web::Request.new(
|
|
434
|
+
connection,
|
|
435
|
+
:post,
|
|
436
|
+
"#{config.target_api_url}/projects/#{project_id}/branches/#{branch_id}/merges",
|
|
437
|
+
{ params: body }
|
|
438
|
+
)
|
|
439
|
+
Web::SendRequest.new(request).perform
|
|
440
|
+
end
|
|
441
|
+
|
|
442
|
+
# @param branch_id [Integer] Branch Identifier
|
|
443
|
+
# @param merge_id [String] Merge Branch Identifier, consists of 36 characters
|
|
444
|
+
# * {https://support.crowdin.com/developer/api/v2/string-based/#operation/api.projects.branches.merges.get API Documentation}
|
|
445
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/string-based/#operation/api.projects.branches.merges.get Enterprise API Documentation}
|
|
446
|
+
def check_branch_merge_status(branch_id, merge_id, project_id = config.project_id)
|
|
447
|
+
project_id || raise_project_id_is_required_error
|
|
448
|
+
|
|
449
|
+
request = Web::Request.new(
|
|
450
|
+
connection,
|
|
451
|
+
:get,
|
|
452
|
+
"#{config.target_api_url}/projects/#{project_id}/branches/#{branch_id}/merges/#{merge_id}"
|
|
453
|
+
)
|
|
454
|
+
Web::SendRequest.new(request).perform
|
|
455
|
+
end
|
|
456
|
+
|
|
457
|
+
# @param branch_id [Integer] Branch Identifier
|
|
458
|
+
# @param merge_id [String] Merge Branch Identifier, consists of 36 characters
|
|
459
|
+
# * {https://support.crowdin.com/developer/api/v2/string-based/#operation/api.projects.branches.merges.summary.get API Documentation}
|
|
460
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/string-based/#operation/api.projects.branches.merges.summary.get Enterprise API Documentation}
|
|
461
|
+
def get_branch_merge_summary(branch_id, merge_id, project_id = config.project_id)
|
|
462
|
+
project_id || raise_project_id_is_required_error
|
|
463
|
+
|
|
464
|
+
request = Web::Request.new(
|
|
465
|
+
connection,
|
|
466
|
+
:get,
|
|
467
|
+
"#{config.target_api_url}/projects/#{project_id}/branches/#{branch_id}/merges/#{merge_id}/summary"
|
|
468
|
+
)
|
|
469
|
+
Web::SendRequest.new(request).perform
|
|
470
|
+
end
|
|
471
|
+
|
|
472
|
+
# @param directory_id [Integer] Directory Identifier
|
|
473
|
+
# @param job_identifier [String] jobIdentifier
|
|
474
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.directories.jobs.get API Documentation}
|
|
475
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.directories.jobs.get Enterprise API Documentation}
|
|
476
|
+
def check_delete_directory_job_status(directory_id, job_identifier, project_id = config.project_id)
|
|
477
|
+
project_id || raise_project_id_is_required_error
|
|
478
|
+
|
|
479
|
+
request = Web::Request.new(
|
|
480
|
+
connection,
|
|
481
|
+
:get,
|
|
482
|
+
"#{config.target_api_url}/projects/#{project_id}/directories/#{directory_id}/jobs/#{job_identifier}"
|
|
483
|
+
)
|
|
484
|
+
Web::SendRequest.new(request).perform
|
|
485
|
+
end
|
|
486
|
+
|
|
487
|
+
# @param file_id [Integer] File Identifier
|
|
488
|
+
# @param job_identifier [String] jobIdentifier
|
|
489
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.files.jobs.get API Documentation}
|
|
490
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.files.jobs.get Enterprise API Documentation}
|
|
491
|
+
def check_delete_file_job_status(file_id, job_identifier, project_id = config.project_id)
|
|
492
|
+
project_id || raise_project_id_is_required_error
|
|
493
|
+
|
|
494
|
+
request = Web::Request.new(
|
|
495
|
+
connection,
|
|
496
|
+
:get,
|
|
497
|
+
"#{config.target_api_url}/projects/#{project_id}/files/#{file_id}/jobs/#{job_identifier}"
|
|
498
|
+
)
|
|
499
|
+
Web::SendRequest.new(request).perform
|
|
500
|
+
end
|
|
501
|
+
|
|
502
|
+
# @param file_id [Integer] File Identifier
|
|
503
|
+
# @param query [Hash] Request Query Parameters
|
|
504
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.files.references.getMany API Documentation}
|
|
505
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.files.references.getMany Enterprise API Documentation}
|
|
506
|
+
def list_asset_references(file_id, query = {}, project_id = config.project_id)
|
|
507
|
+
project_id || raise_project_id_is_required_error
|
|
508
|
+
|
|
509
|
+
request = Web::Request.new(
|
|
510
|
+
connection,
|
|
511
|
+
:get,
|
|
512
|
+
"#{config.target_api_url}/projects/#{project_id}/files/#{file_id}/references",
|
|
513
|
+
{ params: query }
|
|
514
|
+
)
|
|
515
|
+
Web::SendRequest.new(request).perform
|
|
516
|
+
end
|
|
517
|
+
|
|
518
|
+
# @param file_id [Integer] File Identifier
|
|
519
|
+
# @param body [Hash] Request Body
|
|
520
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.files.references.post API Documentation}
|
|
521
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.files.references.post Enterprise API Documentation}
|
|
522
|
+
def add_asset_reference(file_id, body = {}, project_id = config.project_id)
|
|
523
|
+
project_id || raise_project_id_is_required_error
|
|
524
|
+
|
|
525
|
+
request = Web::Request.new(
|
|
526
|
+
connection,
|
|
527
|
+
:post,
|
|
528
|
+
"#{config.target_api_url}/projects/#{project_id}/files/#{file_id}/references",
|
|
529
|
+
{ params: body }
|
|
530
|
+
)
|
|
531
|
+
Web::SendRequest.new(request).perform
|
|
532
|
+
end
|
|
533
|
+
|
|
534
|
+
# @param file_id [Integer] File Identifier
|
|
535
|
+
# @param reference_id [Integer] Reference Identifier
|
|
536
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.files.references.delete API Documentation}
|
|
537
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.files.references.delete Enterprise API Documentation}
|
|
538
|
+
def delete_asset_reference(file_id, reference_id, project_id = config.project_id)
|
|
539
|
+
project_id || raise_project_id_is_required_error
|
|
540
|
+
|
|
541
|
+
request = Web::Request.new(
|
|
542
|
+
connection,
|
|
543
|
+
:delete,
|
|
544
|
+
"#{config.target_api_url}/projects/#{project_id}/files/#{file_id}/references/#{reference_id}"
|
|
545
|
+
)
|
|
546
|
+
Web::SendRequest.new(request).perform
|
|
547
|
+
end
|
|
548
|
+
|
|
549
|
+
# @param file_id [Integer] File Identifier
|
|
550
|
+
# @param reference_id [Integer] Reference Identifier
|
|
551
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.files.references.get API Documentation}
|
|
552
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.files.references.get Enterprise API Documentation}
|
|
553
|
+
def get_asset_reference(file_id, reference_id, project_id = config.project_id)
|
|
554
|
+
project_id || raise_project_id_is_required_error
|
|
555
|
+
|
|
556
|
+
request = Web::Request.new(
|
|
557
|
+
connection,
|
|
558
|
+
:get,
|
|
559
|
+
"#{config.target_api_url}/projects/#{project_id}/files/#{file_id}/references/#{reference_id}"
|
|
560
|
+
)
|
|
561
|
+
Web::SendRequest.new(request).perform
|
|
562
|
+
end
|
|
563
|
+
|
|
564
|
+
# -- For Enterprise mode only --
|
|
565
|
+
|
|
566
|
+
# @param query [Hash] Request Query Parameters
|
|
567
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.strings.reviewed-builds.getMany Enterprise API Documentation}
|
|
568
|
+
def list_reviewed_source_files_builds(query = {}, project_id = config.project_id)
|
|
569
|
+
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
570
|
+
project_id || raise_project_id_is_required_error
|
|
571
|
+
|
|
572
|
+
request = Web::Request.new(
|
|
573
|
+
connection,
|
|
574
|
+
:get,
|
|
575
|
+
"#{config.target_api_url}/projects/#{project_id}/strings/reviewed-builds",
|
|
576
|
+
{ params: query }
|
|
577
|
+
)
|
|
578
|
+
Web::SendRequest.new(request).perform
|
|
579
|
+
end
|
|
580
|
+
|
|
581
|
+
# @param body [Hash] Request Body
|
|
582
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.strings.reviewed-builds.post Enterprise API Documentation}
|
|
583
|
+
def build_reviewed_source_files(body = {}, project_id = config.project_id)
|
|
584
|
+
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
585
|
+
project_id || raise_project_id_is_required_error
|
|
586
|
+
|
|
587
|
+
request = Web::Request.new(
|
|
588
|
+
connection,
|
|
589
|
+
:post,
|
|
590
|
+
"#{config.target_api_url}/projects/#{project_id}/strings/reviewed-builds",
|
|
591
|
+
{ params: body }
|
|
592
|
+
)
|
|
593
|
+
Web::SendRequest.new(request).perform
|
|
594
|
+
end
|
|
595
|
+
|
|
596
|
+
# @param build_id [Integer] Project Reviewed Source Files Build Identifier
|
|
597
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.strings.reviewed-builds.get Enterprise API Documentation}
|
|
598
|
+
def check_reviewed_source_files_build_status(build_id, project_id = config.project_id)
|
|
599
|
+
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
600
|
+
project_id || raise_project_id_is_required_error
|
|
601
|
+
|
|
602
|
+
request = Web::Request.new(
|
|
603
|
+
connection,
|
|
604
|
+
:get,
|
|
605
|
+
"#{config.target_api_url}/projects/#{project_id}/strings/reviewed-builds/#{build_id}"
|
|
606
|
+
)
|
|
607
|
+
Web::SendRequest.new(request).perform
|
|
608
|
+
end
|
|
609
|
+
|
|
610
|
+
# @param build_id [Integer] Project Reviewed Source Files Build Identifier
|
|
611
|
+
# @param destination [String] Destination of File
|
|
612
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.strings.reviewed-builds.download.download Enterprise API Documentation}
|
|
613
|
+
def download_reviewed_source_files(build_id, destination = nil, project_id = config.project_id)
|
|
614
|
+
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
615
|
+
project_id || raise_project_id_is_required_error
|
|
616
|
+
|
|
617
|
+
request = Web::Request.new(
|
|
618
|
+
connection,
|
|
619
|
+
:get,
|
|
620
|
+
"#{config.target_api_url}/projects/#{project_id}/strings/reviewed-builds/#{build_id}/download"
|
|
621
|
+
)
|
|
622
|
+
Web::SendRequest.new(request, destination).perform
|
|
623
|
+
end
|
|
319
624
|
end
|
|
320
625
|
end
|
|
321
626
|
end
|