2019-01-10 09:22:58 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module API
|
|
|
|
module Entities
|
|
|
|
module ContainerRegistry
|
2019-08-05 16:00:50 -04:00
|
|
|
class Tag < Grape::Entity
|
2019-01-10 09:22:58 -05:00
|
|
|
expose :name
|
|
|
|
expose :path
|
|
|
|
expose :location
|
|
|
|
end
|
|
|
|
|
2019-08-05 16:00:50 -04:00
|
|
|
class Repository < Grape::Entity
|
|
|
|
expose :id
|
2019-01-10 09:22:58 -05:00
|
|
|
expose :name
|
|
|
|
expose :path
|
2019-08-05 16:00:50 -04:00
|
|
|
expose :project_id
|
2019-01-10 09:22:58 -05:00
|
|
|
expose :location
|
2019-08-05 16:00:50 -04:00
|
|
|
expose :created_at
|
|
|
|
expose :tags, using: Tag, if: -> (_, options) { options[:tags] }
|
2019-01-10 09:22:58 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
class TagDetails < Tag
|
|
|
|
expose :revision
|
|
|
|
expose :short_revision
|
|
|
|
expose :digest
|
|
|
|
expose :created_at
|
|
|
|
expose :total_size
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|