
from . import AWSObject, AWSProperty


class Subscription(AWSProperty):
    props = {
        'Endpoint': (basestring, True),
        'Protocol': (basestring, True),
    }


class TopicPolicy(AWSObject):
    props = {
        'PolicyDocument': (dict, True),
        'Topics': (list, True),
    }

    def __init__(self, name, **kwargs):
        self.type = "AWS::SNS::TopicPolicy"
        sup = super(TopicPolicy, self)
        sup.__init__(name, self.type, "Properties", self.props, **kwargs)


class Topic(AWSObject):
    props = {
        'DisplayName': (basestring, False),
        'Subscription': (list, True),
    }

    def __init__(self, name, **kwargs):
        self.type = "AWS::SNS::Topic"
        sup = super(Topic, self)
        sup.__init__(name, self.type, "Properties", self.props, **kwargs)


from . import AWSObject, AWSProperty


class Subscription(AWSProperty):
    props = {
        'Endpoint': (basestring, True),
        'Protocol': (basestring, True),
    }


class TopicPolicy(AWSObject):
    props = {
        'PolicyDocument': (dict, True),
        'Topics': (list, True),
    }

    def __init__(self, name, **kwargs):
        self.type = "AWS::SNS::TopicPolicy"
        sup = super(TopicPolicy, self)
        sup.__init__(name, self.type, "Properties", self.props, **kwargs)


class Topic(AWSObject):
    props = {
        'DisplayName': (basestring, False),
        'Subscription': ([Subscription], True),
    }

    def __init__(self, name, **kwargs):
        self.type = "AWS::SNS::Topic"
        sup = super(Topic, self)
        sup.__init__(name, self.type, "Properties", self.props, **kwargs)

Validate the Subscription policy is made up of Subscription objects
Validate the Subscription policy is made up of Subscription objects

  
  from . import AWSObject, AWSProperty
  
  
  class Subscription(AWSProperty):
      props = {
          'Endpoint': (basestring, True),
          'Protocol': (basestring, True),
      }
  
  
  class TopicPolicy(AWSObject):
      props = {
          'PolicyDocument': (dict, True),
          'Topics': (list, True),
      }
  
      def __init__(self, name, **kwargs):
          self.type = "AWS::SNS::TopicPolicy"
          sup = super(TopicPolicy, self)
          sup.__init__(name, self.type, "Properties", self.props, **kwargs)
  
  
  class Topic(AWSObject):
      props = {
          'DisplayName': (basestring, False),
-         'Subscription': (list, True),
+         'Subscription': ([Subscription], True),
      }
  
      def __init__(self, name, **kwargs):
          self.type = "AWS::SNS::Topic"
          sup = super(Topic, self)
          sup.__init__(name, self.type, "Properties", self.props, **kwargs)
  
Validate the Subscription policy is made up of Subscription objects
## Code Before:

from . import AWSObject, AWSProperty


class Subscription(AWSProperty):
    props = {
        'Endpoint': (basestring, True),
        'Protocol': (basestring, True),
    }


class TopicPolicy(AWSObject):
    props = {
        'PolicyDocument': (dict, True),
        'Topics': (list, True),
    }

    def __init__(self, name, **kwargs):
        self.type = "AWS::SNS::TopicPolicy"
        sup = super(TopicPolicy, self)
        sup.__init__(name, self.type, "Properties", self.props, **kwargs)


class Topic(AWSObject):
    props = {
        'DisplayName': (basestring, False),
        'Subscription': (list, True),
    }

    def __init__(self, name, **kwargs):
        self.type = "AWS::SNS::Topic"
        sup = super(Topic, self)
        sup.__init__(name, self.type, "Properties", self.props, **kwargs)

## Instruction:
Validate the Subscription policy is made up of Subscription objects
## Code After:

from . import AWSObject, AWSProperty


class Subscription(AWSProperty):
    props = {
        'Endpoint': (basestring, True),
        'Protocol': (basestring, True),
    }


class TopicPolicy(AWSObject):
    props = {
        'PolicyDocument': (dict, True),
        'Topics': (list, True),
    }

    def __init__(self, name, **kwargs):
        self.type = "AWS::SNS::TopicPolicy"
        sup = super(TopicPolicy, self)
        sup.__init__(name, self.type, "Properties", self.props, **kwargs)


class Topic(AWSObject):
    props = {
        'DisplayName': (basestring, False),
        'Subscription': ([Subscription], True),
    }

    def __init__(self, name, **kwargs):
        self.type = "AWS::SNS::Topic"
        sup = super(Topic, self)
        sup.__init__(name, self.type, "Properties", self.props, **kwargs)
