from . import AWSObject, AWSProperty, Tags
from .compat import policytypes


class LifecyclePolicy(AWSProperty):
    props = {
        'LifecyclePolicyText': (basestring, False),
        'RegistryId': (basestring, False),
    }


class Repository(AWSObject):
    resource_type = "AWS::ECR::Repository"

    props = {
        'ImageScanningConfiguration': (dict, False),
        'ImageTagMutability': (basestring, False),
        'LifecyclePolicy': (LifecyclePolicy, False),
        'RepositoryName': (basestring, False),
        'RepositoryPolicyText': (policytypes, False),
        'Tags': (Tags, False),
    }



from . import AWSObject, AWSProperty, Tags
from .compat import policytypes


class PublicRepository(AWSObject):
    resource_type = "AWS::ECR::PublicRepository"

    props = {
        'RepositoryCatalogData': (dict, False),
        'RepositoryName': (basestring, False),
        'RepositoryPolicyText': (policytypes, False),
        'Tags': (Tags, False),
    }


class RegistryPolicy(AWSObject):
    resource_type = "AWS::ECR::RegistryPolicy"

    props = {
        'PolicyText': (policytypes, True),
    }


class ReplicationDestination(AWSProperty):
    props = {
        'Region': (basestring, True),
        'RegistryId': (basestring, True),
    }


class ReplicationRule(AWSProperty):
    props = {
        'Destinations': ([ReplicationDestination], True),
    }


class ReplicationConfigurationProperty(AWSProperty):
    props = {
        'Rules': ([ReplicationRule], True),
    }


class ReplicationConfiguration(AWSObject):
    resource_type = "AWS::ECR::Repository"

    props = {
        'ReplicationConfigurationProperty':
            (ReplicationConfigurationProperty, True),
    }


class LifecyclePolicy(AWSProperty):
    props = {
        'LifecyclePolicyText': (basestring, False),
        'RegistryId': (basestring, False),
    }


class Repository(AWSObject):
    resource_type = "AWS::ECR::Repository"

    props = {
        'ImageScanningConfiguration': (dict, False),
        'ImageTagMutability': (basestring, False),
        'LifecyclePolicy': (LifecyclePolicy, False),
        'RepositoryName': (basestring, False),
        'RepositoryPolicyText': (policytypes, False),
        'Tags': (Tags, False),
    }

Update ECR per 2020-12-18 and 2021-02-04 changes
Update ECR per 2020-12-18 and 2021-02-04 changes

+ 
+ 
  from . import AWSObject, AWSProperty, Tags
  from .compat import policytypes
+ 
+ 
+ class PublicRepository(AWSObject):
+     resource_type = "AWS::ECR::PublicRepository"
+ 
+     props = {
+         'RepositoryCatalogData': (dict, False),
+         'RepositoryName': (basestring, False),
+         'RepositoryPolicyText': (policytypes, False),
+         'Tags': (Tags, False),
+     }
+ 
+ 
+ class RegistryPolicy(AWSObject):
+     resource_type = "AWS::ECR::RegistryPolicy"
+ 
+     props = {
+         'PolicyText': (policytypes, True),
+     }
+ 
+ 
+ class ReplicationDestination(AWSProperty):
+     props = {
+         'Region': (basestring, True),
+         'RegistryId': (basestring, True),
+     }
+ 
+ 
+ class ReplicationRule(AWSProperty):
+     props = {
+         'Destinations': ([ReplicationDestination], True),
+     }
+ 
+ 
+ class ReplicationConfigurationProperty(AWSProperty):
+     props = {
+         'Rules': ([ReplicationRule], True),
+     }
+ 
+ 
+ class ReplicationConfiguration(AWSObject):
+     resource_type = "AWS::ECR::Repository"
+ 
+     props = {
+         'ReplicationConfigurationProperty':
+             (ReplicationConfigurationProperty, True),
+     }
  
  
  class LifecyclePolicy(AWSProperty):
      props = {
          'LifecyclePolicyText': (basestring, False),
          'RegistryId': (basestring, False),
      }
  
  
  class Repository(AWSObject):
      resource_type = "AWS::ECR::Repository"
  
      props = {
          'ImageScanningConfiguration': (dict, False),
          'ImageTagMutability': (basestring, False),
          'LifecyclePolicy': (LifecyclePolicy, False),
          'RepositoryName': (basestring, False),
          'RepositoryPolicyText': (policytypes, False),
          'Tags': (Tags, False),
      }
  
Update ECR per 2020-12-18 and 2021-02-04 changes
## Code Before:
from . import AWSObject, AWSProperty, Tags
from .compat import policytypes


class LifecyclePolicy(AWSProperty):
    props = {
        'LifecyclePolicyText': (basestring, False),
        'RegistryId': (basestring, False),
    }


class Repository(AWSObject):
    resource_type = "AWS::ECR::Repository"

    props = {
        'ImageScanningConfiguration': (dict, False),
        'ImageTagMutability': (basestring, False),
        'LifecyclePolicy': (LifecyclePolicy, False),
        'RepositoryName': (basestring, False),
        'RepositoryPolicyText': (policytypes, False),
        'Tags': (Tags, False),
    }

## Instruction:
Update ECR per 2020-12-18 and 2021-02-04 changes
## Code After:


from . import AWSObject, AWSProperty, Tags
from .compat import policytypes


class PublicRepository(AWSObject):
    resource_type = "AWS::ECR::PublicRepository"

    props = {
        'RepositoryCatalogData': (dict, False),
        'RepositoryName': (basestring, False),
        'RepositoryPolicyText': (policytypes, False),
        'Tags': (Tags, False),
    }


class RegistryPolicy(AWSObject):
    resource_type = "AWS::ECR::RegistryPolicy"

    props = {
        'PolicyText': (policytypes, True),
    }


class ReplicationDestination(AWSProperty):
    props = {
        'Region': (basestring, True),
        'RegistryId': (basestring, True),
    }


class ReplicationRule(AWSProperty):
    props = {
        'Destinations': ([ReplicationDestination], True),
    }


class ReplicationConfigurationProperty(AWSProperty):
    props = {
        'Rules': ([ReplicationRule], True),
    }


class ReplicationConfiguration(AWSObject):
    resource_type = "AWS::ECR::Repository"

    props = {
        'ReplicationConfigurationProperty':
            (ReplicationConfigurationProperty, True),
    }


class LifecyclePolicy(AWSProperty):
    props = {
        'LifecyclePolicyText': (basestring, False),
        'RegistryId': (basestring, False),
    }


class Repository(AWSObject):
    resource_type = "AWS::ECR::Repository"

    props = {
        'ImageScanningConfiguration': (dict, False),
        'ImageTagMutability': (basestring, False),
        'LifecyclePolicy': (LifecyclePolicy, False),
        'RepositoryName': (basestring, False),
        'RepositoryPolicyText': (policytypes, False),
        'Tags': (Tags, False),
    }
