crowdin-api 1.13.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/.rubocop_todo.yml +1 -0
- data/AGENTS.md +63 -0
- data/CLAUDE.md +1 -0
- data/Gemfile.lock +1 -1
- data/README.md +23 -1
- data/lib/crowdin-api/api_resources/advisor.rb +86 -0
- data/lib/crowdin-api/api_resources/ai.rb +974 -0
- data/lib/crowdin-api/api_resources/applications.rb +252 -15
- data/lib/crowdin-api/api_resources/bundles.rb +45 -29
- data/lib/crowdin-api/api_resources/clients.rb +23 -0
- data/lib/crowdin-api/api_resources/custom_spellcheckers.rb +36 -0
- data/lib/crowdin-api/api_resources/dictionaries.rb +5 -5
- data/lib/crowdin-api/api_resources/distributions.rb +15 -15
- data/lib/crowdin-api/api_resources/external_qa_checks.rb +36 -0
- data/lib/crowdin-api/api_resources/fields.rb +78 -0
- data/lib/crowdin-api/api_resources/glossaries.rb +62 -50
- data/lib/crowdin-api/api_resources/integrations.rb +201 -0
- data/lib/crowdin-api/api_resources/labels.rb +32 -0
- data/lib/crowdin-api/api_resources/languages.rb +16 -0
- data/lib/crowdin-api/api_resources/machine_translation_engines.rb +17 -0
- data/lib/crowdin-api/api_resources/notifications.rb +15 -6
- data/lib/crowdin-api/api_resources/organization.rb +33 -0
- data/lib/crowdin-api/api_resources/organization_webhooks.rb +71 -0
- data/lib/crowdin-api/api_resources/placeholders.rb +182 -0
- data/lib/crowdin-api/api_resources/projects.rb +137 -41
- data/lib/crowdin-api/api_resources/reports.rb +310 -26
- data/lib/crowdin-api/api_resources/screenshots.rb +48 -0
- data/lib/crowdin-api/api_resources/security_logs.rb +63 -0
- data/lib/crowdin-api/api_resources/source_files.rb +370 -65
- data/lib/crowdin-api/api_resources/source_strings.rb +62 -0
- data/lib/crowdin-api/api_resources/storages.rb +11 -11
- data/lib/crowdin-api/api_resources/string_comments.rb +46 -0
- data/lib/crowdin-api/api_resources/string_corrections.rb +21 -6
- data/lib/crowdin-api/api_resources/string_translations.rb +96 -0
- data/lib/crowdin-api/api_resources/style_guides.rb +71 -0
- data/lib/crowdin-api/api_resources/tasks.rb +140 -10
- data/lib/crowdin-api/api_resources/teams.rb +99 -0
- data/lib/crowdin-api/api_resources/translation_memory.rb +138 -0
- data/lib/crowdin-api/api_resources/translation_status.rb +65 -0
- data/lib/crowdin-api/api_resources/translations.rb +122 -2
- data/lib/crowdin-api/api_resources/users.rb +136 -6
- data/lib/crowdin-api/api_resources/vendors.rb +2 -0
- data/lib/crowdin-api/api_resources/webhooks.rb +16 -0
- data/lib/crowdin-api/api_resources/workflows.rb +24 -0
- data/lib/crowdin-api/client/client.rb +3 -8
- data/lib/crowdin-api/client/version.rb +1 -1
- data/lib/crowdin-api/core/graphql_extensions.rb +22 -0
- data/lib/crowdin-api/core/request.rb +1 -1
- data/lib/crowdin-api.rb +4 -1
- data/spec/api_resources/advisor_spec.rb +45 -0
- data/spec/api_resources/ai_spec.rb +863 -0
- data/spec/api_resources/applications_spec.rb +138 -0
- data/spec/api_resources/bundles_spec.rb +8 -0
- data/spec/api_resources/clients_spec.rb +13 -0
- data/spec/api_resources/custom_spellcheckers_spec.rb +21 -0
- data/spec/api_resources/external_qa_checks_spec.rb +21 -0
- data/spec/api_resources/fields_spec.rb +45 -0
- data/spec/api_resources/glossaries_spec.rb +18 -0
- data/spec/api_resources/integrations_spec.rb +117 -0
- data/spec/api_resources/organization_spec.rb +21 -0
- data/spec/api_resources/organization_webhooks_spec.rb +45 -0
- data/spec/api_resources/placeholders_spec.rb +103 -0
- data/spec/api_resources/projects_spec.rb +58 -0
- data/spec/api_resources/reports_spec.rb +221 -0
- data/spec/api_resources/security_logs_spec.rb +39 -0
- data/spec/api_resources/source_files_spec.rb +182 -0
- data/spec/api_resources/source_strings_spec.rb +26 -0
- data/spec/api_resources/string_comments_spec.rb +18 -0
- data/spec/api_resources/string_corrections_spec.rb +25 -19
- data/spec/api_resources/string_translations_spec.rb +26 -0
- data/spec/api_resources/style_guides_spec.rb +45 -0
- data/spec/api_resources/tasks_spec.rb +60 -0
- data/spec/api_resources/teams_spec.rb +42 -0
- data/spec/api_resources/translation_memory_spec.rb +58 -0
- data/spec/api_resources/translation_status_spec.rb +26 -0
- data/spec/api_resources/translations_spec.rb +42 -0
- data/spec/api_resources/users_spec.rb +84 -0
- data/spec/api_resources/workflows_spec.rb +10 -0
- data/spec/unit/client_spec.rb +47 -0
- metadata +28 -1
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
module Crowdin
|
|
4
4
|
module ApiResources
|
|
5
5
|
module TranslationStatus
|
|
6
|
+
# @param branch_id [Integer] Branch Identifier
|
|
7
|
+
# @param query [Hash] Request Query Parameters
|
|
8
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.branches.languages.progress.getMany API Documentation}
|
|
9
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.branches.languages.progress.getMany Enterprise API Documentation}
|
|
6
10
|
def get_branch_progress(branch_id = nil, query = {}, project_id = config.project_id)
|
|
7
11
|
branch_id || raise_parameter_is_required_error(:branch_id)
|
|
8
12
|
project_id || raise_project_id_is_required_error
|
|
@@ -16,6 +20,10 @@ module Crowdin
|
|
|
16
20
|
Web::SendRequest.new(request).perform
|
|
17
21
|
end
|
|
18
22
|
|
|
23
|
+
# @param directory_id [Integer] Directory Identifier
|
|
24
|
+
# @param query [Hash] Request Query Parameters
|
|
25
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.directories.languages.progress.getMany API Documentation}
|
|
26
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.directories.languages.progress.getMany Enterprise API Documentation}
|
|
19
27
|
def get_directory_progress(directory_id = nil, query = {}, project_id = config.project_id)
|
|
20
28
|
directory_id || raise_parameter_is_required_error(:directory_id)
|
|
21
29
|
project_id || raise_project_id_is_required_error
|
|
@@ -29,6 +37,10 @@ module Crowdin
|
|
|
29
37
|
Web::SendRequest.new(request).perform
|
|
30
38
|
end
|
|
31
39
|
|
|
40
|
+
# @param file_id [Integer] File Identifier
|
|
41
|
+
# @param query [Hash] Request Query Parameters
|
|
42
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.files.languages.progress.getMany API Documentation}
|
|
43
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.files.languages.progress.getMany Enterprise API Documentation}
|
|
32
44
|
def get_file_progress(file_id = nil, query = {}, project_id = config.project_id)
|
|
33
45
|
file_id || raise_parameter_is_required_error(:file_id)
|
|
34
46
|
project_id || raise_project_id_is_required_error
|
|
@@ -42,6 +54,10 @@ module Crowdin
|
|
|
42
54
|
Web::SendRequest.new(request).perform
|
|
43
55
|
end
|
|
44
56
|
|
|
57
|
+
# @param language_id [String] Language Identifier
|
|
58
|
+
# @param query [Hash] Request Query Parameters
|
|
59
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.languages.files.progress.getMany API Documentation}
|
|
60
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.languages.files.progress.getMany Enterprise API Documentation}
|
|
45
61
|
def get_language_progress(language_id = nil, query = {}, project_id = config.project_id)
|
|
46
62
|
language_id || raise_parameter_is_required_error(:language_id)
|
|
47
63
|
project_id || raise_project_id_is_required_error
|
|
@@ -55,6 +71,9 @@ module Crowdin
|
|
|
55
71
|
Web::SendRequest.new(request).perform
|
|
56
72
|
end
|
|
57
73
|
|
|
74
|
+
# @param query [Hash] Request Query Parameters
|
|
75
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.languages.progress.getMany API Documentation}
|
|
76
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.languages.progress.getMany Enterprise API Documentation}
|
|
58
77
|
def get_project_progress(query = {}, project_id = config.project_id)
|
|
59
78
|
project_id || raise_project_id_is_required_error
|
|
60
79
|
|
|
@@ -67,6 +86,9 @@ module Crowdin
|
|
|
67
86
|
Web::SendRequest.new(request).perform
|
|
68
87
|
end
|
|
69
88
|
|
|
89
|
+
# @param query [Hash] Request Query Parameters
|
|
90
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.qa-checks.getMany API Documentation}
|
|
91
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.qa-checks.getMany Enterprise API Documentation}
|
|
70
92
|
def get_qa_progress(query = {}, project_id = config.project_id)
|
|
71
93
|
project_id || raise_project_id_is_required_error
|
|
72
94
|
|
|
@@ -78,6 +100,49 @@ module Crowdin
|
|
|
78
100
|
)
|
|
79
101
|
Web::SendRequest.new(request).perform
|
|
80
102
|
end
|
|
103
|
+
|
|
104
|
+
# @param body [Hash] Request Body
|
|
105
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.qa-checks.revalidate.post API Documentation}
|
|
106
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.qa-checks.revalidate.post Enterprise API Documentation}
|
|
107
|
+
def revalidate_qa_checks(body = {}, project_id = config.project_id)
|
|
108
|
+
project_id || raise_project_id_is_required_error
|
|
109
|
+
|
|
110
|
+
request = Web::Request.new(
|
|
111
|
+
connection,
|
|
112
|
+
:post,
|
|
113
|
+
"#{config.target_api_url}/projects/#{project_id}/qa-checks/revalidate",
|
|
114
|
+
{ params: body }
|
|
115
|
+
)
|
|
116
|
+
Web::SendRequest.new(request).perform
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# @param revalidation_id [String] QA Checks Revalidation Identifier, consists of 36 characters
|
|
120
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.qa-checks.revalidate.delete API Documentation}
|
|
121
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.qa-checks.revalidate.delete Enterprise API Documentation}
|
|
122
|
+
def cancel_qa_checks_revalidation(revalidation_id, project_id = config.project_id)
|
|
123
|
+
project_id || raise_project_id_is_required_error
|
|
124
|
+
|
|
125
|
+
request = Web::Request.new(
|
|
126
|
+
connection,
|
|
127
|
+
:delete,
|
|
128
|
+
"#{config.target_api_url}/projects/#{project_id}/qa-checks/revalidate/#{revalidation_id}"
|
|
129
|
+
)
|
|
130
|
+
Web::SendRequest.new(request).perform
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# @param revalidation_id [String] QA Checks Revalidation Identifier, consists of 36 characters
|
|
134
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.qa-checks.revalidate.get API Documentation}
|
|
135
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.qa-checks.revalidate.get Enterprise API Documentation}
|
|
136
|
+
def qa_checks_revalidation_status(revalidation_id, project_id = config.project_id)
|
|
137
|
+
project_id || raise_project_id_is_required_error
|
|
138
|
+
|
|
139
|
+
request = Web::Request.new(
|
|
140
|
+
connection,
|
|
141
|
+
:get,
|
|
142
|
+
"#{config.target_api_url}/projects/#{project_id}/qa-checks/revalidate/#{revalidation_id}"
|
|
143
|
+
)
|
|
144
|
+
Web::SendRequest.new(request).perform
|
|
145
|
+
end
|
|
81
146
|
end
|
|
82
147
|
end
|
|
83
148
|
end
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
module Crowdin
|
|
4
4
|
module ApiResources
|
|
5
5
|
module Translations
|
|
6
|
+
# @param pre_translation_id [Hash] Request Body
|
|
7
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.pre-translations.get API Documentation}
|
|
8
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.pre-translations.get Enterprise API Documentation}
|
|
6
9
|
def pre_translation_status(pre_translation_id = nil, project_id = config.project_id)
|
|
7
10
|
pre_translation_id || raise_parameter_is_required_error(:pre_translation_id)
|
|
8
11
|
project_id || raise_project_id_is_required_error
|
|
@@ -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.pre-translations.post API Documentation}
|
|
23
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.pre-translations.post Enterprise API Documentation}
|
|
18
24
|
def apply_pre_translation(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 query [Hash] Request Query Parameters
|
|
37
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.pre-translations.getMany API Documentation}
|
|
38
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.pre-translations.getMany Enterprise API Documentation}
|
|
30
39
|
def list_pre_translations(query = {}, project_id = config.project_id)
|
|
31
40
|
project_id || raise_project_id_is_required_error
|
|
32
41
|
|
|
@@ -39,6 +48,10 @@ module Crowdin
|
|
|
39
48
|
Web::SendRequest.new(request).perform
|
|
40
49
|
end
|
|
41
50
|
|
|
51
|
+
# @param pre_translation_id [Hash] Request Body
|
|
52
|
+
# @param query [Hash] Request Body
|
|
53
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.pre-translations.patch API Documentation}
|
|
54
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.pre-translations.patch Enterprise API Documentation}
|
|
42
55
|
def edit_pre_translations(pre_translation_id = nil, query = {}, project_id = config.project_id)
|
|
43
56
|
pre_translation_id || raise_parameter_is_required_error(:pre_translation_id)
|
|
44
57
|
project_id || raise_project_id_is_required_error
|
|
@@ -52,8 +65,9 @@ module Crowdin
|
|
|
52
65
|
Web::SendRequest.new(request).perform
|
|
53
66
|
end
|
|
54
67
|
|
|
55
|
-
#
|
|
56
|
-
# * {https://support.crowdin.com/developer/
|
|
68
|
+
# @param pre_translation_id [Hash] Request Body
|
|
69
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.pre-translations.report.getReport API Documentation}
|
|
70
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.pre-translations.report.getReport Enterprise API Documentation}
|
|
57
71
|
def pre_translation_report(pre_translation_id = nil, project_id = config.project_id)
|
|
58
72
|
pre_translation_id || raise_parameter_is_required_error(:pre_translation_id)
|
|
59
73
|
project_id || raise_project_id_is_required_error
|
|
@@ -66,6 +80,10 @@ module Crowdin
|
|
|
66
80
|
Web::SendRequest.new(request).perform
|
|
67
81
|
end
|
|
68
82
|
|
|
83
|
+
# @param directory_id [Integer] Directory Identifier
|
|
84
|
+
# @param query [Hash] Request Body
|
|
85
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.translations.builds.directories.post API Documentation}
|
|
86
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.translations.builds.directories.post Enterprise API Documentation}
|
|
69
87
|
def build_project_directory_translation(directory_id = nil, query = {}, project_id = config.project_id)
|
|
70
88
|
directory_id || raise_parameter_is_required_error(:directory_id)
|
|
71
89
|
project_id || raise_project_id_is_required_error
|
|
@@ -79,6 +97,11 @@ module Crowdin
|
|
|
79
97
|
Web::SendRequest.new(request).perform
|
|
80
98
|
end
|
|
81
99
|
|
|
100
|
+
# @param file_id [Integer] File Identifier
|
|
101
|
+
# @param query [Hash] Request Body
|
|
102
|
+
# @param destination [String] Destination of File
|
|
103
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.translations.builds.files.post API Documentation}
|
|
104
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.translations.builds.files.post Enterprise API Documentation}
|
|
82
105
|
def build_project_file_translation(file_id = nil, query = {}, destination = nil, project_id = config.project_id)
|
|
83
106
|
file_id || raise_parameter_is_required_error(:file_id)
|
|
84
107
|
project_id || raise_project_id_is_required_error
|
|
@@ -95,6 +118,9 @@ module Crowdin
|
|
|
95
118
|
Web::SendRequest.new(request, destination).perform
|
|
96
119
|
end
|
|
97
120
|
|
|
121
|
+
# @param query [Hash] Request Query Parameters
|
|
122
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.translations.builds.getMany API Documentation}
|
|
123
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.translations.builds.getMany Enterprise API Documentation}
|
|
98
124
|
def list_project_builds(query = {}, project_id = config.project_id)
|
|
99
125
|
project_id || raise_project_id_is_required_error
|
|
100
126
|
|
|
@@ -107,6 +133,9 @@ module Crowdin
|
|
|
107
133
|
Web::SendRequest.new(request).perform
|
|
108
134
|
end
|
|
109
135
|
|
|
136
|
+
# @param query [Hash] Request Body
|
|
137
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.translations.builds.post API Documentation}
|
|
138
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.translations.builds.post Enterprise API Documentation}
|
|
110
139
|
def build_project_translation(query = {}, project_id = config.project_id)
|
|
111
140
|
project_id || raise_project_id_is_required_error
|
|
112
141
|
|
|
@@ -119,6 +148,10 @@ module Crowdin
|
|
|
119
148
|
Web::SendRequest.new(request).perform
|
|
120
149
|
end
|
|
121
150
|
|
|
151
|
+
# @param language_id [String] Language Identifier
|
|
152
|
+
# @param query [Hash] Request Body
|
|
153
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.translations.postOnLanguage API Documentation}
|
|
154
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.translations.postOnLanguage Enterprise API Documentation}
|
|
122
155
|
def upload_translations(language_id = nil, query = {}, project_id = config.project_id)
|
|
123
156
|
language_id || raise_parameter_is_required_error(:language_id)
|
|
124
157
|
project_id || raise_project_id_is_required_error
|
|
@@ -132,6 +165,10 @@ module Crowdin
|
|
|
132
165
|
Web::SendRequest.new(request).perform
|
|
133
166
|
end
|
|
134
167
|
|
|
168
|
+
# @param build_id [Integer] Project Build Identifier
|
|
169
|
+
# @param destination [String] Destination of File
|
|
170
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.translations.builds.download.download API Documentation}
|
|
171
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.translations.builds.download.download Enterprise API Documentation}
|
|
135
172
|
def download_project_translations(build_id = nil, destination = nil, project_id = config.project_id)
|
|
136
173
|
build_id || raise_parameter_is_required_error(:build_id)
|
|
137
174
|
project_id || raise_project_id_is_required_error
|
|
@@ -144,6 +181,9 @@ module Crowdin
|
|
|
144
181
|
Web::SendRequest.new(request, destination).perform
|
|
145
182
|
end
|
|
146
183
|
|
|
184
|
+
# @param build_id [Integer] Project Build Identifier
|
|
185
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.translations.builds.get API Documentation}
|
|
186
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.translations.builds.get Enterprise API Documentation}
|
|
147
187
|
def check_project_build_status(build_id = nil, project_id = config.project_id)
|
|
148
188
|
build_id || raise_parameter_is_required_error(:build_id)
|
|
149
189
|
project_id || raise_project_id_is_required_error
|
|
@@ -156,6 +196,9 @@ module Crowdin
|
|
|
156
196
|
Web::SendRequest.new(request).perform
|
|
157
197
|
end
|
|
158
198
|
|
|
199
|
+
# @param build_id [Integer] Project Build Identifier
|
|
200
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.translations.builds.delete API Documentation}
|
|
201
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.translations.builds.delete Enterprise API Documentation}
|
|
159
202
|
def cancel_build(build_id = nil, project_id = config.project_id)
|
|
160
203
|
build_id || raise_parameter_is_required_error(:build_id)
|
|
161
204
|
project_id || raise_project_id_is_required_error
|
|
@@ -168,6 +211,10 @@ module Crowdin
|
|
|
168
211
|
Web::SendRequest.new(request).perform
|
|
169
212
|
end
|
|
170
213
|
|
|
214
|
+
# @param query [Hash] Request Body
|
|
215
|
+
# @param destination [String] Destination of File
|
|
216
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.translations.exports.post API Documentation}
|
|
217
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.translations.exports.post Enterprise API Documentation}
|
|
171
218
|
def export_project_translation(query = {}, destination = nil, project_id = config.project_id)
|
|
172
219
|
project_id || raise_project_id_is_required_error
|
|
173
220
|
|
|
@@ -179,6 +226,79 @@ module Crowdin
|
|
|
179
226
|
)
|
|
180
227
|
Web::SendRequest.new(request, destination).perform
|
|
181
228
|
end
|
|
229
|
+
|
|
230
|
+
# @param body [Array] Request Body
|
|
231
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.pre-translations.patchBatch API Documentation}
|
|
232
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.pre-translations.patchBatch Enterprise API Documentation}
|
|
233
|
+
def auto_translation_batch_operations(body = [], project_id = config.project_id)
|
|
234
|
+
project_id || raise_project_id_is_required_error
|
|
235
|
+
|
|
236
|
+
request = Web::Request.new(
|
|
237
|
+
connection,
|
|
238
|
+
:patch,
|
|
239
|
+
"#{config.target_api_url}/projects/#{project_id}/pre-translations",
|
|
240
|
+
{ params: body }
|
|
241
|
+
)
|
|
242
|
+
Web::SendRequest.new(request).perform
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
# @param body [Hash] Request Body
|
|
246
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.translations.imports API Documentation}
|
|
247
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.translations.enterprise.imports Enterprise API Documentation}
|
|
248
|
+
def import_translations(body = {}, project_id = config.project_id)
|
|
249
|
+
project_id || raise_project_id_is_required_error
|
|
250
|
+
|
|
251
|
+
request = Web::Request.new(
|
|
252
|
+
connection,
|
|
253
|
+
:post,
|
|
254
|
+
"#{config.target_api_url}/projects/#{project_id}/translations/imports",
|
|
255
|
+
{ params: body }
|
|
256
|
+
)
|
|
257
|
+
Web::SendRequest.new(request).perform
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
# @param import_translation_id [String] Import Translation Identifier
|
|
261
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.translations.imports.get API Documentation}
|
|
262
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.translations.enterprise.imports.get Enterprise API Documentation}
|
|
263
|
+
def import_translations_status(import_translation_id, project_id = config.project_id)
|
|
264
|
+
project_id || raise_project_id_is_required_error
|
|
265
|
+
|
|
266
|
+
request = Web::Request.new(
|
|
267
|
+
connection,
|
|
268
|
+
:get,
|
|
269
|
+
"#{config.target_api_url}/projects/#{project_id}/translations/imports/#{import_translation_id}"
|
|
270
|
+
)
|
|
271
|
+
Web::SendRequest.new(request).perform
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# @param import_translation_id [String] Import Translation Identifier
|
|
275
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.translations.imports.report.get API Documentation}
|
|
276
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.translations.imports.report.get Enterprise API Documentation}
|
|
277
|
+
def import_translations_report(import_translation_id, project_id = config.project_id)
|
|
278
|
+
project_id || raise_project_id_is_required_error
|
|
279
|
+
|
|
280
|
+
request = Web::Request.new(
|
|
281
|
+
connection,
|
|
282
|
+
:get,
|
|
283
|
+
"#{config.target_api_url}/projects/#{project_id}/translations/imports/#{import_translation_id}/report"
|
|
284
|
+
)
|
|
285
|
+
Web::SendRequest.new(request).perform
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
# @param body [Array] Request Body
|
|
289
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.translations.validate-qa-checks.post API Documentation}
|
|
290
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.translations.validate-qa-checks.post Enterprise API Documentation}
|
|
291
|
+
def validate_text_by_qa_checks(body = [], project_id = config.project_id)
|
|
292
|
+
project_id || raise_project_id_is_required_error
|
|
293
|
+
|
|
294
|
+
request = Web::Request.new(
|
|
295
|
+
connection,
|
|
296
|
+
:post,
|
|
297
|
+
"#{config.target_api_url}/projects/#{project_id}/translations/validate-qa-checks",
|
|
298
|
+
{ params: body }
|
|
299
|
+
)
|
|
300
|
+
Web::SendRequest.new(request).perform
|
|
301
|
+
end
|
|
182
302
|
end
|
|
183
303
|
end
|
|
184
304
|
end
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Crowdin
|
|
4
4
|
module ApiResources
|
|
5
5
|
module Users
|
|
6
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.user.get API Documentation}
|
|
7
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.user.get Enterprise API Documentation}
|
|
6
8
|
def get_authenticated_user
|
|
7
9
|
request = Web::Request.new(
|
|
8
10
|
connection,
|
|
@@ -12,6 +14,9 @@ module Crowdin
|
|
|
12
14
|
Web::SendRequest.new(request).perform
|
|
13
15
|
end
|
|
14
16
|
|
|
17
|
+
# @param query [Hash] Request Query Parameters
|
|
18
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.members.getMany API Documentation}
|
|
19
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.members.getMany Enterprise API Documentation}
|
|
15
20
|
def list_project_members(query = {}, project_id = config.project_id)
|
|
16
21
|
project_id || raise_project_id_is_required_error
|
|
17
22
|
|
|
@@ -24,6 +29,9 @@ module Crowdin
|
|
|
24
29
|
Web::SendRequest.new(request).perform
|
|
25
30
|
end
|
|
26
31
|
|
|
32
|
+
# @param member_id [Integer] Project Member Identifier
|
|
33
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.members.get API Documentation}
|
|
34
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.members.get Enterprise API Documentation}
|
|
27
35
|
def get_member_info(member_id = nil, project_id = config.project_id)
|
|
28
36
|
member_id || raise_parameter_is_required_error(:member_id)
|
|
29
37
|
project_id || raise_project_id_is_required_error
|
|
@@ -36,11 +44,23 @@ module Crowdin
|
|
|
36
44
|
Web::SendRequest.new(request).perform
|
|
37
45
|
end
|
|
38
46
|
|
|
39
|
-
#
|
|
47
|
+
# @param body [Array] Request Body
|
|
48
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.user.patch API Documentation}
|
|
49
|
+
def edit_authenticated_user(body = [])
|
|
50
|
+
request = Web::Request.new(
|
|
51
|
+
connection,
|
|
52
|
+
:patch,
|
|
53
|
+
"#{config.target_api_url}/user",
|
|
54
|
+
{ params: body }
|
|
55
|
+
)
|
|
56
|
+
Web::SendRequest.new(request).perform
|
|
57
|
+
end
|
|
40
58
|
|
|
59
|
+
# @param query [Hash] Request Body
|
|
60
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.members.post API Documentation}
|
|
61
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.members.post Enterprise API Documentation}
|
|
41
62
|
def add_project_member(query = {}, project_id = config.project_id)
|
|
42
|
-
|
|
43
|
-
project_id || raise_project_id_is_required_error
|
|
63
|
+
project_id || raise_project_id_is_required_error
|
|
44
64
|
|
|
45
65
|
request = Web::Request.new(
|
|
46
66
|
connection,
|
|
@@ -51,8 +71,10 @@ module Crowdin
|
|
|
51
71
|
Web::SendRequest.new(request).perform
|
|
52
72
|
end
|
|
53
73
|
|
|
74
|
+
# @param member_id [Integer] Project Member Identifier
|
|
75
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.members.get API Documentation}
|
|
76
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.members.get Enterprise API Documentation}
|
|
54
77
|
def get_project_member_permissions(member_id = nil, project_id = config.project_id)
|
|
55
|
-
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
56
78
|
member_id || raise_parameter_is_required_error(:member_id)
|
|
57
79
|
project_id || raise_project_id_is_required_error
|
|
58
80
|
|
|
@@ -64,8 +86,11 @@ module Crowdin
|
|
|
64
86
|
Web::SendRequest.new(request).perform
|
|
65
87
|
end
|
|
66
88
|
|
|
89
|
+
# @param member_id [Integer] Project Member Identifier
|
|
90
|
+
# @param query [Hash] Request Body
|
|
91
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.members.put API Documentation}
|
|
92
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.members.put Enterprise API Documentation}
|
|
67
93
|
def replace_project_permissions(member_id = nil, query = {}, project_id = config.project_id)
|
|
68
|
-
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
69
94
|
member_id || raise_parameter_is_required_error(:member_id)
|
|
70
95
|
project_id || raise_project_id_is_required_error
|
|
71
96
|
|
|
@@ -78,8 +103,11 @@ module Crowdin
|
|
|
78
103
|
Web::SendRequest.new(request).perform
|
|
79
104
|
end
|
|
80
105
|
|
|
106
|
+
# @param member_id [Integer] Project Member Identifier
|
|
107
|
+
# @param query [Hash] Request Query Parameters
|
|
108
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.members.delete API Documentation}
|
|
109
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.members.delete Enterprise API Documentation}
|
|
81
110
|
def delete_member_from_project(member_id = nil, query = {}, project_id = config.project_id)
|
|
82
|
-
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
83
111
|
member_id || raise_parameter_is_required_error(:member_id)
|
|
84
112
|
project_id || raise_project_id_is_required_error
|
|
85
113
|
|
|
@@ -96,6 +124,10 @@ module Crowdin
|
|
|
96
124
|
e.message
|
|
97
125
|
end
|
|
98
126
|
|
|
127
|
+
# -- For Enterprise mode only --
|
|
128
|
+
|
|
129
|
+
# @param query [Hash] Request Query Parameters
|
|
130
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.users.getMany Enterprise API Documentation}
|
|
99
131
|
def list_users(query = {})
|
|
100
132
|
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
101
133
|
|
|
@@ -108,6 +140,8 @@ module Crowdin
|
|
|
108
140
|
Web::SendRequest.new(request).perform
|
|
109
141
|
end
|
|
110
142
|
|
|
143
|
+
# @param query [Hash] Request Body
|
|
144
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.users.post Enterprise API Documentation}
|
|
111
145
|
def invite_user(query = {})
|
|
112
146
|
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
113
147
|
|
|
@@ -120,6 +154,8 @@ module Crowdin
|
|
|
120
154
|
Web::SendRequest.new(request).perform
|
|
121
155
|
end
|
|
122
156
|
|
|
157
|
+
# @param user_id [Integer] User Identifier
|
|
158
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.users.getById Enterprise API Documentation}
|
|
123
159
|
def get_user(user_id = nil)
|
|
124
160
|
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
125
161
|
user_id || raise_parameter_is_required_error(:user_id)
|
|
@@ -132,6 +168,8 @@ module Crowdin
|
|
|
132
168
|
Web::SendRequest.new(request).perform
|
|
133
169
|
end
|
|
134
170
|
|
|
171
|
+
# @param user_id [Integer] User Identifier
|
|
172
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.users.delete Enterprise API Documentation}
|
|
135
173
|
def delete_user(user_id = nil)
|
|
136
174
|
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
137
175
|
user_id || raise_parameter_is_required_error(:user_id)
|
|
@@ -144,6 +182,9 @@ module Crowdin
|
|
|
144
182
|
Web::SendRequest.new(request).perform
|
|
145
183
|
end
|
|
146
184
|
|
|
185
|
+
# @param user_id [Integer] User Identifier
|
|
186
|
+
# @param query [Hash] Request Body
|
|
187
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.users.patch Enterprise API Documentation}
|
|
147
188
|
def edit_user(user_id = nil, query = {})
|
|
148
189
|
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
149
190
|
user_id || raise_parameter_is_required_error(:user_id)
|
|
@@ -156,6 +197,95 @@ module Crowdin
|
|
|
156
197
|
)
|
|
157
198
|
Web::SendRequest.new(request).perform
|
|
158
199
|
end
|
|
200
|
+
|
|
201
|
+
# @param group_id [Integer] Group Identifier
|
|
202
|
+
# @param query [Hash] Request Query Parameters
|
|
203
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.groups.managers.getMany Enterprise API Documentation}
|
|
204
|
+
def list_group_managers(group_id, query = {})
|
|
205
|
+
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
206
|
+
|
|
207
|
+
request = Web::Request.new(
|
|
208
|
+
connection,
|
|
209
|
+
:get,
|
|
210
|
+
"#{config.target_api_url}/groups/#{group_id}/managers",
|
|
211
|
+
{ params: query }
|
|
212
|
+
)
|
|
213
|
+
Web::SendRequest.new(request).perform
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# @param group_id [Integer] Group Identifier
|
|
217
|
+
# @param body [Array] Request Body
|
|
218
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.groups.managers.patch Enterprise API Documentation}
|
|
219
|
+
def update_group_managers(group_id, body = [])
|
|
220
|
+
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
221
|
+
|
|
222
|
+
request = Web::Request.new(
|
|
223
|
+
connection,
|
|
224
|
+
:patch,
|
|
225
|
+
"#{config.target_api_url}/groups/#{group_id}/managers",
|
|
226
|
+
{ params: body }
|
|
227
|
+
)
|
|
228
|
+
Web::SendRequest.new(request).perform
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# @param group_id [Integer] Group Identifier
|
|
232
|
+
# @param user_id [Integer] User Identifier
|
|
233
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.groups.managers.get Enterprise API Documentation}
|
|
234
|
+
def get_group_manager(group_id, user_id)
|
|
235
|
+
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
236
|
+
|
|
237
|
+
request = Web::Request.new(
|
|
238
|
+
connection,
|
|
239
|
+
:get,
|
|
240
|
+
"#{config.target_api_url}/groups/#{group_id}/managers/#{user_id}"
|
|
241
|
+
)
|
|
242
|
+
Web::SendRequest.new(request).perform
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
# @param user_id [Integer] User Identifier
|
|
246
|
+
# @param query [Hash] Request Query Parameters
|
|
247
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.users.projects.contributions.getMany Enterprise API Documentation}
|
|
248
|
+
def list_user_projects_contributions(user_id, query = {})
|
|
249
|
+
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
250
|
+
|
|
251
|
+
request = Web::Request.new(
|
|
252
|
+
connection,
|
|
253
|
+
:get,
|
|
254
|
+
"#{config.target_api_url}/users/#{user_id}/projects/contributions",
|
|
255
|
+
{ params: query }
|
|
256
|
+
)
|
|
257
|
+
Web::SendRequest.new(request).perform
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
# @param user_id [Integer] User Identifier
|
|
261
|
+
# @param query [Hash] Request Query Parameters
|
|
262
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.users.projects.permissions.getMany Enterprise API Documentation}
|
|
263
|
+
def list_user_projects_permissions(user_id, query = {})
|
|
264
|
+
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
265
|
+
|
|
266
|
+
request = Web::Request.new(
|
|
267
|
+
connection,
|
|
268
|
+
:get,
|
|
269
|
+
"#{config.target_api_url}/users/#{user_id}/projects/permissions",
|
|
270
|
+
{ params: query }
|
|
271
|
+
)
|
|
272
|
+
Web::SendRequest.new(request).perform
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
# @param user_id [Integer] User Identifier
|
|
276
|
+
# @param body [Array] Request Body
|
|
277
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.users.projects.permissions.patch Enterprise API Documentation}
|
|
278
|
+
def edit_user_projects_permissions(user_id, body = [])
|
|
279
|
+
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
280
|
+
|
|
281
|
+
request = Web::Request.new(
|
|
282
|
+
connection,
|
|
283
|
+
:patch,
|
|
284
|
+
"#{config.target_api_url}/users/#{user_id}/projects/permissions",
|
|
285
|
+
{ params: body }
|
|
286
|
+
)
|
|
287
|
+
Web::SendRequest.new(request).perform
|
|
288
|
+
end
|
|
159
289
|
end
|
|
160
290
|
end
|
|
161
291
|
end
|
|
@@ -5,6 +5,8 @@ module Crowdin
|
|
|
5
5
|
module Vendors
|
|
6
6
|
# -- For Enterprise mode only --
|
|
7
7
|
|
|
8
|
+
# @param query [Hash] Request Query Parameters
|
|
9
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.vendors.getMany Enterprise API Documentation}
|
|
8
10
|
def list_vendors(query = {})
|
|
9
11
|
enterprise_mode? || raise_only_for_enterprise_mode_error
|
|
10
12
|
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
module Crowdin
|
|
4
4
|
module ApiResources
|
|
5
5
|
module Webhooks
|
|
6
|
+
# @param query [Hash] Request Query Parameters
|
|
7
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.webhooks.getMany API Documentation}
|
|
8
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.webhooks.getMany Enterprise API Documentation}
|
|
6
9
|
def list_webhooks(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.webhooks.post API Documentation}
|
|
23
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.webhooks.post Enterprise API Documentation}
|
|
18
24
|
def add_webhook(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 webhook_id [Integer] Webhook Identifier
|
|
37
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.webhooks.get API Documentation}
|
|
38
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.webhooks.get Enterprise API Documentation}
|
|
30
39
|
def get_webhook(webhook_id = nil, project_id = config.project_id)
|
|
31
40
|
webhook_id || raise_parameter_is_required_error(:webhook_id)
|
|
32
41
|
project_id || raise_project_id_is_required_error
|
|
@@ -39,6 +48,9 @@ module Crowdin
|
|
|
39
48
|
Web::SendRequest.new(request).perform
|
|
40
49
|
end
|
|
41
50
|
|
|
51
|
+
# @param webhook_id [Integer] Webhook Identifier
|
|
52
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.webhooks.delete API Documentation}
|
|
53
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.webhooks.delete Enterprise API Documentation}
|
|
42
54
|
def delete_webhook(webhook_id = nil, project_id = config.project_id)
|
|
43
55
|
webhook_id || raise_parameter_is_required_error(:webhook_id)
|
|
44
56
|
project_id || raise_project_id_is_required_error
|
|
@@ -51,6 +63,10 @@ module Crowdin
|
|
|
51
63
|
Web::SendRequest.new(request).perform
|
|
52
64
|
end
|
|
53
65
|
|
|
66
|
+
# @param webhook_id [Integer] Webhook Identifier
|
|
67
|
+
# @param query [Hash] Request Body
|
|
68
|
+
# * {https://support.crowdin.com/developer/api/v2/#operation/api.projects.webhooks.patch API Documentation}
|
|
69
|
+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.webhooks.patch Enterprise API Documentation}
|
|
54
70
|
def edit_webhook(webhook_id = nil, query = {}, project_id = config.project_id)
|
|
55
71
|
webhook_id || raise_parameter_is_required_error(:webhook_id)
|
|
56
72
|
project_id || raise_project_id_is_required_error
|