# Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 31.0.0


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


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

    props = {
        "RepositoryCatalogData": (dict, False),
        "RepositoryName": (str, False),
        "RepositoryPolicyText": (policytypes, False),
        "Tags": (Tags, False),
    }


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

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


class ReplicationDestination(AWSProperty):
    props = {
        "Region": (str, True),
        "RegistryId": (str, 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": (str, False),
        "RegistryId": (str, False),
    }


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

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

# Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 31.0.0


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


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

    props = {
        "RepositoryCatalogData": (dict, False),
        "RepositoryName": (str, False),
        "RepositoryPolicyText": (policytypes, False),
        "Tags": (Tags, False),
    }


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

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


class ReplicationDestination(AWSProperty):
    props = {
        "Region": (str, True),
        "RegistryId": (str, True),
    }


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


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


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

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


class LifecyclePolicy(AWSProperty):
    props = {
        "LifecyclePolicyText": (str, False),
        "RegistryId": (str, False),
    }


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

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

Fix intermittent failure due to an incorrect resource_name in ECR