{
  "typeName" : "AWS::Batch::JobQueue",
  "description" : "Resource Type definition for AWS::Batch::JobQueue",
  "additionalProperties" : false,
  "definitions" : {
    "ResourceArn" : {
      "type" : "string",
      "pattern" : "arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}"
    },
    "ComputeEnvironmentOrder" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "ComputeEnvironment" : {
          "type" : "string"
        },
        "Order" : {
          "type" : "integer"
        }
      },
      "required" : [ "ComputeEnvironment", "Order" ]
    },
    "ServiceEnvironmentOrder" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "ServiceEnvironment" : {
          "type" : "string"
        },
        "Order" : {
          "type" : "integer"
        }
      },
      "required" : [ "ServiceEnvironment", "Order" ]
    },
    "JobStateTimeLimitAction" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Action" : {
          "type" : "string",
          "enum" : [ "CANCEL", "TERMINATE" ]
        },
        "MaxTimeSeconds" : {
          "type" : "integer",
          "minimum" : 600,
          "maximum" : 86400
        },
        "Reason" : {
          "type" : "string"
        },
        "State" : {
          "type" : "string",
          "enum" : [ "RUNNABLE" ]
        }
      },
      "required" : [ "Action", "MaxTimeSeconds", "Reason", "State" ]
    }
  },
  "properties" : {
    "JobQueueName" : {
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 128
    },
    "JobQueueArn" : {
      "$ref" : "#/definitions/ResourceArn"
    },
    "JobQueueType" : {
      "type" : "string"
    },
    "ComputeEnvironmentOrder" : {
      "type" : "array",
      "insertionOrder" : true,
      "uniqueItems" : false,
      "items" : {
        "$ref" : "#/definitions/ComputeEnvironmentOrder"
      }
    },
    "ServiceEnvironmentOrder" : {
      "type" : "array",
      "insertionOrder" : true,
      "uniqueItems" : false,
      "items" : {
        "$ref" : "#/definitions/ServiceEnvironmentOrder"
      }
    },
    "JobStateTimeLimitActions" : {
      "type" : "array",
      "insertionOrder" : true,
      "uniqueItems" : false,
      "items" : {
        "$ref" : "#/definitions/JobStateTimeLimitAction"
      }
    },
    "Priority" : {
      "type" : "integer",
      "minimum" : 0,
      "maximum" : 1000
    },
    "State" : {
      "type" : "string",
      "enum" : [ "DISABLED", "ENABLED" ]
    },
    "SchedulingPolicyArn" : {
      "$ref" : "#/definitions/ResourceArn"
    },
    "Tags" : {
      "type" : "object",
      "description" : "A key-value pair to associate with a resource.",
      "patternProperties" : {
        ".*" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    }
  },
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "Batch:TagResource", "Batch:UntagResource" ]
  },
  "required" : [ "Priority" ],
  "oneOf" : [ {
    "required" : [ "ComputeEnvironmentOrder" ]
  }, {
    "required" : [ "ServiceEnvironmentOrder" ]
  } ],
  "primaryIdentifier" : [ "/properties/JobQueueArn" ],
  "createOnlyProperties" : [ "/properties/JobQueueName", "/properties/JobQueueType" ],
  "readOnlyProperties" : [ "/properties/JobQueueArn" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "Batch:CreateJobQueue", "Batch:TagResource", "Batch:DescribeJobQueues" ]
    },
    "read" : {
      "permissions" : [ "Batch:DescribeJobQueues" ]
    },
    "update" : {
      "permissions" : [ "Batch:DescribeJobQueues", "Batch:UpdateJobQueue", "Batch:TagResource", "Batch:UntagResource" ]
    },
    "delete" : {
      "permissions" : [ "Batch:UpdateJobQueue", "Batch:DescribeJobQueues", "Batch:DeleteJobQueue" ]
    },
    "list" : {
      "permissions" : [ "Batch:DescribeJobQueues" ]
    }
  }
}