You are here

public function Rules::update in Auth0 Single Sign On 8.2

Update a Rule by ID. Required scope: "update:rules"

Parameters

string $id Rule ID to delete.:

array $data Rule data to update.:

Return value

mixed

Throws

CoreException Thrown when $id is empty or not a string or if $data is empty.

\Exception Thrown by the HTTP client when there is a problem with the API call.

File

vendor/auth0/auth0-php/src/API/Management/Rules.php, line 166

Class

Rules
Class Rules. Handles requests to the Rules endpoint of the v2 Management API.

Namespace

Auth0\SDK\API\Management

Code

public function update($id, array $data) {
  if (empty($id) || !is_string($id)) {
    throw new CoreException('Invalid "id" parameter.');
  }
  return $this->apiClient
    ->method('patch')
    ->addPath('rules', $id)
    ->withBody(json_encode($data))
    ->call();
}