From 4a9408cf6ea1fa4493add4ca5bbd4a2bf40ae853 Mon Sep 17 00:00:00 2001 From: Sameen Fatima Date: Tue, 19 Dec 2023 02:27:00 +0500 Subject: [PATCH] fix: specify array content type and fix uri removed required from usersfids --- api-compact.yaml | 102 ++++++++++++++++++++++++----------------------- api.yaml | 23 ++++++----- 2 files changed, 64 insertions(+), 61 deletions(-) diff --git a/api-compact.yaml b/api-compact.yaml index 753f883c..7f30e7cf 100644 --- a/api-compact.yaml +++ b/api-compact.yaml @@ -7,7 +7,7 @@ # # # Available service endpoints -- note that alternate endpoints may be presented at the API Gateway tier -# POST /api/v1/subscriptions/{subscription_plan_uuid}/licenses/assign/ +# POST /api/v1/subscriptions/{uuid}/licenses/assign/ apigateway_responses: &apigateway_responses default: @@ -80,8 +80,8 @@ produces: &produces - "application/json" - "application/csv" -subscription_plan_uuid: &subscription_plan_uuid - name: "subscription_plan_uuid" +uuid: &uuid + name: "uuid" in: "path" required: true type: "string" @@ -94,53 +94,55 @@ auth_header: &auth_header endpoints: v1: - - # /v1/subscriptions/{subscription_plan_uuid}/licenses/assign/ + # api/v1/subscriptions/{uuid}/licenses/assign/ assignLicenses: - post: - description: "Assigns a license to given user emails and sends an activation email." - operationId: "assign_licenses" - consumes: - - "application/json" - produces: *produces - parameters: - - *auth_header - - *subscription_plan_uuid - - name: "body" - in: "body" - description: "List of emails to assign licenses." - required: true - schema: - type: "array" - items: - type: "object" - properties: - user_emails: - description: "List of emails to assign licenses." - type: "array" - required: true - user_sfids: - description: "List of salesforce user ids to assign licenses." - type: "array" - required: true - greeting: - description: "Email template closing e.g Hello." + post: + description: "Assigns a license to given user emails and sends an activation email." + operationId: "assign_licenses" + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - *auth_header + - *uuid + - name: "body" + in: "body" + description: "User emails, sfids, and email content." + required: true + schema: + type: "array" + items: + type: "object" + properties: + user_emails: + description: "List of emails to assign licenses." + type: "array" + required: true + items: type: "string" - required: true - closing: - description: "Email template closing e.g Goodbye." + description: "user email" + user_sfids: + description: "List of salesforce user ids to assign licenses." + type: "array" + items: type: "string" - required: true - notify_users: - description: "Send license assignment email or not." - type: "boolean" - required: true - responses: *responses - x-amazon-apigateway-integration: - responses: *apigateway_responses - httpMethod: "POST" - type: "http" - requestParameters: - integration.request.header.Authorization: "method.request.header.Authorization" - integration.request.path.subscription_plan_uuid: "method.request.path.subscription_plan_uuid" - uri: "https://${stageVariables.license_manager_host}/v1/subscriptions/{subscription_plan_uuid}/licenses/assign/" + description: "user's salesforce opportunity id" + greeting: + description: "Email template closing e.g Hello." + type: "string" + closing: + description: "Email template closing e.g Goodbye." + type: "string" + notify_users: + description: "Send license assignment email or not." + type: "boolean" + responses: *responses + x-amazon-apigateway-integration: + responses: *apigateway_responses + httpMethod: "POST" + type: "http" + requestParameters: + integration.request.header.Authorization: "method.request.header.Authorization" + integration.request.path.uuid: "method.request.path.uuid" + uri: "https://${stageVariables.license_manager_host}/api/v1/subscriptions/{subscription_plan_uuid}/licenses/assign/" diff --git a/api.yaml b/api.yaml index c891d205..440f5da4 100644 --- a/api.yaml +++ b/api.yaml @@ -63,8 +63,8 @@ responses: produces: - application/json - application/csv -subscription_plan_uuid: - name: subscription_plan_uuid +uuid: + name: uuid in: path required: true type: string @@ -83,19 +83,18 @@ endpoints: - application/json produces: - application/json - - application/csv parameters: - name: Authorization in: header required: true type: string - - name: subscription_plan_uuid + - name: uuid in: path required: true type: string - name: body in: body - description: List of emails to assign licenses. + description: User emails, sfids, and email content. required: true schema: type: array @@ -106,22 +105,24 @@ endpoints: description: List of emails to assign licenses. type: array required: true + items: + type: string + description: user email user_sfids: description: List of salesforce user ids to assign licenses. type: array - required: true + items: + type: string + description: user's salesforce opportunity id greeting: description: Email template closing e.g Hello. type: string - required: true closing: description: Email template closing e.g Goodbye. type: string - required: true notify_users: description: Send license assignment email or not. type: boolean - required: true responses: "200": description: OK @@ -157,5 +158,5 @@ endpoints: type: http requestParameters: integration.request.header.Authorization: method.request.header.Authorization - integration.request.path.subscription_plan_uuid: method.request.path.subscription_plan_uuid - uri: https://${stageVariables.license_manager_host}/v1/subscriptions/{subscription_plan_uuid}/licenses/assign/ + integration.request.path.uuid: method.request.path.uuid + uri: https://${stageVariables.license_manager_host}/api/v1/subscriptions/{subscription_plan_uuid}/licenses/assign/