{
  "typeName" : "AWS::Amplify::Branch",
  "description" : "The AWS::Amplify::Branch resource creates a new branch within an app.",
  "additionalProperties" : false,
  "properties" : {
    "AppId" : {
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 20,
      "pattern" : "d[a-z0-9]+"
    },
    "Arn" : {
      "type" : "string",
      "maxLength" : 1000,
      "pattern" : "(?s).*"
    },
    "BasicAuthConfig" : {
      "$ref" : "#/definitions/BasicAuthConfig"
    },
    "BranchName" : {
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 255,
      "pattern" : "(?s).+"
    },
    "BuildSpec" : {
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 25000,
      "pattern" : "(?s).+"
    },
    "Description" : {
      "type" : "string",
      "maxLength" : 1000,
      "pattern" : "(?s).*"
    },
    "EnableAutoBuild" : {
      "type" : "boolean"
    },
    "EnablePerformanceMode" : {
      "type" : "boolean"
    },
    "EnablePullRequestPreview" : {
      "type" : "boolean"
    },
    "EnvironmentVariables" : {
      "type" : "array",
      "uniqueItems" : false,
      "items" : {
        "$ref" : "#/definitions/EnvironmentVariable"
      }
    },
    "Framework" : {
      "type" : "string",
      "maxLength" : 255,
      "pattern" : "(?s).*"
    },
    "PullRequestEnvironmentName" : {
      "type" : "string",
      "maxLength" : 20,
      "pattern" : "(?s).*"
    },
    "Stage" : {
      "type" : "string",
      "enum" : [ "EXPERIMENTAL", "BETA", "PULL_REQUEST", "PRODUCTION", "DEVELOPMENT" ]
    },
    "Tags" : {
      "type" : "array",
      "uniqueItems" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    }
  },
  "definitions" : {
    "EnvironmentVariable" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Name" : {
          "type" : "string",
          "maxLength" : 255,
          "pattern" : "(?s).*"
        },
        "Value" : {
          "type" : "string",
          "maxLength" : 5500,
          "pattern" : "(?s).*"
        }
      },
      "required" : [ "Name", "Value" ]
    },
    "Tag" : {
      "type" : "object",
      "additionalProperties" : false,
      "insertionOrder" : false,
      "properties" : {
        "Key" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 128,
          "pattern" : "^(?!aws:)[a-zA-Z+-=._:/]+$"
        },
        "Value" : {
          "type" : "string",
          "minLength" : 0,
          "maxLength" : 256,
          "pattern" : "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"
        }
      },
      "required" : [ "Key", "Value" ]
    },
    "BasicAuthConfig" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "EnableBasicAuth" : {
          "type" : "boolean"
        },
        "Username" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 255
        },
        "Password" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 255
        }
      },
      "required" : [ "Username", "Password" ]
    }
  },
  "required" : [ "AppId", "BranchName" ],
  "primaryIdentifier" : [ "/properties/Arn" ],
  "createOnlyProperties" : [ "/properties/AppId", "/properties/BranchName" ],
  "readOnlyProperties" : [ "/properties/Arn" ],
  "writeOnlyProperties" : [ "/properties/BasicAuthConfig" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "amplify:CreateBranch", "amplify:TagResource", "codecommit:GetRepository", "codecommit:PutRepositoryTriggers", "codecommit:GetRepositoryTriggers", "s3:GetObject", "s3:GetObjectAcl", "s3:PutObject", "s3:PutObjectAcl", "sns:CreateTopic", "sns:Subscribe", "iam:PassRole" ]
    },
    "delete" : {
      "permissions" : [ "amplify:DeleteBranch", "codecommit:GetRepository", "codecommit:GetRepositoryTriggers", "sns:Unsubscribe", "iam:PassRole" ]
    },
    "list" : {
      "permissions" : [ "amplify:ListBranches", "amplify:ListTagsForResource", "iam:PassRole" ]
    },
    "read" : {
      "permissions" : [ "amplify:GetBranch", "amplify:ListTagsForResource", "codecommit:GetRepository", "codecommit:GetRepositoryTriggers", "s3:GetObject", "s3:GetObjectAcl", "iam:PassRole" ]
    },
    "update" : {
      "permissions" : [ "amplify:UpdateBranch", "amplify:ListTagsForResource", "amplify:TagResource", "amplify:UntagResource", "codecommit:GetRepository", "codecommit:PutRepositoryTriggers", "codecommit:GetRepositoryTriggers", "s3:GetObject", "s3:GetObjectAcl", "s3:PutObject", "s3:PutObjectAcl", "sns:CreateTopic", "sns:Subscribe", "sns:Unsubscribe", "iam:PassRole" ]
    }
  }
}