Skip to content

Commit b66e73c

Browse files
authored
docs: add method documentation for Dictionaries, Distributions and Glossaries APIs (#113)
1 parent 544016d commit b66e73c

File tree

3 files changed

+114
-0
lines changed

3 files changed

+114
-0
lines changed

lib/crowdin-api/api_resources/dictionaries.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
module Crowdin
44
module ApiResources
55
module Dictionaries
6+
# @param query [Hash] Request Body
7+
# * {https://support.crowdin.com/developer/api/v2/#tag/Dictionaries/operation/api.projects.dictionaries.getMany API Documentation}
8+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Dictionaries/operation/api.projects.dictionaries.getMany Enterprise API Documentation}
69
def list_dictionaries(query = {}, project_id = config.project_id)
710
project_id || raise_project_id_is_required_error
811

@@ -15,6 +18,10 @@ def list_dictionaries(query = {}, project_id = config.project_id)
1518
Web::SendRequest.new(request).perform
1619
end
1720

21+
# @param language_id [String] Language Identifier
22+
# @param query [Hash] Request Body
23+
# * {https://support.crowdin.com/developer/api/v2/#tag/Dictionaries/operation/api.projects.dictionaries.patch API Documentation}
24+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Dictionaries/operation/api.projects.dictionaries.patch Enterprise API Documentation}
1825
def edit_dictionary(language_id = nil, query = {}, project_id = config.project_id)
1926
language_id || raise_parameter_is_required_error(:language_id)
2027
project_id || raise_project_id_is_required_error

lib/crowdin-api/api_resources/distributions.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
module Crowdin
44
module ApiResources
55
module Distributions
6+
# @param query [Hash] Request Body
7+
# * {https://support.crowdin.com/developer/api/v2/#tag/Distributions/operation/api.projects.distributions.getMany API Documentation}
8+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Distributions/operation/api.projects.distributions.getMany Enterprise API Documentation}
69
def list_distributions(query = {}, project_id = config.project_id)
710
project_id || raise_project_id_is_required_error
811

@@ -15,6 +18,9 @@ def list_distributions(query = {}, project_id = config.project_id)
1518
Web::SendRequest.new(request).perform
1619
end
1720

21+
# @param query [Hash] Request Body
22+
# * {https://support.crowdin.com/developer/api/v2/#tag/Distributions/operation/api.projects.distributions.post API Documentation}
23+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Distributions/operation/api.projects.distributions.post Enterprise API Documentation}
1824
def add_distribution(query = {}, project_id = config.project_id)
1925
project_id || raise_project_id_is_required_error
2026

@@ -27,6 +33,9 @@ def add_distribution(query = {}, project_id = config.project_id)
2733
Web::SendRequest.new(request).perform
2834
end
2935

36+
# @param hash [String] Hash
37+
# * {https://support.crowdin.com/developer/api/v2/#tag/Distributions/operation/api.projects.distributions.get API Documentation}
38+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Distributions/operation/api.projects.distributions.get Enterprise API Documentation}
3039
def get_distribution(hash = nil, project_id = config.project_id)
3140
hash || raise_parameter_is_required_error(:hash)
3241
project_id || raise_project_id_is_required_error
@@ -39,6 +48,9 @@ def get_distribution(hash = nil, project_id = config.project_id)
3948
Web::SendRequest.new(request).perform
4049
end
4150

51+
# @param hash [String] Hash
52+
# * {https://support.crowdin.com/developer/api/v2/#tag/Distributions/operation/api.projects.distributions.delete API Documentation}
53+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Distributions/operation/api.projects.distributions.delete Enterprise API Documentation}
4254
def delete_distribution(hash = nil, project_id = config.project_id)
4355
hash || raise_parameter_is_required_error(:hash)
4456
project_id || raise_project_id_is_required_error
@@ -51,6 +63,10 @@ def delete_distribution(hash = nil, project_id = config.project_id)
5163
Web::SendRequest.new(request).perform
5264
end
5365

66+
# @param hash [String] Hash
67+
# @param query [Hash] Request Body
68+
# * {https://support.crowdin.com/developer/api/v2/#tag/Distributions/operation/api.projects.distributions.patch API Documentation}
69+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Distributions/operation/api.projects.distributions.patch Enterprise API Documentation}
5470
def edit_distribution(hash = nil, query = {}, project_id = config.project_id)
5571
hash || raise_parameter_is_required_error(:hash)
5672
project_id || raise_project_id_is_required_error
@@ -64,6 +80,9 @@ def edit_distribution(hash = nil, query = {}, project_id = config.project_id)
6480
Web::SendRequest.new(request).perform
6581
end
6682

83+
# @param hash [String] Hash
84+
# * {https://support.crowdin.com/developer/api/v2/#tag/Distributions/operation/api.projects.distributions.release.get API Documentation}
85+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Distributions/operation/api.projects.distributions.release.get Enterprise API Documentation}
6786
def get_distribution_release(hash = nil, project_id = config.project_id)
6887
hash || raise_parameter_is_required_error(:hash)
6988
project_id || raise_project_id_is_required_error
@@ -76,6 +95,9 @@ def get_distribution_release(hash = nil, project_id = config.project_id)
7695
Web::SendRequest.new(request).perform
7796
end
7897

98+
# @param hash [String] Hash
99+
# * {https://support.crowdin.com/developer/api/v2/#tag/Distributions/operation/api.projects.distributions.release.post API Documentation}
100+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Distributions/operation/api.projects.distributions.release.post Enterprise API Documentation}
79101
def release_distribution(hash = nil, project_id = config.project_id)
80102
hash || raise_parameter_is_required_error(:hash)
81103
project_id || raise_project_id_is_required_error

lib/crowdin-api/api_resources/glossaries.rb

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
module Crowdin
44
module ApiResources
55
module Glossaries
6+
# @param query [Hash] Request Body
7+
# * {https://support.crowdin.com/developer/api/v2/#tag/Glossaries/operation/api.glossaries.getMany API Documentation}
8+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Glossaries/operation/api.glossaries.getMany Enterprise API Documentation}
69
def list_glossaries(query = {})
710
request = Web::Request.new(
811
connection,
@@ -13,6 +16,9 @@ def list_glossaries(query = {})
1316
Web::SendRequest.new(request).perform
1417
end
1518

19+
# @param query [Hash] Request Body
20+
# * {https://support.crowdin.com/developer/api/v2/#tag/Glossaries/operation/api.glossaries.post API Documentation}
21+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Glossaries/operation/api.glossaries.post Enterprise API Documentation}
1622
def add_glossary(query = {})
1723
request = Web::Request.new(
1824
connection,
@@ -23,6 +29,10 @@ def add_glossary(query = {})
2329
Web::SendRequest.new(request).perform
2430
end
2531

32+
# @param glossary_id [Integer] Glossary Identifier
33+
# @param query [Hash] Request Body
34+
# * {https://support.crowdin.com/developer/api/v2/#tag/Glossaries/operation/api.glossaries.get API Documentation}
35+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Glossaries/operation/api.glossaries.get Enterprise API Documentation}
2636
def get_glossary(glossary_id = nil, query = {})
2737
glossary_id || raise_parameter_is_required_error(:glossary_id)
2838

@@ -35,6 +45,9 @@ def get_glossary(glossary_id = nil, query = {})
3545
Web::SendRequest.new(request).perform
3646
end
3747

48+
# @param glossary_id [Integer] Glossary Identifier
49+
# * {https://support.crowdin.com/developer/api/v2/#tag/Glossaries/operation/api.glossaries.delete API Documentation}
50+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Glossaries/operation/api.glossaries.delete Enterprise API Documentation}
3851
def delete_glossary(glossary_id = nil)
3952
glossary_id || raise_parameter_is_required_error(:glossary_id)
4053

@@ -46,6 +59,10 @@ def delete_glossary(glossary_id = nil)
4659
Web::SendRequest.new(request).perform
4760
end
4861

62+
# @param glossary_id [Integer] Glossary Identifier
63+
# @param query [Hash] Request Body
64+
# * {https://support.crowdin.com/developer/api/v2/#tag/Glossaries/operation/api.glossaries.patch API Documentation}
65+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Glossaries/operation/api.glossaries.patch Enterprise API Documentation}
4966
def edit_glossary(glossary_id = nil, query = {})
5067
glossary_id || raise_parameter_is_required_error(:glossary_id)
5168

@@ -58,6 +75,11 @@ def edit_glossary(glossary_id = nil, query = {})
5875
Web::SendRequest.new(request).perform
5976
end
6077

78+
# @param query [Hash] Request Body
79+
# @param glossary_id [Integer] Glossary Identifier
80+
# @param destination [String] File destination
81+
# * {https://support.crowdin.com/developer/api/v2/#tag/Glossaries/operation/api.glossaries.exports.post API Documentation}
82+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Glossaries/operation/api.glossaries.exports.post Enterprise API Documentation}
6183
def export_glossary(query = {}, glossary_id = nil, destination = nil)
6284
glossary_id || raise_parameter_is_required_error(:glossary_id)
6385

@@ -70,6 +92,10 @@ def export_glossary(query = {}, glossary_id = nil, destination = nil)
7092
Web::SendRequest.new(request, destination).perform
7193
end
7294

95+
# @param glossary_id [Integer] Glossary Identifier
96+
# @param export_id [String] Export Identifier, consists of 36 characters
97+
# * {https://support.crowdin.com/developer/api/v2/#tag/Glossaries/operation/api.glossaries.exports.get API Documentation}
98+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Glossaries/operation/api.glossaries.exports.get Enterprise API Documentation}
7399
def check_glossary_export_status(glossary_id = nil, export_id = nil)
74100
glossary_id || raise_parameter_is_required_error(:glossary_id)
75101
export_id || raise_parameter_is_required_error(:export_id)
@@ -82,6 +108,11 @@ def check_glossary_export_status(glossary_id = nil, export_id = nil)
82108
Web::SendRequest.new(request).perform
83109
end
84110

111+
# @param glossary_id [Integer] Glossary Identifier
112+
# @param export_id [String] Export Identifier, consists of 36 characters
113+
# @param destination [String] File destination
114+
# * {https://support.crowdin.com/developer/api/v2/#tag/Glossaries/operation/api.glossaries.exports.download.download API Documentation}
115+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Glossaries/operation/api.glossaries.exports.download.download Enterprise API Documentation}
85116
def download_glossary(glossary_id = nil, export_id = nil, destination = nil)
86117
glossary_id || raise_parameter_is_required_error(:glossary_id)
87118
export_id || raise_parameter_is_required_error(:export_id)
@@ -94,6 +125,10 @@ def download_glossary(glossary_id = nil, export_id = nil, destination = nil)
94125
Web::SendRequest.new(request, destination).perform
95126
end
96127

128+
# @param glossary_id [Integer] Glossary Identifier
129+
# @param query [Hash] Request Body
130+
# * {https://support.crowdin.com/developer/api/v2/#tag/Glossaries/operation/api.glossaries.imports.post API Documentation}
131+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Glossaries/operation/api.glossaries.imports.post Enterprise API Documentation}
97132
def import_glossary(glossary_id = nil, query = {})
98133
glossary_id || raise_parameter_is_required_error(:glossary_id)
99134

@@ -106,6 +141,10 @@ def import_glossary(glossary_id = nil, query = {})
106141
Web::SendRequest.new(request).perform
107142
end
108143

144+
# @param glossary_id [Integer] Glossary Identifier
145+
# @param import_id [String] Import Identifier, consists of 36 characters
146+
# * {https://support.crowdin.com/developer/api/v2/#tag/Glossaries/operation/api.glossaries.imports.get API Documentation}
147+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Glossaries/operation/api.glossaries.imports.get Enterprise API Documentation}
109148
def check_glossary_import_status(glossary_id = nil, import_id = nil)
110149
glossary_id || raise_parameter_is_required_error(:glossary_id)
111150
import_id || raise_parameter_is_required_error(:import_id)
@@ -118,6 +157,10 @@ def check_glossary_import_status(glossary_id = nil, import_id = nil)
118157
Web::SendRequest.new(request).perform
119158
end
120159

160+
# @param glossary_id [Integer] Glossary Identifier
161+
# @param query [Hash] Request Body
162+
# * {https://support.crowdin.com/developer/api/v2/#tag/Glossaries/operation/api.glossaries.terms.getMany API Documentation}
163+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Glossaries/operation/api.glossaries.terms.getMany Enterprise API Documentation}
121164
def list_terms(glossary_id = nil, query = {})
122165
glossary_id || raise_parameter_is_required_error(:glossary_id)
123166

@@ -130,6 +173,10 @@ def list_terms(glossary_id = nil, query = {})
130173
Web::SendRequest.new(request).perform
131174
end
132175

176+
# @param glossary_id [Integer] Glossary Identifier
177+
# @param query [Hash] Request Body
178+
# * {https://support.crowdin.com/developer/api/v2/#tag/Glossaries/operation/api.glossaries.terms.post API Documentation}
179+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Glossaries/operation/api.glossaries.terms.post Enterprise API Documentation}
133180
def add_term(glossary_id = nil, query = {})
134181
glossary_id || raise_parameter_is_required_error(:glossary_id)
135182

@@ -142,6 +189,10 @@ def add_term(glossary_id = nil, query = {})
142189
Web::SendRequest.new(request).perform
143190
end
144191

192+
# @param glossary_id [Integer] Glossary Identifier
193+
# @param query [Hash] Request Body
194+
# * {https://support.crowdin.com/developer/api/v2/#tag/Glossaries/operation/api.glossaries.terms.deleteMany API Documentation}
195+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Glossaries/operation/api.glossaries.terms.deleteMany Enterprise API Documentation}
145196
def clear_glossary(glossary_id = nil, query = {})
146197
glossary_id || raise_parameter_is_required_error(:glossary_id)
147198

@@ -158,6 +209,10 @@ def clear_glossary(glossary_id = nil, query = {})
158209
e.message
159210
end
160211

212+
# @param glossary_id [Integer] Glossary Identifier
213+
# @param term_id [Integer] Term Identifier
214+
# * {https://support.crowdin.com/developer/api/v2/#tag/Glossaries/operation/api.glossaries.terms.get API Documentation}
215+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Glossaries/operation/api.glossaries.terms.get Enterprise API Documentation}
161216
def get_term(glossary_id = nil, term_id = nil)
162217
glossary_id || raise_parameter_is_required_error(:glossary_id)
163218
term_id || raise_parameter_is_required_error(:term_id)
@@ -170,6 +225,10 @@ def get_term(glossary_id = nil, term_id = nil)
170225
Web::SendRequest.new(request).perform
171226
end
172227

228+
# @param glossary_id [Integer] Glossary Identifier
229+
# @param term_id [Integer] Term Identifier
230+
# * {https://support.crowdin.com/developer/api/v2/#tag/Glossaries/operation/api.glossaries.terms.delete API Documentation}
231+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Glossaries/operation/api.glossaries.terms.delete Enterprise API Documentation}
173232
def delete_term(glossary_id = nil, term_id = nil)
174233
glossary_id || raise_parameter_is_required_error(:glossary_id)
175234
term_id || raise_parameter_is_required_error(:term_id)
@@ -182,6 +241,11 @@ def delete_term(glossary_id = nil, term_id = nil)
182241
Web::SendRequest.new(request).perform
183242
end
184243

244+
# @param glossary_id [Integer] Glossary Identifier
245+
# @param term_id [Integer] Term Identifier
246+
# @param query [Hash] Request Body
247+
# * {https://support.crowdin.com/developer/api/v2/#tag/Glossaries/operation/api.glossaries.terms.patch API Documentation}
248+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Glossaries/operation/api.glossaries.terms.patch Enterprise API Documentation}
185249
def edit_term(glossary_id = nil, term_id = nil, query = {})
186250
glossary_id || raise_parameter_is_required_error(:glossary_id)
187251
term_id || raise_parameter_is_required_error(:term_id)
@@ -195,6 +259,10 @@ def edit_term(glossary_id = nil, term_id = nil, query = {})
195259
Web::SendRequest.new(request).perform
196260
end
197261

262+
# @param glossary_id [Integer] Glossary Identifier
263+
# @param query [Hash] Request Body
264+
# * {https://support.crowdin.com/developer/api/v2/#tag/Glossaries/operation/api.glossaries.concepts.getMany API Documentation}
265+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Glossaries/operation/api.glossaries.concepts.getMany Enterprise API Documentation}
198266
def list_concepts(glossary_id = nil, query = {})
199267
glossary_id || raise_parameter_is_required_error(:glossary_id)
200268

@@ -207,6 +275,10 @@ def list_concepts(glossary_id = nil, query = {})
207275
Web::SendRequest.new(request).perform
208276
end
209277

278+
# @param glossary_id [Integer] Glossary Identifier
279+
# @param concept_id [Integer] Concept Identifier
280+
# * {https://support.crowdin.com/developer/api/v2/#tag/Glossaries/operation/api.glossaries.concepts.get API Documentation}
281+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Glossaries/operation/api.glossaries.concepts.get Enterprise API Documentation}
210282
def get_concept(glossary_id = nil, concept_id = nil)
211283
glossary_id || raise_parameter_is_required_error(:glossary_id)
212284
concept_id || raise_parameter_is_required_error(:concept_id)
@@ -219,6 +291,11 @@ def get_concept(glossary_id = nil, concept_id = nil)
219291
Web::SendRequest.new(request).perform
220292
end
221293

294+
# @param glossary_id [Integer] Glossary Identifier
295+
# @param concept_id [Integer] Concept Identifier
296+
# @param query [Hash] Request Body
297+
# * {https://support.crowdin.com/developer/api/v2/#tag/Glossaries/operation/api.glossaries.concepts.put API Documentation}
298+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Glossaries/operation/api.glossaries.concepts.put Enterprise API Documentation}
222299
def update_concept(glossary_id = nil, concept_id = nil, query = {})
223300
glossary_id || raise_parameter_is_required_error(:glossary_id)
224301
concept_id || raise_parameter_is_required_error(:concept_id)
@@ -232,6 +309,10 @@ def update_concept(glossary_id = nil, concept_id = nil, query = {})
232309
Web::SendRequest.new(request).perform
233310
end
234311

312+
# @param glossary_id [Integer] Glossary Identifier
313+
# @param concept_id [Integer] Concept Identifier
314+
# * {https://support.crowdin.com/developer/api/v2/#tag/Glossaries/operation/api.glossaries.concepts.delete API Documentation}
315+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Glossaries/operation/api.glossaries.concepts.delete Enterprise API Documentation}
235316
def delete_concept(glossary_id = nil, concept_id = nil)
236317
glossary_id || raise_parameter_is_required_error(:glossary_id)
237318
concept_id || raise_parameter_is_required_error(:concept_id)
@@ -244,6 +325,10 @@ def delete_concept(glossary_id = nil, concept_id = nil)
244325
Web::SendRequest.new(request).perform
245326
end
246327

328+
# @param project_id [Integer] Project Identifier
329+
# @param query [Hash] Request Body
330+
# * {https://support.crowdin.com/developer/api/v2/#tag/Glossaries/operation/api.projects.glossaries.concordance.post API Documentation}
331+
# * {https://support.crowdin.com/developer/enterprise/api/v2/#tag/Glossaries/operation/api.projects.glossaries.concordance.post Enterprise API Documentation}
247332
def search_glossaries_concordance(project_id = nil, query = {})
248333
project_id || raise_project_id_is_required_error
249334

0 commit comments

Comments
 (0)