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/atlassian/jira_connect/serializers/pipeline_entity.rb')
-rw-r--r--lib/atlassian/jira_connect/serializers/pipeline_entity.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/atlassian/jira_connect/serializers/pipeline_entity.rb b/lib/atlassian/jira_connect/serializers/pipeline_entity.rb
new file mode 100644
index 00000000000..e67cf1a7229
--- /dev/null
+++ b/lib/atlassian/jira_connect/serializers/pipeline_entity.rb
@@ -0,0 +1,31 @@
+# frozen_string_literal: true
+
+module Atlassian
+ module JiraConnect
+ module Serializers
+ # Both this an BuildEntity represent a Ci::Pipeline
+ class PipelineEntity < Grape::Entity
+ include Gitlab::Routing
+
+ format_with(:string, &:to_s)
+
+ expose :id, format_with: :string
+ expose :display_name, as: :displayName
+ expose :url
+
+ private
+
+ alias_method :pipeline, :object
+ delegate :project, to: :object
+
+ def display_name
+ "#{project.name} pipeline #{pipeline.iid}"
+ end
+
+ def url
+ project_pipeline_url(project, pipeline)
+ end
+ end
+ end
+ end
+end