From 9ac7f703bd7dace3d5f020dbf73ba850c4c26422 Mon Sep 17 00:00:00 2001 From: Maksym Novozhylov Date: Mon, 21 Oct 2019 13:50:10 +0200 Subject: [PATCH] v1.3.2 --- CHANGES.md | 4 +++ composer.json | 2 +- src/Upwork/API/Routers/Metadata.php | 30 +++++++++++++++++++++++ tests/Upwork/API/Routers/MetadataTest.php | 22 +++++++++++++++++ 4 files changed, 57 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 225ede4..a85494e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # Release History +## 1.3.2 +* Add Specialties API +* Add Skills V2 API + ## 1.3.1 * Fixed non-working getByContract from Workdays API diff --git a/composer.json b/composer.json index 9fd285e..019e7c3 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "upwork/php-upwork", "description": "PHP bindings for Upwork API", - "version": "v1.3.0", + "version": "v1.3.2", "type": "library", "keywords": ["upwork", "php", "api"], "homepage": "http://www.upwork.com", diff --git a/src/Upwork/API/Routers/Metadata.php b/src/Upwork/API/Routers/Metadata.php index 6a1b601..2674086 100644 --- a/src/Upwork/API/Routers/Metadata.php +++ b/src/Upwork/API/Routers/Metadata.php @@ -72,6 +72,36 @@ public function getSkills() return $response; } + /** + * Get Skills V2 + * + * @return object + */ + public function getSkillsV2() + { + ApiDebug::p(__FUNCTION__); + + $response = $this->_client->get('/profiles/v2/metadata/skills'); + ApiDebug::p('found response info', $response); + + return $response; + } + + /** + * Get Specialties + * + * @return object + */ + public function getSpecialties() + { + ApiDebug::p(__FUNCTION__); + + $response = $this->_client->get('/profiles/v1/metadata/specialties'); + ApiDebug::p('found response info', $response); + + return $response; + } + /** * Get regions * diff --git a/tests/Upwork/API/Routers/MetadataTest.php b/tests/Upwork/API/Routers/MetadataTest.php index 9c4c5d0..b38ff08 100644 --- a/tests/Upwork/API/Routers/MetadataTest.php +++ b/tests/Upwork/API/Routers/MetadataTest.php @@ -35,6 +35,28 @@ public function testGetSkills() $this->_checkResponse($response); } + /** + * @test + */ + public function testGetSkillsV2() + { + $router = new \Upwork\API\Routers\Metadata($this->_client); + $response = $router->getSkillsV2(); + + $this->_checkResponse($response); + } + + /** + * @test + */ + public function testGetSpecialties() + { + $router = new \Upwork\API\Routers\Metadata($this->_client); + $response = $router->getSpecialties(); + + $this->_checkResponse($response); + } + /** * @test */