From af09e47d77aedf0cac0fca3a94101fe1b68058a9 Mon Sep 17 00:00:00 2001 From: Joseph Date: Sat, 3 Jan 2026 13:22:16 +0000 Subject: [PATCH 1/3] Update Application.php --- src/Endpoint/Application.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Endpoint/Application.php b/src/Endpoint/Application.php index 32e383c..c560d11 100644 --- a/src/Endpoint/Application.php +++ b/src/Endpoint/Application.php @@ -117,4 +117,19 @@ public function uploadImage(int $id, string $image): stdClass return (object) $application; } + + /** + * Delete the image of an application + * + * @param int $id Application Id + * + * @return boolean + * + * @see https://gotify.net/api-docs#/application/removeAppImage API docs for deleting an application image + */ + public function deleteImage(int $id): bool + { + $response = $this->guzzle->delete($this->endpoint . '/' . $id . '/image'); + return $response->getStatusCode() === 200 ? true : false; + } } From 24438df3c431b635bc421c9159c1e448c59bdf27 Mon Sep 17 00:00:00 2001 From: Joseph Date: Sat, 3 Jan 2026 13:22:19 +0000 Subject: [PATCH 2/3] Update ApplicationTest.php --- tests/Endpoints/ApplicationTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/Endpoints/ApplicationTest.php b/tests/Endpoints/ApplicationTest.php index 48fda2d..c039213 100644 --- a/tests/Endpoints/ApplicationTest.php +++ b/tests/Endpoints/ApplicationTest.php @@ -113,6 +113,16 @@ public function testUploadImage(): void $this->assertObjectHasProperty('image', $uploaded); } + /** + * Test deleting an image for the application + */ + #[Depends('testUploadImage')] + public function testDeleteImage(): void + { + $deleted = self::$application->deleteImage(self::$appId); + $this->assertTrue($deleted); + } + /** * Test deleting an application */ From 8e38ff1debac9079ce77c755280ac4bada9fd94e Mon Sep 17 00:00:00 2001 From: Joseph Date: Sat, 3 Jan 2026 13:27:13 +0000 Subject: [PATCH 3/3] Update endpoints.md --- docs/endpoints.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/endpoints.md b/docs/endpoints.md index 1c4538e..d51c275 100644 --- a/docs/endpoints.md +++ b/docs/endpoints.md @@ -57,6 +57,12 @@ Upload image for an application uploadImage(int $id, string $image): stdClass ``` +Delete the image for an application + +```PHP +deleteImage(int $id): stdClass +``` + ## ApplicationMessage ```PHP