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); } }