Skip to content

Commit

Permalink
add CM to create/update keys
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyshchang committed Dec 7, 2023
1 parent 52b1844 commit 1969c33
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
24 changes: 20 additions & 4 deletions doc/compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -19897,11 +19897,11 @@
"x-code-samples": [
{
"lang": "Curl",
"source": "curl \"https://api.phrase.com/v2/projects/:project_id/keys\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X POST \\\n -F branch=my-feature-branch \\\n -F name=home.index.headline \\\n -F description=Some%20description%20worth%20knowing... \\\n -F name_plural=home.index.headlines \\\n -F data_type=number \\\n -F tags=awesome-feature,needs-proofreading \\\n -F max_characters_allowed=140 \\\n -F screenshot=@/path/to/my/screenshot.png"
"source": "curl \"https://api.phrase.com/v2/projects/:project_id/keys\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X POST \\\n -F branch=my-feature-branch \\\n -F name=home.index.headline \\\n -F description=Some%20description%20worth%20knowing... \\\n -F name_plural=home.index.headlines \\\n -F data_type=number \\\n -F tags=awesome-feature,needs-proofreading \\\n -F max_characters_allowed=140 \\\n -F screenshot=@/path/to/my/screenshot.png\n -F custom_metadata[property]=value"
},
{
"lang": "CLI v2",
"source": "phrase keys create \\\n--project_id <project_id> \\\n--data '{\"branch\":\"my-feature-branch\", \"name\":\"home.index.headline\", \"description\": \"Some description worth knowing...\", \"name_plural\":\"home.index.headlines\", \"data_type\":\"number\", \"tags\":\"awesome-feature,needs-proofreading\", \"max_characters_allowed\":\"140\", \"screenshot\":\"/path/to/my/screenshot.png\"}' \\\n--access_token <token>"
"source": "phrase keys create \\\n--project_id <project_id> \\\n--data '{\"branch\":\"my-feature-branch\", \"name\":\"home.index.headline\", \"description\": \"Some description worth knowing...\", \"name_plural\":\"home.index.headlines\", \"data_type\":\"number\", \"tags\":\"awesome-feature,needs-proofreading\", \"max_characters_allowed\":\"140\", \"screenshot\":\"/path/to/my/screenshot.png\", \"custom_metadata\": {\"property\" => \"value\"}}' \\\n--access_token <token>"
}
],
"requestBody": {
Expand Down Expand Up @@ -19994,6 +19994,14 @@
"description": "NSStringLocalizedFormatKey attribute. Used in .stringsdict format.",
"type": "string",
"example": null
},
"custom_metadata": {
"description": "Custom metadata property name and value pairs to be associated with key.",
"type": "object",
"example": {
"fruit": "Apple",
"vegetable": "Tomato"
}
}
}
}
Expand Down Expand Up @@ -20322,11 +20330,11 @@
"x-code-samples": [
{
"lang": "Curl",
"source": "curl \"https://api.phrase.com/v2/projects/:project_id/keys/:id\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X PATCH \\\n -F branch=my-feature-branch \\\n -F name=home.index.headline \\\n -F description=Some%20description%20worth%20knowing... \\\n -F name_plural=home.index.headlines \\\n -F data_type=number \\\n -F tags=awesome-feature,needs-proofreading \\\n -F max_characters_allowed=140 \\\n -F screenshot=@/path/to/my/screenshot.png"
"source": "curl \"https://api.phrase.com/v2/projects/:project_id/keys/:id\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X PATCH \\\n -F branch=my-feature-branch \\\n -F name=home.index.headline \\\n -F description=Some%20description%20worth%20knowing... \\\n -F name_plural=home.index.headlines \\\n -F data_type=number \\\n -F tags=awesome-feature,needs-proofreading \\\n -F max_characters_allowed=140 \\\n -F screenshot=@/path/to/my/screenshot.png\n -F custom_metadata[property]=value"
},
{
"lang": "CLI v2",
"source": "phrase keys update \\\n--project_id <project_id> \\\n--id <id> \\\n--data '{\"branch\":\"my-feature-branch\", \"name\":\"home.index.headline\", \"description\": \"Some description worth knowing...\", \"name_plural\":\"home.index.headlines\", \"data_type\":\"number\", \"tags\":\"awesome-feature,needs-proofreading\", \"max_characters_allowed\":\"140\", \"screenshot\":\"/path/to/my/screenshot.png\"}' \\\n--access_token <token>"
"source": "phrase keys update \\\n--project_id <project_id> \\\n--id <id> \\\n--data '{\"branch\":\"my-feature-branch\", \"name\":\"home.index.headline\", \"description\": \"Some description worth knowing...\", \"name_plural\":\"home.index.headlines\", \"data_type\":\"number\", \"tags\":\"awesome-feature,needs-proofreading\", \"max_characters_allowed\":\"140\", \"screenshot\":\"/path/to/my/screenshot.png\", \"custom_metadata\": {\"property\" => \"value\"}}' \\\n--access_token <token>"
}
],
"requestBody": {
Expand Down Expand Up @@ -20414,6 +20422,14 @@
"description": "NSStringLocalizedFormatKey attribute. Used in .stringsdict format.",
"type": "string",
"example": null
},
"custom_metadata": {
"description": "Custom metadata property name and value pairs to be associated with key.",
"type": "object",
"example": {
"fruit": "Apple",
"vegetable": "Tomato"
}
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions paths/keys/create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,8 @@ requestBody:
custom_metadata:
description: Custom metadata property name and value pairs to be associated with key.
type: object
example:
fruit: Apple
vegetable: Tomato

x-cli-version: '2.5'
9 changes: 8 additions & 1 deletion paths/keys/update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ x-code-samples:
-F tags=awesome-feature,needs-proofreading \
-F max_characters_allowed=140 \
-F screenshot=@/path/to/my/screenshot.png
-F custom_metadata[property]=value
- lang: CLI v2
source: |-
phrase keys update \
--project_id <project_id> \
--id <id> \
--data '{"branch":"my-feature-branch", "name":"home.index.headline", "description": "Some description worth knowing...", "name_plural":"home.index.headlines", "data_type":"number", "tags":"awesome-feature,needs-proofreading", "max_characters_allowed":"140", "screenshot":"/path/to/my/screenshot.png"}' \
--data '{"branch":"my-feature-branch", "name":"home.index.headline", "description": "Some description worth knowing...", "name_plural":"home.index.headlines", "data_type":"number", "tags":"awesome-feature,needs-proofreading", "max_characters_allowed":"140", "screenshot":"/path/to/my/screenshot.png", "custom_metadata": {"property" => "value"}}' \
--access_token <token>
requestBody:
required: true
Expand Down Expand Up @@ -120,4 +121,10 @@ requestBody:
description: NSStringLocalizedFormatKey attribute. Used in .stringsdict format.
type: string
example:
custom_metadata:
description: Custom metadata property name and value pairs to be associated with key.
type: object
example:
fruit: Apple
vegetable: Tomato
x-cli-version: '2.5'

0 comments on commit 1969c33

Please sign in to comment.