Skip to content

Commit d810e9e

Browse files
authored
refactor!: add missing required params (#571)
* Add missing required params * Add project_id as required param for creating distribution * Bump major phrase-go version * Auto bump major go packages
1 parent bad41cc commit d810e9e

File tree

44 files changed

+196
-73
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+196
-73
lines changed

clients/go/test/api_uploads_test.go

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/java/src/test/java/com/phrase/client/api/LocalesApiTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ public void localeDeleteTest() throws ApiException {
114114
String id = null;
115115
String xPhraseAppOTP = null;
116116
String branch = null;
117+
117118
api.localeDelete(projectId, id, xPhraseAppOTP, branch);
118119

119120
// TODO: test validations

clients/java/src/test/java/com/phrase/client/api/UploadsApiTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ public void uploadCreateTest() throws ApiException, IOException, InterruptedExce
9292
String branch = "branch_example";
9393
File file = File.createTempFile("test", "test");
9494
file.deleteOnExit();
95-
String fileFormat = null;
96-
String localeId = null;
95+
String fileFormat = "simple_json";
96+
String localeId = "en";
9797
String tags = null;
9898
Boolean updateTranslations = null;
9999
Boolean updateDescriptions = null;
@@ -106,7 +106,7 @@ public void uploadCreateTest() throws ApiException, IOException, InterruptedExce
106106
Boolean autotranslate = null;
107107
Boolean markReviewed = null;
108108
Boolean tagOnlyAffectedKeys = null;
109-
Upload response = api.uploadCreate(projectId, xPhraseAppOTP, branch, file, fileFormat, localeId, tags, updateTranslations, updateDescriptions, convertEmoji, skipUploadTags, skipUnverification, fileEncoding, localeMapping, formatOptions, autotranslate, markReviewed, tagOnlyAffectedKeys);
109+
Upload response = api.uploadCreate(projectId, file, fileFormat, localeId, xPhraseAppOTP, branch, tags, updateTranslations, updateDescriptions, convertEmoji, skipUploadTags, skipUnverification, fileEncoding, localeMapping, formatOptions, autotranslate, markReviewed, tagOnlyAffectedKeys);
110110

111111
Assert.assertEquals("valid id returned", "id_example", response.getId());
112112
Assert.assertEquals("valid creation date returned", OffsetDateTime.parse("2015-01-28T09:52:53Z"), response.getCreatedAt());

clients/php/test/Api/UploadsApiTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function testUploadCreate()
107107
$file = new \SplFileObject($fileName, 'w+');
108108
$file->fwrite('test');
109109

110-
$result = $this->apiInstance->uploadCreate($projectId, null, null, $file);
110+
$result = $this->apiInstance->uploadCreate($projectId, $file, "yml", "en", null, null);
111111
$file = null;
112112
unlink($fileName);
113113

clients/python/test/test_uploads_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ def test_upload_create(self, mock_post):
4848
api_response = api_instance.upload_create(
4949
project_id,
5050
file="./test/fixtures/en.json",
51-
file_format="simple_json"
51+
file_format="simple_json",
52+
locale_id="en"
5253
)
5354

5455
self.assertEqual("https://api.phrase.com/v2/projects/project_id_example/uploads", mock_post.call_args_list[0].args[1])

clients/ruby/spec/api/locales_api_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
# @option opts [Boolean] :skip_unverified_translations Indicates whether the locale file should skip all unverified translations. This parameter is deprecated and should be replaced with <code>include_unverified_translations</code>.
8888
# @option opts [Boolean] :include_unverified_translations if set to false unverified translations are excluded
8989
# @option opts [Boolean] :use_last_reviewed_version If set to true the last reviewed version of a translation is used. This is only available if the review workflow is enabled for the project.
90-
# @option opts [String] :fallback_locale_id If a key has no translation in the locale being downloaded the translation in the fallback locale will be used. Provide the public ID of the locale that should be used as the fallback. Requires include_empty_translations to be set to <code>true</code>.
90+
# @option opts [String] :fallback_locale_id If a key has no translation in the locale being downloaded the translation in the fallback locale will be used. Provide the ID of the locale that should be used as the fallback. Requires include_empty_translations to be set to <code>true</code>.
9191
# @option opts [String] :source_locale_id Provides the source language of a corresponding job as the source language of the generated locale file. This parameter will be ignored unless used in combination with a <code>tag</code> parameter indicating a specific job.
9292
# @return [File]
9393
describe 'locale_download test' do

clients/ruby/spec/api/uploads_api_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# @option opts [String] :branch specify the branch to use
3030
# @option opts [File] :file File to be imported
3131
# @option opts [String] :file_format File format. Auto-detected when possible and not specified.
32-
# @option opts [String] :locale_id Locale of the file's content. Can be the name or public id of the locale. Preferred is the public id.
32+
# @option opts [String] :locale_id Locale of the file's content. Can be the name or id of the locale. Preferred is id.
3333
# @option opts [String] :tags List of tags separated by comma to be associated with the new keys contained in the upload.
3434
# @option opts [Boolean] :update_translations Indicates whether existing translations should be updated with the file content.
3535
# @option opts [Boolean] :update_descriptions Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions.
@@ -53,7 +53,7 @@
5353
end
5454

5555
it 'should work' do
56-
@api_instance.upload_create('project_id', file: File.new('Gemfile'))
56+
@api_instance.upload_create('project_id', File.new('Gemfile'), "yml", "en")
5757

5858
expect(a_request(:post, 'https://api.phrase.com/v2/projects/project_id/uploads')
5959
.with { |req|

clients/typescript/__tests__/BasicApiTest.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ describe('UploadsApi', () => {
8989
test('uploads a file', async () => {
9090
const projectId = 'my-project-id';
9191
const file = fs.createReadStream('package.json');
92+
const fileFormat = 'json';
93+
const localeId = 'en';
9294

93-
await api.uploadCreate({projectId, file}).then((response) => {
95+
await api.uploadCreate({projectId, file, fileFormat, localeId}).then((response) => {
9496
expect(response.id).toBe('upload_id');
9597
});
9698

0 commit comments

Comments
 (0)