Skip to content

Commit b56d328

Browse files
feat(api): Add show API endpoint for custom_metadata_labels (#359)
* 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 <matias.alvarez@phrase.com>
1 parent 001effc commit b56d328

File tree

3 files changed

+109
-0
lines changed

3 files changed

+109
-0
lines changed

doc/compiled.json

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6166,6 +6166,70 @@
61666166
"x-cli-version": "2.9"
61676167
}
61686168
},
6169+
"/accounts/{account_id}/custom_metadata/labels/{id}": {
6170+
"get": {
6171+
"summary": "Get a single property",
6172+
"description": "Get details of a single custom property.",
6173+
"operationId": "custom_metadata_property/show",
6174+
"tags": [
6175+
"Custom Metadata"
6176+
],
6177+
"parameters": [
6178+
{
6179+
"$ref": "#/components/parameters/X-PhraseApp-OTP"
6180+
},
6181+
{
6182+
"$ref": "#/components/parameters/account_id"
6183+
},
6184+
{
6185+
"$ref": "#/components/parameters/id"
6186+
}
6187+
],
6188+
"responses": {
6189+
"200": {
6190+
"description": "OK",
6191+
"content": {
6192+
"application/json": {
6193+
"schema": {
6194+
"$ref": "#/components/schemas/custom_metadata_property"
6195+
}
6196+
}
6197+
},
6198+
"headers": {
6199+
"X-Rate-Limit-Limit": {
6200+
"$ref": "#/components/headers/X-Rate-Limit-Limit"
6201+
},
6202+
"X-Rate-Limit-Remaining": {
6203+
"$ref": "#/components/headers/X-Rate-Limit-Remaining"
6204+
},
6205+
"X-Rate-Limit-Reset": {
6206+
"$ref": "#/components/headers/X-Rate-Limit-Reset"
6207+
}
6208+
}
6209+
},
6210+
"400": {
6211+
"$ref": "#/components/responses/400"
6212+
},
6213+
"404": {
6214+
"$ref": "#/components/responses/404"
6215+
},
6216+
"429": {
6217+
"$ref": "#/components/responses/429"
6218+
}
6219+
},
6220+
"x-code-samples": [
6221+
{
6222+
"lang": "Curl",
6223+
"source": "curl \"https://api.phrase.com/v2/accounts/:account_id/custom_metadata/labels/:id\" \\\n -u USERNAME_OR_ACCESS_TOKEN"
6224+
},
6225+
{
6226+
"lang": "CLI v2",
6227+
"source": "phrase custom_metadata_labels show \\\n--account_id <account_id> \\\n--id <id> \\\n--access_token <token>"
6228+
}
6229+
],
6230+
"x-cli-version": "2.9"
6231+
}
6232+
},
61696233
"/accounts/{account_id}/invitations": {
61706234
"get": {
61716235
"summary": "List invitations",

paths.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@
5050
"/accounts/{account_id}/custom_metadata/labels":
5151
get:
5252
"$ref": "./paths/custom_metadata_properties/index.yaml"
53+
"/accounts/{account_id}/custom_metadata/labels/{id}":
54+
get:
55+
"$ref": "./paths/custom_metadata_properties/show.yaml"
5356
"/accounts/{account_id}/invitations":
5457
get:
5558
"$ref": "./paths/invitations/index.yaml"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
summary: Get a single property
3+
description: Get details of a single custom property.
4+
operationId: custom_metadata_property/show
5+
tags:
6+
- Custom Metadata
7+
parameters:
8+
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP"
9+
- "$ref": "../../parameters.yaml#/account_id"
10+
- "$ref": "../../parameters.yaml#/id"
11+
responses:
12+
'200':
13+
description: OK
14+
content:
15+
application/json:
16+
schema:
17+
"$ref": "../../schemas/custom_metadata_property.yaml#/custom_metadata_property"
18+
headers:
19+
X-Rate-Limit-Limit:
20+
"$ref": "../../headers.yaml#/X-Rate-Limit-Limit"
21+
X-Rate-Limit-Remaining:
22+
"$ref": "../../headers.yaml#/X-Rate-Limit-Remaining"
23+
X-Rate-Limit-Reset:
24+
"$ref": "../../headers.yaml#/X-Rate-Limit-Reset"
25+
'400':
26+
"$ref": "../../responses.yaml#/400"
27+
'404':
28+
"$ref": "../../responses.yaml#/404"
29+
'429':
30+
"$ref": "../../responses.yaml#/429"
31+
x-code-samples:
32+
- lang: Curl
33+
source: |-
34+
curl "https://api.phrase.com/v2/accounts/:account_id/custom_metadata/labels/:id" \
35+
-u USERNAME_OR_ACCESS_TOKEN
36+
- lang: CLI v2
37+
source: |-
38+
phrase custom_metadata_labels show \
39+
--account_id <account_id> \
40+
--id <id> \
41+
--access_token <token>
42+
x-cli-version: '2.9'

0 commit comments

Comments
 (0)