{
  "typeName" : "AWS::FraudDetector::Variable",
  "description" : "A resource schema for a Variable 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
    }
  },
  "properties" : {
    "Name" : {
      "description" : "The name of the variable.",
      "type" : "string",
      "pattern" : "^[a-z_][a-z0-9_]{0,99}?$"
    },
    "DataSource" : {
      "description" : "The source of the data.",
      "type" : "string",
      "enum" : [ "EVENT", "EXTERNAL_MODEL_SCORE" ]
    },
    "DataType" : {
      "description" : "The data type.",
      "type" : "string",
      "enum" : [ "STRING", "INTEGER", "FLOAT", "BOOLEAN" ]
    },
    "DefaultValue" : {
      "description" : "The default value for the variable when no value is received.",
      "type" : "string"
    },
    "Description" : {
      "description" : "The description.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 256
    },
    "Tags" : {
      "description" : "Tags associated with this variable.",
      "type" : "array",
      "uniqueItems" : false,
      "insertionOrder" : false,
      "maxItems" : 200,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "VariableType" : {
      "description" : "The variable type. For more information see https://docs.aws.amazon.com/frauddetector/latest/ug/create-a-variable.html#variable-types",
      "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" ]
    },
    "Arn" : {
      "description" : "The ARN of the variable.",
      "type" : "string"
    },
    "CreatedTime" : {
      "description" : "The time when the variable was created.",
      "type" : "string"
    },
    "LastUpdatedTime" : {
      "description" : "The time when the variable was last updated.",
      "type" : "string"
    }
  },
  "additionalProperties" : false,
  "required" : [ "DataType", "DataSource", "DefaultValue", "Name" ],
  "createOnlyProperties" : [ "/properties/Name" ],
  "readOnlyProperties" : [ "/properties/Arn", "/properties/CreatedTime", "/properties/LastUpdatedTime" ],
  "primaryIdentifier" : [ "/properties/Arn" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "frauddetector:GetVariables", "frauddetector:CreateVariable", "frauddetector:ListTagsForResource" ]
    },
    "read" : {
      "permissions" : [ "frauddetector:GetVariables", "frauddetector:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "frauddetector:GetVariables", "frauddetector:UpdateVariable", "frauddetector:ListTagsForResource", "frauddetector:TagResource", "frauddetector:UntagResource" ]
    },
    "delete" : {
      "permissions" : [ "frauddetector:GetVariables", "frauddetector:DeleteVariable" ]
    },
    "list" : {
      "permissions" : [ "frauddetector:GetVariables", "frauddetector:ListTagsForResource" ]
    }
  }
}