{
  "Description": "API Gateway Resource for AWS Amplify CLI",
  "AWSTemplateFormatVersion": "2010-09-09",
  "Parameters": {
    "functionflexsdkjsaws477da9b8Name": {
      "Type": "String",
      "Default": "functionflexsdkjsaws477da9b8Name"
    },
    "functionflexsdkjsaws477da9b8Arn": {
      "Type": "String",
      "Default": "functionflexsdkjsaws477da9b8Arn"
    },
    "env": {
      "Type": "String"
    }
  },
  "Conditions": {
    "ShouldNotCreateEnvResources": {
      "Fn::Equals": [
        {
          "Ref": "env"
        },
        "NONE"
      ]
    }
  },
  "Outputs": {
    "RootUrl": {
      "Description": "Root URL of the API gateway",
      "Value": {
        "Fn::Join": [
          "",
          [
            "https://",
            {
              "Ref": "apicde40323"
            },
            ".execute-api.",
            {
              "Ref": "AWS::Region"
            },
            ".amazonaws.com/",
            {
              "Fn::If": [
                "ShouldNotCreateEnvResources",
                "Prod",
                {
                  "Ref": "env"
                }
              ]
            }
          ]
        ]
      }
    },
    "ApiName": {
      "Description": "API Friendly name",
      "Value": "apicde40323"
    },
    "ApiId": {
      "Description": "API ID (prefix of API URL)",
      "Value": {
        "Ref": "apicde40323"
      }
    }
  },
  "Resources": {
    "functionflexsdkjsaws477da9b8Permissionapicde40323": {
      "Type": "AWS::Lambda::Permission",
      "Properties": {
        "Action": "lambda:InvokeFunction",
        "FunctionName": {
          "Ref": "functionflexsdkjsaws477da9b8Name"
        },
        "Principal": "apigateway.amazonaws.com",
        "SourceArn": {
          "Fn::Join": [
            "",
            [
              "arn:aws:execute-api:",
              {
                "Ref": "AWS::Region"
              },
              ":",
              {
                "Ref": "AWS::AccountId"
              },
              ":",
              {
                "Ref": "apicde40323"
              },
              "/*/*/*"
            ]
          ]
        }
      }
    },
    "apicde40323": {
      "Type": "AWS::ApiGateway::RestApi",
      "Properties": {
        "Body": {
          "swagger": "2.0",
          "info": {
            "version": "2018-05-24T17:52:00Z",
            "title": "apicde40323"
          },
          "host": {
            "Fn::Join": [
              "",
              [
                "apigateway.",
                {
                  "Ref": "AWS::Region"
                },
                ".amazonaws.com"
              ]
            ]
          },
          "basePath": {
            "Fn::If": [
              "ShouldNotCreateEnvResources",
              "/Prod",
              {
                "Fn::Join": [
                  "",
                  [
                    "/",
                    {
                      "Ref": "env"
                    }
                  ]
                ]
              }
            ]
          },
          "schemes": [
            "https"
          ],
          "paths": {
            "/items": {
              "options": {
                "consumes": [
                  "application/json"
                ],
                "produces": [
                  "application/json"
                ],
                "responses": {
                  "200": {
                    "description": "200 response",
                    "headers": {
                      "Access-Control-Allow-Origin": {
                        "type": "string"
                      },
                      "Access-Control-Allow-Methods": {
                        "type": "string"
                      },
                      "Access-Control-Allow-Headers": {
                        "type": "string"
                      }
                    }
                  }
                },
                "x-amazon-apigateway-integration": {
                  "responses": {
                    "default": {
                      "statusCode": "200",
                      "responseParameters": {
                        "method.response.header.Access-Control-Allow-Methods": "'DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT'",
                        "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'",
                        "method.response.header.Access-Control-Allow-Origin": "'*'"
                      }
                    }
                  },
                  "requestTemplates": {
                    "application/json": "{\"statusCode\": 200}"
                  },
                  "passthroughBehavior": "when_no_match",
                  "type": "mock"
                }
              },
              "x-amazon-apigateway-any-method": {
                "consumes": [
                  "application/json"
                ],
                "produces": [
                  "application/json"
                ],
                "parameters": [
                  {
                    "in": "body",
                    "name": "RequestSchema",
                    "required": false,
                    "schema": {
                      "$ref": "#/definitions/RequestSchema"
                    }
                  }
                ],
                "responses": {
                  "200": {
                    "description": "200 response",
                    "schema": {
                      "$ref": "#/definitions/ResponseSchema"
                    }
                  }
                },
                "x-amazon-apigateway-integration": {
                  "responses": {
                    "default": {
                      "statusCode": "200"
                    }
                  },
                  "uri": {
                    "Fn::Join": [
                      "",
                      [
                        "arn:aws:apigateway:",
                        {
                          "Ref": "AWS::Region"
                        },
                        ":lambda:path/2015-03-31/functions/",
                        {
                          "Ref": "functionflexsdkjsaws477da9b8Arn"
                        },
                        "/invocations"
                      ]
                    ]
                  },
                  "passthroughBehavior": "when_no_match",
                  "httpMethod": "POST",
                  "type": "aws_proxy"
                }
              }
            },
            "/items/{proxy+}": {
              "options": {
                "consumes": [
                  "application/json"
                ],
                "produces": [
                  "application/json"
                ],
                "responses": {
                  "200": {
                    "description": "200 response",
                    "headers": {
                      "Access-Control-Allow-Origin": {
                        "type": "string"
                      },
                      "Access-Control-Allow-Methods": {
                        "type": "string"
                      },
                      "Access-Control-Allow-Headers": {
                        "type": "string"
                      }
                    }
                  }
                },
                "x-amazon-apigateway-integration": {
                  "responses": {
                    "default": {
                      "statusCode": "200",
                      "responseParameters": {
                        "method.response.header.Access-Control-Allow-Methods": "'DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT'",
                        "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'",
                        "method.response.header.Access-Control-Allow-Origin": "'*'"
                      }
                    }
                  },
                  "requestTemplates": {
                    "application/json": "{\"statusCode\": 200}"
                  },
                  "passthroughBehavior": "when_no_match",
                  "type": "mock"
                }
              },
              "x-amazon-apigateway-any-method": {
                "consumes": [
                  "application/json"
                ],
                "produces": [
                  "application/json"
                ],
                "parameters": [
                  {
                    "in": "body",
                    "name": "RequestSchema",
                    "required": false,
                    "schema": {
                      "$ref": "#/definitions/RequestSchema"
                    }
                  }
                ],
                "responses": {
                  "200": {
                    "description": "200 response",
                    "schema": {
                      "$ref": "#/definitions/ResponseSchema"
                    }
                  }
                },
                "x-amazon-apigateway-integration": {
                  "responses": {
                    "default": {
                      "statusCode": "200"
                    }
                  },
                  "uri": {
                    "Fn::Join": [
                      "",
                      [
                        "arn:aws:apigateway:",
                        {
                          "Ref": "AWS::Region"
                        },
                        ":lambda:path/2015-03-31/functions/",
                        {
                          "Ref": "functionflexsdkjsaws477da9b8Arn"
                        },
                        "/invocations"
                      ]
                    ]
                  },
                  "passthroughBehavior": "when_no_match",
                  "httpMethod": "POST",
                  "type": "aws_proxy"
                }
              }
            }
          },
          "securityDefinitions": {
            "sigv4": {
              "type": "apiKey",
              "name": "Authorization",
              "in": "header",
              "x-amazon-apigateway-authtype": "awsSigv4"
            }
          },
          "definitions": {
            "RequestSchema": {
              "type": "object",
              "required": [
                "request"
              ],
              "properties": {
                "request": {
                  "type": "string"
                }
              },
              "title": "Request Schema"
            },
            "ResponseSchema": {
              "type": "object",
              "required": [
                "response"
              ],
              "properties": {
                "response": {
                  "type": "string"
                }
              },
              "title": "Response Schema"
            }
          }
        },
        "Description": "",
        "FailOnWarnings": true,
        "Name": "apicde40323"
      }
    },
    "apicde40323Default4XXResponse": {
      "Type": "AWS::ApiGateway::GatewayResponse",
      "Properties": {
        "ResponseType": "DEFAULT_4XX",
        "RestApiId": {
          "Ref": "apicde40323"
        },
        "ResponseParameters": {
          "gatewayresponse.header.Access-Control-Allow-Origin": "'*'",
          "gatewayresponse.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'",
          "gatewayresponse.header.Access-Control-Allow-Methods": "'DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT'",
          "gatewayresponse.header.Access-Control-Expose-Headers": "'Date,X-Amzn-ErrorType'"
        }
      }
    },
    "apicde40323Default5XXResponse": {
      "Type": "AWS::ApiGateway::GatewayResponse",
      "Properties": {
        "ResponseType": "DEFAULT_5XX",
        "RestApiId": {
          "Ref": "apicde40323"
        },
        "ResponseParameters": {
          "gatewayresponse.header.Access-Control-Allow-Origin": "'*'",
          "gatewayresponse.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'",
          "gatewayresponse.header.Access-Control-Allow-Methods": "'DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT'",
          "gatewayresponse.header.Access-Control-Expose-Headers": "'Date,X-Amzn-ErrorType'"
        }
      }
    },
    "DeploymentAPIGWapicde40323c2efd04a": {
      "Type": "AWS::ApiGateway::Deployment",
      "Properties": {
        "RestApiId": {
          "Ref": "apicde40323"
        },
        "Description": "The Development stage deployment of your API.",
        "StageName": {
          "Fn::If": [
            "ShouldNotCreateEnvResources",
            "Prod",
            {
              "Ref": "env"
            }
          ]
        }
      },
      "DependsOn": [
        "apicde40323Default4XXResponse",
        "apicde40323Default5XXResponse"
      ]
    }
  }
}