Skip to content

Commit

Permalink
feat: define subscription plans endpoint for gateway (#593)
Browse files Browse the repository at this point in the history
* feat: define subscription plans endpoint for gateway

* fix: add uuid query param to subscription list gateway

* fix: make customer uuid query param optional for gateway
  • Loading branch information
justEhmadSaeed authored Feb 14, 2024
1 parent 1aabd9e commit d156536
Show file tree
Hide file tree
Showing 2 changed files with 159 additions and 0 deletions.
65 changes: 65 additions & 0 deletions api-compact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,22 @@ apigateway_responses: &apigateway_responses
500:
statusCode: "500"

apigateway_get_responses: &apigateway_get_responses
default:
statusCode: "400"
200:
statusCode: "200"
401:
statusCode: "401"
403:
statusCode: "403"
404:
statusCode: "404"
429:
statusCode: "429"
500:
statusCode: "500"

bulk_revoke_apigateway_responses: &bulk_revoke_apigateway_responses
default:
statusCode: "400"
Expand Down Expand Up @@ -99,6 +115,22 @@ responses: &responses
500:
description: "Internal Server Error"

get_responses: &get_responses
200:
description: "OK"
400:
description: "Bad Request"
401:
description: "Unauthorized"
403:
description: "Forbidden"
404:
description: "Not Found"
429:
description: "Too Many Requests"
500:
description: "Internal Server Error"

bulk_revoke_responses: &bulk_revoke_responses
204:
description: "No Content - All revocations were successful"
Expand All @@ -125,6 +157,12 @@ enterprise_customer_uuid_qs_param: &enterprise_customer_uuid_qs_param
required: true
type: "string"

enterprise_customer_uuid_qs_param_optional: &enterprise_customer_uuid_qs_param_optional
in: "query"
name: "enterprise_customer_uuid"
required: false
type: "string"

enroll_all_qs_param: &enroll_all_qs_param
in: "query"
name: "enroll_all"
Expand Down Expand Up @@ -285,6 +323,33 @@ endpoints:
integration.request.querystring.enroll_all: "method.request.querystring.enroll_all"
integration.request.querystring.subscription_uuid: "method.request.querystring.subscription_uuid"
uri: "https://${stageVariables.license_manager_host}/api/v1/bulk-license-enrollment"
# /api/v1/subscriptions
subscriptionsList:
get:
operationId: subscriptions_summary_endpoint
description: Returns a list of subscription plans for a customer
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- *auth_header
- *enterprise_customer_uuid_qs_param_optional
- name: "page"
in: "query"
required: false
type: "integer"
responses: *get_responses
x-amazon-apigateway-integration:
responses: *apigateway_get_responses
httpMethod: "GET"
type: "http"
requestParameters:
integration.request.header.Authorization: "method.request.header.Authorization"
integration.request.querystring.enterprise_customer_uuid: "method.request.querystring.enterprise_customer_uuid"
integration.request.querystring.page: "method.request.querystring.page"
uri: "https://${stageVariables.license_manager_host}/api/v1/subscriptions"

definitions:
BulkRevokeFilters:
type: "object"
Expand Down
94 changes: 94 additions & 0 deletions api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ apigateway_responses:
statusCode: "500"
default:
statusCode: "400"
apigateway_get_responses:
"200":
statusCode: "200"
"401":
statusCode: "401"
"403":
statusCode: "403"
"404":
statusCode: "404"
"429":
statusCode: "429"
"500":
statusCode: "500"
default:
statusCode: "400"
bulk_revoke_apigateway_responses:
"204":
statusCode: "204"
Expand Down Expand Up @@ -79,6 +94,21 @@ responses:
description: Too Many Requests
"500":
description: Internal Server Error
get_responses:
"200":
description: OK
"400":
description: Bad Request
"401":
description: Unauthorized
"403":
description: Forbidden
"404":
description: Not Found
"429":
description: Too Many Requests
"500":
description: Internal Server Error
bulk_revoke_responses:
"204":
description: No Content - All revocations were successful
Expand All @@ -102,6 +132,11 @@ enterprise_customer_uuid_qs_param:
name: enterprise_customer_uuid
required: true
type: string
enterprise_customer_uuid_qs_param_optional:
in: query
name: enterprise_customer_uuid
required: false
type: string
enroll_all_qs_param:
in: query
name: enroll_all
Expand Down Expand Up @@ -371,6 +406,65 @@ endpoints:
integration.request.querystring.enroll_all: method.request.querystring.enroll_all
integration.request.querystring.subscription_uuid: method.request.querystring.subscription_uuid
uri: https://${stageVariables.license_manager_host}/api/v1/bulk-license-enrollment
subscriptionsList:
get:
operationId: subscriptions_summary_endpoint
description: Returns a list of subscription plans for a customer
consumes:
- application/json
produces:
- application/json
parameters:
- name: Authorization
in: header
required: true
type: string
- in: query
name: enterprise_customer_uuid
required: false
type: string
- name: page
in: query
required: false
type: integer
responses:
"200":
description: OK
"400":
description: Bad Request
"401":
description: Unauthorized
"403":
description: Forbidden
"404":
description: Not Found
"429":
description: Too Many Requests
"500":
description: Internal Server Error
x-amazon-apigateway-integration:
responses:
"200":
statusCode: "200"
"401":
statusCode: "401"
"403":
statusCode: "403"
"404":
statusCode: "404"
"429":
statusCode: "429"
"500":
statusCode: "500"
default:
statusCode: "400"
httpMethod: GET
type: http
requestParameters:
integration.request.header.Authorization: method.request.header.Authorization
integration.request.querystring.enterprise_customer_uuid: method.request.querystring.enterprise_customer_uuid
integration.request.querystring.page: method.request.querystring.page
uri: https://${stageVariables.license_manager_host}/api/v1/subscriptions
definitions:
BulkRevokeFilters:
type: object
Expand Down

0 comments on commit d156536

Please sign in to comment.