Skip to content

Commit

Permalink
nest create under collection
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyshchang committed Dec 6, 2023
1 parent 0978091 commit 7ca6c3d
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 74 deletions.
135 changes: 66 additions & 69 deletions doc/compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -6178,70 +6178,6 @@
}
],
"x-cli-version": "2.9"
}
},
"/accounts/{account_id}/custom_metadata/labels/{id}": {
"get": {
"summary": "Get a single property",
"description": "Get details of a single custom property.",
"operationId": "custom_metadata_property/show",
"tags": [
"Custom Metadata"
],
"parameters": [
{
"$ref": "#/components/parameters/X-PhraseApp-OTP"
},
{
"$ref": "#/components/parameters/account_id"
},
{
"$ref": "#/components/parameters/id"
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/custom_metadata_property"
}
}
},
"headers": {
"X-Rate-Limit-Limit": {
"$ref": "#/components/headers/X-Rate-Limit-Limit"
},
"X-Rate-Limit-Remaining": {
"$ref": "#/components/headers/X-Rate-Limit-Remaining"
},
"X-Rate-Limit-Reset": {
"$ref": "#/components/headers/X-Rate-Limit-Reset"
}
}
},
"400": {
"$ref": "#/components/responses/400"
},
"404": {
"$ref": "#/components/responses/404"
},
"429": {
"$ref": "#/components/responses/429"
}
},
"x-code-samples": [
{
"lang": "Curl",
"source": "curl \"https://api.phrase.com/v2/accounts/:account_id/custom_metadata/labels/:id\" \\\n -u USERNAME_OR_ACCESS_TOKEN"
},
{
"lang": "CLI v2",
"source": "phrase custom_metadata_labels show \\\n--account_id <account_id> \\\n--id <id> \\\n--access_token <token>"
}
],
"x-cli-version": "2.9"
},
"post": {
"summary": "Create a property",
Expand All @@ -6257,9 +6193,6 @@
{
"$ref": "#/components/parameters/account_id"
},
{
"$ref": "#/components/parameters/id"
},
{
"description": "name of the property",
"example": [
Expand Down Expand Up @@ -6354,11 +6287,75 @@
"x-code-samples": [
{
"lang": "Curl",
"source": "curl \"https://api.phrase.com/v2/accounts/:account_id/custom_metadata/labels/:id\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X POST \\\n -d '{\"name\":\"Fruit\",\"description\":\"A healthy snack for all ages\",\"project_ids\":[\"1\",\"2\",\"3\"],\"value_options\":[\"apple\",\"banana\",\"coconut\"]}' \\\n -H 'Content-Type: application/json'"
"source": "curl \"https://api.phrase.com/v2/accounts/:account_id/custom_metadata/labels\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X POST \\\n -d '{\"name\":\"Fruit\",\"description\":\"A healthy snack for all ages\",\"project_ids\":[\"1\",\"2\",\"3\"],\"value_options\":[\"apple\",\"banana\",\"coconut\"]}' \\\n -H 'Content-Type: application/json'"
},
{
"lang": "CLI v2",
"source": "phrase custom_metadata_properties create \\\n--account_id <account_id> \\\n--id <id> \\\n--data '{\"name\":\"Fruit\",\"description\":\"A healthy snack for all ages\",\"project_ids\":[\"1\",\"2\",\"3\"],\"value_options\":[\"apple\",\"banana\",\"coconut\"]}' \\\n--access_token <token>"
"source": "phrase custom_metadata_properties create \\\n--account_id <account_id> \\\n--data '{\"name\":\"Fruit\",\"description\":\"A healthy snack for all ages\",\"project_ids\":[\"1\",\"2\",\"3\"],\"value_options\":[\"apple\",\"banana\",\"coconut\"]}' \\\n--access_token <token>"
}
],
"x-cli-version": "2.9"
}
},
"/accounts/{account_id}/custom_metadata/labels/{id}": {
"get": {
"summary": "Get a single property",
"description": "Get details of a single custom property.",
"operationId": "custom_metadata_property/show",
"tags": [
"Custom Metadata"
],
"parameters": [
{
"$ref": "#/components/parameters/X-PhraseApp-OTP"
},
{
"$ref": "#/components/parameters/account_id"
},
{
"$ref": "#/components/parameters/id"
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/custom_metadata_property"
}
}
},
"headers": {
"X-Rate-Limit-Limit": {
"$ref": "#/components/headers/X-Rate-Limit-Limit"
},
"X-Rate-Limit-Remaining": {
"$ref": "#/components/headers/X-Rate-Limit-Remaining"
},
"X-Rate-Limit-Reset": {
"$ref": "#/components/headers/X-Rate-Limit-Reset"
}
}
},
"400": {
"$ref": "#/components/responses/400"
},
"404": {
"$ref": "#/components/responses/404"
},
"429": {
"$ref": "#/components/responses/429"
}
},
"x-code-samples": [
{
"lang": "Curl",
"source": "curl \"https://api.phrase.com/v2/accounts/:account_id/custom_metadata/labels/:id\" \\\n -u USERNAME_OR_ACCESS_TOKEN"
},
{
"lang": "CLI v2",
"source": "phrase custom_metadata_labels show \\\n--account_id <account_id> \\\n--id <id> \\\n--access_token <token>"
}
],
"x-cli-version": "2.9"
Expand Down
4 changes: 2 additions & 2 deletions paths.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@
"/accounts/{account_id}/custom_metadata/labels":
get:
"$ref": "./paths/custom_metadata_properties/index.yaml"
post:
"$ref": "./paths/custom_metadata_properties/create.yaml"
"/accounts/{account_id}/custom_metadata/labels/{id}":
get:
"$ref": "./paths/custom_metadata_properties/show.yaml"
post:
"$ref": "./paths/custom_metadata_properties/create.yaml"
patch:
"$ref": "./paths/custom_metadata_properties/update.yaml"
delete:
Expand Down
4 changes: 1 addition & 3 deletions paths/custom_metadata_properties/create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ tags:
parameters:
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP"
- "$ref": "../../parameters.yaml#/account_id"
- "$ref": "../../parameters.yaml#/id"
- description: name of the property
example:
- Fruit
Expand Down Expand Up @@ -68,7 +67,7 @@ responses:
x-code-samples:
- lang: Curl
source: |-
curl "https://api.phrase.com/v2/accounts/:account_id/custom_metadata/labels/:id" \
curl "https://api.phrase.com/v2/accounts/:account_id/custom_metadata/labels" \
-u USERNAME_OR_ACCESS_TOKEN \
-X POST \
-d '{"name":"Fruit","description":"A healthy snack for all ages","project_ids":["1","2","3"],"value_options":["apple","banana","coconut"]}' \
Expand All @@ -77,7 +76,6 @@ x-code-samples:
source: |-
phrase custom_metadata_properties create \
--account_id <account_id> \
--id <id> \
--data '{"name":"Fruit","description":"A healthy snack for all ages","project_ids":["1","2","3"],"value_options":["apple","banana","coconut"]}' \
--access_token <token>
x-cli-version: '2.9'

0 comments on commit 7ca6c3d

Please sign in to comment.