From f14492d744295960cf200f44b7dcc28e64c07886 Mon Sep 17 00:00:00 2001 From: Bruno Fontes Date: Fri, 12 Feb 2021 19:03:12 -0300 Subject: [PATCH] Include edit Project Status --- src/Project.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Project.php b/src/Project.php index cfd2def..ee2e417 100644 --- a/src/Project.php +++ b/src/Project.php @@ -42,4 +42,19 @@ class Project extends \BrunoFontes\Memsource\BaseApi throw new \Exception("Error getting project {$projectUid}: " . $this->getError($response), 1); } } + + /** + * Edit the project status + * + * @param string $projectUid The project UID + * @param string $status The new status + */ + public function editStatus(string $projectUid, string $status): void + { + $queryParam = ['status' => $status]; + $response = $this->fetchApi->fetch('jsonPost', "{$this->_url}/{$projectUid}/setStatus", $queryParam); + if ($this->hasError($response)) { + throw new \Exception("Error editing project status on project: {$projectUid}: " . $this->getError($response), 1); + } + } }