Skip to content

Commit 07b3182

Browse files
authored
feat(API): RepoSync export: optional branch parameter (#1050)
1 parent b93ce3b commit 07b3182

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
@@ -22971,6 +22971,11 @@
2297122971
"description": "Source branch to open a pull request from",
2297222972
"type": "string",
2297322973
"example": "my-feature-branch"
22974+
},
22975+
"branch": {
22976+
"description": "Strings branch to export from",
22977+
"type": "string",
22978+
"example": "my-strings-branch"
2297422979
}
2297522980
}
2297622981
}
@@ -23012,14 +23017,13 @@
2301223017
"x-code-samples": [
2301323018
{
2301423019
"lang": "Curl",
23015-
"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\"}'"
23020+
"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\"}'"
2301623021
},
2301723022
{
2301823023
"lang": "CLI v2",
23019-
"source": "phrase repo_syncs export \\\n--id <repo_sync_id> \\\n--pr_branch my-feature-branch \\\n--access_token <token>"
23024+
"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>"
2302023025
}
23021-
],
23022-
"x-cli-version": "2.24"
23026+
]
2302323027
}
2302423028
},
2302523029
"/accounts/{account_id}/repo_syncs/{id}/import": {
@@ -23039,11 +23043,31 @@
2303923043
},
2304023044
{
2304123045
"$ref": "#/components/parameters/id"
23042-
},
23043-
{
23044-
"$ref": "#/components/parameters/branch"
2304523046
}
2304623047
],
23048+
"requestBody": {
23049+
"required": false,
23050+
"content": {
23051+
"application/json": {
23052+
"schema": {
23053+
"type": "object",
23054+
"title": "repo_sync/import/parameters",
23055+
"properties": {
23056+
"repository_branch": {
23057+
"description": "Branch to import from",
23058+
"type": "string",
23059+
"example": "my-feature-branch"
23060+
},
23061+
"branch": {
23062+
"description": "Strings branch to import to",
23063+
"type": "string",
23064+
"example": "my-strings-branch"
23065+
}
23066+
}
23067+
}
23068+
}
23069+
}
23070+
},
2304723071
"responses": {
2304823072
"200": {
2304923073
"description": "OK",
@@ -23079,32 +23103,13 @@
2307923103
"x-code-samples": [
2308023104
{
2308123105
"lang": "Curl",
23082-
"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'"
23106+
"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'"
2308323107
},
2308423108
{
2308523109
"lang": "CLI v2",
23086-
"source": "phrase repo_syncs import \\\n--id <repo_sync_id> \\\n--data '{\"repository_branch\":\"my-feature-branch\"}' \\\n--access_token <token>"
23110+
"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>"
2308723111
}
23088-
],
23089-
"requestBody": {
23090-
"required": false,
23091-
"content": {
23092-
"application/json": {
23093-
"schema": {
23094-
"type": "object",
23095-
"title": "repo_sync/import/parameters",
23096-
"properties": {
23097-
"repository_branch": {
23098-
"description": "Branch to import from",
23099-
"type": "string",
23100-
"example": "my-feature-branch"
23101-
}
23102-
}
23103-
}
23104-
}
23105-
}
23106-
},
23107-
"x-cli-version": "2.24"
23112+
]
2310823113
}
2310923114
},
2311023115
"/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)