crowdin-api 1.14.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 +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 +27 -1
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
module Crowdin
|
|
4
4
|
module ApiResources
|
|
5
5
|
module Reports
|
|
6
|
+
# @param query [Hash] Request Body
|
|
7
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.reports.post API Documentation}
|
|
8
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.reports.post Enterprise API Documentation}
|
|
6
9
|
def generate_report(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 report_id [String] Report Identifier, consists of 36 characters
|
|
22
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.reports.get API Documentation}
|
|
23
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.reports.get Enterprise API Documentation}
|
|
18
24
|
def check_report_generation_status(report_id = nil, project_id = config.project_id)
|
|
19
25
|
report_id || raise_parameter_is_required_error(:report_id)
|
|
20
26
|
project_id || raise_project_id_is_required_error
|
|
@@ -27,6 +33,10 @@ module Crowdin
|
|
|
27
33
|
Web::SendRequest.new(request).perform
|
|
28
34
|
end
|
|
29
35
|
|
|
36
|
+
# @param report_id [String] Report Identifier, consists of 36 characters
|
|
37
|
+
# @param destination [String] Destination of File
|
|
38
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.reports.download.download API Documentation}
|
|
39
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.reports.download.download Enterprise API Documentation}
|
|
30
40
|
def download_report(report_id = nil, destination = nil, project_id = config.project_id)
|
|
31
41
|
report_id || raise_parameter_is_required_error(:report_id)
|
|
32
42
|
project_id || raise_project_id_is_required_error
|
|
@@ -39,8 +49,263 @@ module Crowdin
|
|
|
39
49
|
Web::SendRequest.new(request, destination).perform
|
|
40
50
|
end
|
|
41
51
|
|
|
52
|
+
# @param query [Hash] Request Query Parameters
|
|
53
|
+
# @param user_id [Integer] User Identifier (Crowdin only)
|
|
54
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.reports.archives.getMany API Documentation}
|
|
55
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.reports.archives.getMany Enterprise API Documentation}
|
|
56
|
+
def list_report_archives(query = {}, user_id = nil)
|
|
57
|
+
enterprise_mode? || user_id || raise_parameter_is_required_error(:user_id)
|
|
58
|
+
|
|
59
|
+
endpoint = 'reports/archives'
|
|
60
|
+
endpoint = "users/#{user_id}/#{endpoint}" unless enterprise_mode?
|
|
61
|
+
request = Web::Request.new(
|
|
62
|
+
connection,
|
|
63
|
+
:get,
|
|
64
|
+
"#{config.target_api_url}/#{endpoint}",
|
|
65
|
+
{ params: query }
|
|
66
|
+
)
|
|
67
|
+
Web::SendRequest.new(request).perform
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# @param archive_id [Integer] Report archive identifier
|
|
71
|
+
# @param user_id [Integer] User Identifier (Crowdin only)
|
|
72
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.users.reports.archives.delete API Documentation}
|
|
73
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.reports.archives.delete Enterprise API Documentation}
|
|
74
|
+
def delete_report_archive(archive_id, user_id = nil)
|
|
75
|
+
enterprise_mode? || user_id || raise_parameter_is_required_error(:user_id)
|
|
76
|
+
|
|
77
|
+
endpoint = "reports/archives/#{archive_id}"
|
|
78
|
+
endpoint = "users/#{user_id}/#{endpoint}" unless enterprise_mode?
|
|
79
|
+
request = Web::Request.new(
|
|
80
|
+
connection,
|
|
81
|
+
:delete,
|
|
82
|
+
"#{config.target_api_url}/#{endpoint}"
|
|
83
|
+
)
|
|
84
|
+
Web::SendRequest.new(request).perform
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# @param archive_id [Integer] Report archive identifier
|
|
88
|
+
# @param user_id [Integer] User Identifier (Crowdin only)
|
|
89
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.users.reports.archives.get API Documentation}
|
|
90
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.reports.archives.get Enterprise API Documentation}
|
|
91
|
+
def get_report_archive(archive_id, user_id = nil)
|
|
92
|
+
enterprise_mode? || user_id || raise_parameter_is_required_error(:user_id)
|
|
93
|
+
|
|
94
|
+
endpoint = "reports/archives/#{archive_id}"
|
|
95
|
+
endpoint = "users/#{user_id}/#{endpoint}" unless enterprise_mode?
|
|
96
|
+
request = Web::Request.new(
|
|
97
|
+
connection,
|
|
98
|
+
:get,
|
|
99
|
+
"#{config.target_api_url}/#{endpoint}"
|
|
100
|
+
)
|
|
101
|
+
Web::SendRequest.new(request).perform
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# @param archive_id [Integer] Report archive identifier
|
|
105
|
+
# @param body [Hash] Request Body
|
|
106
|
+
# @param user_id [Integer] User Identifier (Crowdin only)
|
|
107
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.reports.archives.exports.post API Documentation}
|
|
108
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.reports.archives.exports.post Enterprise API Documentation}
|
|
109
|
+
def export_report_archive(archive_id, body = {}, user_id = nil)
|
|
110
|
+
enterprise_mode? || user_id || raise_parameter_is_required_error(:user_id)
|
|
111
|
+
|
|
112
|
+
endpoint = "reports/archives/#{archive_id}/exports"
|
|
113
|
+
endpoint = "users/#{user_id}/#{endpoint}" unless enterprise_mode?
|
|
114
|
+
request = Web::Request.new(
|
|
115
|
+
connection,
|
|
116
|
+
:post,
|
|
117
|
+
"#{config.target_api_url}/#{endpoint}",
|
|
118
|
+
{ params: body }
|
|
119
|
+
)
|
|
120
|
+
Web::SendRequest.new(request).perform
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# @param archive_id [Integer] Report archive identifier
|
|
124
|
+
# @param export_id [String] Export Identifier, consists of 36 characters
|
|
125
|
+
# @param user_id [Integer] User Identifier (Crowdin only)
|
|
126
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.users.reports.archives.exports.get API Documentation}
|
|
127
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.reports.archives.exports.get Enterprise API Documentation}
|
|
128
|
+
def check_report_archive_export_status(archive_id, export_id, user_id = nil)
|
|
129
|
+
enterprise_mode? || user_id || raise_parameter_is_required_error(:user_id)
|
|
130
|
+
|
|
131
|
+
endpoint = "reports/archives/#{archive_id}/exports/#{export_id}"
|
|
132
|
+
endpoint = "users/#{user_id}/#{endpoint}" unless enterprise_mode?
|
|
133
|
+
request = Web::Request.new(
|
|
134
|
+
connection,
|
|
135
|
+
:get,
|
|
136
|
+
"#{config.target_api_url}/#{endpoint}"
|
|
137
|
+
)
|
|
138
|
+
Web::SendRequest.new(request).perform
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# @param archive_id [Integer] Report archive identifier
|
|
142
|
+
# @param export_id [String] Export Identifier, consists of 36 characters
|
|
143
|
+
# @param destination [String] Destination of File
|
|
144
|
+
# @param user_id [Integer] User Identifier (Crowdin only)
|
|
145
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.users.reports.archives.exports.download.get API Documentation}
|
|
146
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.reports.archives.exports.download.get Enterprise API Documentation}
|
|
147
|
+
def download_report_archive(archive_id, export_id, destination = nil, user_id = nil)
|
|
148
|
+
enterprise_mode? || user_id || raise_parameter_is_required_error(:user_id)
|
|
149
|
+
|
|
150
|
+
endpoint = "reports/archives/#{archive_id}/exports/#{export_id}/download"
|
|
151
|
+
endpoint = "users/#{user_id}/#{endpoint}" unless enterprise_mode?
|
|
152
|
+
request = Web::Request.new(
|
|
153
|
+
connection,
|
|
154
|
+
:get,
|
|
155
|
+
"#{config.target_api_url}/#{endpoint}"
|
|
156
|
+
)
|
|
157
|
+
Web::SendRequest.new(request, destination).perform
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# @param user_id [Integer] User Identifier
|
|
161
|
+
# @param query [Hash] Request Query Parameters
|
|
162
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.users.reports.settings-templates.getMany API Documentation}
|
|
163
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.users.reports.settings-templates.getMany Enterprise API Documentation}
|
|
164
|
+
def list_user_report_settings_templates(user_id, query = {})
|
|
165
|
+
request = Web::Request.new(
|
|
166
|
+
connection,
|
|
167
|
+
:get,
|
|
168
|
+
"#{config.target_api_url}/users/#{user_id}/reports/settings-templates",
|
|
169
|
+
{ params: query }
|
|
170
|
+
)
|
|
171
|
+
Web::SendRequest.new(request).perform
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# @param user_id [Integer] User Identifier
|
|
175
|
+
# @param body [Hash] Request Body
|
|
176
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.users.reports.settings-templates.post API Documentation}
|
|
177
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.users.reports.settings-templates.post Enterprise API Documentation}
|
|
178
|
+
def add_user_report_settings_template(user_id, body = {})
|
|
179
|
+
request = Web::Request.new(
|
|
180
|
+
connection,
|
|
181
|
+
:post,
|
|
182
|
+
"#{config.target_api_url}/users/#{user_id}/reports/settings-templates",
|
|
183
|
+
{ params: body }
|
|
184
|
+
)
|
|
185
|
+
Web::SendRequest.new(request).perform
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# @param user_id [Integer] User Identifier
|
|
189
|
+
# @param report_settings_template_id [Integer] Report Settings Template Identifier
|
|
190
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.users.reports.settings-templates.delete API Documentation}
|
|
191
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.users.reports.settings-templates.delete Enterprise API Documentation}
|
|
192
|
+
def delete_user_report_settings_template(user_id, report_settings_template_id)
|
|
193
|
+
request = Web::Request.new(
|
|
194
|
+
connection,
|
|
195
|
+
:delete,
|
|
196
|
+
"#{config.target_api_url}/users/#{user_id}/reports/settings-templates/#{report_settings_template_id}"
|
|
197
|
+
)
|
|
198
|
+
Web::SendRequest.new(request).perform
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# @param user_id [Integer] User Identifier
|
|
202
|
+
# @param report_settings_template_id [Integer] Report Settings Template Identifier
|
|
203
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.users.reports.settings-templates.get API Documentation}
|
|
204
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.users.reports.settings-templates.get Enterprise API Documentation}
|
|
205
|
+
def get_user_report_settings_template(user_id, report_settings_template_id)
|
|
206
|
+
request = Web::Request.new(
|
|
207
|
+
connection,
|
|
208
|
+
:get,
|
|
209
|
+
"#{config.target_api_url}/users/#{user_id}/reports/settings-templates/#{report_settings_template_id}"
|
|
210
|
+
)
|
|
211
|
+
Web::SendRequest.new(request).perform
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# @param user_id [Integer] User Identifier
|
|
215
|
+
# @param report_settings_template_id [Integer] Report Settings Template Identifier
|
|
216
|
+
# @param body [Array] Request Body
|
|
217
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.users.reports.settings-templates.patch API Documentation}
|
|
218
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.users.reports.settings-templates.patch Enterprise API Documentation}
|
|
219
|
+
def edit_user_report_settings_template(user_id, report_settings_template_id, body = [])
|
|
220
|
+
request = Web::Request.new(
|
|
221
|
+
connection,
|
|
222
|
+
:patch,
|
|
223
|
+
"#{config.target_api_url}/users/#{user_id}/reports/settings-templates/#{report_settings_template_id}",
|
|
224
|
+
{ params: body }
|
|
225
|
+
)
|
|
226
|
+
Web::SendRequest.new(request).perform
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# @param query [Hash] Request Query Parameters
|
|
230
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.reports.settings-templates.getMany API Documentation}
|
|
231
|
+
def list_report_settings_templates(query = {}, project_id = config.project_id)
|
|
232
|
+
project_id || raise_project_id_is_required_error
|
|
233
|
+
|
|
234
|
+
request = Web::Request.new(
|
|
235
|
+
connection,
|
|
236
|
+
:get,
|
|
237
|
+
"#{config.target_api_url}/projects/#{project_id}/reports/settings-templates",
|
|
238
|
+
{ params: query }
|
|
239
|
+
)
|
|
240
|
+
Web::SendRequest.new(request).perform
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# @param query [Hash] Request Body
|
|
244
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.reports.settings-templates.post API Documentation}
|
|
245
|
+
def add_report_settings_template(query = {}, project_id = config.project_id)
|
|
246
|
+
project_id || raise_project_id_is_required_error
|
|
247
|
+
%i[name currency unit mode config].each do |param|
|
|
248
|
+
query[param] || raise_parameter_is_required_error(param)
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
request = Web::Request.new(
|
|
252
|
+
connection,
|
|
253
|
+
:post,
|
|
254
|
+
"#{config.target_api_url}/projects/#{project_id}/reports/settings-templates",
|
|
255
|
+
{ params: query }
|
|
256
|
+
)
|
|
257
|
+
Web::SendRequest.new(request).perform
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
# @param template_id [Hash] Request Body
|
|
261
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.reports.settings-templates.get API Documentation}
|
|
262
|
+
def get_report_settings_template(template_id = nil, project_id = config.project_id)
|
|
263
|
+
project_id || raise_project_id_is_required_error
|
|
264
|
+
template_id || raise_parameter_is_required_error(:template_id)
|
|
265
|
+
|
|
266
|
+
request = Web::Request.new(
|
|
267
|
+
connection,
|
|
268
|
+
:get,
|
|
269
|
+
"#{config.target_api_url}/projects/#{project_id}/reports/settings-templates/#{template_id}"
|
|
270
|
+
)
|
|
271
|
+
Web::SendRequest.new(request).perform
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# @param query [Hash] Request Body
|
|
275
|
+
# @param template_id [Hash] Request Body
|
|
276
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.reports.settings-templates.patch API Documentation}
|
|
277
|
+
def edit_report_settings_template(query = {}, template_id = nil, project_id = config.project_id)
|
|
278
|
+
project_id || raise_project_id_is_required_error
|
|
279
|
+
template_id || raise_parameter_is_required_error(:template_id)
|
|
280
|
+
|
|
281
|
+
request = Web::Request.new(
|
|
282
|
+
connection,
|
|
283
|
+
:patch,
|
|
284
|
+
"#{config.target_api_url}/projects/#{project_id}/reports/settings-templates/#{template_id}",
|
|
285
|
+
{ params: query }
|
|
286
|
+
)
|
|
287
|
+
Web::SendRequest.new(request).perform
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
# @param template_id [Hash] Request Body
|
|
291
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.reports.settings-templates.delete API Documentation}
|
|
292
|
+
def delete_report_settings_template(template_id = nil, project_id = config.project_id)
|
|
293
|
+
project_id || raise_project_id_is_required_error
|
|
294
|
+
template_id || raise_parameter_is_required_error(:template_id)
|
|
295
|
+
|
|
296
|
+
request = Web::Request.new(
|
|
297
|
+
connection,
|
|
298
|
+
:delete,
|
|
299
|
+
"#{config.target_api_url}/projects/#{project_id}/reports/settings-templates/#{template_id}"
|
|
300
|
+
)
|
|
301
|
+
Web::SendRequest.new(request).perform
|
|
302
|
+
end
|
|
303
|
+
|
|
42
304
|
# -- For Enterprise mode only --
|
|
43
305
|
|
|
306
|
+
# @param group_id [Integer] Group Identifier
|
|
307
|
+
# @param query [Hash] Request Body
|
|
308
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.groups.reports.post Enterprise API Documentation}
|
|
44
309
|
def generate_group_report(group_id = nil, query = {})
|
|
45
310
|
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
46
311
|
group_id || raise_parameter_is_required_error(:group_id)
|
|
@@ -54,6 +319,9 @@ module Crowdin
|
|
|
54
319
|
Web::SendRequest.new(request).perform
|
|
55
320
|
end
|
|
56
321
|
|
|
322
|
+
# @param group_id [Integer] Group Identifier
|
|
323
|
+
# @param report_id [String] Report Identifier, consists of 36 characters
|
|
324
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.groups.reports.get Enterprise API Documentation}
|
|
57
325
|
def check_group_report_generation_status(group_id = nil, report_id = nil)
|
|
58
326
|
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
59
327
|
group_id || raise_parameter_is_required_error(:group_id)
|
|
@@ -67,6 +335,10 @@ module Crowdin
|
|
|
67
335
|
Web::SendRequest.new(request).perform
|
|
68
336
|
end
|
|
69
337
|
|
|
338
|
+
# @param group_id [Integer] Group Identifier
|
|
339
|
+
# @param report_id [String] Report Identifier, consists of 36 characters
|
|
340
|
+
# @param destination [String] Destination of File
|
|
341
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.groups.reports.download.download Enterprise API Documentation}
|
|
70
342
|
def download_group_report(group_id = nil, report_id = nil, destination = nil)
|
|
71
343
|
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
72
344
|
group_id || raise_parameter_is_required_error(:group_id)
|
|
@@ -80,6 +352,8 @@ module Crowdin
|
|
|
80
352
|
Web::SendRequest.new(request, destination).perform
|
|
81
353
|
end
|
|
82
354
|
|
|
355
|
+
# @param query [Hash] Request Body
|
|
356
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.reports.post Enterprise API Documentation}
|
|
83
357
|
def generate_organization_report(query = {})
|
|
84
358
|
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
85
359
|
|
|
@@ -92,6 +366,8 @@ module Crowdin
|
|
|
92
366
|
Web::SendRequest.new(request).perform
|
|
93
367
|
end
|
|
94
368
|
|
|
369
|
+
# @param report_id [String] Report Identifier, consists of 36 characters
|
|
370
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.reports.get Enterprise API Documentation}
|
|
95
371
|
def check_organization_report_generation_status(report_id = nil)
|
|
96
372
|
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
97
373
|
report_id || raise_parameter_is_required_error(:report_id)
|
|
@@ -104,6 +380,9 @@ module Crowdin
|
|
|
104
380
|
Web::SendRequest.new(request).perform
|
|
105
381
|
end
|
|
106
382
|
|
|
383
|
+
# @param report_id [String] Report Identifier, consists of 36 characters
|
|
384
|
+
# @param destination [String] Destination of File
|
|
385
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.reports.download.download Enterprise API Documentation}
|
|
107
386
|
def download_organization_report(report_id = nil, destination = nil)
|
|
108
387
|
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
109
388
|
report_id || raise_parameter_is_required_error(:report_id)
|
|
@@ -116,66 +395,71 @@ module Crowdin
|
|
|
116
395
|
Web::SendRequest.new(request, destination).perform
|
|
117
396
|
end
|
|
118
397
|
|
|
119
|
-
|
|
120
|
-
|
|
398
|
+
# @param query [Hash] Request Query Parameters
|
|
399
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.reports.settings-templates.getMany Enterprise API Documentation}
|
|
400
|
+
def list_organization_report_settings_templates(query = {})
|
|
401
|
+
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
121
402
|
|
|
122
403
|
request = Web::Request.new(
|
|
123
404
|
connection,
|
|
124
405
|
:get,
|
|
125
|
-
"#{config.target_api_url}/
|
|
406
|
+
"#{config.target_api_url}/reports/settings-templates",
|
|
126
407
|
{ params: query }
|
|
127
408
|
)
|
|
128
409
|
Web::SendRequest.new(request).perform
|
|
129
410
|
end
|
|
130
411
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
end
|
|
412
|
+
# @param body [Hash] Request Body
|
|
413
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.reports.settings-templates.post Enterprise API Documentation}
|
|
414
|
+
def add_organization_report_settings_template(body = {})
|
|
415
|
+
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
136
416
|
|
|
137
417
|
request = Web::Request.new(
|
|
138
418
|
connection,
|
|
139
419
|
:post,
|
|
140
|
-
"#{config.target_api_url}/
|
|
141
|
-
{ params:
|
|
420
|
+
"#{config.target_api_url}/reports/settings-templates",
|
|
421
|
+
{ params: body }
|
|
142
422
|
)
|
|
143
423
|
Web::SendRequest.new(request).perform
|
|
144
424
|
end
|
|
145
425
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
426
|
+
# @param report_settings_template_id [Integer] Report Settings Template Identifier
|
|
427
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.reports.settings-templates.delete Enterprise API Documentation}
|
|
428
|
+
def delete_organization_report_settings_template(report_settings_template_id)
|
|
429
|
+
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
149
430
|
|
|
150
431
|
request = Web::Request.new(
|
|
151
432
|
connection,
|
|
152
|
-
:
|
|
153
|
-
"#{config.target_api_url}/
|
|
433
|
+
:delete,
|
|
434
|
+
"#{config.target_api_url}/reports/settings-templates/#{report_settings_template_id}"
|
|
154
435
|
)
|
|
155
436
|
Web::SendRequest.new(request).perform
|
|
156
437
|
end
|
|
157
438
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
439
|
+
# @param report_settings_template_id [Integer] Report Settings Template Identifier
|
|
440
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.reports.settings-templates.get Enterprise API Documentation}
|
|
441
|
+
def get_organization_report_settings_template(report_settings_template_id)
|
|
442
|
+
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
161
443
|
|
|
162
444
|
request = Web::Request.new(
|
|
163
445
|
connection,
|
|
164
|
-
:
|
|
165
|
-
"#{config.target_api_url}/
|
|
166
|
-
{ params: query }
|
|
446
|
+
:get,
|
|
447
|
+
"#{config.target_api_url}/reports/settings-templates/#{report_settings_template_id}"
|
|
167
448
|
)
|
|
168
449
|
Web::SendRequest.new(request).perform
|
|
169
450
|
end
|
|
170
451
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
452
|
+
# @param report_settings_template_id [Integer] Report Settings Template Identifier
|
|
453
|
+
# @param body [Array] Request Body
|
|
454
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.reports.settings-templates.patch Enterprise API Documentation}
|
|
455
|
+
def edit_organization_report_settings_template(report_settings_template_id, body = [])
|
|
456
|
+
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
174
457
|
|
|
175
458
|
request = Web::Request.new(
|
|
176
459
|
connection,
|
|
177
|
-
:
|
|
178
|
-
"#{config.target_api_url}/
|
|
460
|
+
:patch,
|
|
461
|
+
"#{config.target_api_url}/reports/settings-templates/#{report_settings_template_id}",
|
|
462
|
+
{ params: body }
|
|
179
463
|
)
|
|
180
464
|
Web::SendRequest.new(request).perform
|
|
181
465
|
end
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
module Crowdin
|
|
4
4
|
module ApiResources
|
|
5
5
|
module Screenshots
|
|
6
|
+
# @param query [Hash] Request Query Parameters
|
|
7
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.screenshots.getMany API Documentation}
|
|
8
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.screenshots.getMany Enterprise API Documentation}
|
|
6
9
|
def list_screenshots(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.screenshots.post API Documentation}
|
|
23
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.screenshots.post Enterprise API Documentation}
|
|
18
24
|
def add_screenshot(query = {}, project_id = config.project_id)
|
|
19
25
|
project_id || raise_project_id_is_required_error
|
|
20
26
|
|
|
@@ -27,6 +33,9 @@ module Crowdin
|
|
|
27
33
|
Web::SendRequest.new(request).perform
|
|
28
34
|
end
|
|
29
35
|
|
|
36
|
+
# @param screenshot_id [Integer] Screenshot Identifier
|
|
37
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.screenshots.get API Documentation}
|
|
38
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.screenshots.get Enterprise API Documentation}
|
|
30
39
|
def get_screenshot(screenshot_id = nil, project_id = config.project_id)
|
|
31
40
|
screenshot_id || raise_parameter_is_required_error(:screenshot_id)
|
|
32
41
|
project_id || raise_project_id_is_required_error
|
|
@@ -39,6 +48,10 @@ module Crowdin
|
|
|
39
48
|
Web::SendRequest.new(request).perform
|
|
40
49
|
end
|
|
41
50
|
|
|
51
|
+
# @param screenshot_id [Integer] Screenshot Identifier
|
|
52
|
+
# @param query [Hash] Request Body
|
|
53
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.screenshots.put API Documentation}
|
|
54
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.screenshots.put Enterprise API Documentation}
|
|
42
55
|
def update_screenshot(screenshot_id = nil, query = {}, project_id = config.project_id)
|
|
43
56
|
screenshot_id || raise_parameter_is_required_error(:screenshot_id)
|
|
44
57
|
project_id || raise_project_id_is_required_error
|
|
@@ -52,6 +65,9 @@ module Crowdin
|
|
|
52
65
|
Web::SendRequest.new(request).perform
|
|
53
66
|
end
|
|
54
67
|
|
|
68
|
+
# @param screenshot_id [Integer] Screenshot Identifier
|
|
69
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.screenshots.delete API Documentation}
|
|
70
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.screenshots.delete Enterprise API Documentation}
|
|
55
71
|
def delete_screenshot(screenshot_id = nil, project_id = config.project_id)
|
|
56
72
|
screenshot_id || raise_parameter_is_required_error(:screenshot_id)
|
|
57
73
|
project_id || raise_project_id_is_required_error
|
|
@@ -64,6 +80,10 @@ module Crowdin
|
|
|
64
80
|
Web::SendRequest.new(request).perform
|
|
65
81
|
end
|
|
66
82
|
|
|
83
|
+
# @param screenshot_id [Integer] Screenshot Identifier
|
|
84
|
+
# @param query [Hash] Request Body
|
|
85
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.screenshots.patch API Documentation}
|
|
86
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.screenshots.patch Enterprise API Documentation}
|
|
67
87
|
def edit_screenshot(screenshot_id = nil, query = {}, project_id = config.project_id)
|
|
68
88
|
screenshot_id || raise_parameter_is_required_error(:screenshot_id)
|
|
69
89
|
project_id || raise_project_id_is_required_error
|
|
@@ -77,6 +97,10 @@ module Crowdin
|
|
|
77
97
|
Web::SendRequest.new(request).perform
|
|
78
98
|
end
|
|
79
99
|
|
|
100
|
+
# @param screenshot_id [Integer] Screenshot Identifier
|
|
101
|
+
# @param query [Hash] Request Query Parameters
|
|
102
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.screenshots.tags.getMany API Documentation}
|
|
103
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.screenshots.tags.getMany Enterprise API Documentation}
|
|
80
104
|
def list_tags(screenshot_id = nil, query = {}, project_id = config.project_id)
|
|
81
105
|
screenshot_id || raise_parameter_is_required_error(:screenshot_id)
|
|
82
106
|
project_id || raise_project_id_is_required_error
|
|
@@ -90,6 +114,10 @@ module Crowdin
|
|
|
90
114
|
Web::SendRequest.new(request).perform
|
|
91
115
|
end
|
|
92
116
|
|
|
117
|
+
# @param screenshot_id [Integer] Screenshot Identifier
|
|
118
|
+
# @param query [Hash] Request Body
|
|
119
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.screenshots.tags.putMany API Documentation}
|
|
120
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.screenshots.tags.putMany Enterprise API Documentation}
|
|
93
121
|
def replace_tags(screenshot_id = nil, query = {}, project_id = config.project_id)
|
|
94
122
|
screenshot_id || raise_parameter_is_required_error(:screenshot_id)
|
|
95
123
|
project_id || raise_project_id_is_required_error
|
|
@@ -103,6 +131,10 @@ module Crowdin
|
|
|
103
131
|
Web::SendRequest.new(request).perform
|
|
104
132
|
end
|
|
105
133
|
|
|
134
|
+
# @param screenshot_id [Integer] Screenshot Identifier
|
|
135
|
+
# @param query [Hash] Request Body
|
|
136
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.screenshots.tags.post API Documentation}
|
|
137
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.screenshots.tags.post Enterprise API Documentation}
|
|
106
138
|
def add_tag(screenshot_id = nil, query = {}, project_id = config.project_id)
|
|
107
139
|
screenshot_id || raise_parameter_is_required_error(:screenshot_id)
|
|
108
140
|
project_id || raise_project_id_is_required_error
|
|
@@ -116,6 +148,9 @@ module Crowdin
|
|
|
116
148
|
Web::SendRequest.new(request).perform
|
|
117
149
|
end
|
|
118
150
|
|
|
151
|
+
# @param screenshot_id [Integer] Screenshot Identifier
|
|
152
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.screenshots.tags.deleteMany API Documentation}
|
|
153
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.screenshots.tags.deleteMany Enterprise API Documentation}
|
|
119
154
|
def clear_tags(screenshot_id = nil, project_id = config.project_id)
|
|
120
155
|
screenshot_id || raise_parameter_is_required_error(:screenshot_id)
|
|
121
156
|
project_id || raise_project_id_is_required_error
|
|
@@ -128,6 +163,10 @@ module Crowdin
|
|
|
128
163
|
Web::SendRequest.new(request).perform
|
|
129
164
|
end
|
|
130
165
|
|
|
166
|
+
# @param screenshot_id [Integer] Screenshot Identifier
|
|
167
|
+
# @param tag_id [Integer] Tag Identifier
|
|
168
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.screenshots.tags.get API Documentation}
|
|
169
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.screenshots.tags.get Enterprise API Documentation}
|
|
131
170
|
def get_tag(screenshot_id = nil, tag_id = nil, project_id = config.project_id)
|
|
132
171
|
screenshot_id || raise_parameter_is_required_error(:screenshot_id)
|
|
133
172
|
tag_id || raise_parameter_is_required_error(:tag_id)
|
|
@@ -141,6 +180,10 @@ module Crowdin
|
|
|
141
180
|
Web::SendRequest.new(request).perform
|
|
142
181
|
end
|
|
143
182
|
|
|
183
|
+
# @param screenshot_id [Integer] Screenshot Identifier
|
|
184
|
+
# @param tag_id [Integer] Tag Identifier
|
|
185
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.screenshots.tags.delete API Documentation}
|
|
186
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.screenshots.tags.delete Enterprise API Documentation}
|
|
144
187
|
def delete_tag(screenshot_id = nil, tag_id = nil, project_id = config.project_id)
|
|
145
188
|
screenshot_id || raise_parameter_is_required_error(:screenshot_id)
|
|
146
189
|
tag_id || raise_parameter_is_required_error(:tag_id)
|
|
@@ -154,6 +197,11 @@ module Crowdin
|
|
|
154
197
|
Web::SendRequest.new(request).perform
|
|
155
198
|
end
|
|
156
199
|
|
|
200
|
+
# @param screenshot_id [Integer] Screenshot Identifier
|
|
201
|
+
# @param tag_id [Integer] Tag Identifier
|
|
202
|
+
# @param query [Hash] Request Body
|
|
203
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.screenshots.tags.patch API Documentation}
|
|
204
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.screenshots.tags.patch Enterprise API Documentation}
|
|
157
205
|
def edit_tag(screenshot_id = nil, tag_id = nil, query = {}, project_id = config.project_id)
|
|
158
206
|
screenshot_id || raise_parameter_is_required_error(:screenshot_id)
|
|
159
207
|
tag_id || raise_parameter_is_required_error(:tag_id)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Crowdin
|
|
4
|
+
module ApiResources
|
|
5
|
+
module SecurityLogs
|
|
6
|
+
# @param user_id [Integer] User Identifier
|
|
7
|
+
# @param query [Hash] Request Query Parameters
|
|
8
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.users.security-logs.getMany API Documentation}
|
|
9
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.users.security-logs.getMany Enterprise API Documentation}
|
|
10
|
+
def list_user_security_logs(user_id, query = {})
|
|
11
|
+
request = Web::Request.new(
|
|
12
|
+
connection,
|
|
13
|
+
:get,
|
|
14
|
+
"#{config.target_api_url}/users/#{user_id}/security-logs",
|
|
15
|
+
{ params: query }
|
|
16
|
+
)
|
|
17
|
+
Web::SendRequest.new(request).perform
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# @param user_id [Integer] User Identifier
|
|
21
|
+
# @param security_log_id [Integer] User Security Log Id
|
|
22
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.users.security-logs.get API Documentation}
|
|
23
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.users.security-logs.get Enterprise API Documentation}
|
|
24
|
+
def get_user_security_log(user_id, security_log_id)
|
|
25
|
+
request = Web::Request.new(
|
|
26
|
+
connection,
|
|
27
|
+
:get,
|
|
28
|
+
"#{config.target_api_url}/users/#{user_id}/security-logs/#{security_log_id}"
|
|
29
|
+
)
|
|
30
|
+
Web::SendRequest.new(request).perform
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# -- For Enterprise mode only --
|
|
34
|
+
|
|
35
|
+
# @param query [Hash] Request Query Parameters
|
|
36
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.security-logs.getMany Enterprise API Documentation}
|
|
37
|
+
def list_organization_security_logs(query = {})
|
|
38
|
+
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
39
|
+
|
|
40
|
+
request = Web::Request.new(
|
|
41
|
+
connection,
|
|
42
|
+
:get,
|
|
43
|
+
"#{config.target_api_url}/security-logs",
|
|
44
|
+
{ params: query }
|
|
45
|
+
)
|
|
46
|
+
Web::SendRequest.new(request).perform
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# @param security_log_id [Integer] Organization Security Log
|
|
50
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.security-logs.get Enterprise API Documentation}
|
|
51
|
+
def get_organization_security_log(security_log_id)
|
|
52
|
+
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
53
|
+
|
|
54
|
+
request = Web::Request.new(
|
|
55
|
+
connection,
|
|
56
|
+
:get,
|
|
57
|
+
"#{config.target_api_url}/security-logs/#{security_log_id}"
|
|
58
|
+
)
|
|
59
|
+
Web::SendRequest.new(request).perform
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|