openapi: "3.0.1" info: title: "ServerlesspressoConfigServiceRestApi" version: "2021-12-21T15:32:58Z" paths: /config: get: responses: "200": description: "200 response" headers: Access-Control-Allow-Origin: schema: type: "string" Access-Control-Allow-Methods: schema: type: "string" Access-Control-Allow-Headers: schema: type: "string" content: application/json: schema: $ref: "#/components/schemas/Empty" x-amazon-apigateway-integration: credentials: Fn::GetAtt: [ConfigRESTApiRole, Arn] httpMethod: "POST" uri: Fn::Sub: arn:aws:apigateway:${AWS::Region}:dynamodb:action/GetItem responses: default: statusCode: "200" responseParameters: method.response.header.Access-Control-Allow-Methods: "'GET,OPTIONS'" method.response.header.Access-Control-Allow-Headers: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'" method.response.header.Access-Control-Allow-Origin: "'*'" requestTemplates: application/json: "#set($eventId = $input.params('eventId'))\n#set ($PK\ \ = \"config-$eventId\")\n {\n \"TableName\": \"serverlesspresso-config-table\"\ ,\n \"Key\": {\n \"PK\": {\n \"S\":\"$PK\"\n }\n\ \ }\n}\n" passthroughBehavior: "when_no_templates" type: "aws" options: responses: "200": description: "200 response" headers: Access-Control-Allow-Origin: schema: type: "string" Access-Control-Allow-Methods: schema: type: "string" Access-Control-Allow-Headers: schema: type: "string" content: {} x-amazon-apigateway-integration: responses: default: statusCode: "200" responseParameters: method.response.header.Access-Control-Allow-Methods: "'GET,OPTIONS'" method.response.header.Access-Control-Allow-Headers: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'" method.response.header.Access-Control-Allow-Origin: "'*'" responseTemplates: application/json: "{}\n" requestTemplates: application/json: "{\n \"statusCode\" : 200\n}\n" passthroughBehavior: "when_no_match" type: "mock" /admin-config: get: responses: "200": description: "200 response" headers: Access-Control-Allow-Origin: schema: type: "string" Access-Control-Allow-Methods: schema: type: "string" Access-Control-Allow-Headers: schema: type: "string" content: application/json: schema: $ref: "#/components/schemas/Empty" security: [ { "ServerlespressoAuth" : ["openid", "aws.cognito.signin.user.admin"] } ] x-amazon-apigateway-integration: credentials: Fn::GetAtt: [ConfigRESTApiRole, Arn] httpMethod: "POST" uri: Fn::Sub: arn:aws:apigateway:${AWS::Region}:dynamodb:action/GetItem responses: default: statusCode: "200" responseParameters: method.response.header.Access-Control-Allow-Methods: "'GET,OPTIONS'" method.response.header.Access-Control-Allow-Headers: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'" method.response.header.Access-Control-Allow-Origin: "'*'" requestTemplates: application/json: "#set($eventId = $input.params('eventId'))\n#set ($PK\ \ = \"config-$eventId\")\n {\n \"TableName\": \"serverlesspresso-config-table\"\ ,\n \"Key\": {\n \"PK\": {\n \"S\":\"$PK\"\n }\n\ \ }\n}\n" passthroughBehavior: "when_no_templates" type: "aws" options: responses: "200": description: "200 response" headers: Access-Control-Allow-Origin: schema: type: "string" Access-Control-Allow-Methods: schema: type: "string" Access-Control-Allow-Headers: schema: type: "string" content: {} x-amazon-apigateway-integration: responses: default: statusCode: "200" responseParameters: method.response.header.Access-Control-Allow-Methods: "'GET,OPTIONS'" method.response.header.Access-Control-Allow-Headers: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'" method.response.header.Access-Control-Allow-Origin: "'*'" responseTemplates: application/json: "{}\n" requestTemplates: application/json: "{\n \"statusCode\" : 200\n}\n" passthroughBehavior: "when_no_match" type: "mock" /store: put: responses: "200": description: "200 response" headers: Access-Control-Allow-Origin: schema: type: "string" Access-Control-Allow-Methods: schema: type: "string" Access-Control-Allow-Headers: schema: type: "string" content: application/json: schema: $ref: "#/components/schemas/Empty" security: [ { "ServerlespressoAuth" : ["openid", "aws.cognito.signin.user.admin"] } ] x-amazon-apigateway-integration: credentials: Fn::GetAtt: [ConfigRESTApiRole, Arn] httpMethod: "POST" uri: "arn:aws:apigateway:${AWS::Region}:dynamodb:action/UpdateItem" responses: default: statusCode: "200" responseParameters: method.response.header.Access-Control-Allow-Methods: "'GET,OPTIONS'" method.response.header.Access-Control-Allow-Headers: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'" method.response.header.Access-Control-Allow-Origin: "'*'" requestTemplates: application/json: "#set($state = $input.params('state'))\n\n#if( $state\ \ == 'open' )\n #set($stateBool = true)\n#else\n #set($stateBool = false)\n\ #end\n\n#set($eventId = $input.params('eventId'))\n#set ($PK = \"config-$eventId\"\ )\n\n\n\n\n\n\n{\n \"TableName\": \"serverlesspresso-config-table\"\ ,\n \"Key\": {\n \"PK\": {\n \"S\":\"$PK\"\n }\n\ \ },\n \"UpdateExpression\": \"set storeOpen = :openState\",\n \ \ \"ExpressionAttributeValues\": {\n \":openState\": {\n \"\ BOOL\": $stateBool\n }\n },\n \"ReturnValues\":\"ALL_NEW\"\n}" passthroughBehavior: "when_no_templates" type: "aws" options: responses: "200": description: "200 response" headers: Access-Control-Allow-Origin: schema: type: "string" Access-Control-Allow-Methods: schema: type: "string" Access-Control-Allow-Headers: schema: type: "string" content: {} x-amazon-apigateway-integration: responses: default: statusCode: "200" responseParameters: method.response.header.Access-Control-Allow-Methods: "'PUT,OPTIONS'" method.response.header.Access-Control-Allow-Headers: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'" method.response.header.Access-Control-Allow-Origin: "'*'" responseTemplates: application/json: "{}\n" requestTemplates: application/json: "{\n \"statusCode\" : 200\n}\n" passthroughBehavior: "when_no_match" type: "mock" components: schemas: Empty: title: "Empty Schema" type: "object" securitySchemes: ServerlespressoAuth: type: "apiKey" name: "Authorization" in: "header" x-amazon-apigateway-authtype: "cognito_user_pools" x-amazon-apigateway-authorizer: providerARNs: - Fn::Sub: ${UserPoolARNParameter} type: "cognito_user_pools"