From 7915f816976bc85251a53c16a01e7935ced602a2 Mon Sep 17 00:00:00 2001 From: Louis Rose Date: Tue, 19 Mar 2024 16:35:06 +0000 Subject: [PATCH] adds export to fake job #2 --- README.md | 2 +- .../resources/__files/jobs/2.cancelled.json | 5 +- .../resources/__files/jobs/2.completed.json | 27 +++++++++- .../resources/__files/jobs/2.converting.json | 49 ++++++++++++++++++- .../__files/jobs/2.initialising.json | 1 + 5 files changed, 77 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 02a62ba..4cfbca6 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ the [Zamzar API documentation](https://developers.zamzar.com/docs). By default, `zamzar-mock` will boot with the following example jobs: * 1 - A successful conversion from `example.mp3` to `example.txt` -* 2 - A successful conversion from `example.key` to `example-*.png` (multiple output files) +* 2 - A successful conversion from `example.key` to `example-*.png` (multiple output files; with an export) * 3 - A failed conversion from `example.doc` to `example.pdf` ### Test Imports diff --git a/src/main/resources/__files/jobs/2.cancelled.json b/src/main/resources/__files/jobs/2.cancelled.json index 76efcb8..a6efee4 100644 --- a/src/main/resources/__files/jobs/2.cancelled.json +++ b/src/main/resources/__files/jobs/2.cancelled.json @@ -6,7 +6,8 @@ "name": "example.key", "size": 420568 }, - "target_files": [], "target_format": "png", - "credit_cost": 1 + "export_url": "s3://example-bucket/thumbnails/", + "credit_cost": 1, + "target_files": [] } \ No newline at end of file diff --git a/src/main/resources/__files/jobs/2.completed.json b/src/main/resources/__files/jobs/2.completed.json index a52fa26..bfe3dec 100644 --- a/src/main/resources/__files/jobs/2.completed.json +++ b/src/main/resources/__files/jobs/2.completed.json @@ -6,6 +6,9 @@ "name": "example.key", "size": 420568 }, + "target_format": "png", + "export_url": "s3://example-bucket/thumbnails/", + "credit_cost": 1, "target_files": [ { "id": 4, @@ -28,6 +31,26 @@ "size": 74457 } ], - "target_format": "png", - "credit_cost": 1 + "exports": [ + { + "id": 1, + "url": "s3://example-bucket/thumbnails/example-0.png", + "status": "successful" + }, + { + "id": 2, + "url": "s3://example-bucket/thumbnails/example-1.png", + "status": "successful" + }, + { + "id": 3, + "url": "s3://example-bucket/thumbnails/example-2.png", + "status": "successful" + }, + { + "id": 1, + "url": "s3://example-bucket/thumbnails/example.zip", + "status": "successful" + } + ] } \ No newline at end of file diff --git a/src/main/resources/__files/jobs/2.converting.json b/src/main/resources/__files/jobs/2.converting.json index c5b276e..1f7bc26 100644 --- a/src/main/resources/__files/jobs/2.converting.json +++ b/src/main/resources/__files/jobs/2.converting.json @@ -1,11 +1,56 @@ { "id": 2, - "status": "converting", + "status": "successful", "source_file": { "id": 3, "name": "example.key", "size": 420568 }, "target_format": "png", - "credit_cost": 1 + "export_url": "s3://example-bucket/thumbnails/", + "credit_cost": 1, + "target_files": [ + { + "id": 4, + "name": "example-0.png", + "size": 55342 + }, + { + "id": 5, + "name": "example-1.png", + "size": 57979 + }, + { + "id": 6, + "name": "example-2.png", + "size": 71021 + }, + { + "id": 7, + "name": "example.zip", + "size": 74457 + } + ], + "exports": [ + { + "id": 1, + "url": "s3://example-bucket/thumbnails/example-0.png", + "status": "successful" + }, + { + "id": 2, + "url": "s3://example-bucket/thumbnails/example-1.png", + "status": "successful" + }, + { + "id": 3, + "url": "s3://example-bucket/thumbnails/example-2.png", + "status": "successful" + }, + { + "id": 1, + "url": "s3://example-bucket/thumbnails/example.zip", + "status": "uploading" + } + ] } \ No newline at end of file diff --git a/src/main/resources/__files/jobs/2.initialising.json b/src/main/resources/__files/jobs/2.initialising.json index aa7fcf5..29a6d01 100644 --- a/src/main/resources/__files/jobs/2.initialising.json +++ b/src/main/resources/__files/jobs/2.initialising.json @@ -7,5 +7,6 @@ "size": 420568 }, "target_format": "png", + "export_url": "s3://example-bucket/thumbnails/", "credit_cost": 1 } \ No newline at end of file