You are here

interface LingotekApiInterface in Lingotek Translation 3.4.x

Same name and namespace in other branches
  1. 8 src/Remote/LingotekApiInterface.php \Drupal\lingotek\Remote\LingotekApiInterface
  2. 8.2 src/Remote/LingotekApiInterface.php \Drupal\lingotek\Remote\LingotekApiInterface
  3. 4.0.x src/Remote/LingotekApiInterface.php \Drupal\lingotek\Remote\LingotekApiInterface
  4. 3.0.x src/Remote/LingotekApiInterface.php \Drupal\lingotek\Remote\LingotekApiInterface
  5. 3.1.x src/Remote/LingotekApiInterface.php \Drupal\lingotek\Remote\LingotekApiInterface
  6. 3.2.x src/Remote/LingotekApiInterface.php \Drupal\lingotek\Remote\LingotekApiInterface
  7. 3.3.x src/Remote/LingotekApiInterface.php \Drupal\lingotek\Remote\LingotekApiInterface
  8. 3.5.x src/Remote/LingotekApiInterface.php \Drupal\lingotek\Remote\LingotekApiInterface
  9. 3.6.x src/Remote/LingotekApiInterface.php \Drupal\lingotek\Remote\LingotekApiInterface
  10. 3.7.x src/Remote/LingotekApiInterface.php \Drupal\lingotek\Remote\LingotekApiInterface
  11. 3.8.x src/Remote/LingotekApiInterface.php \Drupal\lingotek\Remote\LingotekApiInterface

Hierarchy

Expanded class hierarchy of LingotekApiInterface

All classes that implement LingotekApiInterface

3 files declare their use of LingotekApiInterface
Lingotek.php in src/Lingotek.php
LingotekFake.php in tests/modules/lingotek_test/src/LingotekFake.php
LingotekUnitTest.php in tests/src/Unit/LingotekUnitTest.php

File

src/Remote/LingotekApiInterface.php, line 7

Namespace

Drupal\lingotek\Remote
View source
interface LingotekApiInterface extends ContainerInjectionInterface {

  /**
   * Get the account information.
   *
   * @return array|bool
   *   Array with account info. FALSE in case of error.
   *   The keys are user_id, username, login_id, email, and name.
   */
  public function getAccountInfo();

  /**
   * Get the available locales on Lingotek.
   *
   * @return array|bool
   *   Array of locales (as in de-DE, es-ES). FALSE if there is an error.
   */
  public function getLocales();

  /**
   * Adds a document to Lingotek.
   *
   * @param array $args
   *   The document data.
   * @see http://devzone.lingotek.com
   *
   * @return \Psr\Http\Message\ResponseInterface
   *   A response.
   *
   * @throws \Drupal\lingotek\Exception\LingotekApiException
   */
  public function addDocument($args);

  /**
   * Gets the document content from Lingotek.
   *
   * @param string $doc_id
   *   The document id.
   *
   * @return string
   *   The content.
   *
   * @throws \Drupal\lingotek\Exception\LingotekApiException
   */
  public function getDocumentContent($doc_id);

  /**
   * Updates a document in Lingotek.
   *
   * @param string $id
   *   The document id.
   * @param array $args
   *   The document data.
   * @see http://devzone.lingotek.com
   *
   * @return \Psr\Http\Message\ResponseInterface
   *   A response.
   *
   * @throws \Drupal\lingotek\Exception\LingotekApiException
   */
  public function patchDocument($id, $args);

  /**
   * Cancels a document on Lingotek.
   *
   * @param string $document_id
   *   The document id.
   *
   * @return \Psr\Http\Message\ResponseInterface
   *   A response.
   */
  public function cancelDocument($document_id);

  /**
   * Cancels the document target with this document id and locale from the Lingotek service.
   *
   * @param string $document_id
   *   The document id.
   * @param string $locale
   *   The locale target we want to cancel the translation.
   *
   * @return \Psr\Http\Message\ResponseInterface
   *   A response.
   */
  public function cancelDocumentTarget($document_id, $locale);

  /**
   * Gets the document target translation statuses from the Lingotek service.
   *
   * @param string $id
   *   The document id.
   *
   * @return \Psr\Http\Message\ResponseInterface
   *   A response.
   */
  public function getDocumentTranslationStatuses($id);

  /**
   * Gets the document target translation status for a given locale from the Lingotek service.
   *
   * @param string $id
   *   The document id.
   * @param string $locale
   *   The target locale.
   *
   * @return \Psr\Http\Message\ResponseInterface
   *   A response.
   */
  public function getDocumentTranslationStatus($id, $locale);

  /**
   * Gets the document information from the Lingotek service.
   *
   * @param string $id
   *   The document id.
   *
   * @return \Psr\Http\Message\ResponseInterface
   *   A response.
   */
  public function getDocumentInfo($id);

  /**
   * Gets the document status from the Lingotek service.
   *
   * @param string $id
   *   The document id.
   *
   * @return \Psr\Http\Message\ResponseInterface
   *   A response.
   */
  public function getDocumentStatus($id);

  /**
   * Adds a document target translation for a given locale from the Lingotek service.
   *
   * @param string $id
   *   The document id.
   * @param string $locale
   *   The target locale.
   * @param string $workflow_id
   *   (Optional) The workflow ID.
   *
   * @return \Psr\Http\Message\ResponseInterface
   *   A response.
   */
  public function addTranslation($id, $locale, $workflow_id = NULL);

  /**
   * Gets a document target translation for a given locale from the Lingotek service.
   *
   * @param string $id
   *   The document id.
   * @param string $locale
   *   The target locale.
   * @param bool $useSource
   *   (Optional) Flag indicating if should return the source if this is not yet
   *   translated. By default is FALSE.
   *
   * @return \Psr\Http\Message\ResponseInterface
   *   A response.
   */
  public function getTranslation($id, $locale, $useSource);

  /**
   * Deletes a document target translation for a given locale from the Lingotek service.
   *
   * @param string $id
   *   The document id.
   * @param string $locale
   *   The target locale.
   *
   * @return \Psr\Http\Message\ResponseInterface
   *   A response.
   */
  public function deleteTranslation($id, $locale);

  /**
   * Gets the communities associated with the current account.
   *
   * @return array|bool
   *   Array with communities information. FALSE in case of error.
   *   The keys are the ids, and values are the name of the resource.
   */
  public function getCommunities();

  /**
   * Gets the project with the given ID.
   *
   * @param string $id
   *   The project ID.
   *
   * @return array|bool
   *   Array with project information.
   */
  public function getProject($id);

  /**
   * Gets the community related projects.
   *
   * @param string $community_id
   *   The community ID.
   *
   * @return array|bool
   *   Array with projects information. FALSE in case of error.
   *   The keys are the ids, and values are the name of the resource.
   */
  public function getProjects($community_id);

  /**
   * Gets the community related vaults.
   *
   * @param string $community_id
   *   The community ID.
   *
   * @return array|bool
   *   Array with vaults information. FALSE in case of error.
   *   The keys are the ids, and values are the name of the resource.
   */
  public function getVaults($community_id);

  /**
   * Gets the community related workflows.
   *
   * @param string $community_id
   *   The community ID.
   *
   * @return array|bool
   *   Array with communities information. FALSE in case of error.
   *   The keys are the ids, and values are the name of the resource.
   */
  public function getWorkflows($community_id);

  /**
   * Get the available filters on Lingotek.
   *
   * @return array|bool
   *   Array of filters as in (id, label). FALSE if there is an error.
   */
  public function getFilters();

}

Members

Namesort descending Modifiers Type Description Overrides
ContainerInjectionInterface::create public static function Instantiates a new instance of this class. 75
LingotekApiInterface::addDocument public function Adds a document to Lingotek. 1
LingotekApiInterface::addTranslation public function Adds a document target translation for a given locale from the Lingotek service. 1
LingotekApiInterface::cancelDocument public function Cancels a document on Lingotek. 1
LingotekApiInterface::cancelDocumentTarget public function Cancels the document target with this document id and locale from the Lingotek service. 1
LingotekApiInterface::deleteTranslation public function Deletes a document target translation for a given locale from the Lingotek service. 1
LingotekApiInterface::getAccountInfo public function Get the account information. 1
LingotekApiInterface::getCommunities public function Gets the communities associated with the current account. 1
LingotekApiInterface::getDocumentContent public function Gets the document content from Lingotek. 1
LingotekApiInterface::getDocumentInfo public function Gets the document information from the Lingotek service. 1
LingotekApiInterface::getDocumentStatus public function Gets the document status from the Lingotek service. 1
LingotekApiInterface::getDocumentTranslationStatus public function Gets the document target translation status for a given locale from the Lingotek service. 1
LingotekApiInterface::getDocumentTranslationStatuses public function Gets the document target translation statuses from the Lingotek service. 1
LingotekApiInterface::getFilters public function Get the available filters on Lingotek. 1
LingotekApiInterface::getLocales public function Get the available locales on Lingotek. 1
LingotekApiInterface::getProject public function Gets the project with the given ID. 1
LingotekApiInterface::getProjects public function Gets the community related projects. 1
LingotekApiInterface::getTranslation public function Gets a document target translation for a given locale from the Lingotek service. 1
LingotekApiInterface::getVaults public function Gets the community related vaults. 1
LingotekApiInterface::getWorkflows public function Gets the community related workflows. 1
LingotekApiInterface::patchDocument public function Updates a document in Lingotek. 1