entities.rb 1.31 KB
Newer Older
1 2 3 4
module Ci
  module API
    module Entities
      class Commit < Grape::Entity
5
        expose :id, :sha, :project_id, :created_at
6 7 8 9 10 11 12 13 14
        expose :status, :finished_at, :duration
        expose :git_commit_message, :git_author_name, :git_author_email
      end

      class CommitWithBuilds < Commit
        expose :builds
      end

      class Build < Grape::Entity
15
        expose :id, :commands, :ref, :sha, :status, :project_id, :repo_url,
16 17
          :before_sha, :allow_git_fetch, :project_name

Valery Sizov's avatar
Valery Sizov committed
18 19 20
        expose :options do |model|
          model.options
        end
Valery Sizov's avatar
Valery Sizov committed
21 22 23 24

        expose :timeout do |model|
          model.timeout
        end
25 26 27 28 29 30 31 32 33

        expose :variables
      end

      class Runner < Grape::Entity
        expose :id, :token
      end

      class Project < Grape::Entity
Valery Sizov's avatar
Valery Sizov committed
34
        expose :id, :name, :token, :default_ref, :gitlab_url, :path,
35
          :always_build, :polling_interval, :public, :ssh_url_to_repo, :gitlab_id
Valery Sizov's avatar
Valery Sizov committed
36 37 38 39

        expose :timeout do |model|
          model.timeout
        end
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
      end

      class RunnerProject < Grape::Entity
        expose :id, :project_id, :runner_id
      end

      class WebHook < Grape::Entity
        expose :id, :project_id, :url
      end

      class TriggerRequest < Grape::Entity
        expose :id, :variables
        expose :commit, using: Commit
      end
    end
  end
end