summaryrefslogtreecommitdiff
path: root/lib/api/entities
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-27 18:09:04 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-27 18:09:04 +0000
commit390582e118752426acf5cb25ec99103d312d891c (patch)
treebb0b1a6a46632024ffc3ba1983e4ebcb0fab4428 /lib/api/entities
parent1ea1db491c8bc90789acda45c9002aaa5c4dc498 (diff)
downloadgitlab-ce-390582e118752426acf5cb25ec99103d312d891c.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/entities')
-rw-r--r--lib/api/entities/hook.rb10
-rw-r--r--lib/api/entities/project_export_status.rb20
-rw-r--r--lib/api/entities/project_hook.rb12
-rw-r--r--lib/api/entities/project_identity.rb12
-rw-r--r--lib/api/entities/shared_group.rb17
5 files changed, 71 insertions, 0 deletions
diff --git a/lib/api/entities/hook.rb b/lib/api/entities/hook.rb
new file mode 100644
index 00000000000..ac813bcac3f
--- /dev/null
+++ b/lib/api/entities/hook.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+module API
+ module Entities
+ class Hook < Grape::Entity
+ expose :id, :url, :created_at, :push_events, :tag_push_events, :merge_requests_events, :repository_update_events
+ expose :enable_ssl_verification
+ end
+ end
+end
diff --git a/lib/api/entities/project_export_status.rb b/lib/api/entities/project_export_status.rb
new file mode 100644
index 00000000000..ad84a45996a
--- /dev/null
+++ b/lib/api/entities/project_export_status.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+module API
+ module Entities
+ class ProjectExportStatus < ProjectIdentity
+ include ::API::Helpers::RelatedResourcesHelpers
+
+ expose :export_status
+ expose :_links, if: lambda { |project, _options| project.export_status == :finished } do
+ expose :api_url do |project|
+ expose_url(api_v4_projects_export_download_path(id: project.id))
+ end
+
+ expose :web_url do |project|
+ Gitlab::Routing.url_helpers.download_export_project_url(project)
+ end
+ end
+ end
+ end
+end
diff --git a/lib/api/entities/project_hook.rb b/lib/api/entities/project_hook.rb
new file mode 100644
index 00000000000..cdd3714ed64
--- /dev/null
+++ b/lib/api/entities/project_hook.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+module API
+ module Entities
+ class ProjectHook < Hook
+ expose :project_id, :issues_events, :confidential_issues_events
+ expose :note_events, :confidential_note_events, :pipeline_events, :wiki_page_events
+ expose :job_events
+ expose :push_events_branch_filter
+ end
+ end
+end
diff --git a/lib/api/entities/project_identity.rb b/lib/api/entities/project_identity.rb
new file mode 100644
index 00000000000..2055195eea0
--- /dev/null
+++ b/lib/api/entities/project_identity.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+module API
+ module Entities
+ class ProjectIdentity < Grape::Entity
+ expose :id, :description
+ expose :name, :name_with_namespace
+ expose :path, :path_with_namespace
+ expose :created_at
+ end
+ end
+end
diff --git a/lib/api/entities/shared_group.rb b/lib/api/entities/shared_group.rb
new file mode 100644
index 00000000000..862e73e07f0
--- /dev/null
+++ b/lib/api/entities/shared_group.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+module API
+ module Entities
+ class SharedGroup < Grape::Entity
+ expose :group_id
+ expose :group_name do |group_link, options|
+ group_link.group.name
+ end
+ expose :group_full_path do |group_link, options|
+ group_link.group.full_path
+ end
+ expose :group_access, as: :group_access_level
+ expose :expires_at
+ end
+ end
+end