{"openapi":"3.0.2","info":{"title":"A beautiful and amazing TPSMyAssessmentServices","version":"2018-05-10","description":"An example service, deployed with the Octane Service creator,\nwhich will echo the string"},"paths":{"/api/v1/assessments/{user}":{"get":{"description":"Gets assessments by the User Email or User Alias","operationId":"GetAssessmentsByUser","parameters":[{"name":"user","in":"path","schema":{"type":"string"},"required":true},{"name":"status","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"GetAssessmentsByUser 200 response","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string"}},"Access-Control-Expose-Headers":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAssessmentsByUserResponseContent"}}}},"400":{"description":"InvalidRequestException 400 response","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string"}},"Access-Control-Expose-Headers":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequestExceptionResponseContent"}}}},"404":{"description":"ResourceNotFoundException 404 response","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string"}},"Access-Control-Expose-Headers":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceNotFoundExceptionResponseContent"}}}},"500":{"description":"InternalServiceErrorException 500 response","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string"}},"Access-Control-Expose-Headers":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServiceErrorExceptionResponseContent"}}}}},"x-amazon-apigateway-integration":{"type":"aws","httpMethod":"POST","uri":{"Fn::Sub":"arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyAssessmentsByUserHandler.Arn}/invocations"},"credentials":{"Fn::Sub":"${APIGatewayExecutionRole.Arn}"},"responses":{"default":{"statusCode":"200","responseParameters":{"method.response.header.Access-Control-Expose-Headers":"'Content-Length,Content-Type,X-Amzn-Errortype,X-Amzn-Requestid'","method.response.header.Access-Control-Allow-Origin":"'*'"}}}}},"options":{"description":"Handles CORS-preflight requests","operationId":"CorsApiV1AssessmentsUser","parameters":[{"name":"user","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Canned response for CORS-preflight requests","headers":{"Access-Control-Allow-Headers":{"schema":{"type":"string"}},"Access-Control-Allow-Methods":{"schema":{"type":"string"}},"Access-Control-Allow-Origin":{"schema":{"type":"string"}},"Access-Control-Max-Age":{"schema":{"type":"string"}}}}},"security":[],"tags":["CORS"],"x-amazon-apigateway-integration":{"contentHandling":"CONVERT_TO_TEXT","requestTemplates":{"application/json":"{\"statusCode\":200}"},"responses":{"default":{"responseParameters":{"method.response.header.Access-Control-Max-Age":"'600'","method.response.header.Access-Control-Allow-Headers":"'*,Amz-Sdk-Invocation-Id,Amz-Sdk-Request,authorization,content-type,Date,Host,X-Amz-Content-Sha256,x-amz-date,x-amz-security-token,X-Amz-Target,X-Amz-User-Agent,X-Amzn-Trace-Id'","method.response.header.Access-Control-Allow-Origin":"'*'","method.response.header.Access-Control-Allow-Methods":"'GET'"},"statusCode":"200"}},"type":"mock","passthroughBehavior":"when_no_match"}}},"/api/v1/favorites":{"options":{"description":"Handles CORS-preflight requests","operationId":"CorsApiV1Favorites","responses":{"200":{"description":"Canned response for CORS-preflight requests","headers":{"Access-Control-Allow-Headers":{"schema":{"type":"string"}},"Access-Control-Allow-Methods":{"schema":{"type":"string"}},"Access-Control-Allow-Origin":{"schema":{"type":"string"}},"Access-Control-Max-Age":{"schema":{"type":"string"}}}}},"security":[],"tags":["CORS"],"x-amazon-apigateway-integration":{"contentHandling":"CONVERT_TO_TEXT","requestTemplates":{"application/json":"{\"statusCode\":200}"},"responses":{"default":{"responseParameters":{"method.response.header.Access-Control-Max-Age":"'600'","method.response.header.Access-Control-Allow-Headers":"'*,Amz-Sdk-Invocation-Id,Amz-Sdk-Request,authorization,Content-Length,content-type,Date,Host,X-Amz-Content-Sha256,x-amz-date,x-amz-security-token,X-Amz-Target,X-Amz-User-Agent,X-Amzn-Trace-Id'","method.response.header.Access-Control-Allow-Origin":"'*'","method.response.header.Access-Control-Allow-Methods":"'POST,PUT'"},"statusCode":"200"}},"type":"mock","passthroughBehavior":"when_no_match"}},"post":{"description":"Creates/Updates favorite item for the userId. Requires email as userId","operationId":"CreateFavoritesForUserId","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFavoritesForUserIdRequestContent"}}},"required":true},"responses":{"201":{"description":"CreateFavoritesForUserId 201 response","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string"}},"Access-Control-Expose-Headers":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFavoritesForUserIdResponseContent"}}}},"400":{"description":"InvalidRequestException 400 response","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string"}},"Access-Control-Expose-Headers":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequestExceptionResponseContent"}}}},"500":{"description":"InternalServiceErrorException 500 response","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string"}},"Access-Control-Expose-Headers":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServiceErrorExceptionResponseContent"}}}}},"x-amazon-apigateway-integration":{"type":"aws","httpMethod":"POST","uri":{"Fn::Sub":"arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${CreateFavoritesForUserIdLambdaHandler.Arn}/invocations"},"credentials":{"Fn::Sub":"${APIGatewayExecutionRole.Arn}"},"responses":{"default":{"statusCode":"200","responseParameters":{"method.response.header.Access-Control-Expose-Headers":"'Content-Length,Content-Type,X-Amzn-Errortype,X-Amzn-Requestid'","method.response.header.Access-Control-Allow-Origin":"'*'"}}}}},"put":{"description":"Deletes favorite of a userId.","operationId":"DeleteUserFavorites","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteUserFavoritesRequestContent"}}},"required":true},"responses":{"200":{"description":"DeleteUserFavorites 200 response","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string"}},"Access-Control-Expose-Headers":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteUserFavoritesResponseContent"}}}},"400":{"description":"InvalidRequestException 400 response","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string"}},"Access-Control-Expose-Headers":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequestExceptionResponseContent"}}}},"404":{"description":"FavoriteNotFoundException 404 response","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string"}},"Access-Control-Expose-Headers":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FavoriteNotFoundExceptionResponseContent"}}}},"409":{"description":"ConflictException 409 response","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string"}},"Access-Control-Expose-Headers":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConflictExceptionResponseContent"}}}},"500":{"description":"InternalServiceErrorException 500 response","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string"}},"Access-Control-Expose-Headers":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServiceErrorExceptionResponseContent"}}}}},"x-amazon-apigateway-integration":{"type":"aws","httpMethod":"POST","credentials":{"Fn::Sub":"${APIGatewayExecutionRole.Arn}"},"uri":{"Fn::Sub":"arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${DeleteFavoritesByUserIdLambdaHandler.Arn}/invocations"},"responses":{"default":{"statusCode":"200","responseParameters":{"method.response.header.Access-Control-Expose-Headers":"'Content-Length,Content-Type,X-Amzn-Errortype,X-Amzn-Requestid'","method.response.header.Access-Control-Allow-Origin":"'*'"}}}}}},"/api/v1/favorites/{userId}":{"get":{"description":"Gets favorite item by the user. Requires email as userId","operationId":"GetFavoritesByUserId","parameters":[{"name":"userId","in":"path","schema":{"type":"string","pattern":"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$"},"required":true}],"responses":{"200":{"description":"GetFavoritesByUserId 200 response","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string"}},"Access-Control-Expose-Headers":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetFavoritesByUserIdResponseContent"}}}},"400":{"description":"InvalidRequestException 400 response","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string"}},"Access-Control-Expose-Headers":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequestExceptionResponseContent"}}}},"404":{"description":"FavoriteNotFoundException 404 response","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string"}},"Access-Control-Expose-Headers":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FavoriteNotFoundExceptionResponseContent"}}}}},"x-amazon-apigateway-integration":{"type":"aws","httpMethod":"POST","uri":{"Fn::Sub":"arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${GetFavoritesByUserIdLambdaHandler.Arn}/invocations"},"credentials":{"Fn::Sub":"${APIGatewayExecutionRole.Arn}"},"responses":{"default":{"statusCode":"200","responseParameters":{"method.response.header.Access-Control-Expose-Headers":"'Content-Length,Content-Type,X-Amzn-Errortype,X-Amzn-Requestid'","method.response.header.Access-Control-Allow-Origin":"'*'"}}}}},"options":{"description":"Handles CORS-preflight requests","operationId":"CorsApiV1FavoritesUserid","parameters":[{"name":"userId","in":"path","schema":{"type":"string","pattern":"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$"},"required":true}],"responses":{"200":{"description":"Canned response for CORS-preflight requests","headers":{"Access-Control-Allow-Headers":{"schema":{"type":"string"}},"Access-Control-Allow-Methods":{"schema":{"type":"string"}},"Access-Control-Allow-Origin":{"schema":{"type":"string"}},"Access-Control-Max-Age":{"schema":{"type":"string"}}}}},"security":[],"tags":["CORS"],"x-amazon-apigateway-integration":{"contentHandling":"CONVERT_TO_TEXT","requestTemplates":{"application/json":"{\"statusCode\":200}"},"responses":{"default":{"responseParameters":{"method.response.header.Access-Control-Max-Age":"'600'","method.response.header.Access-Control-Allow-Headers":"'*,Amz-Sdk-Invocation-Id,Amz-Sdk-Request,authorization,content-type,Date,Host,X-Amz-Content-Sha256,x-amz-date,x-amz-security-token,X-Amz-Target,X-Amz-User-Agent,X-Amzn-Trace-Id'","method.response.header.Access-Control-Allow-Origin":"'*'","method.response.header.Access-Control-Allow-Methods":"'GET'"},"statusCode":"200"}},"type":"mock","passthroughBehavior":"when_no_match"}}}},"components":{"schemas":{"Activity":{"type":"object","properties":{"type":{"type":"string"},"previousState":{"type":"string"},"currentState":{"type":"string"},"personType":{"$ref":"#/components/schemas/PersonType"},"personName":{"type":"string"},"text":{"type":"string"}}},"Assessment":{"type":"object","properties":{"name":{"type":"string"},"tpaRecordType":{"type":"string"},"tpsRecordId":{"type":"string"},"tpsRecordSystemId":{"type":"string"},"state":{"$ref":"#/components/schemas/State"},"questionnaires":{"type":"array","items":{"$ref":"#/components/schemas/Questionnaire"}},"assessmentOutcome":{"$ref":"#/components/schemas/AssessmentOutcome"},"tier":{"type":"number"},"thirdParty":{"$ref":"#/components/schemas/ThirdParty"},"activities":{"type":"array","items":{"$ref":"#/components/schemas/Activity"}}}},"AssessmentOutcome":{"type":"string","enum":["Amazon 3P Security Bar Met","Amazon 3P Security Bar Met With Exceptions","Amazon 3P Security Bar Not Met","In Progress","Pending Review","Misc"]},"ConflictExceptionResponseContent":{"type":"object","description":"This error is due to updating or deleting an item that can cause an inconsistent state.","properties":{"message":{"type":"string","description":"Description of the error."}},"required":["message"]},"CreateFavoritesForUserIdRequestContent":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$"},"tpsRecord":{"$ref":"#/components/schemas/TPSRecord"}},"required":["tpsRecord","userId"]},"CreateFavoritesForUserIdResponseContent":{"type":"object","properties":{"isSuccessful":{"type":"boolean"}},"required":["isSuccessful"]},"DeleteUserFavoritesRequestContent":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$"},"tpsRecord":{"$ref":"#/components/schemas/TPSRecord"}},"required":["tpsRecord","userId"]},"DeleteUserFavoritesResponseContent":{"type":"object","properties":{"isSuccessful":{"type":"boolean"}},"required":["isSuccessful"]},"Favorite":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$"},"createdAt":{"type":"number"},"lastUpdated":{"type":"number"},"tpsRecord":{"$ref":"#/components/schemas/TPSRecord"}}},"FavoriteNotFoundExceptionResponseContent":{"type":"object","description":"This error is thrown when the request references a resource which does not exist.","properties":{"message":{"type":"string","description":"Description of the error."}}},"GetAssessmentsByUserResponseContent":{"type":"object","properties":{"assessments":{"type":"array","items":{"$ref":"#/components/schemas/Assessment"}}}},"GetFavoritesByUserIdResponseContent":{"type":"object","properties":{"favorite":{"$ref":"#/components/schemas/Favorite"}}},"InternalServiceErrorExceptionResponseContent":{"type":"object","description":"This error is thrown when there server is unable to process the request for reasons that are not the fault of the client","properties":{"message":{"type":"string","description":"Description of the error."}}},"InvalidRequestExceptionResponseContent":{"type":"object","description":"This error is thrown when the request could not be understood by the server due to malformed input.","properties":{"message":{"type":"string","description":"Description of the error."}}},"PersonType":{"type":"string","enum":["System","User"]},"Questionnaire":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/QuestionnaireType"},"expiresOn":{"type":"number","format":"double"},"progressPercentage":{"type":"number","format":"double"}}},"QuestionnaireType":{"type":"string","enum":["Intake","DDQ","Security Followup","GENERAL"]},"ResourceNotFoundExceptionResponseContent":{"type":"object","description":"This error is thrown when the request references a resource which does not exist.","properties":{"message":{"type":"string","description":"Description of the error."}}},"State":{"type":"string","enum":["Awaiting Assessor","Awaiting Vendor","Awaiting Requester","Meeting Scheduled","DDQ","Assessment Complete","Completed","Closed"]},"TPSRecord":{"type":"object","additionalProperties":{"type":"string"}},"ThirdParty":{"type":"object","properties":{"name":{"type":"string"},"primaryContactName":{"type":"string"},"primaryContactEmail":{"type":"string"}}}},"securitySchemes":{"CognitoAuthorizer":{"type":"apiKey","description":"Amazon Cognito User Pools authentication","name":"Authorization","in":"header","x-amazon-apigateway-authorizer":{"type":"cognito_user_pools","providerARNs":[{"Fn::ImportValue":"MyAssessmentServices-UserPoolArn"}]},"x-amazon-apigateway-authtype":"cognito_user_pools"}}},"security":[{"CognitoAuthorizer":[]}],"x-amazon-apigateway-gateway-responses":{"DEFAULT_4XX":{"responseTemplates":{"application/json":"{\"message\":$context.error.messageString}"},"responseParameters":{"gatewayresponse.header.Access-Control-Allow-Origin":"'*'"}},"DEFAULT_5XX":{"responseTemplates":{"application/json":"{\"message\":$context.error.messageString}"},"responseParameters":{"gatewayresponse.header.Access-Control-Allow-Origin":"'*'"}}}}