Skip to content

Commit

Permalink
feat(api): Add show API endpoint for custom_metadata_labels (#359)
Browse files Browse the repository at this point in the history
* add paths for custom metadata show

* align tag

* make summary and description more clear and concise

* fix path with namespace

* specify version 2.9

* update compiled json

* change from label to property for consistency

* fix merge conflicts

* remove unused branch param

* compile docs

---------

Co-authored-by: Matias Alvarez <[email protected]>
  • Loading branch information
anthonyshchang and malvarezphrase authored Dec 5, 2023
1 parent 001effc commit b56d328
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 0 deletions.
64 changes: 64 additions & 0 deletions doc/compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -6166,6 +6166,70 @@
"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"
}
},
"/accounts/{account_id}/invitations": {
"get": {
"summary": "List invitations",
Expand Down
3 changes: 3 additions & 0 deletions paths.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
"/accounts/{account_id}/custom_metadata/labels":
get:
"$ref": "./paths/custom_metadata_properties/index.yaml"
"/accounts/{account_id}/custom_metadata/labels/{id}":
get:
"$ref": "./paths/custom_metadata_properties/show.yaml"
"/accounts/{account_id}/invitations":
get:
"$ref": "./paths/invitations/index.yaml"
Expand Down
42 changes: 42 additions & 0 deletions paths/custom_metadata_properties/show.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
summary: Get a single property
description: Get details of a single custom property.
operationId: custom_metadata_property/show
tags:
- Custom Metadata
parameters:
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP"
- "$ref": "../../parameters.yaml#/account_id"
- "$ref": "../../parameters.yaml#/id"
responses:
'200':
description: OK
content:
application/json:
schema:
"$ref": "../../schemas/custom_metadata_property.yaml#/custom_metadata_property"
headers:
X-Rate-Limit-Limit:
"$ref": "../../headers.yaml#/X-Rate-Limit-Limit"
X-Rate-Limit-Remaining:
"$ref": "../../headers.yaml#/X-Rate-Limit-Remaining"
X-Rate-Limit-Reset:
"$ref": "../../headers.yaml#/X-Rate-Limit-Reset"
'400':
"$ref": "../../responses.yaml#/400"
'404':
"$ref": "../../responses.yaml#/404"
'429':
"$ref": "../../responses.yaml#/429"
x-code-samples:
- lang: Curl
source: |-
curl "https://api.phrase.com/v2/accounts/:account_id/custom_metadata/labels/:id" \
-u USERNAME_OR_ACCESS_TOKEN
- lang: CLI v2
source: |-
phrase custom_metadata_labels show \
--account_id <account_id> \
--id <id> \
--access_token <token>
x-cli-version: '2.9'

0 comments on commit b56d328

Please sign in to comment.