<commit_before><?php

require_once("HttpClient.php");
require_once("FileUploadParameterBuilder.php");

class SmartlingAPI {

  const SANDBOX_MODE = 'SANDBOX';
  const PRODUCTION_MODE = 'PRODUCTION';
  const SANDBOX_URL = 'https://sandbox-api.smartling.com/v1';
  const PRODUCTION_URL = 'https://api.smartling.com/v1';

  /**
   * api base url
   *
   * @var string
   */
  protected $_baseUrl = "";

  /**
   *
   * @var string
   */
  protected $_apiKey;

  /**
   *
   * @var string
   */
  protected $_projectId;

  /**
   *
   * @var null | string
   */
  protected $_response = null;

  public function __construct($baseUrl, $apiKey, $projectId, $mode = self::SANDBOX_MODE) {
    $this->_apiKey = $apiKey;
    $this->_projectId = $projectId;
    if ($mode == self::PRODUCTION_MODE) {
      if (!empty($baseUrl)) {
        $this->_baseUrl = $baseUrl;
      }
      else {
        $this->_baseUrl = self::PRODUCTION_URL;
      }
    }
    else {
      $this->_baseUrl = self::SANDBOX_URL;
    }
  }

  /**
   * upload file to Smartling service
   *
   * @param string $path
   * @param string $fileType
   * @param string $fileUri
   * @param array $params
   * @return string
   */
  public function uploadFile($path, $params = array()) {
    return $this->sendRequest('file/upload', $params, HttpClient::REQUEST_TYPE_POST, true);
  }

  /**
   * upload content to Smartling service
   *
   * @param string $content
   * @param string $fileType
   * @param string $fileUri
   * @param array $params
   * @return string
   */
  public function uploadContent($content, $fileType, $fileUri, $params = array()) {
    return $this->sendRequest('file/upload', array_merge_recursive(array(
          'overwriteApprovedLocales' => FALSE,
          'file' => $content,
          'fileType' => $fileType,<commit_msg>Update api<commit_after><?php

require_once("HttpClient.php");
require_once("FileUploadParameterBuilder.php");

class SmartlingAPI {

  const SANDBOX_MODE = 'SANDBOX';
  const PRODUCTION_MODE = 'PRODUCTION';
  const SANDBOX_URL = 'https://sandbox-api.smartling.com/v1';
  const PRODUCTION_URL = 'https://api.smartling.com/v1';

  /**
   * api base url
   *
   * @var string
   */
  protected $_baseUrl = "";

  /**
   *
   * @var string
   */
  protected $_apiKey;

  /**
   *
   * @var string
   */
  protected $_projectId;

  /**
   *
   * @var null | string
   */
  protected $_response = null;

  public function __construct($baseUrl, $apiKey, $projectId, $mode = self::SANDBOX_MODE) {
    $this->_apiKey = $apiKey;
    $this->_projectId = $projectId;
    if ($mode == self::PRODUCTION_MODE) {
      if (!empty($baseUrl)) {
        $this->_baseUrl = $baseUrl;
      }
      else {
        $this->_baseUrl = self::PRODUCTION_URL;
      }
    }
    else {
      $this->_baseUrl = self::SANDBOX_URL;
    }
  }

  /**
   * upload file to Smartling service
   *
   * @param string $path
   * @param string $fileType
   * @param string $fileUri
   * @param array $params
   * @return string
   */
  public function uploadFile($path, $params = array()) {
    return $this->sendRequest('file/upload', array_merge_recursive(array('file' => $path), $params), HttpClient::REQUEST_TYPE_POST, true);
  }

  /**
   * upload content to Smartling service
   *
   * @param string $content
   * @param string $fileType
   * @param string $fileUri
   * @param array $params
   * @return string
   */
  public function uploadContent($content, $fileType, $fileUri, $params = array()) {
    return $this->sendRequest('file/upload', array_merge_recursive(array(
          'overwriteApprovedLocales' => FALSE,
          'file' => $content,
          'fileType' => $fileType,
{'fraction_non_alphanumeric': 0.14847161572052403, 'fraction_numerical': 0.001091703056768559, 'mean_word_length': 2.870116156282999, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 24, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5590095', 'n_tokens_mistral': 1252, 'n_tokens_neox': 1202, 'n_words': 254}