Skip to content

Commit

Permalink
feat: add repo sync events show endpoint (#641)
Browse files Browse the repository at this point in the history
* feat: add repo sync events show endpoint

* Add id to repo sync event
  • Loading branch information
theSoenke authored Jul 2, 2024
1 parent 3989a25 commit e1d9cfb
Show file tree
Hide file tree
Showing 8 changed files with 140 additions and 29 deletions.
97 changes: 81 additions & 16 deletions doc/compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -4523,6 +4523,9 @@
"type": "object",
"title": "repo_sync_event",
"properties": {
"id": {
"type": "string"
},
"event_type": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -4638,6 +4641,15 @@
"type": "string"
}
},
"repo_sync_id": {
"in": "path",
"name": "repo_sync_id",
"description": "Repo Sync ID",
"required": true,
"schema": {
"type": "string"
}
},
"space_id": {
"in": "path",
"name": "space_id",
Expand Down Expand Up @@ -22931,14 +22943,7 @@
"content": {
"application/json": {
"schema": {
"type": "object",
"title": "repo_sync/export",
"properties": {
"message": {
"type": "string",
"example": "Export started"
}
}
"$ref": "#/components/schemas/repo_sync_event"
}
}
},
Expand Down Expand Up @@ -23002,14 +23007,7 @@
"content": {
"application/json": {
"schema": {
"type": "object",
"title": "repo_sync/import",
"properties": {
"message": {
"type": "string",
"example": "Import started"
}
}
"$ref": "#/components/schemas/repo_sync_event"
}
}
},
Expand Down Expand Up @@ -23121,6 +23119,73 @@
"x-cli-version": "2.24"
}
},
"/accounts/{account_id}/repo_syncs/{repo_sync_id}/events/{id}": {
"get": {
"summary": "Get a single Repo Sync Event",
"description": "Shows a single Repo Sync event.",
"operationId": "repo_sync_event/show",
"tags": [
"Repo Syncs"
],
"parameters": [
{
"$ref": "#/components/parameters/X-PhraseApp-OTP"
},
{
"$ref": "#/components/parameters/account_id"
},
{
"$ref": "#/components/parameters/repo_sync_id"
},
{
"$ref": "#/components/parameters/id"
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/repo_sync_event"
}
}
},
"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/ab12cd34/repo_syncs/56ef78/events/78dfgj\"\\\n -u USERNAME_OR_ACCESS_TOKEN"
},
{
"lang": "CLI v2",
"source": "phrase repo_sync_event show \\\n--id <id> \\\n--repo_sync_id <repo_sync_id> \\\n--account_id abcd1234 \\\n--access_token <token>"
}
],
"x-cli-version": "2.24"
}
},
"/accounts/{account_id}/repo_syncs/{id}/deactivate": {
"post": {
"summary": "Deactivate a Repo Sync",
Expand Down
7 changes: 7 additions & 0 deletions parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ query_account_id:
required: false
schema:
type: string
repo_sync_id:
in: path
name: repo_sync_id
description: Repo Sync ID
required: true
schema:
type: string
space_id:
in: path
name: space_id
Expand Down
5 changes: 4 additions & 1 deletion paths.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,10 @@
"$ref": "./paths/repo_syncs/import.yaml"
"/accounts/{account_id}/repo_syncs/{id}/events":
get:
"$ref": "./paths/repo_syncs/events.yaml"
"$ref": "./paths/repo_sync_events/index.yaml"
"/accounts/{account_id}/repo_syncs/{repo_sync_id}/events/{id}":
get:
"$ref": "./paths/repo_sync_events/show.yaml"
"/accounts/{account_id}/repo_syncs/{id}/deactivate":
post:
"$ref": "./paths/repo_syncs/deactivate.yaml"
Expand Down
File renamed without changes.
44 changes: 44 additions & 0 deletions paths/repo_sync_events/show.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
summary: Get a single Repo Sync Event
description: Shows a single Repo Sync event.
operationId: repo_sync_event/show
tags:
- Repo Syncs
parameters:
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP"
- "$ref": "../../parameters.yaml#/account_id"
- "$ref": "../../parameters.yaml#/repo_sync_id"
- "$ref": "../../parameters.yaml#/id"
responses:
'200':
description: OK
content:
application/json:
schema:
"$ref": "../../schemas/repo_sync_event.yaml#/repo_sync_event"
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/ab12cd34/repo_syncs/56ef78/events/78dfgj"\
-u USERNAME_OR_ACCESS_TOKEN
- lang: CLI v2
source: |-
phrase repo_sync_event show \
--id <id> \
--repo_sync_id <repo_sync_id> \
--account_id abcd1234 \
--access_token <token>
x-cli-version: '2.24'
7 changes: 1 addition & 6 deletions paths/repo_syncs/export.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,7 @@ responses:
content:
application/json:
schema:
type: object
title: repo_sync/export
properties:
message:
type: string
example: Export started
"$ref": "../../schemas/repo_sync_event.yaml#/repo_sync_event"
headers:
X-Rate-Limit-Limit:
"$ref": "../../headers.yaml#/X-Rate-Limit-Limit"
Expand Down
7 changes: 1 addition & 6 deletions paths/repo_syncs/import.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,7 @@ responses:
content:
application/json:
schema:
type: object
title: repo_sync/import
properties:
message:
type: string
example: Import started
"$ref": "../../schemas/repo_sync_event.yaml#/repo_sync_event"
headers:
X-Rate-Limit-Limit:
"$ref": "../../headers.yaml#/X-Rate-Limit-Limit"
Expand Down
2 changes: 2 additions & 0 deletions schemas/repo_sync_event.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ repo_sync_event:
type: object
title: repo_sync_event
properties:
id:
type: string
event_type:
type: string
enum: [import, export]
Expand Down

0 comments on commit e1d9cfb

Please sign in to comment.