You are here

class DeviceCredentials in Auth0 Single Sign On 8.2

Hierarchy

Expanded class hierarchy of DeviceCredentials

1 file declares its use of DeviceCredentials
Management.php in vendor/auth0/auth0-php/src/API/Management.php

File

vendor/auth0/auth0-php/src/API/Management/DeviceCredentials.php, line 5

Namespace

Auth0\SDK\API\Management
View source
class DeviceCredentials extends GenericResource {
  const TYPE_PUBLIC_KEY = 'public_key';
  const TYPE_REFESH_TOKEN = 'refresh_token';

  /**
   *
   * @param  string            $user_id
   * @param  string            $client_id
   * @param  string            $type
   * @param  null|string|array $fields
   * @param  null|string|array $include_fields
   * @return mixed
   */
  public function getAll($user_id = null, $client_id = null, $type = null, $fields = null, $include_fields = null) {
    $request = $this->apiClient
      ->method('get')
      ->addPath('device-credentials');
    if ($fields !== null) {
      if (is_array($fields)) {
        $fields = implode(',', $fields);
      }
      $request
        ->withParam('fields', $fields);
    }
    if ($include_fields !== null) {
      $request
        ->withParam('include_fields', $include_fields);
    }
    if ($user_id !== null) {
      $request
        ->withParam('user_id', $user_id);
    }
    if ($client_id !== null) {
      $request
        ->withParam('client_id', $client_id);
    }
    if ($type !== null) {
      $request
        ->withParam('type', $type);
    }
    return $request
      ->call();
  }

  /**
   *
   * @param  array $data
   * @return mixed
   */
  public function createPublicKey($data) {
    return $this->apiClient
      ->method('post')
      ->addPath('device-credentials')
      ->withBody(json_encode($data))
      ->call();
  }

  /**
   *
   * @param  string $id
   * @return mixed
   */
  public function deleteDeviceCredential($id) {
    return $this->apiClient
      ->method('delete')
      ->addPath('device-credentials', $id)
      ->call();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DeviceCredentials::createPublicKey public function
DeviceCredentials::deleteDeviceCredential public function
DeviceCredentials::getAll public function
DeviceCredentials::TYPE_PUBLIC_KEY constant
DeviceCredentials::TYPE_REFESH_TOKEN constant
GenericResource::$apiClient protected property Injected ApiClient instance to use.
GenericResource::checkEmptyOrInvalidString protected function Check that a variable is a string and is not empty.
GenericResource::checkInvalidPermissions protected function Check for invalid permissions with an array of permissions.
GenericResource::getApiClient public function Get the injected ApiClient instance.
GenericResource::normalizeIncludeTotals protected function Normalize include_totals parameter.
GenericResource::normalizePagination protected function Normalize pagination parameters.
GenericResource::__construct public function GenericResource constructor.