{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-ses/json-schema/amazon-ses-create-traffic-policy-request-schema.json",
  "title": "CreateTrafficPolicyRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-ses-traffic-policy-api-openapi.yml#/components/schemas/CreateTrafficPolicyRequest",
  "type": "object",
  "properties": {
    "ClientToken": {
      "type": "string",
      "description": "A unique token that Amazon SES uses to recognize subsequent retries of the same request."
    },
    "TrafficPolicyName": {
      "type": "string",
      "description": "A user-friendly name for the traffic policy resource."
    },
    "PolicyStatements": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PolicyStatement"
      },
      "description": "Conditional statements for filtering email traffic."
    },
    "DefaultAction": {
      "type": "string",
      "enum": [
        "ALLOW",
        "DENY"
      ],
      "description": "Default action instructs the traﬃc policy to either Allow or Deny (block) messages that fall outside of (or not addressed by) the conditions of your policy statements"
    },
    "MaxMessageSizeBytes": {
      "type": "integer",
      "description": "The maximum message size in bytes of email which is allowed in by this traffic policy—anything larger will be blocked."
    },
    "Tags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/MailManagerTag"
      },
      "description": "The tags used to organize, track, or control access for the resource. For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }."
    }
  },
  "required": [
    "TrafficPolicyName",
    "PolicyStatements",
    "DefaultAction"
  ],
  "$defs": {
    "IngressAnalysis": {
      "type": "object",
      "properties": {
        "Analyzer": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of an Add On."
        },
        "ResultField": {
          "type": "string",
          "description": "The returned value from an Add On."
        }
      },
      "required": [
        "Analyzer",
        "ResultField"
      ]
    },
    "IngressBooleanExpression": {
      "type": "object",
      "properties": {
        "Evaluate": {
          "$ref": "#/$defs/IngressBooleanToEvaluate"
        },
        "Operator": {
          "type": "string",
          "enum": [
            "IS_TRUE",
            "IS_FALSE"
          ],
          "description": "The matching operator for a boolean condition expression."
        }
      },
      "required": [
        "Evaluate",
        "Operator"
      ]
    },
    "IngressBooleanToEvaluate": {
      "type": "object",
      "properties": {
        "Analysis": {
          "$ref": "#/$defs/IngressAnalysis"
        },
        "IsInAddressList": {
          "$ref": "#/$defs/IngressIsInAddressList"
        }
      },
      "description": "Exactly one member is set."
    },
    "IngressIpToEvaluate": {
      "type": "object",
      "properties": {
        "Attribute": {
          "type": "string",
          "enum": [
            "SENDER_IP"
          ],
          "description": "An enum type representing the allowed attribute types for an IP condition."
        }
      },
      "description": "Exactly one member is set."
    },
    "IngressIpv4Expression": {
      "type": "object",
      "properties": {
        "Evaluate": {
          "$ref": "#/$defs/IngressIpToEvaluate"
        },
        "Operator": {
          "type": "string",
          "enum": [
            "CIDR_MATCHES",
            "NOT_CIDR_MATCHES"
          ],
          "description": "The matching operator for an IP condition expression."
        },
        "Values": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The right hand side argument of an IP condition expression."
        }
      },
      "required": [
        "Evaluate",
        "Operator",
        "Values"
      ]
    },
    "IngressIpv6Expression": {
      "type": "object",
      "properties": {
        "Evaluate": {
          "$ref": "#/$defs/IngressIpv6ToEvaluate"
        },
        "Operator": {
          "type": "string",
          "enum": [
            "CIDR_MATCHES",
            "NOT_CIDR_MATCHES"
          ],
          "description": "The matching operator for an IPv6 condition expression."
        },
        "Values": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The right hand side argument of an IPv6 condition expression."
        }
      },
      "required": [
        "Evaluate",
        "Operator",
        "Values"
      ]
    },
    "IngressIpv6ToEvaluate": {
      "type": "object",
      "properties": {
        "Attribute": {
          "type": "string",
          "enum": [
            "SENDER_IPV6"
          ],
          "description": "An enum type representing the allowed attribute types for an IPv6 condition."
        }
      },
      "description": "Exactly one member is set."
    },
    "IngressIsInAddressList": {
      "type": "object",
      "properties": {
        "Attribute": {
          "type": "string",
          "enum": [
            "RECIPIENT"
          ],
          "description": "The email attribute that needs to be evaluated against the address list."
        },
        "AddressLists": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The address lists that will be used for evaluation."
        }
      },
      "required": [
        "Attribute",
        "AddressLists"
      ]
    },
    "IngressStringExpression": {
      "type": "object",
      "properties": {
        "Evaluate": {
          "$ref": "#/$defs/IngressStringToEvaluate"
        },
        "Operator": {
          "type": "string",
          "enum": [
            "EQUALS",
            "NOT_EQUALS",
            "STARTS_WITH",
            "ENDS_WITH",
            "CONTAINS"
          ],
          "description": "The matching operator for a string condition expression."
        },
        "Values": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The right hand side argument of a string condition expression."
        }
      },
      "required": [
        "Evaluate",
        "Operator",
        "Values"
      ]
    },
    "IngressStringToEvaluate": {
      "type": "object",
      "properties": {
        "Attribute": {
          "type": "string",
          "enum": [
            "RECIPIENT"
          ],
          "description": "The enum type representing the allowed attribute types for a string condition."
        },
        "Analysis": {
          "$ref": "#/$defs/IngressAnalysis"
        }
      },
      "description": "Exactly one member is set."
    },
    "IngressTlsProtocolExpression": {
      "type": "object",
      "properties": {
        "Evaluate": {
          "$ref": "#/$defs/IngressTlsProtocolToEvaluate"
        },
        "Operator": {
          "type": "string",
          "enum": [
            "MINIMUM_TLS_VERSION",
            "IS"
          ],
          "description": "The matching operator for a TLS condition expression."
        },
        "Value": {
          "type": "string",
          "enum": [
            "TLS1_2",
            "TLS1_3"
          ],
          "description": "The right hand side argument of a TLS condition expression."
        }
      },
      "required": [
        "Evaluate",
        "Operator",
        "Value"
      ]
    },
    "IngressTlsProtocolToEvaluate": {
      "type": "object",
      "properties": {
        "Attribute": {
          "type": "string",
          "enum": [
            "TLS_PROTOCOL"
          ],
          "description": "The enum type representing the allowed attribute types for the TLS condition."
        }
      },
      "description": "Exactly one member is set."
    },
    "MailManagerTag": {
      "type": "object",
      "properties": {
        "Key": {
          "type": "string",
          "description": "The key of the key-value tag."
        },
        "Value": {
          "type": "string",
          "description": "The value of the key-value tag."
        }
      },
      "required": [
        "Key",
        "Value"
      ]
    },
    "PolicyCondition": {
      "type": "object",
      "properties": {
        "StringExpression": {
          "$ref": "#/$defs/IngressStringExpression"
        },
        "IpExpression": {
          "$ref": "#/$defs/IngressIpv4Expression"
        },
        "Ipv6Expression": {
          "$ref": "#/$defs/IngressIpv6Expression"
        },
        "TlsExpression": {
          "$ref": "#/$defs/IngressTlsProtocolExpression"
        },
        "BooleanExpression": {
          "$ref": "#/$defs/IngressBooleanExpression"
        }
      },
      "description": "Exactly one member is set."
    },
    "PolicyStatement": {
      "type": "object",
      "properties": {
        "Conditions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PolicyCondition"
          },
          "description": "The list of conditions to apply to incoming messages for filtering email traffic."
        },
        "Action": {
          "type": "string",
          "enum": [
            "ALLOW",
            "DENY"
          ],
          "description": "The action that informs a traffic policy resource to either allow or block the email if it matches a condition in the policy statement."
        }
      },
      "required": [
        "Conditions",
        "Action"
      ]
    }
  }
}