You are here

class Jobs in Auth0 Single Sign On 8.2

Hierarchy

Expanded class hierarchy of Jobs

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

File

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

Namespace

Auth0\SDK\API\Management
View source
class Jobs extends GenericResource {

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

  /**
   *
   * @param  string $id
   * @return mixed
   */
  public function getErrors($id) {
    return $this->apiClient
      ->method('get')
      ->addPath('jobs', $id)
      ->addPath('errors')
      ->call();
  }

  /**
   *
   * @param  string $file_path
   * @param  string $connection_id
   * @param  array  $params
   * @return mixed
   */
  public function importUsers($file_path, $connection_id, $params = []) {
    $request = $this->apiClient
      ->method('post', false)
      ->addPath('jobs')
      ->addPath('users-imports')
      ->addFile('users', $file_path)
      ->addFormParam('connection_id', $connection_id);
    if (isset($params['upsert'])) {
      $request
        ->addFormParam('upsert', filter_var($params['upsert'], FILTER_VALIDATE_BOOLEAN));
    }
    if (isset($params['send_completion_email'])) {
      $request
        ->addFormParam('send_completion_email', filter_var($params['send_completion_email'], FILTER_VALIDATE_BOOLEAN));
    }
    if (!empty($params['external_id'])) {
      $request
        ->addFormParam('external_id', $params['external_id']);
    }
    return $request
      ->call();
  }

  /**
   *
   * @param  string $user_id
   * @return mixed
   */
  public function sendVerificationEmail($user_id) {
    return $this->apiClient
      ->method('post')
      ->addPath('jobs')
      ->addPath('verification-email')
      ->withBody(json_encode([
      'user_id' => $user_id,
    ]))
      ->call();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
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.
Jobs::get public function
Jobs::getErrors public function
Jobs::importUsers public function
Jobs::sendVerificationEmail public function