Skip to content

Commit 47b8491

Browse files
committed
feat(API): RepoSync export: optional branch parameter
1 parent f4c8447 commit 47b8491

3 files changed

Lines changed: 58 additions & 48 deletions

File tree

doc/compiled.json

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -22910,6 +22910,11 @@
2291022910
"description": "Source branch to open a pull request from",
2291122911
"type": "string",
2291222912
"example": "my-feature-branch"
22913+
},
22914+
"branch": {
22915+
"description": "Strings branch to export from",
22916+
"type": "string",
22917+
"example": "my-strings-branch"
2291322918
}
2291422919
}
2291522920
}
@@ -22951,14 +22956,13 @@
2295122956
"x-code-samples": [
2295222957
{
2295322958
"lang": "Curl",
22954-
"source": "curl \"https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/45ef6789/export\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X POST \\\n -H 'Content-Type: application/json' \\\n -d '{\"pr_branch\":\"my-feature-branch\"}'"
22959+
"source": "curl \"https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/45ef6789/export\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X POST \\\n -H 'Content-Type: application/json' \\\n -d '{\"pr_branch\":\"my-feature-branch\", \"branch\":\"my-strings-branch\"}'"
2295522960
},
2295622961
{
2295722962
"lang": "CLI v2",
22958-
"source": "phrase repo_syncs export \\\n--id <repo_sync_id> \\\n--pr_branch my-feature-branch \\\n--access_token <token>"
22963+
"source": "phrase repo_syncs export \\\n--id <repo_sync_id> \\\n--data '{\"pr_branch\":\"my-feature-branch\", \"branch\":\"my-strings-branch\"}' \\\n--access_token <token>"
2295922964
}
22960-
],
22961-
"x-cli-version": "2.24"
22965+
]
2296222966
}
2296322967
},
2296422968
"/accounts/{account_id}/repo_syncs/{id}/import": {
@@ -22978,11 +22982,31 @@
2297822982
},
2297922983
{
2298022984
"$ref": "#/components/parameters/id"
22981-
},
22982-
{
22983-
"$ref": "#/components/parameters/branch"
2298422985
}
2298522986
],
22987+
"requestBody": {
22988+
"required": false,
22989+
"content": {
22990+
"application/json": {
22991+
"schema": {
22992+
"type": "object",
22993+
"title": "repo_sync/import/parameters",
22994+
"properties": {
22995+
"repository_branch": {
22996+
"description": "Branch to import from",
22997+
"type": "string",
22998+
"example": "my-feature-branch"
22999+
},
23000+
"branch": {
23001+
"description": "Strings branch to import to",
23002+
"type": "string",
23003+
"example": "my-strings-branch"
23004+
}
23005+
}
23006+
}
23007+
}
23008+
}
23009+
},
2298623010
"responses": {
2298723011
"200": {
2298823012
"description": "OK",
@@ -23018,32 +23042,13 @@
2301823042
"x-code-samples": [
2301923043
{
2302023044
"lang": "Curl",
23021-
"source": "curl \"https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/45ef6789/import\"\\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X POST \\\n -d '{\"repository_branch\":\"my-feature-branch\"}' \\\n -H 'Content-Type: application/json'"
23045+
"source": "curl \"https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/45ef6789/import\"\\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X POST \\\n -d '{\"repository_branch\":\"my-feature-branch\", \"branch\":\"my-strings-branch\"}' \\\n -H 'Content-Type: application/json'"
2302223046
},
2302323047
{
2302423048
"lang": "CLI v2",
23025-
"source": "phrase repo_syncs import \\\n--id <repo_sync_id> \\\n--data '{\"repository_branch\":\"my-feature-branch\"}' \\\n--access_token <token>"
23049+
"source": "phrase repo_syncs import \\\n--id <repo_sync_id> \\\n--data '{\"repository_branch\":\"my-feature-branch\", \"branch\":\"my-strings-branch\"}' \\\n--access_token <token>"
2302623050
}
23027-
],
23028-
"requestBody": {
23029-
"required": false,
23030-
"content": {
23031-
"application/json": {
23032-
"schema": {
23033-
"type": "object",
23034-
"title": "repo_sync/import/parameters",
23035-
"properties": {
23036-
"repository_branch": {
23037-
"description": "Branch to import from",
23038-
"type": "string",
23039-
"example": "my-feature-branch"
23040-
}
23041-
}
23042-
}
23043-
}
23044-
}
23045-
},
23046-
"x-cli-version": "2.24"
23051+
]
2304723052
}
2304823053
},
2304923054
"/accounts/{account_id}/repo_syncs/{id}/events": {

paths/repo_syncs/export.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ requestBody:
2424
description: Source branch to open a pull request from
2525
type: string
2626
example: my-feature-branch
27+
branch:
28+
description: Strings branch to export from
29+
type: string
30+
example: my-strings-branch
2731
responses:
2832
'200':
2933
description: OK
@@ -51,11 +55,10 @@ x-code-samples:
5155
-u USERNAME_OR_ACCESS_TOKEN \
5256
-X POST \
5357
-H 'Content-Type: application/json' \
54-
-d '{"pr_branch":"my-feature-branch"}'
58+
-d '{"pr_branch":"my-feature-branch", "branch":"my-strings-branch"}'
5559
- lang: CLI v2
5660
source: |-
5761
phrase repo_syncs export \
5862
--id <repo_sync_id> \
59-
--pr_branch my-feature-branch \
63+
--data '{"pr_branch":"my-feature-branch", "branch":"my-strings-branch"}' \
6064
--access_token <token>
61-
x-cli-version: '2.24'

paths/repo_syncs/import.yaml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,22 @@ parameters:
1212
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP"
1313
- "$ref": "../../parameters.yaml#/account_id"
1414
- "$ref": "../../parameters.yaml#/id"
15-
- "$ref": "../../parameters.yaml#/branch"
15+
requestBody:
16+
required: false
17+
content:
18+
application/json:
19+
schema:
20+
type: object
21+
title: repo_sync/import/parameters
22+
properties:
23+
repository_branch:
24+
description: Branch to import from
25+
type: string
26+
example: my-feature-branch
27+
branch:
28+
description: Strings branch to import to
29+
type: string
30+
example: my-strings-branch
1631
responses:
1732
'200':
1833
description: OK
@@ -39,24 +54,11 @@ x-code-samples:
3954
curl "https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/45ef6789/import"\
4055
-u USERNAME_OR_ACCESS_TOKEN \
4156
-X POST \
42-
-d '{"repository_branch":"my-feature-branch"}' \
57+
-d '{"repository_branch":"my-feature-branch", "branch":"my-strings-branch"}' \
4358
-H 'Content-Type: application/json'
4459
- lang: CLI v2
4560
source: |-
4661
phrase repo_syncs import \
4762
--id <repo_sync_id> \
48-
--data '{"repository_branch":"my-feature-branch"}' \
63+
--data '{"repository_branch":"my-feature-branch", "branch":"my-strings-branch"}' \
4964
--access_token <token>
50-
requestBody:
51-
required: false
52-
content:
53-
application/json:
54-
schema:
55-
type: object
56-
title: repo_sync/import/parameters
57-
properties:
58-
repository_branch:
59-
description: Branch to import from
60-
type: string
61-
example: my-feature-branch
62-
x-cli-version: '2.24'

0 commit comments

Comments
 (0)