diff --git a/lib/RetailCrm/Methods/V5/Module.php b/lib/RetailCrm/Methods/V5/Module.php index 5322d08..421e02d 100644 --- a/lib/RetailCrm/Methods/V5/Module.php +++ b/lib/RetailCrm/Methods/V5/Module.php @@ -73,4 +73,32 @@ trait Module ['integrationModule' => json_encode($configuration)] ); } + + /** + * Update scopes + * + * @param string $code + * @param array $requires + * + * @throws \RetailCrm\Exception\InvalidJsonException + * @throws \RetailCrm\Exception\CurlException + * @throws \InvalidArgumentException + * + * @return \RetailCrm\Response\ApiResponse + */ + public function integrationModulesUpdateScopes($code, array $requires) + { + if (!count($requires) || empty($requires['scopes'])) { + throw new \InvalidArgumentException( + 'Parameter `requires` must contains a data & configuration `scopes` must be set' + ); + } + + /* @noinspection PhpUndefinedMethodInspection */ + return $this->client->makeRequest( + sprintf('/integration-modules/%s/update-scopes', $code), + "POST", + ['requires' => json_encode($requires)] + ); + } }