summaryrefslogtreecommitdiff
path: root/app/serializers/environment_entity.rb
blob: bfccfd8bb7c1616852d10bc772263dbaf7248ff9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class EnvironmentEntity < Grape::Entity
  include RequestAwareEntity

  expose :id
  expose :name
  expose :state
  expose :external_url
  expose :environment_type
  expose :last_deployment, using: DeploymentEntity
  expose :can_run_stop_action?

  expose :environment_url do |environment|
    namespace_project_environment_url(
      environment.project.namespace,
      environment.project,
      environment)
  end

  expose :created_at, :updated_at
end