1
0
mirror of synced 2024-11-22 05:16:07 +03:00

add update-scopes method

This commit is contained in:
Vladimir Kolchin 2023-01-20 08:31:25 +01:00
parent 649c1a38ff
commit f3db3fdb63

View File

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