You are here

class UploadFileParameters in TMGMT Translator Smartling 8.3

Same name and namespace in other branches
  1. 8.4 vendor/smartling/api-sdk-php/src/File/Params/UploadFileParameters.php \Smartling\File\Params\UploadFileParameters
  2. 8.2 api-sdk-php/src/File/Params/UploadFileParameters.php \Smartling\File\Params\UploadFileParameters
  3. 8.2 vendor/smartling/api-sdk-php/src/File/Params/UploadFileParameters.php \Smartling\File\Params\UploadFileParameters

Class UploadFileParameters

@package Smartling\File\Params

Hierarchy

Expanded class hierarchy of UploadFileParameters

8 files declare their use of UploadFileParameters
batch-example.php in vendor/smartling/api-sdk-php/examples/batch-example.php
BatchApi.php in vendor/smartling/api-sdk-php/src/Batch/BatchApi.php
BatchApiTest.php in vendor/smartling/api-sdk-php/tests/unit/BatchApiTest.php
FileApi.php in vendor/smartling/api-sdk-php/src/File/FileApi.php
FileApiTest.php in vendor/smartling/api-sdk-php/tests/unit/FileApiTest.php

... See full list

File

vendor/smartling/api-sdk-php/src/File/Params/UploadFileParameters.php, line 13

Namespace

Smartling\File\Params
View source
class UploadFileParameters extends BaseParameters {
  public function __construct($clientLibId = BaseApiAbstract::CLIENT_LIB_ID_SDK, $clientLibVersion = BaseApiAbstract::CLIENT_LIB_ID_VERSION) {
    $this
      ->setAuthorized(false);
    $this
      ->setClientLibId($clientLibId, $clientLibVersion);
  }

  /**
   * @param string $client_lib_id
   * @param string $version
   *
   * @return UploadFileParameters
   */
  public function setClientLibId($client_lib_id, $version) {
    $this
      ->set('smartling.client_lib_id', json_encode([
      'client' => $client_lib_id,
      'version' => $version,
    ], JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE));
    return $this;
  }

  /**
   * @param string $callback_url
   *
   * @return UploadFileParameters
   */
  public function setCallbackUrl($callback_url) {
    $this
      ->set('callbackUrl', $callback_url);
    return $this;
  }

  /**
   * @param int $authorized
   *
   * @return UploadFileParameters
   */
  public function setAuthorized($authorized) {
    $this
      ->set('authorize', $authorized);
    return $this;
  }

  /**
   * @param array $locales_to_approve
   *
   * @return UploadFileParameters
   */
  public function setLocalesToApprove($locales_to_approve) {
    if (is_string($locales_to_approve)) {
      $locales_to_approve = [
        $locales_to_approve,
      ];
    }
    $this
      ->set('localeIdsToAuthorize', $locales_to_approve);
    return $this;
  }

  /**
   * @inheritdoc
   */
  public function exportToArray() {
    $params = $this->params;
    $params['authorize'] = array_key_exists('localeIdsToAuthorize', $params) ? false : (bool) $params['authorize'];
    return $params;
  }

}

Members