
from . import AWSObject
from .validators import integer
try:
    from awacs.aws import Policy
    policytypes = (dict, Policy)
except ImportError:
    policytypes = dict,


class Queue(AWSObject):
    type = "AWS::SQS::Queue"

    props = {
        'DelaySeconds': (integer, False),
        'MaximumMessageSize': (integer, False),
        'MessageRetentionPeriod': (integer, False),
        'QueueName': (basestring, False),
        'ReceiveMessageWaitTimeSeconds': (integer, False),
        'VisibilityTimeout': (integer, False),
    }


class QueuePolicy(AWSObject):
    type = "AWS::SQS::QueuePolicy"

    props = {
        'PolicyDocument': (policytypes, False),
        'Queues': (list, True),
    }


from . import AWSObject, AWSProperty
from .validators import integer
try:
    from awacs.aws import Policy
    policytypes = (dict, Policy)
except ImportError:
    policytypes = dict,


class RedrivePolicy(AWSProperty):
    props = {
        'deadLetterTargetArn': (basestring, False),
        'maxReceiveCount': (integer, False),
    }


class Queue(AWSObject):
    type = "AWS::SQS::Queue"

    props = {
        'DelaySeconds': (integer, False),
        'MaximumMessageSize': (integer, False),
        'MessageRetentionPeriod': (integer, False),
        'QueueName': (basestring, False),
        'ReceiveMessageWaitTimeSeconds': (integer, False),
        'RedrivePolicy': (RedrivePolicy, False),
        'VisibilityTimeout': (integer, False),
    }


class QueuePolicy(AWSObject):
    type = "AWS::SQS::QueuePolicy"

    props = {
        'PolicyDocument': (policytypes, False),
        'Queues': (list, True),
    }

Add SQS dead letter queue from CloudFormation release 2014-01-29
Add SQS dead letter queue from CloudFormation release 2014-01-29

  
- from . import AWSObject
+ from . import AWSObject, AWSProperty
  from .validators import integer
  try:
      from awacs.aws import Policy
      policytypes = (dict, Policy)
  except ImportError:
      policytypes = dict,
+ 
+ 
+ class RedrivePolicy(AWSProperty):
+     props = {
+         'deadLetterTargetArn': (basestring, False),
+         'maxReceiveCount': (integer, False),
+     }
  
  
  class Queue(AWSObject):
      type = "AWS::SQS::Queue"
  
      props = {
          'DelaySeconds': (integer, False),
          'MaximumMessageSize': (integer, False),
          'MessageRetentionPeriod': (integer, False),
          'QueueName': (basestring, False),
          'ReceiveMessageWaitTimeSeconds': (integer, False),
+         'RedrivePolicy': (RedrivePolicy, False),
          'VisibilityTimeout': (integer, False),
      }
  
  
  class QueuePolicy(AWSObject):
      type = "AWS::SQS::QueuePolicy"
  
      props = {
          'PolicyDocument': (policytypes, False),
          'Queues': (list, True),
      }
  
Add SQS dead letter queue from CloudFormation release 2014-01-29
## Code Before:

from . import AWSObject
from .validators import integer
try:
    from awacs.aws import Policy
    policytypes = (dict, Policy)
except ImportError:
    policytypes = dict,


class Queue(AWSObject):
    type = "AWS::SQS::Queue"

    props = {
        'DelaySeconds': (integer, False),
        'MaximumMessageSize': (integer, False),
        'MessageRetentionPeriod': (integer, False),
        'QueueName': (basestring, False),
        'ReceiveMessageWaitTimeSeconds': (integer, False),
        'VisibilityTimeout': (integer, False),
    }


class QueuePolicy(AWSObject):
    type = "AWS::SQS::QueuePolicy"

    props = {
        'PolicyDocument': (policytypes, False),
        'Queues': (list, True),
    }

## Instruction:
Add SQS dead letter queue from CloudFormation release 2014-01-29
## Code After:

from . import AWSObject, AWSProperty
from .validators import integer
try:
    from awacs.aws import Policy
    policytypes = (dict, Policy)
except ImportError:
    policytypes = dict,


class RedrivePolicy(AWSProperty):
    props = {
        'deadLetterTargetArn': (basestring, False),
        'maxReceiveCount': (integer, False),
    }


class Queue(AWSObject):
    type = "AWS::SQS::Queue"

    props = {
        'DelaySeconds': (integer, False),
        'MaximumMessageSize': (integer, False),
        'MessageRetentionPeriod': (integer, False),
        'QueueName': (basestring, False),
        'ReceiveMessageWaitTimeSeconds': (integer, False),
        'RedrivePolicy': (RedrivePolicy, False),
        'VisibilityTimeout': (integer, False),
    }


class QueuePolicy(AWSObject):
    type = "AWS::SQS::QueuePolicy"

    props = {
        'PolicyDocument': (policytypes, False),
        'Queues': (list, True),
    }
