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.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/docs.yml +1 -0
  3. data/.rubocop.yml +4 -0
  4. data/.rubocop_todo.yml +1 -0
  5. data/AGENTS.md +63 -0
  6. data/CLAUDE.md +1 -0
  7. data/Gemfile.lock +7 -7
  8. data/README.md +1 -1
  9. data/crowdin-api.gemspec +1 -1
  10. data/lib/crowdin-api/api_resources/advisor.rb +86 -0
  11. data/lib/crowdin-api/api_resources/ai.rb +974 -0
  12. data/lib/crowdin-api/api_resources/applications.rb +247 -10
  13. data/lib/crowdin-api/api_resources/bundles.rb +45 -29
  14. data/lib/crowdin-api/api_resources/clients.rb +23 -0
  15. data/lib/crowdin-api/api_resources/custom_spellcheckers.rb +36 -0
  16. data/lib/crowdin-api/api_resources/dictionaries.rb +5 -5
  17. data/lib/crowdin-api/api_resources/distributions.rb +15 -15
  18. data/lib/crowdin-api/api_resources/external_qa_checks.rb +36 -0
  19. data/lib/crowdin-api/api_resources/fields.rb +78 -0
  20. data/lib/crowdin-api/api_resources/glossaries.rb +62 -50
  21. data/lib/crowdin-api/api_resources/integrations.rb +201 -0
  22. data/lib/crowdin-api/api_resources/labels.rb +32 -0
  23. data/lib/crowdin-api/api_resources/languages.rb +16 -0
  24. data/lib/crowdin-api/api_resources/machine_translation_engines.rb +17 -0
  25. data/lib/crowdin-api/api_resources/notifications.rb +15 -6
  26. data/lib/crowdin-api/api_resources/organization.rb +33 -0
  27. data/lib/crowdin-api/api_resources/organization_webhooks.rb +71 -0
  28. data/lib/crowdin-api/api_resources/placeholders.rb +182 -0
  29. data/lib/crowdin-api/api_resources/projects.rb +137 -41
  30. data/lib/crowdin-api/api_resources/reports.rb +310 -26
  31. data/lib/crowdin-api/api_resources/screenshots.rb +48 -0
  32. data/lib/crowdin-api/api_resources/security_logs.rb +63 -0
  33. data/lib/crowdin-api/api_resources/source_files.rb +370 -65
  34. data/lib/crowdin-api/api_resources/source_strings.rb +62 -0
  35. data/lib/crowdin-api/api_resources/storages.rb +11 -11
  36. data/lib/crowdin-api/api_resources/string_comments.rb +46 -0
  37. data/lib/crowdin-api/api_resources/string_corrections.rb +21 -6
  38. data/lib/crowdin-api/api_resources/string_translations.rb +96 -0
  39. data/lib/crowdin-api/api_resources/style_guides.rb +71 -0
  40. data/lib/crowdin-api/api_resources/tasks.rb +140 -10
  41. data/lib/crowdin-api/api_resources/teams.rb +99 -0
  42. data/lib/crowdin-api/api_resources/translation_memory.rb +138 -0
  43. data/lib/crowdin-api/api_resources/translation_status.rb +65 -0
  44. data/lib/crowdin-api/api_resources/translations.rb +122 -2
  45. data/lib/crowdin-api/api_resources/users.rb +136 -6
  46. data/lib/crowdin-api/api_resources/vendors.rb +2 -0
  47. data/lib/crowdin-api/api_resources/webhooks.rb +16 -0
  48. data/lib/crowdin-api/api_resources/workflows.rb +24 -0
  49. data/lib/crowdin-api/client/version.rb +1 -1
  50. data/lib/crowdin-api/core/request.rb +1 -1
  51. data/lib/crowdin-api.rb +3 -1
  52. data/spec/api_resources/advisor_spec.rb +45 -0
  53. data/spec/api_resources/ai_spec.rb +863 -0
  54. data/spec/api_resources/applications_spec.rb +138 -0
  55. data/spec/api_resources/bundles_spec.rb +8 -0
  56. data/spec/api_resources/clients_spec.rb +13 -0
  57. data/spec/api_resources/custom_spellcheckers_spec.rb +21 -0
  58. data/spec/api_resources/external_qa_checks_spec.rb +21 -0
  59. data/spec/api_resources/fields_spec.rb +45 -0
  60. data/spec/api_resources/glossaries_spec.rb +18 -0
  61. data/spec/api_resources/integrations_spec.rb +117 -0
  62. data/spec/api_resources/organization_spec.rb +21 -0
  63. data/spec/api_resources/organization_webhooks_spec.rb +45 -0
  64. data/spec/api_resources/placeholders_spec.rb +103 -0
  65. data/spec/api_resources/projects_spec.rb +58 -0
  66. data/spec/api_resources/reports_spec.rb +221 -0
  67. data/spec/api_resources/security_logs_spec.rb +39 -0
  68. data/spec/api_resources/source_files_spec.rb +182 -0
  69. data/spec/api_resources/source_strings_spec.rb +26 -0
  70. data/spec/api_resources/string_comments_spec.rb +18 -0
  71. data/spec/api_resources/string_corrections_spec.rb +25 -19
  72. data/spec/api_resources/string_translations_spec.rb +26 -0
  73. data/spec/api_resources/style_guides_spec.rb +45 -0
  74. data/spec/api_resources/tasks_spec.rb +60 -0
  75. data/spec/api_resources/teams_spec.rb +42 -0
  76. data/spec/api_resources/translation_memory_spec.rb +58 -0
  77. data/spec/api_resources/translation_status_spec.rb +26 -0
  78. data/spec/api_resources/translations_spec.rb +42 -0
  79. data/spec/api_resources/users_spec.rb +84 -0
  80. data/spec/api_resources/workflows_spec.rb +10 -0
  81. metadata +29 -3
@@ -3,9 +3,9 @@
3
3
  module Crowdin
4
4
  module ApiResources
5
5
  module Projects
6
- # * {https://developer.crowdin.com/api/v2/#operation/api.projects.getMany API Documentation}
7
- # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.getMany Enterprise API Documentation}
8
- # @param query [Hash] Request Body
6
+ # @param query [Hash] Request Query Parameters
7
+ # * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.getMany API Documentation}
8
+ # * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.getMany Enterprise API Documentation}
9
9
  def list_projects(query = {})
10
10
  request = Web::Request.new(
11
11
  connection,
@@ -16,9 +16,9 @@ module Crowdin
16
16
  Web::SendRequest.new(request).perform
17
17
  end
18
18
 
19
- # * {https://developer.crowdin.com/api/v2/#operation/api.projects.post API Documentation}
20
- # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.post Enterprise API Documentation}
21
19
  # @param query [Hash] Request Body
20
+ # * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.post API Documentation}
21
+ # * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.post Enterprise API Documentation}
22
22
  def add_project(query = {})
23
23
  request = Web::Request.new(
24
24
  connection,
@@ -29,9 +29,8 @@ module Crowdin
29
29
  Web::SendRequest.new(request).perform
30
30
  end
31
31
 
32
- # * {https://developer.crowdin.com/api/v2/#operation/api.projects.get API Documentation}
33
- # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.get Enterprise API Documentation}
34
- # @param project_id [Integer] Project ID
32
+ # * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.get API Documentation}
33
+ # * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.get Enterprise API Documentation}
35
34
  def get_project(project_id = nil)
36
35
  project_id || raise_parameter_is_required_error(:project_id)
37
36
 
@@ -43,9 +42,8 @@ module Crowdin
43
42
  Web::SendRequest.new(request).perform
44
43
  end
45
44
 
46
- # * {https://developer.crowdin.com/api/v2/#operation/api.projects.delete API Documentation}
47
- # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.delete Enterprise API Documentation}
48
- # @param project_id [Integer] Project ID
45
+ # * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.delete API Documentation}
46
+ # * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.delete Enterprise API Documentation}
49
47
  def delete_project(project_id = nil)
50
48
  project_id || raise_parameter_is_required_error(:project_id)
51
49
 
@@ -57,10 +55,9 @@ module Crowdin
57
55
  Web::SendRequest.new(request).perform
58
56
  end
59
57
 
60
- # @param project_id [Integer] Project ID
61
58
  # @param query [Hash] Request Body
62
- # * {https://developer.crowdin.com/api/v2/#operation/api.projects.patch API Documentation}
63
- # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.patch Enterprise API Documentation}
59
+ # * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.patch API Documentation}
60
+ # * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.patch Enterprise API Documentation}
64
61
  def edit_project(project_id = nil, query = {})
65
62
  project_id || raise_parameter_is_required_error(:project_id)
66
63
 
@@ -73,9 +70,8 @@ module Crowdin
73
70
  Web::SendRequest.new(request).perform
74
71
  end
75
72
 
76
- # @param project_id [Integer] Project ID
77
- # * {https://developer.crowdin.com/api/v2/#operation/api.projects.strings-exporter-settings.getMany API Documentation}
78
- # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.strings-exporter-settings.getMany Enterprise API Documentation}
73
+ # * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.strings-exporter-settings.getMany API Documentation}
74
+ # * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.strings-exporter-settings.getMany Enterprise API Documentation}
79
75
  def list_project_strings_exporter_settings(project_id = nil)
80
76
  project_id || raise_parameter_is_required_error(:project_id)
81
77
 
@@ -87,10 +83,9 @@ module Crowdin
87
83
  Web::SendRequest.new(request).perform
88
84
  end
89
85
 
90
- # @param project_id [Integer] Project ID
91
86
  # @param query [Hash] Request Body
92
- # * {https://developer.crowdin.com/api/v2/#operation/api.projects.strings-exporter-settings.post API Documentation}
93
- # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.strings-exporter-settings.post Enterprise API Documentation}
87
+ # * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.strings-exporter-settings.post API Documentation}
88
+ # * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.strings-exporter-settings.post Enterprise API Documentation}
94
89
  def add_project_strings_exporter_settings(project_id = nil, query = {})
95
90
  project_id || raise_parameter_is_required_error(:project_id)
96
91
 
@@ -103,10 +98,9 @@ module Crowdin
103
98
  Web::SendRequest.new(request).perform
104
99
  end
105
100
 
106
- # @param project_id [Integer] Project ID
107
- # @param system_strings_exporter_settings_id [Integer] Request Body
108
- # * {https://developer.crowdin.com/api/v2/#operation/api.projects.strings-exporter-settings.get API Documentation}
109
- # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.strings-exporter-settings.get Enterprise API Documentation}
101
+ # @param system_strings_exporter_settings_id [Integer] System strings exporter Settings Identifier
102
+ # * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.strings-exporter-settings.get API Documentation}
103
+ # * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.strings-exporter-settings.get Enterprise API Documentation}
110
104
  def get_project_strings_exporter_settings(project_id = nil, system_strings_exporter_settings_id = nil)
111
105
  project_id || raise_parameter_is_required_error(:project_id)
112
106
  system_strings_exporter_settings_id || raise_parameter_is_required_error(:system_strings_exporter_settings_id)
@@ -120,10 +114,9 @@ module Crowdin
120
114
  Web::SendRequest.new(request).perform
121
115
  end
122
116
 
123
- # @param project_id [Integer] Project ID
124
- # @param system_strings_exporter_settings_id [Integer] Request Body
125
- # * {https://developer.crowdin.com/api/v2/#operation/api.projects.strings-exporter-settings.delete API Documentation}
126
- # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.strings-exporter-settings.delete Enterprise API Documentation}
117
+ # @param system_strings_exporter_settings_id [Integer] System strings exporter Settings Identifier
118
+ # * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.strings-exporter-settings.delete API Documentation}
119
+ # * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.strings-exporter-settings.delete Enterprise API Documentation}
127
120
  def delete_project_strings_exporter_settings(project_id = nil, system_strings_exporter_settings_id = nil)
128
121
  project_id || raise_parameter_is_required_error(:project_id)
129
122
  system_strings_exporter_settings_id || raise_parameter_is_required_error(:system_strings_exporter_settings_id)
@@ -137,11 +130,10 @@ module Crowdin
137
130
  Web::SendRequest.new(request).perform
138
131
  end
139
132
 
140
- # @param project_id [Integer] Project ID
141
- # @param system_strings_exporter_settings_id [Integer] Request Body
133
+ # @param system_strings_exporter_settings_id [Integer] System strings exporter Settings Identifier
142
134
  # @param query [Hash] Request Body
143
- # * {https://developer.crowdin.com/api/v2/#operation/api.projects.strings-exporter-settings.patch API Documentation}
144
- # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.strings-exporter-settings.patch Enterprise API Documentation}
135
+ # * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.strings-exporter-settings.patch API Documentation}
136
+ # * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.strings-exporter-settings.patch Enterprise API Documentation}
145
137
  def edit_project_strings_exporter_settings(project_id = nil, system_strings_exporter_settings_id = nil, query = {})
146
138
  project_id || raise_parameter_is_required_error(:project_id)
147
139
  system_strings_exporter_settings_id || raise_parameter_is_required_error(:system_strings_exporter_settings_id)
@@ -156,10 +148,114 @@ module Crowdin
156
148
  Web::SendRequest.new(request).perform
157
149
  end
158
150
 
151
+ # * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.file-format-settings.getMany API Documentation}
152
+ # * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.file-format-settings.getMany Enterprise API Documentation}
153
+ def list_project_file_format_settings(project_id = config.project_id)
154
+ project_id || raise_project_id_is_required_error
155
+
156
+ request = Web::Request.new(
157
+ connection,
158
+ :get,
159
+ "#{config.target_api_url}/projects/#{project_id}/file-format-settings"
160
+ )
161
+ Web::SendRequest.new(request).perform
162
+ end
163
+
164
+ # @param body [Hash] Request Body
165
+ # * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.file-format-settings.post API Documentation}
166
+ # * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.file-format-settings.post Enterprise API Documentation}
167
+ def add_project_file_format_settings(body = {}, project_id = config.project_id)
168
+ project_id || raise_project_id_is_required_error
169
+
170
+ request = Web::Request.new(
171
+ connection,
172
+ :post,
173
+ "#{config.target_api_url}/projects/#{project_id}/file-format-settings",
174
+ { params: body }
175
+ )
176
+ Web::SendRequest.new(request).perform
177
+ end
178
+
179
+ # @param file_format_settings_id [Integer] File Format Settings Identifier
180
+ # * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.file-format-settings.delete API Documentation}
181
+ # * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.file-format-settings.delete Enterprise API Documentation}
182
+ def delete_project_file_format_settings(file_format_settings_id, project_id = config.project_id)
183
+ project_id || raise_project_id_is_required_error
184
+
185
+ request = Web::Request.new(
186
+ connection,
187
+ :delete,
188
+ "#{config.target_api_url}/projects/#{project_id}/file-format-settings/#{file_format_settings_id}"
189
+ )
190
+ Web::SendRequest.new(request).perform
191
+ end
192
+
193
+ # @param file_format_settings_id [Integer] File Format Settings Identifier
194
+ # * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.file-format-settings.get API Documentation}
195
+ # * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.file-format-settings.get Enterprise API Documentation}
196
+ def get_project_file_format_settings(file_format_settings_id, project_id = config.project_id)
197
+ project_id || raise_project_id_is_required_error
198
+
199
+ request = Web::Request.new(
200
+ connection,
201
+ :get,
202
+ "#{config.target_api_url}/projects/#{project_id}/file-format-settings/#{file_format_settings_id}"
203
+ )
204
+ Web::SendRequest.new(request).perform
205
+ end
206
+
207
+ # @param file_format_settings_id [Integer] File Format Settings Identifier
208
+ # @param body [Array] Request Body
209
+ # * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.file-format-settings.patch API Documentation}
210
+ # * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.file-format-settings.patch Enterprise API Documentation}
211
+ def edit_project_file_format_settings(file_format_settings_id, body = [], project_id = config.project_id)
212
+ project_id || raise_project_id_is_required_error
213
+
214
+ request = Web::Request.new(
215
+ connection,
216
+ :patch,
217
+ "#{config.target_api_url}/projects/#{project_id}/file-format-settings/#{file_format_settings_id}",
218
+ { params: body }
219
+ )
220
+ Web::SendRequest.new(request).perform
221
+ end
222
+
223
+ # @param file_format_settings_id [Integer] File Format Settings Identifier
224
+ # * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.file-format-settings.custom-segmentations.delete API Documentation}
225
+ # * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.file-format-settings.custom-segmentations.delete Enterprise API Documentation}
226
+ def reset_project_file_format_settings_custom_segmentation(file_format_settings_id, project_id = config.project_id)
227
+ project_id || raise_project_id_is_required_error
228
+
229
+ endpoint = "projects/#{project_id}/file-format-settings/#{file_format_settings_id}/custom-segmentations"
230
+ request = Web::Request.new(
231
+ connection,
232
+ :delete,
233
+ "#{config.target_api_url}/#{endpoint}"
234
+ )
235
+ Web::SendRequest.new(request).perform
236
+ end
237
+
238
+ # @param file_format_settings_id [Integer] File Format Settings Identifier
239
+ # @param destination [String] Destination of File
240
+ # * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.file-format-settings.custom-segmentations.get API Documentation}
241
+ # * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.file-format-settings.custom-segmentations.get Enterprise API Documentation}
242
+ def download_project_file_format_settings_custom_segmentation(file_format_settings_id, destination = nil,
243
+ project_id = config.project_id)
244
+ project_id || raise_project_id_is_required_error
245
+
246
+ endpoint = "projects/#{project_id}/file-format-settings/#{file_format_settings_id}/custom-segmentations"
247
+ request = Web::Request.new(
248
+ connection,
249
+ :get,
250
+ "#{config.target_api_url}/#{endpoint}"
251
+ )
252
+ Web::SendRequest.new(request, destination).perform
253
+ end
254
+
159
255
  # -- For Enterprise mode only --
160
256
 
161
- # @param query [Hash] Request Body
162
- # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.groups.getMany Enterprise API Documentation}
257
+ # @param query [Hash] Request Query Parameters
258
+ # * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.groups.getMany Enterprise API Documentation}
163
259
  def list_groups(query = {})
164
260
  enterprise_mode? || raise_only_for_enterprise_mode_error
165
261
 
@@ -173,7 +269,7 @@ module Crowdin
173
269
  end
174
270
 
175
271
  # @param query [Hash] Request Body
176
- # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.groups.post Enterprise API Documentation}
272
+ # * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.groups.post Enterprise API Documentation}
177
273
  def add_group(query = {})
178
274
  enterprise_mode? || raise_only_for_enterprise_mode_error
179
275
 
@@ -186,8 +282,8 @@ module Crowdin
186
282
  Web::SendRequest.new(request).perform
187
283
  end
188
284
 
189
- # @param group_id [Integer] Group ID
190
- # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.groups.get Enterprise API Documentation}
285
+ # @param group_id [Integer] Group Identifier
286
+ # * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.groups.get Enterprise API Documentation}
191
287
  def get_group(group_id = nil)
192
288
  enterprise_mode? || raise_only_for_enterprise_mode_error
193
289
  group_id || raise_parameter_is_required_error(:group_id)
@@ -200,8 +296,8 @@ module Crowdin
200
296
  Web::SendRequest.new(request).perform
201
297
  end
202
298
 
203
- # @param group_id [Integer] Group ID
204
- # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.groups.delete Enterprise API Documentation}
299
+ # @param group_id [Integer] Group Identifier
300
+ # * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.groups.delete Enterprise API Documentation}
205
301
  def delete_group(group_id = nil)
206
302
  enterprise_mode? || raise_only_for_enterprise_mode_error
207
303
  group_id || raise_parameter_is_required_error(:group_id)
@@ -214,9 +310,9 @@ module Crowdin
214
310
  Web::SendRequest.new(request).perform
215
311
  end
216
312
 
217
- # @param group_id [Integer] Group ID
313
+ # @param group_id [Integer] Group Identifier
218
314
  # @param query [Hash] Request Body
219
- # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.groups.patch Enterprise API Documentation}
315
+ # * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.groups.patch Enterprise API Documentation}
220
316
  def edit_group(group_id = nil, query = {})
221
317
  enterprise_mode? || raise_only_for_enterprise_mode_error
222
318
  group_id || raise_parameter_is_required_error(:group_id)