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

pipeline_entity.rb « serializers « jira_connect « atlassian « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e67cf1a7229d13f72d4114e85c464f4ae650b7e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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