gitlab-org--gitlab-foss/lib/ci/api/entities.rb

66 lines
1.5 KiB
Ruby
Raw Normal View History

2015-08-25 21:42:46 -04:00
module Ci
module API
module Entities
class Commit < Grape::Entity
2015-10-06 06:01:16 -04:00
expose :id, :sha, :project_id, :created_at
2015-08-25 21:42:46 -04:00
expose :status, :finished_at, :duration
expose :git_commit_message, :git_author_name, :git_author_email
end
class CommitWithBuilds < Commit
expose :builds
end
class ArtifactFile < Grape::Entity
expose :filename, :size
end
2015-08-25 21:42:46 -04:00
class Build < Grape::Entity
expose :id, :ref, :tag, :sha, :status
expose :name, :token, :stage
expose :project_id
expose :project_name
expose :artifacts_file, using: ArtifactFile, if: lambda { |build, opts| build.artifacts_file.exists? }
end
class BuildDetails < Build
expose :commands
expose :repo_url
expose :before_sha
expose :allow_git_fetch
expose :token
2015-09-15 08:51:03 -04:00
expose :options do |model|
model.options
end
2015-09-14 04:15:54 -04:00
expose :timeout do |model|
model.timeout
end
2015-08-25 21:42:46 -04:00
expose :variables
expose :dependencies do
expose :depends_on_builds, as: :builds, using: Build
end
2015-08-25 21:42:46 -04:00
end
class Runner < Grape::Entity
expose :id, :token
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