environment_entity.rb 492 Bytes
Newer Older
1 2 3 4 5
class EnvironmentEntity < Grape::Entity
  include RequestAwareEntity

  expose :id
  expose :name
6 7 8
  expose :state
  expose :external_url
  expose :environment_type
9
  expose :project, with: ProjectEntity
10 11
  expose :last_deployment, using: DeploymentEntity
  expose :stoppable?
12

13
  expose :environment_url do |environment|
14
    @urls.namespace_project_environment_url(
15 16
      environment.project.namespace,
      environment.project,
17
      environment)
18 19
  end

20
  expose :created_at, :updated_at
21
end