debian-mirror-gitlab/lib/api/entities/releases/link.rb
2023-04-23 21:23:45 +05:30

26 lines
932 B
Ruby

# frozen_string_literal: true
module API
module Entities
module Releases
class Link < Grape::Entity
expose :id, documentation: { type: 'integer', example: 1 }
expose :name, documentation: { type: 'string', example: 'app-v1.0.dmg' }
expose :url, documentation:
{
type: 'string',
example: 'https://gitlab.example.com/root/app/-/jobs/688/artifacts/raw/bin/app-v1.0.dmg'
}
expose :direct_asset_url, documentation:
{
type: 'string',
example: 'https://gitlab.example.com/root/app/-/releases/v1.0/downloads/app-v1.0.dmg'
} do |link|
::Releases::LinkPresenter.new(link).direct_asset_url
end
expose :external?, documentation: { type: 'boolean' }, as: :external # @deprecated
expose :link_type, documentation: { type: 'string', example: 'other' }
end
end
end
end