You are here

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

Update a Role by ID. Required scope: "update:roles"

@link https://auth0.com/docs/api/management/v2#!/Roles/patch_roles_by_id

Parameters

string $role_id Role to ID update.:

array $data Data to update.:

Return value

mixed

Throws

EmptyOrInvalidParameterException Thrown if the id parameter is empty or is not a string.

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

File

vendor/auth0/auth0-php/src/API/Management/Roles.php, line 121

Class

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

Namespace

Auth0\SDK\API\Management

Code

public function update($role_id, array $data) {
  $this
    ->checkEmptyOrInvalidString($role_id, 'role_id');
  return $this->apiClient
    ->method('patch')
    ->addPath('roles', $role_id)
    ->withBody(json_encode($data))
    ->call();
}