From a17a816198af48319ecadc85fee447c21ef76fe1 Mon Sep 17 00:00:00 2001 From: Akolzin Dmitry Date: Tue, 26 Oct 2021 13:02:54 +0300 Subject: [PATCH] add scopes in credentials method --- src/Model/Response/Api/Credentials.php | 9 +++++++++ tests/src/ResourceGroup/ApiTest.php | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/Model/Response/Api/Credentials.php b/src/Model/Response/Api/Credentials.php index fc83016..973b1b5 100644 --- a/src/Model/Response/Api/Credentials.php +++ b/src/Model/Response/Api/Credentials.php @@ -21,6 +21,7 @@ use RetailCrm\Api\Model\Response\SuccessResponse; class Credentials extends SuccessResponse { /** + * @deprecated * @var string[] * * @JMS\Type("array") @@ -28,6 +29,14 @@ class Credentials extends SuccessResponse */ public $credentials; + /** + * @var string[] + * + * @JMS\Type("array") + * @JMS\SerializedName("scopes") + */ + public $scopes; + /** * @var string * diff --git a/tests/src/ResourceGroup/ApiTest.php b/tests/src/ResourceGroup/ApiTest.php index 4a2b79c..08247e4 100644 --- a/tests/src/ResourceGroup/ApiTest.php +++ b/tests/src/ResourceGroup/ApiTest.php @@ -52,6 +52,7 @@ EOF; $json = <<<'EOF' { "success": true, + "scopes": ["order_read", "customer_read", "reference_read"], "credentials": [ "/api/integration-modules/{code}", "/api/integration-modules/{code}/edit" @@ -74,5 +75,6 @@ EOF; "/api/integration-modules/{code}", "/api/integration-modules/{code}/edit" ], $credentials->credentials); + self::assertEquals(["order_read", "customer_read", "reference_read"], $credentials->scopes); } }