2020-03-09 13:42:32 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module API
|
|
|
|
module Entities
|
|
|
|
class ProjectExportStatus < ProjectIdentity
|
|
|
|
include ::API::Helpers::RelatedResourcesHelpers
|
|
|
|
|
2023-01-13 00:05:48 +05:30
|
|
|
expose :export_status, documentation: {
|
|
|
|
type: 'string', example: 'finished', values: %w[queued started finished failed]
|
|
|
|
}
|
2020-03-09 13:42:32 +05:30
|
|
|
expose :_links, if: lambda { |project, _options| project.export_status == :finished } do
|
2023-01-13 00:05:48 +05:30
|
|
|
expose :api_url, documentation: {
|
|
|
|
type: 'string',
|
|
|
|
example: 'https://gitlab.example.com/api/v4/projects/1/export/download'
|
|
|
|
} do |project|
|
2020-03-09 13:42:32 +05:30
|
|
|
expose_url(api_v4_projects_export_download_path(id: project.id))
|
|
|
|
end
|
|
|
|
|
2023-01-13 00:05:48 +05:30
|
|
|
expose :web_url, documentation: {
|
|
|
|
type: 'string',
|
|
|
|
example: 'https://gitlab.example.com/gitlab-org/gitlab-test/download_export'
|
|
|
|
} do |project|
|
2020-03-09 13:42:32 +05:30
|
|
|
Gitlab::Routing.url_helpers.download_export_project_url(project)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|