From b56d3289eb3e1b254f1039a3620a0ef9397a74c5 Mon Sep 17 00:00:00 2001 From: anthonyshchang <108525179+anthonyshchang@users.noreply.github.com> Date: Tue, 5 Dec 2023 16:45:23 +0100 Subject: [PATCH] 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 --- doc/compiled.json | 64 ++++++++++++++++++++++ paths.yaml | 3 + paths/custom_metadata_properties/show.yaml | 42 ++++++++++++++ 3 files changed, 109 insertions(+) create mode 100644 paths/custom_metadata_properties/show.yaml diff --git a/doc/compiled.json b/doc/compiled.json index 2788f64d..6016dcee 100644 --- a/doc/compiled.json +++ b/doc/compiled.json @@ -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 \\\n--id \\\n--access_token " + } + ], + "x-cli-version": "2.9" + } + }, "/accounts/{account_id}/invitations": { "get": { "summary": "List invitations", diff --git a/paths.yaml b/paths.yaml index 82b59fa2..b5457407 100644 --- a/paths.yaml +++ b/paths.yaml @@ -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" diff --git a/paths/custom_metadata_properties/show.yaml b/paths/custom_metadata_properties/show.yaml new file mode 100644 index 00000000..5bbdc2b8 --- /dev/null +++ b/paths/custom_metadata_properties/show.yaml @@ -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 \ + --id \ + --access_token +x-cli-version: '2.9'