You are here

class AuditLogApi in TMGMT Translator Smartling 8.3

Same name and namespace in other branches
  1. 8.4 vendor/smartling/api-sdk-php/src/AuditLog/AuditLogApi.php \Smartling\AuditLog\AuditLogApi

Hierarchy

Expanded class hierarchy of AuditLogApi

3 files declare their use of AuditLogApi
AuditLogApiFunctionalTest.php in vendor/smartling/api-sdk-php/tests/functional/AuditLogApiFunctionalTest.php
AuditLogApiTest.php in vendor/smartling/api-sdk-php/tests/unit/AuditLogApiTest.php
SmartlingApiFactory.php in src/Smartling/SmartlingApiFactory.php
SmartlingApiFactory.php.

File

vendor/smartling/api-sdk-php/src/AuditLog/AuditLogApi.php, line 12

Namespace

Smartling\AuditLog
View source
class AuditLogApi extends BaseApiAbstract {
  const ENDPOINT_URL = 'https://api.smartling.com/audit-log-api/v2';
  const PROJECT_LEVEL_URL = 'projects/%s/logs';
  const ACCOUNT_LEVEL_URL = 'accounts/%s/logs';

  /**
   * {@inheritdoc}
   */
  public function __construct($projectId, ClientInterface $client, LoggerInterface $logger = null, $service_url = null) {
    parent::__construct($projectId, $client, $logger, $service_url);

    // Do not include project_id into base url since
    // audit log service has /accounts/{accountUid}/logs
    // endpoint without project id.
    $this
      ->setBaseUrl(rtrim($service_url, '/'));
  }
  public static function create(AuthApiInterface $authProvider, $projectId, LoggerInterface $logger = null) {
    $client = self::initializeHttpClient(self::ENDPOINT_URL);
    $instance = new self($projectId, $client, $logger, self::ENDPOINT_URL);
    $instance
      ->setAuth($authProvider);
    return $instance;
  }
  public function createProjectLevelLogRecord(CreateRecordParameters $createRecordRecommendedParameters) {
    $requestData = $this
      ->getDefaultRequestData('json', $createRecordRecommendedParameters
      ->exportToArray());
    $endpoint = vsprintf(self::PROJECT_LEVEL_URL, [
      $this
        ->getProjectId(),
    ]);
    return $this
      ->sendRequest($endpoint, $requestData, static::HTTP_METHOD_POST);
  }
  public function createAccountLevelLogRecord($accountUid, CreateRecordParameters $createRecordRecommendedParameters) {
    $requestData = $this
      ->getDefaultRequestData('json', $createRecordRecommendedParameters
      ->exportToArray());
    $endpoint = vsprintf(self::ACCOUNT_LEVEL_URL, [
      $accountUid,
    ]);
    return $this
      ->sendRequest($endpoint, $requestData, static::HTTP_METHOD_POST);
  }
  public function searchProjectLevelLogRecord(SearchRecordParameters $searchParameters) {
    $requestData = $this
      ->getDefaultRequestData('query', $searchParameters
      ->exportToArray());
    $endpoint = vsprintf(self::PROJECT_LEVEL_URL, [
      $this
        ->getProjectId(),
    ]);
    return $this
      ->sendRequest($endpoint, $requestData, static::HTTP_METHOD_GET);
  }
  public function searchAccountLevelLogRecord($accountUid, SearchRecordParameters $searchParameters) {
    $requestData = $this
      ->getDefaultRequestData('query', $searchParameters
      ->exportToArray());
    $endpoint = vsprintf(self::ACCOUNT_LEVEL_URL, [
      $accountUid,
    ]);
    return $this
      ->sendRequest($endpoint, $requestData, static::HTTP_METHOD_GET);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AuditLogApi::ACCOUNT_LEVEL_URL constant
AuditLogApi::create public static function
AuditLogApi::createAccountLevelLogRecord public function
AuditLogApi::createProjectLevelLogRecord public function
AuditLogApi::ENDPOINT_URL constant
AuditLogApi::PROJECT_LEVEL_URL constant
AuditLogApi::searchAccountLevelLogRecord public function
AuditLogApi::searchProjectLevelLogRecord public function
AuditLogApi::__construct public function BaseApiAbstract constructor. Overrides BaseApiAbstract::__construct
BaseApiAbstract::$auth private property
BaseApiAbstract::$baseUrl private property Smartling API base url.
BaseApiAbstract::$currentClientId private static property
BaseApiAbstract::$currentClientUserAgentExtension private static property
BaseApiAbstract::$currentClientVersion private static property
BaseApiAbstract::$httpClient private property Http Client abstraction.
BaseApiAbstract::$logger private property Logger.
BaseApiAbstract::$projectId private property Project Id in Smartling dashboard
BaseApiAbstract::checkAuthenticationError private function
BaseApiAbstract::CLIENT_LIB_ID_SDK constant
BaseApiAbstract::CLIENT_LIB_ID_VERSION constant
BaseApiAbstract::CLIENT_USER_AGENT_EXTENSION constant
BaseApiAbstract::getAuth protected function
BaseApiAbstract::getBaseUrl protected function
BaseApiAbstract::getCurrentClientId public static function
BaseApiAbstract::getCurrentClientUserAgentExtension public static function
BaseApiAbstract::getCurrentClientVersion public static function
BaseApiAbstract::getDefaultRequestData protected function 1
BaseApiAbstract::getHttpClient protected function
BaseApiAbstract::getLogger protected function
BaseApiAbstract::getProjectId protected function
BaseApiAbstract::HTTP_METHOD_DELETE constant
BaseApiAbstract::HTTP_METHOD_GET constant
BaseApiAbstract::HTTP_METHOD_POST constant
BaseApiAbstract::HTTP_METHOD_PUT constant
BaseApiAbstract::initializeHttpClient protected static function
BaseApiAbstract::normalizeUri private function
BaseApiAbstract::PATTERN_DATE_TIME_ISO_8601 constant PHP equivalent to 'YYYY-MM-DDThh:mm:ssZ'
BaseApiAbstract::processBodyOptions protected function 3
BaseApiAbstract::processError private function
BaseApiAbstract::processErrors private function
BaseApiAbstract::readFile protected function OOP wrapper for fopen() function.
BaseApiAbstract::sendRequest protected function
BaseApiAbstract::setAuth protected function
BaseApiAbstract::setBaseUrl protected function
BaseApiAbstract::setCurrentClientId public static function
BaseApiAbstract::setCurrentClientUserAgentExtension public static function
BaseApiAbstract::setCurrentClientVersion public static function
BaseApiAbstract::setHttpClient protected function
BaseApiAbstract::setLogger protected function
BaseApiAbstract::setProjectId protected function