Skip to content

Commit

Permalink
feat: Get single token & associated services (#487)
Browse files Browse the repository at this point in the history
  • Loading branch information
mzottola authored Oct 27, 2023
1 parent 37b14b8 commit 9ee8f12
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ paths:
$ref: './resources/GitToken.yaml'
/organization/{organizationId}/gitToken/{gitTokenId}:
$ref: './resources/GitTokenRef.yaml'
/organization/{organizationId}/gitToken/{gitTokenId}/associatedServices:
$ref: './resources/GitTokenAssociatedServices.yaml'
/organization/{organizationId}/member:
$ref: './resources/OrganizationMember.yaml'
/organization/{organizationId}/inviteMember:
Expand Down
22 changes: 22 additions & 0 deletions src/resources/GitTokenAssociatedServices.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
get:
summary: 'Get organization git token associated services'
description: 'Get organization git tokens associated services'
operationId: getGitTokenAssociatedServices
parameters:
- $ref: '../parameters/path/organizationId.yaml'
- $ref: '../parameters/path/gitTokenId.yaml'
tags:
- Organization Main Calls
responses:
'200':
description: 'Get organization git token associated services'
content:
application/json:
schema:
$ref: '../schemas/GitTokenAssociatedServicesResponseList.yaml'
'401':
$ref: '../responses/NotAuthorized.yaml'
'403':
$ref: '../responses/Forbidden.yaml'
'404':
$ref: '../responses/NotFound.yaml'
22 changes: 22 additions & 0 deletions src/resources/GitTokenRef.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
get:
summary: 'Get organization git token'
description: 'Get organization git tokens'
operationId: getOrganizationGitTokens
parameters:
- $ref: '../parameters/path/organizationId.yaml'
- $ref: '../parameters/path/gitTokenId.yaml'
tags:
- Organization Main Calls
responses:
'200':
description: 'Get organization git token'
content:
application/json:
schema:
$ref: '../schemas/GitTokenResponse.yaml'
'401':
$ref: '../responses/NotAuthorized.yaml'
'403':
$ref: '../responses/Forbidden.yaml'
'404':
$ref: '../responses/NotFound.yaml'
put:
summary: 'Edit a git token'
operationId: editGitToken
Expand Down
27 changes: 27 additions & 0 deletions src/schemas/GitTokenAssociatedServiceResponse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
type: object
required:
- project_id
- project_name
- environment_id
- environment_name
- service_id
- service_name
- service_type
properties:
project_id:
type: string
format: uuid
project_name:
type: string
environment_id:
type: string
format: uuid
environment_name:
type: string
service_id:
type: string
format: uuid
service_name:
type: string
service_type:
$ref: "./enums/GitTokenAssociatedServiceType.yaml"
6 changes: 6 additions & 0 deletions src/schemas/GitTokenAssociatedServicesResponseList.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: object
properties:
results:
type: array
items:
$ref: './GitTokenAssociatedServiceResponse.yaml'
4 changes: 4 additions & 0 deletions src/schemas/GitTokenResponse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ allOf:
required:
- name
- type
- associated_services_count
properties:
name:
type: string
Expand All @@ -14,3 +15,6 @@ allOf:
expired_at:
type: string
format: date
associated_services_count:
type: number
description: The number of services using this git token
6 changes: 6 additions & 0 deletions src/schemas/_index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,12 @@ GitRepositoryBranchResponseList:
$ref: ./GitRepositoryBranchResponseList.yaml
GitRepositoryResponseList:
$ref: ./GitRepositoryResponseList.yaml
GitTokenAssociatedServiceType:
$ref: ./enums/GitTokenAssociatedServiceType.yaml
GitTokenAssociatedServiceResponse:
$ref: ./GitTokenAssociatedServiceResponse.yaml
GitTokenAssociatedServicesResponseList:
$ref: ./GitTokenAssociatedServicesResponseList.yaml
GitTokenRequest:
$ref: ./GitTokenRequest.yaml
GitTokenResponse:
Expand Down
5 changes: 5 additions & 0 deletions src/schemas/enums/GitTokenAssociatedServiceType.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: string
enum:
- APPLICATION
- JOB
- HELM

0 comments on commit 9ee8f12

Please sign in to comment.