Skip to content

Commit a6e22df

Browse files
author
Phrase
committed
1 parent 5b3bd76 commit a6e22df

File tree

7 files changed

+52
-3
lines changed

7 files changed

+52
-3
lines changed

.openapi-generator/FILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ docs/ReleasesApi.md
255255
docs/RepoSync.md
256256
docs/RepoSyncEvent.md
257257
docs/RepoSyncEventsApi.md
258+
docs/RepoSyncImportParameters.md
258259
docs/RepoSyncsApi.md
259260
docs/ReportsApi.md
260261
docs/Screenshot.md
@@ -494,6 +495,7 @@ model_release_update_parameters.go
494495
model_release_update_parameters_1.go
495496
model_repo_sync.go
496497
model_repo_sync_event.go
498+
model_repo_sync_import_parameters.go
497499
model_screenshot.go
498500
model_screenshot_marker.go
499501
model_screenshot_marker_create_parameters.go

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ Class | Method | HTTP request | Description
514514
- [ReleaseUpdateParameters1](docs/ReleaseUpdateParameters1.md)
515515
- [RepoSync](docs/RepoSync.md)
516516
- [RepoSyncEvent](docs/RepoSyncEvent.md)
517+
- [RepoSyncImportParameters](docs/RepoSyncImportParameters.md)
517518
- [Screenshot](docs/Screenshot.md)
518519
- [ScreenshotMarker](docs/ScreenshotMarker.md)
519520
- [ScreenshotMarkerCreateParameters](docs/ScreenshotMarkerCreateParameters.md)

api/openapi.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20823,6 +20823,12 @@ paths:
2082320823
schema:
2082420824
type: string
2082520825
style: simple
20826+
requestBody:
20827+
content:
20828+
application/json:
20829+
schema:
20830+
$ref: '#/components/schemas/repo_sync_import_parameters'
20831+
required: false
2082620832
responses:
2082720833
"200":
2082820834
content:
@@ -20873,11 +20879,13 @@ paths:
2087320879
curl "https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/45ef6789/import"\
2087420880
-u USERNAME_OR_ACCESS_TOKEN \
2087520881
-X POST \
20882+
-d '{"repository_branch":"my-feature-branch"}' \
2087620883
-H 'Content-Type: application/json'
2087720884
- lang: CLI v2
2087820885
source: |-
2087920886
phrase repo_syncs import \
2088020887
--id <repo_sync_id> \
20888+
--data '{"repository_branch":"my-feature-branch"}' \
2088120889
--access_token <token>
2088220890
x-cli-version: "2.24"
2088320891
/accounts/{account_id}/repo_syncs/{id}/events:
@@ -34556,6 +34564,14 @@ components:
3455634564
score: 0.95
3455734565
id: translation_id_2
3455834566
errors: []
34567+
repo_sync_import_parameters:
34568+
properties:
34569+
repository_branch:
34570+
description: Branch to import from
34571+
example: my-feature-branch
34572+
type: string
34573+
title: repo_sync/import/parameters
34574+
type: object
3455934575
space_create_parameters:
3456034576
properties:
3456134577
name:

api_repo_syncs.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,8 @@ func (a *RepoSyncsApiService) RepoSyncExport(ctx _context.Context, accountId str
332332

333333
// RepoSyncImportOpts Optional parameters for the method 'RepoSyncImport'
334334
type RepoSyncImportOpts struct {
335-
XPhraseAppOTP optional.String `json:"X-PhraseApp-OTP,omitempty"`
335+
XPhraseAppOTP optional.String `json:"X-PhraseApp-OTP,omitempty"`
336+
RepoSyncImportParameters optional.Interface `json:"RepoSyncImportParameters,omitempty"`
336337
}
337338

338339
/*
@@ -343,6 +344,7 @@ Import translations from repository provider to Phrase Strings according to the
343344
- @param id ID
344345
- @param optional nil or *RepoSyncImportOpts - Optional Parameters:
345346
- @param "XPhraseAppOTP" (optional.String) - Two-Factor-Authentication token (optional)
347+
- @param "RepoSyncImportParameters" (optional.Interface of RepoSyncImportParameters) -
346348
347349
@return RepoSyncEvent
348350
*/
@@ -367,7 +369,7 @@ func (a *RepoSyncsApiService) RepoSyncImport(ctx _context.Context, accountId str
367369
localVarFormParams := _neturl.Values{}
368370

369371
// to determine the Content-Type header
370-
localVarHTTPContentTypes := []string{}
372+
localVarHTTPContentTypes := []string{"application/json"}
371373

372374
// set Content-Type header
373375
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
@@ -386,6 +388,15 @@ func (a *RepoSyncsApiService) RepoSyncImport(ctx _context.Context, accountId str
386388
if localVarOptionals != nil && localVarOptionals.XPhraseAppOTP.IsSet() {
387389
localVarHeaderParams["X-PhraseApp-OTP"] = parameterToString(localVarOptionals.XPhraseAppOTP.Value(), "")
388390
}
391+
// body params
392+
if localVarOptionals != nil && localVarOptionals.RepoSyncImportParameters.IsSet() {
393+
localVarOptionalRepoSyncImportParameters, localVarOptionalRepoSyncImportParametersok := localVarOptionals.RepoSyncImportParameters.Value().(RepoSyncImportParameters)
394+
if !localVarOptionalRepoSyncImportParametersok {
395+
return localVarReturnValue, nil, reportError("repoSyncImportParameters should be RepoSyncImportParameters")
396+
}
397+
localVarPostBody = &localVarOptionalRepoSyncImportParameters
398+
}
399+
389400
if ctx != nil {
390401
// API Key Authentication
391402
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {

docs/RepoSyncImportParameters.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# RepoSyncImportParameters
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**RepositoryBranch** | **string** | Branch to import from | [optional]
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+

docs/RepoSyncsApi.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ Optional parameters are passed through a pointer to a RepoSyncImportOpts struct
174174
Name | Type | Description | Notes
175175
------------- | ------------- | ------------- | -------------
176176
**xPhraseAppOTP** | **optional.String**| Two-Factor-Authentication token (optional) |
177+
**repoSyncImportParameters** | [**optional.Interface of RepoSyncImportParameters**](RepoSyncImportParameters.md)| |
177178

178179
### Return type
179180

@@ -185,7 +186,7 @@ Name | Type | Description | Notes
185186

186187
### HTTP request headers
187188

188-
- **Content-Type**: Not defined
189+
- **Content-Type**: application/json
189190
- **Accept**: application/json
190191

191192
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package phrase
2+
3+
// RepoSyncImportParameters struct for RepoSyncImportParameters
4+
type RepoSyncImportParameters struct {
5+
// Branch to import from
6+
RepositoryBranch string `json:"repository_branch,omitempty"`
7+
}

0 commit comments

Comments
 (0)