diff --git a/clients/java/src/test/java/com/phrase/client/api/LocalesApiTest.java b/clients/java/src/test/java/com/phrase/client/api/LocalesApiTest.java index af1f8770..bab6b85d 100644 --- a/clients/java/src/test/java/com/phrase/client/api/LocalesApiTest.java +++ b/clients/java/src/test/java/com/phrase/client/api/LocalesApiTest.java @@ -137,10 +137,10 @@ public void localeDownloadTest() throws ApiException, IOException, InterruptedEx mockBackend.enqueue(mockResponse); - + Map nestedFormatOptionsMap = new HashMap<>(); nestedFormatOptionsMap.put("nested_option", "sub_option"); - + Map formatOptionsMap = new HashMap<>(); formatOptionsMap.put("omit_separator_space", "true"); formatOptionsMap.put("fallback_language", "en"); @@ -167,7 +167,8 @@ public void localeDownloadTest() throws ApiException, IOException, InterruptedEx Boolean useLastReviewedVersion = null; String fallbackLocaleId = null; String sourceLocaleId = null; - File response = api.localeDownload(projectId, id, xPhraseAppOTP, ifModifiedSince, ifNoneMatch, branch, fileFormat, tags, tag, includeEmptyTranslations, excludeEmptyZeroForms, includeTranslatedKeys, keepNotranslateTags, convertEmoji, formatOptions, encoding, skipUnverifiedTranslations, includeUnverifiedTranslations, useLastReviewedVersion, fallbackLocaleId, sourceLocaleId); + Object customMetadataFilters = null; + File response = api.localeDownload(projectId, id, xPhraseAppOTP, ifModifiedSince, ifNoneMatch, branch, fileFormat, tags, tag, includeEmptyTranslations, excludeEmptyZeroForms, includeTranslatedKeys, keepNotranslateTags, convertEmoji, formatOptions, encoding, skipUnverifiedTranslations, includeUnverifiedTranslations, useLastReviewedVersion, fallbackLocaleId, sourceLocaleId, customMetadataFilters); String fileContents = new String(java.nio.file.Files.readAllBytes(response.toPath())); Assert.assertEquals("Correct file contents", fileContents, body); diff --git a/doc/compiled.json b/doc/compiled.json index f7b9a545..72a692b7 100644 --- a/doc/compiled.json +++ b/doc/compiled.json @@ -7778,6 +7778,17 @@ "schema": { "type": "string" } + }, + { + "name": "custom_metadata_filters", + "in": "query", + "description": "Custom metadata filters. Provide the name of the metadata field and the value to filter by. Only keys with matching metadata will be included in the download.\n", + "schema": { + "type": "object", + "properties": {} + }, + "style": "deepObject", + "explode": true } ], "responses": { @@ -7816,7 +7827,7 @@ "x-code-samples": [ { "lang": "Curl", - "source": "curl \"https://api.phrase.com/v2/projects/:project_id/locales/:id/download?branch=my-feature-branch&file_format=yml&tags=feature1,feature2&tag=feature\" \\\n -u USERNAME_OR_ACCESS_TOKEN" + "source": "curl \"https://api.phrase.com/v2/projects/:project_id/locales/:id/download?branch=my-feature-branch&file_format=yml&tags=feature1,feature2&tag=feature&custom_metadata_filters[tone]=friendly\" \\\n -u USERNAME_OR_ACCESS_TOKEN" }, { "lang": "CLI v2", diff --git a/paths/locales/download.yaml b/paths/locales/download.yaml index 97b052a0..8d75f417 100644 --- a/paths/locales/download.yaml +++ b/paths/locales/download.yaml @@ -112,6 +112,15 @@ parameters: in: query schema: type: string + - name: custom_metadata_filters + in: query + description: | + Custom metadata filters. Provide the name of the metadata field and the value to filter by. Only keys with matching metadata will be included in the download. + schema: + type: object + properties: {} + style: deepObject + explode: true responses: "200": description: OK @@ -136,7 +145,7 @@ responses: x-code-samples: - lang: Curl source: |- - curl "https://api.phrase.com/v2/projects/:project_id/locales/:id/download?branch=my-feature-branch&file_format=yml&tags=feature1,feature2&tag=feature" \ + curl "https://api.phrase.com/v2/projects/:project_id/locales/:id/download?branch=my-feature-branch&file_format=yml&tags=feature1,feature2&tag=feature&custom_metadata_filters[tone]=friendly" \ -u USERNAME_OR_ACCESS_TOKEN - lang: CLI v2 source: |-