module Stratosphere.ECR.ReplicationConfiguration.ReplicationRuleProperty (
        module Exports, ReplicationRuleProperty(..),
        mkReplicationRuleProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.ECR.ReplicationConfiguration.ReplicationDestinationProperty as Exports
import {-# SOURCE #-} Stratosphere.ECR.ReplicationConfiguration.RepositoryFilterProperty as Exports
import Stratosphere.ResourceProperties
data ReplicationRuleProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html>
    ReplicationRuleProperty {ReplicationRuleProperty -> ()
haddock_workaround_ :: (),
                             -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html#cfn-ecr-replicationconfiguration-replicationrule-destinations>
                             ReplicationRuleProperty -> [ReplicationDestinationProperty]
destinations :: [ReplicationDestinationProperty],
                             -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html#cfn-ecr-replicationconfiguration-replicationrule-repositoryfilters>
                             ReplicationRuleProperty -> Maybe [RepositoryFilterProperty]
repositoryFilters :: (Prelude.Maybe [RepositoryFilterProperty])}
  deriving stock (ReplicationRuleProperty -> ReplicationRuleProperty -> Bool
(ReplicationRuleProperty -> ReplicationRuleProperty -> Bool)
-> (ReplicationRuleProperty -> ReplicationRuleProperty -> Bool)
-> Eq ReplicationRuleProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ReplicationRuleProperty -> ReplicationRuleProperty -> Bool
== :: ReplicationRuleProperty -> ReplicationRuleProperty -> Bool
$c/= :: ReplicationRuleProperty -> ReplicationRuleProperty -> Bool
/= :: ReplicationRuleProperty -> ReplicationRuleProperty -> Bool
Prelude.Eq, Int -> ReplicationRuleProperty -> ShowS
[ReplicationRuleProperty] -> ShowS
ReplicationRuleProperty -> String
(Int -> ReplicationRuleProperty -> ShowS)
-> (ReplicationRuleProperty -> String)
-> ([ReplicationRuleProperty] -> ShowS)
-> Show ReplicationRuleProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ReplicationRuleProperty -> ShowS
showsPrec :: Int -> ReplicationRuleProperty -> ShowS
$cshow :: ReplicationRuleProperty -> String
show :: ReplicationRuleProperty -> String
$cshowList :: [ReplicationRuleProperty] -> ShowS
showList :: [ReplicationRuleProperty] -> ShowS
Prelude.Show)
mkReplicationRuleProperty ::
  [ReplicationDestinationProperty] -> ReplicationRuleProperty
mkReplicationRuleProperty :: [ReplicationDestinationProperty] -> ReplicationRuleProperty
mkReplicationRuleProperty [ReplicationDestinationProperty]
destinations
  = ReplicationRuleProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), destinations :: [ReplicationDestinationProperty]
destinations = [ReplicationDestinationProperty]
destinations,
       repositoryFilters :: Maybe [RepositoryFilterProperty]
repositoryFilters = Maybe [RepositoryFilterProperty]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties ReplicationRuleProperty where
  toResourceProperties :: ReplicationRuleProperty -> ResourceProperties
toResourceProperties ReplicationRuleProperty {[ReplicationDestinationProperty]
Maybe [RepositoryFilterProperty]
()
haddock_workaround_ :: ReplicationRuleProperty -> ()
destinations :: ReplicationRuleProperty -> [ReplicationDestinationProperty]
repositoryFilters :: ReplicationRuleProperty -> Maybe [RepositoryFilterProperty]
haddock_workaround_ :: ()
destinations :: [ReplicationDestinationProperty]
repositoryFilters :: Maybe [RepositoryFilterProperty]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::ECR::ReplicationConfiguration.ReplicationRule",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
                           [Key
"Destinations" Key -> [ReplicationDestinationProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= [ReplicationDestinationProperty]
destinations]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [Key -> [RepositoryFilterProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"RepositoryFilters" ([RepositoryFilterProperty] -> (Key, Value))
-> Maybe [RepositoryFilterProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RepositoryFilterProperty]
repositoryFilters]))}
instance JSON.ToJSON ReplicationRuleProperty where
  toJSON :: ReplicationRuleProperty -> Value
toJSON ReplicationRuleProperty {[ReplicationDestinationProperty]
Maybe [RepositoryFilterProperty]
()
haddock_workaround_ :: ReplicationRuleProperty -> ()
destinations :: ReplicationRuleProperty -> [ReplicationDestinationProperty]
repositoryFilters :: ReplicationRuleProperty -> Maybe [RepositoryFilterProperty]
haddock_workaround_ :: ()
destinations :: [ReplicationDestinationProperty]
repositoryFilters :: Maybe [RepositoryFilterProperty]
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
              [Key
"Destinations" Key -> [ReplicationDestinationProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= [ReplicationDestinationProperty]
destinations]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [Key -> [RepositoryFilterProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"RepositoryFilters" ([RepositoryFilterProperty] -> (Key, Value))
-> Maybe [RepositoryFilterProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RepositoryFilterProperty]
repositoryFilters])))
instance Property "Destinations" ReplicationRuleProperty where
  type PropertyType "Destinations" ReplicationRuleProperty = [ReplicationDestinationProperty]
  set :: PropertyType "Destinations" ReplicationRuleProperty
-> ReplicationRuleProperty -> ReplicationRuleProperty
set PropertyType "Destinations" ReplicationRuleProperty
newValue ReplicationRuleProperty {[ReplicationDestinationProperty]
Maybe [RepositoryFilterProperty]
()
haddock_workaround_ :: ReplicationRuleProperty -> ()
destinations :: ReplicationRuleProperty -> [ReplicationDestinationProperty]
repositoryFilters :: ReplicationRuleProperty -> Maybe [RepositoryFilterProperty]
haddock_workaround_ :: ()
destinations :: [ReplicationDestinationProperty]
repositoryFilters :: Maybe [RepositoryFilterProperty]
..}
    = ReplicationRuleProperty {destinations :: [ReplicationDestinationProperty]
destinations = [ReplicationDestinationProperty]
PropertyType "Destinations" ReplicationRuleProperty
newValue, Maybe [RepositoryFilterProperty]
()
haddock_workaround_ :: ()
repositoryFilters :: Maybe [RepositoryFilterProperty]
haddock_workaround_ :: ()
repositoryFilters :: Maybe [RepositoryFilterProperty]
..}
instance Property "RepositoryFilters" ReplicationRuleProperty where
  type PropertyType "RepositoryFilters" ReplicationRuleProperty = [RepositoryFilterProperty]
  set :: PropertyType "RepositoryFilters" ReplicationRuleProperty
-> ReplicationRuleProperty -> ReplicationRuleProperty
set PropertyType "RepositoryFilters" ReplicationRuleProperty
newValue ReplicationRuleProperty {[ReplicationDestinationProperty]
Maybe [RepositoryFilterProperty]
()
haddock_workaround_ :: ReplicationRuleProperty -> ()
destinations :: ReplicationRuleProperty -> [ReplicationDestinationProperty]
repositoryFilters :: ReplicationRuleProperty -> Maybe [RepositoryFilterProperty]
haddock_workaround_ :: ()
destinations :: [ReplicationDestinationProperty]
repositoryFilters :: Maybe [RepositoryFilterProperty]
..}
    = ReplicationRuleProperty
        {repositoryFilters :: Maybe [RepositoryFilterProperty]
repositoryFilters = [RepositoryFilterProperty] -> Maybe [RepositoryFilterProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [RepositoryFilterProperty]
PropertyType "RepositoryFilters" ReplicationRuleProperty
newValue, [ReplicationDestinationProperty]
()
haddock_workaround_ :: ()
destinations :: [ReplicationDestinationProperty]
haddock_workaround_ :: ()
destinations :: [ReplicationDestinationProperty]
..}