From eb86b0259cc74c0a7eb82a7215a2712c9edd5de2 Mon Sep 17 00:00:00 2001 From: Phrase Date: Mon, 26 Aug 2024 09:46:05 +0000 Subject: [PATCH] Deploying from phrase/openapi@11003ace --- docs/Api/UploadsApi.md | 6 ++++-- lib/Api/UploadsApi.php | 27 ++++++++++++++++++--------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/docs/Api/UploadsApi.md b/docs/Api/UploadsApi.md index d00fd6f..9d85581 100644 --- a/docs/Api/UploadsApi.md +++ b/docs/Api/UploadsApi.md @@ -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_translation_keys, $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_translations_on_source_match, $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 @@ -42,6 +42,7 @@ $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_translations_on_source_match = false; // bool | Update target translations only if the source translations of the uploaded multilingual file match the stored translations. $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. @@ -54,7 +55,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_translation_keys, $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_translations_on_source_match, $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; @@ -76,6 +77,7 @@ Name | Type | Description | Notes **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_translations_on_source_match** | **bool**| Update target translations only if the source translations of the uploaded multilingual file match the stored translations. | [optional] [default to false] **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] diff --git a/lib/Api/UploadsApi.php b/lib/Api/UploadsApi.php index ee5222e..1f93df6 100644 --- a/lib/Api/UploadsApi.php +++ b/lib/Api/UploadsApi.php @@ -127,6 +127,7 @@ public function getConfig() * @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_translations_on_source_match Update target translations only if the source translations of the uploaded multilingual file match the stored translations. (optional, default to false) * @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) @@ -142,9 +143,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_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) + 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_translations_on_source_match = false, $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_translation_keys, $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_translations_on_source_match, $update_descriptions, $convert_emoji, $skip_upload_tags, $skip_unverification, $file_encoding, $locale_mapping, $format_options, $autotranslate, $mark_reviewed, $tag_only_affected_keys); return $response; } @@ -162,6 +163,7 @@ public function uploadCreate($project_id, $file, $file_format, $locale_id, $x_ph * @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_translations_on_source_match Update target translations only if the source translations of the uploaded multilingual file match the stored translations. (optional, default to false) * @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) @@ -177,9 +179,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_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) + 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_translations_on_source_match = false, $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_translation_keys, $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_translations_on_source_match, $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(); @@ -268,6 +270,7 @@ public function uploadCreateWithHttpInfo($project_id, $file, $file_format, $loca * @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_translations_on_source_match Update target translations only if the source translations of the uploaded multilingual file match the stored translations. (optional, default to false) * @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) @@ -282,9 +285,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_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) + 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_translations_on_source_match = false, $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_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->uploadCreateAsyncWithHttpInfo($project_id, $file, $file_format, $locale_id, $x_phrase_app_otp, $branch, $tags, $update_translations, $update_translation_keys, $update_translations_on_source_match, $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]; @@ -306,6 +309,7 @@ function ($response) { * @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_translations_on_source_match Update target translations only if the source translations of the uploaded multilingual file match the stored translations. (optional, default to false) * @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) @@ -320,10 +324,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_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) + 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_translations_on_source_match = false, $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_translation_keys, $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_translations_on_source_match, $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()) @@ -371,6 +375,7 @@ function ($exception) { * @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_translations_on_source_match Update target translations only if the source translations of the uploaded multilingual file match the stored translations. (optional, default to false) * @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) @@ -385,7 +390,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_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) + 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_translations_on_source_match = false, $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)) { @@ -464,6 +469,10 @@ protected function uploadCreateRequest($project_id, $file, $file_format, $locale $this->formParamsAppend($formParams, 'update_translation_keys', $update_translation_keys); } // form params + if ($update_translations_on_source_match !== null) { + $this->formParamsAppend($formParams, 'update_translations_on_source_match', $update_translations_on_source_match); + } + // form params if ($update_descriptions !== null) { $this->formParamsAppend($formParams, 'update_descriptions', $update_descriptions); }