From 0572b98c94e10e08a7471b0a212bafeb843a4e0e Mon Sep 17 00:00:00 2001 From: Melvin Zottola Date: Fri, 20 Oct 2023 11:36:35 +0200 Subject: [PATCH] feat: Add git token api --- src/openapi.yaml | 2 ++ src/resources/GitToken.yaml | 21 +++++++++++++++++++ .../ApplicationGitRepositoryRequest.yaml | 6 ++++++ src/schemas/GitTokenResponse.yaml | 13 ++++++++++++ src/schemas/GitTokenResponseList.yaml | 6 ++++++ src/schemas/_index.yaml | 2 ++ 6 files changed, 50 insertions(+) create mode 100644 src/resources/GitToken.yaml create mode 100644 src/schemas/GitTokenResponse.yaml create mode 100644 src/schemas/GitTokenResponseList.yaml diff --git a/src/openapi.yaml b/src/openapi.yaml index 8c340947..ae3b5f7d 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -218,6 +218,8 @@ paths: $ref: './resources/OrganizationApiTokenRef.yaml' /organization/{organizationId}/availableRole: $ref: './resources/OrganizationAvailableRole.yaml' + /organization/{organizationId}/gitToken: + $ref: './resources/GitToken.yaml' /organization/{organizationId}/member: $ref: './resources/OrganizationMember.yaml' /organization/{organizationId}/inviteMember: diff --git a/src/resources/GitToken.yaml b/src/resources/GitToken.yaml new file mode 100644 index 00000000..21a971be --- /dev/null +++ b/src/resources/GitToken.yaml @@ -0,0 +1,21 @@ +get: + summary: 'List organization git tokens' + description: 'List organization git tokens' + operationId: listOrganizationGitTokens + parameters: + - $ref: '../parameters/path/organizationId.yaml' + tags: + - Organization Main Calls + responses: + '200': + description: 'List organization git tokens' + content: + application/json: + schema: + $ref: '../schemas/GitTokenResponseList.yaml' + '401': + $ref: '../responses/NotAuthorized.yaml' + '403': + $ref: '../responses/Forbidden.yaml' + '404': + $ref: '../responses/NotFound.yaml' diff --git a/src/schemas/ApplicationGitRepositoryRequest.yaml b/src/schemas/ApplicationGitRepositoryRequest.yaml index 7b7c47fa..e95f999a 100644 --- a/src/schemas/ApplicationGitRepositoryRequest.yaml +++ b/src/schemas/ApplicationGitRepositoryRequest.yaml @@ -19,3 +19,9 @@ properties: type: string default: / description: indicates the root path of the application. + git_token_id: + type: string + format: uuid + description: The git token id on Qovery side + nullable: true + diff --git a/src/schemas/GitTokenResponse.yaml b/src/schemas/GitTokenResponse.yaml new file mode 100644 index 00000000..ca4357b2 --- /dev/null +++ b/src/schemas/GitTokenResponse.yaml @@ -0,0 +1,13 @@ +allOf: + - $ref: './BaseResponse.yaml' + - type: object + required: + - name + - type + properties: + name: + type: string + description: + type: string + type: + $ref: './enums/GitProvider.yaml' diff --git a/src/schemas/GitTokenResponseList.yaml b/src/schemas/GitTokenResponseList.yaml new file mode 100644 index 00000000..9a163200 --- /dev/null +++ b/src/schemas/GitTokenResponseList.yaml @@ -0,0 +1,6 @@ +type: object +properties: + results: + type: array + items: + $ref: './GitTokenResponse.yaml' \ No newline at end of file diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index 8044d8cf..06eecac6 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -358,6 +358,8 @@ GitRepositoryBranchResponseList: $ref: ./GitRepositoryBranchResponseList.yaml GitRepositoryResponseList: $ref: ./GitRepositoryResponseList.yaml +GitTokenResponse: + $ref: ./GitTokenResponse.yaml Healthcheck: $ref: ./Healthcheck.yaml Instance: