{
  "typeName" : "AWS::FraudDetector::EventType",
  "description" : "A resource schema for an EventType in Amazon Fraud Detector.",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-rpdk.git",
  "definitions" : {
    "Tag" : {
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "type" : "string",
          "minLength" : 0,
          "maxLength" : 256
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    },
    "EventVariable" : {
      "type" : "object",
      "properties" : {
        "Arn" : {
          "type" : "string"
        },
        "Inline" : {
          "type" : "boolean"
        },
        "Name" : {
          "type" : "string"
        },
        "DataSource" : {
          "type" : "string",
          "enum" : [ "EVENT" ]
        },
        "DataType" : {
          "type" : "string",
          "enum" : [ "STRING", "INTEGER", "FLOAT", "BOOLEAN" ]
        },
        "DefaultValue" : {
          "type" : "string"
        },
        "VariableType" : {
          "type" : "string",
          "enum" : [ "AUTH_CODE", "AVS", "BILLING_ADDRESS_L1", "BILLING_ADDRESS_L2", "BILLING_CITY", "BILLING_COUNTRY", "BILLING_NAME", "BILLING_PHONE", "BILLING_STATE", "BILLING_ZIP", "CARD_BIN", "CATEGORICAL", "CURRENCY_CODE", "EMAIL_ADDRESS", "FINGERPRINT", "FRAUD_LABEL", "FREE_FORM_TEXT", "IP_ADDRESS", "NUMERIC", "ORDER_ID", "PAYMENT_TYPE", "PHONE_NUMBER", "PRICE", "PRODUCT_CATEGORY", "SHIPPING_ADDRESS_L1", "SHIPPING_ADDRESS_L2", "SHIPPING_CITY", "SHIPPING_COUNTRY", "SHIPPING_NAME", "SHIPPING_PHONE", "SHIPPING_STATE", "SHIPPING_ZIP", "USERAGENT" ]
        },
        "Description" : {
          "description" : "The description.",
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 256
        },
        "Tags" : {
          "description" : "Tags associated with this event type.",
          "type" : "array",
          "uniqueItems" : false,
          "insertionOrder" : false,
          "maxItems" : 200,
          "items" : {
            "$ref" : "#/definitions/Tag"
          }
        },
        "CreatedTime" : {
          "description" : "The time when the event type was created.",
          "type" : "string"
        },
        "LastUpdatedTime" : {
          "description" : "The time when the event type was last updated.",
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "Label" : {
      "type" : "object",
      "properties" : {
        "Arn" : {
          "type" : "string"
        },
        "Inline" : {
          "type" : "boolean"
        },
        "Name" : {
          "type" : "string"
        },
        "Description" : {
          "description" : "The description.",
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 256
        },
        "Tags" : {
          "description" : "Tags associated with this event type.",
          "type" : "array",
          "uniqueItems" : false,
          "insertionOrder" : false,
          "maxItems" : 200,
          "items" : {
            "$ref" : "#/definitions/Tag"
          }
        },
        "CreatedTime" : {
          "description" : "The time when the event type was created.",
          "type" : "string"
        },
        "LastUpdatedTime" : {
          "description" : "The time when the event type was last updated.",
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "EntityType" : {
      "type" : "object",
      "properties" : {
        "Arn" : {
          "type" : "string"
        },
        "Inline" : {
          "type" : "boolean"
        },
        "Name" : {
          "type" : "string"
        },
        "Description" : {
          "description" : "The description.",
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 256
        },
        "Tags" : {
          "description" : "Tags associated with this event type.",
          "type" : "array",
          "uniqueItems" : false,
          "insertionOrder" : false,
          "maxItems" : 200,
          "items" : {
            "$ref" : "#/definitions/Tag"
          }
        },
        "CreatedTime" : {
          "description" : "The time when the event type was created.",
          "type" : "string"
        },
        "LastUpdatedTime" : {
          "description" : "The time when the event type was last updated.",
          "type" : "string"
        }
      },
      "additionalProperties" : false
    }
  },
  "properties" : {
    "Name" : {
      "description" : "The name for the event type",
      "type" : "string",
      "pattern" : "^[0-9a-z_-]+$",
      "minLength" : 1,
      "maxLength" : 64
    },
    "Tags" : {
      "description" : "Tags associated with this event type.",
      "type" : "array",
      "uniqueItems" : false,
      "insertionOrder" : false,
      "maxItems" : 200,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "Description" : {
      "description" : "The description of the event type.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 128
    },
    "EventVariables" : {
      "type" : "array",
      "uniqueItems" : false,
      "insertionOrder" : false,
      "minItems" : 1,
      "items" : {
        "$ref" : "#/definitions/EventVariable"
      }
    },
    "Labels" : {
      "type" : "array",
      "uniqueItems" : false,
      "insertionOrder" : false,
      "minItems" : 2,
      "items" : {
        "$ref" : "#/definitions/Label"
      }
    },
    "EntityTypes" : {
      "type" : "array",
      "uniqueItems" : false,
      "insertionOrder" : false,
      "minItems" : 1,
      "items" : {
        "$ref" : "#/definitions/EntityType"
      }
    },
    "Arn" : {
      "description" : "The ARN of the event type.",
      "type" : "string"
    },
    "CreatedTime" : {
      "description" : "The time when the event type was created.",
      "type" : "string"
    },
    "LastUpdatedTime" : {
      "description" : "The time when the event type was last updated.",
      "type" : "string"
    }
  },
  "additionalProperties" : false,
  "required" : [ "EntityTypes", "EventVariables", "Labels", "Name" ],
  "createOnlyProperties" : [ "/properties/Name" ],
  "readOnlyProperties" : [ "/properties/Arn", "/properties/CreatedTime", "/properties/LastUpdatedTime", "/properties/EventVariables/*/Arn", "/properties/EventVariables/*/CreatedTime", "/properties/EventVariables/*/LastUpdatedTime", "/properties/Labels/*/Arn", "/properties/Labels/*/CreatedTime", "/properties/Labels/*/LastUpdatedTime", "/properties/EntityTypes/*/Arn", "/properties/EntityTypes/*/CreatedTime", "/properties/EntityTypes/*/LastUpdatedTime" ],
  "primaryIdentifier" : [ "/properties/Arn" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "frauddetector:BatchCreateVariable", "frauddetector:BatchGetVariable", "frauddetector:CreateVariable", "frauddetector:GetVariables", "frauddetector:PutLabel", "frauddetector:PutEntityType", "frauddetector:PutEventType", "frauddetector:GetEventTypes", "frauddetector:GetLabels", "frauddetector:GetEntityTypes", "frauddetector:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "frauddetector:BatchCreateVariable", "frauddetector:BatchGetVariable", "frauddetector:CreateVariable", "frauddetector:UpdateVariable", "frauddetector:GetVariables", "frauddetector:PutLabel", "frauddetector:PutEntityType", "frauddetector:PutEventType", "frauddetector:GetEventTypes", "frauddetector:GetLabels", "frauddetector:GetEntityTypes", "frauddetector:DeleteEventType", "frauddetector:DeleteVariable", "frauddetector:DeleteLabel", "frauddetector:DeleteEntityType", "frauddetector:ListTagsForResource", "frauddetector:TagResource", "frauddetector:UntagResource" ]
    },
    "delete" : {
      "permissions" : [ "frauddetector:BatchGetVariable", "frauddetector:GetVariables", "frauddetector:GetEventTypes", "frauddetector:GetLabels", "frauddetector:GetEntityTypes", "frauddetector:DeleteEventType", "frauddetector:DeleteVariable", "frauddetector:DeleteLabel", "frauddetector:DeleteEntityType", "frauddetector:ListTagsForResource" ]
    },
    "read" : {
      "permissions" : [ "frauddetector:BatchGetVariable", "frauddetector:GetVariables", "frauddetector:GetEventTypes", "frauddetector:GetLabels", "frauddetector:GetEntityTypes", "frauddetector:ListTagsForResource" ]
    },
    "list" : {
      "permissions" : [ "frauddetector:BatchGetVariable", "frauddetector:GetVariables", "frauddetector:GetEventTypes", "frauddetector:GetLabels", "frauddetector:GetEntityTypes", "frauddetector:ListTagsForResource" ]
    }
  }
}