{
  "typeName" : "AWS::SES::MailManagerTrafficPolicy",
  "description" : "Definition of AWS::SES::MailManagerTrafficPolicy Resource Type",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-ses-mailmanager",
  "definitions" : {
    "AcceptAction" : {
      "type" : "string",
      "enum" : [ "ALLOW", "DENY" ]
    },
    "IngressAnalysis" : {
      "type" : "object",
      "properties" : {
        "Analyzer" : {
          "type" : "string",
          "pattern" : "^[a-zA-Z0-9:_/+=,@.#-]+$"
        },
        "ResultField" : {
          "type" : "string",
          "maxLength" : 256,
          "minLength" : 1,
          "pattern" : "^(addon\\.)?[\\sa-zA-Z0-9_]+$"
        }
      },
      "required" : [ "Analyzer", "ResultField" ],
      "additionalProperties" : false
    },
    "IngressAddressListEmailAttribute" : {
      "type" : "string",
      "enum" : [ "RECIPIENT" ]
    },
    "IngressIsInAddressList" : {
      "type" : "object",
      "properties" : {
        "Attribute" : {
          "$ref" : "#/definitions/IngressAddressListEmailAttribute"
        },
        "AddressLists" : {
          "type" : "array",
          "items" : {
            "type" : "string"
          },
          "maxItems" : 1,
          "minItems" : 1,
          "uniqueItems" : true
        }
      },
      "required" : [ "AddressLists", "Attribute" ],
      "additionalProperties" : false
    },
    "IngressBooleanExpression" : {
      "type" : "object",
      "properties" : {
        "Evaluate" : {
          "$ref" : "#/definitions/IngressBooleanToEvaluate"
        },
        "Operator" : {
          "$ref" : "#/definitions/IngressBooleanOperator"
        }
      },
      "required" : [ "Evaluate", "Operator" ],
      "additionalProperties" : false
    },
    "IngressBooleanOperator" : {
      "type" : "string",
      "enum" : [ "IS_TRUE", "IS_FALSE" ]
    },
    "IngressBooleanToEvaluate" : {
      "oneOf" : [ {
        "type" : "object",
        "title" : "Analysis",
        "properties" : {
          "Analysis" : {
            "$ref" : "#/definitions/IngressAnalysis"
          }
        },
        "required" : [ "Analysis" ],
        "additionalProperties" : false
      }, {
        "type" : "object",
        "title" : "IsInAddressList",
        "properties" : {
          "IsInAddressList" : {
            "$ref" : "#/definitions/IngressIsInAddressList"
          }
        },
        "required" : [ "IsInAddressList" ],
        "additionalProperties" : false
      } ]
    },
    "IngressIpOperator" : {
      "type" : "string",
      "enum" : [ "CIDR_MATCHES", "NOT_CIDR_MATCHES" ]
    },
    "IngressIpToEvaluate" : {
      "oneOf" : [ {
        "type" : "object",
        "title" : "Attribute",
        "properties" : {
          "Attribute" : {
            "$ref" : "#/definitions/IngressIpv4Attribute"
          }
        },
        "required" : [ "Attribute" ],
        "additionalProperties" : false
      } ]
    },
    "IngressIpv4Attribute" : {
      "type" : "string",
      "enum" : [ "SENDER_IP" ]
    },
    "IngressIpv4Expression" : {
      "type" : "object",
      "properties" : {
        "Evaluate" : {
          "$ref" : "#/definitions/IngressIpToEvaluate"
        },
        "Operator" : {
          "$ref" : "#/definitions/IngressIpOperator"
        },
        "Values" : {
          "type" : "array",
          "items" : {
            "type" : "string",
            "pattern" : "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/([0-9]|[12][0-9]|3[0-2])$"
          }
        }
      },
      "required" : [ "Evaluate", "Operator", "Values" ],
      "additionalProperties" : false
    },
    "IngressIpv6Attribute" : {
      "type" : "string",
      "enum" : [ "SENDER_IPV6" ]
    },
    "IngressIpv6Expression" : {
      "type" : "object",
      "properties" : {
        "Evaluate" : {
          "$ref" : "#/definitions/IngressIpv6ToEvaluate"
        },
        "Operator" : {
          "$ref" : "#/definitions/IngressIpOperator"
        },
        "Values" : {
          "type" : "array",
          "items" : {
            "type" : "string",
            "maxLength" : 49,
            "pattern" : "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\\/(12[0-8]|1[0-1][0-9]|[1-9][0-9]|[0-9])$"
          }
        }
      },
      "required" : [ "Evaluate", "Operator", "Values" ],
      "additionalProperties" : false
    },
    "IngressIpv6ToEvaluate" : {
      "oneOf" : [ {
        "type" : "object",
        "title" : "Attribute",
        "properties" : {
          "Attribute" : {
            "$ref" : "#/definitions/IngressIpv6Attribute"
          }
        },
        "required" : [ "Attribute" ],
        "additionalProperties" : false
      } ]
    },
    "IngressStringEmailAttribute" : {
      "type" : "string",
      "enum" : [ "RECIPIENT" ]
    },
    "IngressStringExpression" : {
      "type" : "object",
      "properties" : {
        "Evaluate" : {
          "$ref" : "#/definitions/IngressStringToEvaluate"
        },
        "Operator" : {
          "$ref" : "#/definitions/IngressStringOperator"
        },
        "Values" : {
          "type" : "array",
          "items" : {
            "type" : "string"
          }
        }
      },
      "required" : [ "Evaluate", "Operator", "Values" ],
      "additionalProperties" : false
    },
    "IngressStringOperator" : {
      "type" : "string",
      "enum" : [ "EQUALS", "NOT_EQUALS", "STARTS_WITH", "ENDS_WITH", "CONTAINS" ]
    },
    "IngressStringToEvaluate" : {
      "oneOf" : [ {
        "type" : "object",
        "title" : "Attribute",
        "properties" : {
          "Attribute" : {
            "$ref" : "#/definitions/IngressStringEmailAttribute"
          }
        },
        "required" : [ "Attribute" ],
        "additionalProperties" : false
      }, {
        "type" : "object",
        "title" : "Analysis",
        "properties" : {
          "Analysis" : {
            "$ref" : "#/definitions/IngressAnalysis"
          }
        },
        "required" : [ "Analysis" ],
        "additionalProperties" : false
      } ]
    },
    "IngressTlsAttribute" : {
      "type" : "string",
      "enum" : [ "TLS_PROTOCOL" ]
    },
    "IngressTlsProtocolAttribute" : {
      "type" : "string",
      "enum" : [ "TLS1_2", "TLS1_3" ]
    },
    "IngressTlsProtocolExpression" : {
      "type" : "object",
      "properties" : {
        "Evaluate" : {
          "$ref" : "#/definitions/IngressTlsProtocolToEvaluate"
        },
        "Operator" : {
          "$ref" : "#/definitions/IngressTlsProtocolOperator"
        },
        "Value" : {
          "$ref" : "#/definitions/IngressTlsProtocolAttribute"
        }
      },
      "required" : [ "Evaluate", "Operator", "Value" ],
      "additionalProperties" : false
    },
    "IngressTlsProtocolOperator" : {
      "type" : "string",
      "enum" : [ "MINIMUM_TLS_VERSION", "IS" ]
    },
    "IngressTlsProtocolToEvaluate" : {
      "oneOf" : [ {
        "type" : "object",
        "title" : "Attribute",
        "properties" : {
          "Attribute" : {
            "$ref" : "#/definitions/IngressTlsAttribute"
          }
        },
        "required" : [ "Attribute" ],
        "additionalProperties" : false
      } ]
    },
    "PolicyCondition" : {
      "oneOf" : [ {
        "type" : "object",
        "title" : "StringExpression",
        "properties" : {
          "StringExpression" : {
            "$ref" : "#/definitions/IngressStringExpression"
          }
        },
        "required" : [ "StringExpression" ],
        "additionalProperties" : false
      }, {
        "type" : "object",
        "title" : "IpExpression",
        "properties" : {
          "IpExpression" : {
            "$ref" : "#/definitions/IngressIpv4Expression"
          }
        },
        "required" : [ "IpExpression" ],
        "additionalProperties" : false
      }, {
        "type" : "object",
        "title" : "Ipv6Expression",
        "properties" : {
          "Ipv6Expression" : {
            "$ref" : "#/definitions/IngressIpv6Expression"
          }
        },
        "required" : [ "Ipv6Expression" ],
        "additionalProperties" : false
      }, {
        "type" : "object",
        "title" : "TlsExpression",
        "properties" : {
          "TlsExpression" : {
            "$ref" : "#/definitions/IngressTlsProtocolExpression"
          }
        },
        "required" : [ "TlsExpression" ],
        "additionalProperties" : false
      }, {
        "type" : "object",
        "title" : "BooleanExpression",
        "properties" : {
          "BooleanExpression" : {
            "$ref" : "#/definitions/IngressBooleanExpression"
          }
        },
        "required" : [ "BooleanExpression" ],
        "additionalProperties" : false
      } ]
    },
    "PolicyStatement" : {
      "type" : "object",
      "properties" : {
        "Conditions" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/PolicyCondition"
          },
          "minItems" : 1
        },
        "Action" : {
          "$ref" : "#/definitions/AcceptAction"
        }
      },
      "required" : [ "Action", "Conditions" ],
      "additionalProperties" : false
    },
    "Tag" : {
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string",
          "maxLength" : 128,
          "minLength" : 1,
          "pattern" : "^[a-zA-Z0-9/_\\+=\\.:@\\-]+$"
        },
        "Value" : {
          "type" : "string",
          "maxLength" : 256,
          "minLength" : 0,
          "pattern" : "^[a-zA-Z0-9/_\\+=\\.:@\\-]*$"
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    }
  },
  "properties" : {
    "DefaultAction" : {
      "$ref" : "#/definitions/AcceptAction"
    },
    "MaxMessageSizeBytes" : {
      "type" : "number",
      "minimum" : 1
    },
    "PolicyStatements" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/PolicyStatement"
      }
    },
    "Tags" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/Tag"
      },
      "maxItems" : 200,
      "minItems" : 0
    },
    "TrafficPolicyArn" : {
      "type" : "string"
    },
    "TrafficPolicyId" : {
      "type" : "string",
      "maxLength" : 100,
      "minLength" : 1
    },
    "TrafficPolicyName" : {
      "type" : "string",
      "maxLength" : 63,
      "minLength" : 3,
      "pattern" : "^[A-Za-z0-9_\\-]+$"
    }
  },
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "ses:TagResource", "ses:UntagResource" ]
  },
  "required" : [ "DefaultAction", "PolicyStatements" ],
  "readOnlyProperties" : [ "/properties/TrafficPolicyArn", "/properties/TrafficPolicyId" ],
  "primaryIdentifier" : [ "/properties/TrafficPolicyId" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "ses:TagResource", "ses:ListTagsForResource", "ses:GetTrafficPolicy", "ses:CreateTrafficPolicy" ]
    },
    "read" : {
      "permissions" : [ "ses:ListTagsForResource", "ses:GetTrafficPolicy" ]
    },
    "update" : {
      "permissions" : [ "ses:TagResource", "ses:UntagResource", "ses:ListTagsForResource", "ses:GetTrafficPolicy", "ses:UpdateTrafficPolicy" ]
    },
    "delete" : {
      "permissions" : [ "ses:GetTrafficPolicy", "ses:DeleteTrafficPolicy" ]
    },
    "list" : {
      "permissions" : [ "ses:ListTrafficPolicies" ]
    }
  },
  "additionalProperties" : false
}