summaryrefslogtreecommitdiff
path: root/lib/api/entities.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r--lib/api/entities.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 59042d2b568..90abee94f6a 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -10,6 +10,28 @@ module API
expose :content
end
+ class WikiAttachment < Grape::Entity
+ include Gitlab::FileMarkdownLinkBuilder
+
+ expose :file_name
+ expose :file_path
+ expose :branch
+ expose :link do
+ expose :file_path, as: :url
+ expose :markdown do |_entity|
+ self.markdown_link
+ end
+ end
+
+ def filename
+ object.file_name
+ end
+
+ def secure_url
+ object.file_path
+ end
+ end
+
class UserSafe < Grape::Entity
expose :id, :name, :username
end
@@ -83,6 +105,7 @@ module API
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
class SharedGroup < Grape::Entity
@@ -665,6 +688,8 @@ module API
expose :diff_refs, using: Entities::DiffRefs
+ expose :diverged_commits_count, as: :diverged_commits_count, if: -> (_, options) { options[:include_diverged_commits_count] }
+
def build_available?(options)
options[:project]&.feature_available?(:builds, options[:current_user])
end