Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/group_debian_distributions.rb')
-rw-r--r--lib/api/group_debian_distributions.rb35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/api/group_debian_distributions.rb b/lib/api/group_debian_distributions.rb
new file mode 100644
index 00000000000..01a8774bd97
--- /dev/null
+++ b/lib/api/group_debian_distributions.rb
@@ -0,0 +1,35 @@
+# frozen_string_literal: true
+
+module API
+ class GroupDebianDistributions < ::API::Base
+ params do
+ requires :id, type: String, desc: 'The ID of a group'
+ end
+
+ resource :groups, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
+ rescue_from ArgumentError do |e|
+ render_api_error!(e.message, 400)
+ end
+
+ rescue_from ActiveRecord::RecordInvalid do |e|
+ render_api_error!(e.message, 400)
+ end
+
+ after_validation do
+ require_packages_enabled!
+
+ not_found! unless ::Feature.enabled?(:debian_group_packages, user_group)
+ end
+
+ namespace ':id/-' do
+ helpers do
+ def project_or_group
+ user_group
+ end
+ end
+
+ include ::API::Concerns::Packages::DebianDistributionEndpoints
+ end
+ end
+ end
+end