summaryrefslogtreecommitdiff
path: root/app/serializers/job_artifact_report_entity.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/serializers/job_artifact_report_entity.rb')
-rw-r--r--app/serializers/job_artifact_report_entity.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/serializers/job_artifact_report_entity.rb b/app/serializers/job_artifact_report_entity.rb
new file mode 100644
index 00000000000..857cbfe8ee8
--- /dev/null
+++ b/app/serializers/job_artifact_report_entity.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class JobArtifactReportEntity < Grape::Entity
+ include RequestAwareEntity
+
+ expose :file_type
+ expose :file_format
+ expose :size
+
+ expose :download_path do |artifact|
+ download_project_job_artifacts_path(job.project, job, file_type: artifact.file_format)
+ end
+
+ alias_method :job, :object
+end