Skip to content

Commit

Permalink
Deploying from phrase/openapi@4492ec0a
Browse files Browse the repository at this point in the history
  • Loading branch information
Phrase committed Apr 29, 2024
1 parent f7f5310 commit 1dd1c83
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
6 changes: 4 additions & 2 deletions docs/Api/UploadsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Method | HTTP request | Description

## uploadCreate

> \Phrase\Model\Upload uploadCreate($project_id, $file, $file_format, $locale_id, $x_phrase_app_otp, $branch, $tags, $update_translations, $update_descriptions, $convert_emoji, $skip_upload_tags, $skip_unverification, $file_encoding, $locale_mapping, $format_options, $autotranslate, $mark_reviewed, $tag_only_affected_keys)
> \Phrase\Model\Upload uploadCreate($project_id, $file, $file_format, $locale_id, $x_phrase_app_otp, $branch, $tags, $update_translations, $update_translation_keys, $update_descriptions, $convert_emoji, $skip_upload_tags, $skip_unverification, $file_encoding, $locale_mapping, $format_options, $autotranslate, $mark_reviewed, $tag_only_affected_keys)
Upload a new file

Expand Down Expand Up @@ -41,6 +41,7 @@ $x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentic
$branch = 'branch_example'; // string | specify the branch to use
$tags = 'tags_example'; // string | List of tags separated by comma to be associated with the new keys contained in the upload.
$update_translations = True; // bool | Indicates whether existing translations should be updated with the file content.
$update_translation_keys = true; // bool | Pass `false` here to prevent new keys from being created and existing keys updated.
$update_descriptions = True; // bool | Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions.
$convert_emoji = True; // bool | This option is obsolete. Providing the option will cause a bad request error.
$skip_upload_tags = True; // bool | Indicates whether the upload should not create upload tags.
Expand All @@ -53,7 +54,7 @@ $mark_reviewed = True; // bool | Indicated whether the imported translations sho
$tag_only_affected_keys = false; // bool | Indicates whether only keys affected (created or updated) by the upload should be tagged. The default is `false`

try {
$result = $apiInstance->uploadCreate($project_id, $file, $file_format, $locale_id, $x_phrase_app_otp, $branch, $tags, $update_translations, $update_descriptions, $convert_emoji, $skip_upload_tags, $skip_unverification, $file_encoding, $locale_mapping, $format_options, $autotranslate, $mark_reviewed, $tag_only_affected_keys);
$result = $apiInstance->uploadCreate($project_id, $file, $file_format, $locale_id, $x_phrase_app_otp, $branch, $tags, $update_translations, $update_translation_keys, $update_descriptions, $convert_emoji, $skip_upload_tags, $skip_unverification, $file_encoding, $locale_mapping, $format_options, $autotranslate, $mark_reviewed, $tag_only_affected_keys);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling UploadsApi->uploadCreate: ', $e->getMessage(), PHP_EOL;
Expand All @@ -74,6 +75,7 @@ Name | Type | Description | Notes
**branch** | **string**| specify the branch to use | [optional]
**tags** | **string**| List of tags separated by comma to be associated with the new keys contained in the upload. | [optional]
**update_translations** | **bool**| Indicates whether existing translations should be updated with the file content. | [optional]
**update_translation_keys** | **bool**| Pass `false` here to prevent new keys from being created and existing keys updated. | [optional] [default to true]
**update_descriptions** | **bool**| Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions. | [optional]
**convert_emoji** | **bool**| This option is obsolete. Providing the option will cause a bad request error. | [optional]
**skip_upload_tags** | **bool**| Indicates whether the upload should not create upload tags. | [optional]
Expand Down
27 changes: 18 additions & 9 deletions lib/Api/UploadsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ public function getConfig()
* @param string $branch specify the branch to use (optional)
* @param string $tags List of tags separated by comma to be associated with the new keys contained in the upload. (optional)
* @param bool $update_translations Indicates whether existing translations should be updated with the file content. (optional)
* @param bool $update_translation_keys Pass `false` here to prevent new keys from being created and existing keys updated. (optional, default to true)
* @param bool $update_descriptions Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions. (optional)
* @param bool $convert_emoji This option is obsolete. Providing the option will cause a bad request error. (optional)
* @param bool $skip_upload_tags Indicates whether the upload should not create upload tags. (optional)
Expand All @@ -141,9 +142,9 @@ public function getConfig()
* @throws \InvalidArgumentException
* @return \Phrase\Model\Upload
*/
public function uploadCreate($project_id, $file, $file_format, $locale_id, $x_phrase_app_otp = null, $branch = null, $tags = null, $update_translations = null, $update_descriptions = null, $convert_emoji = null, $skip_upload_tags = null, $skip_unverification = null, $file_encoding = null, $locale_mapping = null, $format_options = null, $autotranslate = null, $mark_reviewed = null, $tag_only_affected_keys = false)
public function uploadCreate($project_id, $file, $file_format, $locale_id, $x_phrase_app_otp = null, $branch = null, $tags = null, $update_translations = null, $update_translation_keys = true, $update_descriptions = null, $convert_emoji = null, $skip_upload_tags = null, $skip_unverification = null, $file_encoding = null, $locale_mapping = null, $format_options = null, $autotranslate = null, $mark_reviewed = null, $tag_only_affected_keys = false)
{
list($response) = $this->uploadCreateWithHttpInfo($project_id, $file, $file_format, $locale_id, $x_phrase_app_otp, $branch, $tags, $update_translations, $update_descriptions, $convert_emoji, $skip_upload_tags, $skip_unverification, $file_encoding, $locale_mapping, $format_options, $autotranslate, $mark_reviewed, $tag_only_affected_keys);
list($response) = $this->uploadCreateWithHttpInfo($project_id, $file, $file_format, $locale_id, $x_phrase_app_otp, $branch, $tags, $update_translations, $update_translation_keys, $update_descriptions, $convert_emoji, $skip_upload_tags, $skip_unverification, $file_encoding, $locale_mapping, $format_options, $autotranslate, $mark_reviewed, $tag_only_affected_keys);
return $response;
}

Expand All @@ -160,6 +161,7 @@ public function uploadCreate($project_id, $file, $file_format, $locale_id, $x_ph
* @param string $branch specify the branch to use (optional)
* @param string $tags List of tags separated by comma to be associated with the new keys contained in the upload. (optional)
* @param bool $update_translations Indicates whether existing translations should be updated with the file content. (optional)
* @param bool $update_translation_keys Pass `false` here to prevent new keys from being created and existing keys updated. (optional, default to true)
* @param bool $update_descriptions Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions. (optional)
* @param bool $convert_emoji This option is obsolete. Providing the option will cause a bad request error. (optional)
* @param bool $skip_upload_tags Indicates whether the upload should not create upload tags. (optional)
Expand All @@ -175,9 +177,9 @@ public function uploadCreate($project_id, $file, $file_format, $locale_id, $x_ph
* @throws \InvalidArgumentException
* @return array of \Phrase\Model\Upload, HTTP status code, HTTP response headers (array of strings)
*/
public function uploadCreateWithHttpInfo($project_id, $file, $file_format, $locale_id, $x_phrase_app_otp = null, $branch = null, $tags = null, $update_translations = null, $update_descriptions = null, $convert_emoji = null, $skip_upload_tags = null, $skip_unverification = null, $file_encoding = null, $locale_mapping = null, $format_options = null, $autotranslate = null, $mark_reviewed = null, $tag_only_affected_keys = false)
public function uploadCreateWithHttpInfo($project_id, $file, $file_format, $locale_id, $x_phrase_app_otp = null, $branch = null, $tags = null, $update_translations = null, $update_translation_keys = true, $update_descriptions = null, $convert_emoji = null, $skip_upload_tags = null, $skip_unverification = null, $file_encoding = null, $locale_mapping = null, $format_options = null, $autotranslate = null, $mark_reviewed = null, $tag_only_affected_keys = false)
{
$request = $this->uploadCreateRequest($project_id, $file, $file_format, $locale_id, $x_phrase_app_otp, $branch, $tags, $update_translations, $update_descriptions, $convert_emoji, $skip_upload_tags, $skip_unverification, $file_encoding, $locale_mapping, $format_options, $autotranslate, $mark_reviewed, $tag_only_affected_keys);
$request = $this->uploadCreateRequest($project_id, $file, $file_format, $locale_id, $x_phrase_app_otp, $branch, $tags, $update_translations, $update_translation_keys, $update_descriptions, $convert_emoji, $skip_upload_tags, $skip_unverification, $file_encoding, $locale_mapping, $format_options, $autotranslate, $mark_reviewed, $tag_only_affected_keys);

try {
$options = $this->createHttpClientOption();
Expand Down Expand Up @@ -265,6 +267,7 @@ public function uploadCreateWithHttpInfo($project_id, $file, $file_format, $loca
* @param string $branch specify the branch to use (optional)
* @param string $tags List of tags separated by comma to be associated with the new keys contained in the upload. (optional)
* @param bool $update_translations Indicates whether existing translations should be updated with the file content. (optional)
* @param bool $update_translation_keys Pass `false` here to prevent new keys from being created and existing keys updated. (optional, default to true)
* @param bool $update_descriptions Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions. (optional)
* @param bool $convert_emoji This option is obsolete. Providing the option will cause a bad request error. (optional)
* @param bool $skip_upload_tags Indicates whether the upload should not create upload tags. (optional)
Expand All @@ -279,9 +282,9 @@ public function uploadCreateWithHttpInfo($project_id, $file, $file_format, $loca
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function uploadCreateAsync($project_id, $file, $file_format, $locale_id, $x_phrase_app_otp = null, $branch = null, $tags = null, $update_translations = null, $update_descriptions = null, $convert_emoji = null, $skip_upload_tags = null, $skip_unverification = null, $file_encoding = null, $locale_mapping = null, $format_options = null, $autotranslate = null, $mark_reviewed = null, $tag_only_affected_keys = false)
public function uploadCreateAsync($project_id, $file, $file_format, $locale_id, $x_phrase_app_otp = null, $branch = null, $tags = null, $update_translations = null, $update_translation_keys = true, $update_descriptions = null, $convert_emoji = null, $skip_upload_tags = null, $skip_unverification = null, $file_encoding = null, $locale_mapping = null, $format_options = null, $autotranslate = null, $mark_reviewed = null, $tag_only_affected_keys = false)
{
return $this->uploadCreateAsyncWithHttpInfo($project_id, $file, $file_format, $locale_id, $x_phrase_app_otp, $branch, $tags, $update_translations, $update_descriptions, $convert_emoji, $skip_upload_tags, $skip_unverification, $file_encoding, $locale_mapping, $format_options, $autotranslate, $mark_reviewed, $tag_only_affected_keys)
return $this->uploadCreateAsyncWithHttpInfo($project_id, $file, $file_format, $locale_id, $x_phrase_app_otp, $branch, $tags, $update_translations, $update_translation_keys, $update_descriptions, $convert_emoji, $skip_upload_tags, $skip_unverification, $file_encoding, $locale_mapping, $format_options, $autotranslate, $mark_reviewed, $tag_only_affected_keys)
->then(
function ($response) {
return $response[0];
Expand All @@ -302,6 +305,7 @@ function ($response) {
* @param string $branch specify the branch to use (optional)
* @param string $tags List of tags separated by comma to be associated with the new keys contained in the upload. (optional)
* @param bool $update_translations Indicates whether existing translations should be updated with the file content. (optional)
* @param bool $update_translation_keys Pass `false` here to prevent new keys from being created and existing keys updated. (optional, default to true)
* @param bool $update_descriptions Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions. (optional)
* @param bool $convert_emoji This option is obsolete. Providing the option will cause a bad request error. (optional)
* @param bool $skip_upload_tags Indicates whether the upload should not create upload tags. (optional)
Expand All @@ -316,10 +320,10 @@ function ($response) {
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function uploadCreateAsyncWithHttpInfo($project_id, $file, $file_format, $locale_id, $x_phrase_app_otp = null, $branch = null, $tags = null, $update_translations = null, $update_descriptions = null, $convert_emoji = null, $skip_upload_tags = null, $skip_unverification = null, $file_encoding = null, $locale_mapping = null, $format_options = null, $autotranslate = null, $mark_reviewed = null, $tag_only_affected_keys = false)
public function uploadCreateAsyncWithHttpInfo($project_id, $file, $file_format, $locale_id, $x_phrase_app_otp = null, $branch = null, $tags = null, $update_translations = null, $update_translation_keys = true, $update_descriptions = null, $convert_emoji = null, $skip_upload_tags = null, $skip_unverification = null, $file_encoding = null, $locale_mapping = null, $format_options = null, $autotranslate = null, $mark_reviewed = null, $tag_only_affected_keys = false)
{
$returnType = '\Phrase\Model\Upload';
$request = $this->uploadCreateRequest($project_id, $file, $file_format, $locale_id, $x_phrase_app_otp, $branch, $tags, $update_translations, $update_descriptions, $convert_emoji, $skip_upload_tags, $skip_unverification, $file_encoding, $locale_mapping, $format_options, $autotranslate, $mark_reviewed, $tag_only_affected_keys);
$request = $this->uploadCreateRequest($project_id, $file, $file_format, $locale_id, $x_phrase_app_otp, $branch, $tags, $update_translations, $update_translation_keys, $update_descriptions, $convert_emoji, $skip_upload_tags, $skip_unverification, $file_encoding, $locale_mapping, $format_options, $autotranslate, $mark_reviewed, $tag_only_affected_keys);

return $this->client
->sendAsync($request, $this->createHttpClientOption())
Expand Down Expand Up @@ -366,6 +370,7 @@ function ($exception) {
* @param string $branch specify the branch to use (optional)
* @param string $tags List of tags separated by comma to be associated with the new keys contained in the upload. (optional)
* @param bool $update_translations Indicates whether existing translations should be updated with the file content. (optional)
* @param bool $update_translation_keys Pass `false` here to prevent new keys from being created and existing keys updated. (optional, default to true)
* @param bool $update_descriptions Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions. (optional)
* @param bool $convert_emoji This option is obsolete. Providing the option will cause a bad request error. (optional)
* @param bool $skip_upload_tags Indicates whether the upload should not create upload tags. (optional)
Expand All @@ -380,7 +385,7 @@ function ($exception) {
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
protected function uploadCreateRequest($project_id, $file, $file_format, $locale_id, $x_phrase_app_otp = null, $branch = null, $tags = null, $update_translations = null, $update_descriptions = null, $convert_emoji = null, $skip_upload_tags = null, $skip_unverification = null, $file_encoding = null, $locale_mapping = null, $format_options = null, $autotranslate = null, $mark_reviewed = null, $tag_only_affected_keys = false)
protected function uploadCreateRequest($project_id, $file, $file_format, $locale_id, $x_phrase_app_otp = null, $branch = null, $tags = null, $update_translations = null, $update_translation_keys = true, $update_descriptions = null, $convert_emoji = null, $skip_upload_tags = null, $skip_unverification = null, $file_encoding = null, $locale_mapping = null, $format_options = null, $autotranslate = null, $mark_reviewed = null, $tag_only_affected_keys = false)
{
// verify the required parameter 'project_id' is set
if ($project_id === null || (is_array($project_id) && count($project_id) === 0)) {
Expand Down Expand Up @@ -455,6 +460,10 @@ protected function uploadCreateRequest($project_id, $file, $file_format, $locale
$this->formParamsAppend($formParams, 'update_translations', $update_translations);
}
// form params
if ($update_translation_keys !== null) {
$this->formParamsAppend($formParams, 'update_translation_keys', $update_translation_keys);
}
// form params
if ($update_descriptions !== null) {
$this->formParamsAppend($formParams, 'update_descriptions', $update_descriptions);
}
Expand Down

0 comments on commit 1dd1c83

Please sign in to comment.