Skip to content

Commit

Permalink
Deploying from phrase/openapi@3623478f
Browse files Browse the repository at this point in the history
  • Loading branch information
Phrase committed Dec 13, 2023
1 parent c3deeb8 commit 2483061
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
12 changes: 11 additions & 1 deletion api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5396,6 +5396,16 @@ paths:
schema:
type: string
style: form
- 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.
explode: true
in: query
name: custom_metadata_filters
required: false
schema:
properties: {}
type: object
style: deepObject
responses:
"200":
content:
Expand Down Expand Up @@ -5444,7 +5454,7 @@ paths:
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: |-
Expand Down
7 changes: 7 additions & 0 deletions api_locales.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ type LocaleDownloadOpts struct {
UseLastReviewedVersion optional.Bool `json:"use_last_reviewed_version,omitempty"`
FallbackLocaleId optional.String `json:"fallback_locale_id,omitempty"`
SourceLocaleId optional.String `json:"source_locale_id,omitempty"`
CustomMetadataFilters optional.Interface `json:"custom_metadata_filters,omitempty"`
}

/*
Expand Down Expand Up @@ -382,6 +383,7 @@ Download a locale in a specific file format.
- @param "UseLastReviewedVersion" (optional.Bool) - 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.
- @param "FallbackLocaleId" (optional.String) - 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>.
- @param "SourceLocaleId" (optional.String) - 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.
- @param "CustomMetadataFilters" (optional.Interface of map[string]interface{}) - 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.
@return *os.File
*/
Expand Down Expand Up @@ -455,6 +457,11 @@ func (a *LocalesApiService) LocaleDownload(ctx _context.Context, projectId strin
if localVarOptionals != nil && localVarOptionals.SourceLocaleId.IsSet() {
localVarQueryParams.Add("source_locale_id", parameterToString(localVarOptionals.SourceLocaleId.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.CustomMetadataFilters.IsSet() {
for key, value := range localVarOptionals.CustomMetadataFilters.Value().(map[string]interface{}) {
localVarQueryParams.Add(fmt.Sprintf("custom_metadata_filters[%s]", key), parameterToString(value, ""))
}
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}

Expand Down
1 change: 1 addition & 0 deletions docs/LocalesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ Name | Type | Description | Notes
**useLastReviewedVersion** | **optional.Bool**| 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. |
**fallbackLocaleId** | **optional.String**| 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 &lt;code&gt;true&lt;/code&gt;. |
**sourceLocaleId** | **optional.String**| 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 &lt;code&gt;tag&lt;/code&gt; parameter indicating a specific job. |
**customMetadataFilters** | [**optional.Interface of map[string]interface{}**](.md)| 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. |

### Return type

Expand Down

0 comments on commit 2483061

Please sign in to comment.