Skip to content

Commit

Permalink
fix parameter definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyshchang committed Nov 30, 2023
1 parent a56a258 commit 001effc
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 45 deletions.
51 changes: 25 additions & 26 deletions doc/compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,7 @@
"multi_select",
"number",
"single_select",
"string",
"text"
]
},
Expand Down Expand Up @@ -4214,6 +4215,16 @@
"type": "string"
}
},
"data_type": {
"in": "query",
"name": "data_type",
"description": "Data Type of Custom Metadata Property",
"required": false,
"schema": {
"type": "string"
},
"example": "boolean"
},
"query_account_id": {
"in": "query",
"name": "account_id",
Expand Down Expand Up @@ -6053,7 +6064,7 @@
"x-cli-version": "2.5"
}
},
"/accounts/{account_id}/custom_metadata/properties": {
"/accounts/{account_id}/custom_metadata/labels": {
"get": {
"summary": "List properties",
"description": "List all custom metadata properties for an account.\n\nThis endpoint is only available to accounts with advanced plans or above.\n",
Expand All @@ -6066,39 +6077,27 @@
"$ref": "#/components/parameters/X-PhraseApp-OTP"
},
{
"$ref": "#/components/parameters/account_id"
},
{
"$ref": "#/components/parameters/page"
},
{
"$ref": "#/components/parameters/per_page"
},
{
"description": "specify the branch to use",
"example": "my-feature-branch",
"name": "branch",
"in": "query",
"schema": {
"type": "string"
}
"$ref": "#/components/parameters/data_type"
},
{
"description": "ids of projects that the properties belong to",
"description": "id of project that the properties belong to",
"example": [
"abcd1234cdef1234abcd1234cdef1234"
],
"name": "project_ids",
"name": "project_id",
"in": "query",
"schema": {
"type": "array",
"items": {
"type": "string"
}
"type": "string"
}
},
{
"description": "Sort criteria. Can be one of: key_name, created_at, updated_at.",
"$ref": "#/components/parameters/page"
},
{
"$ref": "#/components/parameters/per_page"
},
{
"description": "Sort criteria. Can be one of: name, data_type, created_at.",
"example": "updated_at",
"name": "sort",
"in": "query",
Expand Down Expand Up @@ -6157,11 +6156,11 @@
"x-code-samples": [
{
"lang": "Curl",
"source": "curl \"https://api.phrase.com/v2/accounts/:account_id/custom_metadata/labels?branch=my-feature-branch&page=1&per_page=10&project_ids=%5B1,2,3%5D&sort=created_at&order=desc\" \\\n -u USERNAME_OR_ACCESS_TOKEN"
"source": "curl \"https://api.phrase.com/v2/accounts/:account_id/custom_metadata/labels?data_type=boolean&project_id=1&page=1&per_page=10&sort=created_at&order=desc\" \\\n -u USERNAME_OR_ACCESS_TOKEN"
},
{
"lang": "CLI v2",
"source": "phrase custom_metadata_properties list \\\n--account_id <account_id> \\\n--branch my-feature-branch \\\n--page 1 \\\n--per_page 10 \\\n--project_ids [1,2,3] \\\n--sort created_at \\\n--order desc \\\n--access_token <token>"
"source": "phrase custom_metadata_properties list \\\n--account_id <account_id> \\\n--data_type boolean \\\n--project_id 1 \\\n--page 1 \\\n--per_page 10 \\\n--sort created_at \\\n--order desc \\\n--access_token <token>"
}
],
"x-cli-version": "2.9"
Expand Down
8 changes: 8 additions & 0 deletions parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ account_id:
required: true
schema:
type: string
data_type:
in: query
name: data_type
description: Data Type of Custom Metadata Property
required: false
schema:
type: string
example: boolean
query_account_id:
in: query
name: account_id
Expand Down
2 changes: 1 addition & 1 deletion paths.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"$ref": "./paths/styleguides/update.yaml"
delete:
"$ref": "./paths/styleguides/destroy.yaml"
"/accounts/{account_id}/custom_metadata/properties":
"/accounts/{account_id}/custom_metadata/labels":
get:
"$ref": "./paths/custom_metadata_properties/index.yaml"
"/accounts/{account_id}/invitations":
Expand Down
28 changes: 10 additions & 18 deletions paths/custom_metadata_properties/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,17 @@ tags:
- Custom Metadata
parameters:
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP"
- "$ref": "../../parameters.yaml#/account_id"
- "$ref": "../../parameters.yaml#/page"
- "$ref": "../../parameters.yaml#/per_page"
- description: specify the branch to use
example: my-feature-branch
name: branch
in: query
schema:
type: string
- description: ids of projects that the properties belong to
- "$ref": "../../parameters.yaml#/data_type"
- description: id of project that the properties belong to
example:
- abcd1234cdef1234abcd1234cdef1234
name: project_ids
name: project_id
in: query
schema:
type: array
items:
type: string
- description: 'Sort criteria. Can be one of: key_name, created_at, updated_at.'
type: string
- "$ref": "../../parameters.yaml#/page"
- "$ref": "../../parameters.yaml#/per_page"
- description: 'Sort criteria. Can be one of: name, data_type, created_at.'
example: updated_at
name: sort
in: query
Expand Down Expand Up @@ -66,16 +58,16 @@ responses:
x-code-samples:
- lang: Curl
source: |-
curl "https://api.phrase.com/v2/accounts/:account_id/custom_metadata/labels?branch=my-feature-branch&page=1&per_page=10&project_ids=%5B1,2,3%5D&sort=created_at&order=desc" \
curl "https://api.phrase.com/v2/accounts/:account_id/custom_metadata/labels?data_type=boolean&project_id=1&page=1&per_page=10&sort=created_at&order=desc" \
-u USERNAME_OR_ACCESS_TOKEN
- lang: CLI v2
source: |-
phrase custom_metadata_properties list \
--account_id <account_id> \
--branch my-feature-branch \
--data_type boolean \
--project_id 1 \
--page 1 \
--per_page 10 \
--project_ids [1,2,3] \
--sort created_at \
--order desc \
--access_token <token>
Expand Down
1 change: 1 addition & 0 deletions schemas/custom_metadata_property.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ custom_metadata_property:
- multi_select
- number
- single_select
- string
- text
user:
"$ref": "./user_preview.yaml#/user_preview"
Expand Down

0 comments on commit 001effc

Please sign in to comment.