module Stratosphere.DSQL.Cluster (
        module Exports, Cluster(..), mkCluster
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.DSQL.Cluster.MultiRegionPropertiesProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data Cluster
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dsql-cluster.html>
    Cluster {Cluster -> ()
haddock_workaround_ :: (),
             -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dsql-cluster.html#cfn-dsql-cluster-deletionprotectionenabled>
             Cluster -> Maybe (Value Bool)
deletionProtectionEnabled :: (Prelude.Maybe (Value Prelude.Bool)),
             -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dsql-cluster.html#cfn-dsql-cluster-kmsencryptionkey>
             Cluster -> Maybe (Value Text)
kmsEncryptionKey :: (Prelude.Maybe (Value Prelude.Text)),
             -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dsql-cluster.html#cfn-dsql-cluster-multiregionproperties>
             Cluster -> Maybe MultiRegionPropertiesProperty
multiRegionProperties :: (Prelude.Maybe MultiRegionPropertiesProperty),
             -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dsql-cluster.html#cfn-dsql-cluster-tags>
             Cluster -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
  deriving stock (Cluster -> Cluster -> Bool
(Cluster -> Cluster -> Bool)
-> (Cluster -> Cluster -> Bool) -> Eq Cluster
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Cluster -> Cluster -> Bool
== :: Cluster -> Cluster -> Bool
$c/= :: Cluster -> Cluster -> Bool
/= :: Cluster -> Cluster -> Bool
Prelude.Eq, Int -> Cluster -> ShowS
[Cluster] -> ShowS
Cluster -> String
(Int -> Cluster -> ShowS)
-> (Cluster -> String) -> ([Cluster] -> ShowS) -> Show Cluster
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Cluster -> ShowS
showsPrec :: Int -> Cluster -> ShowS
$cshow :: Cluster -> String
show :: Cluster -> String
$cshowList :: [Cluster] -> ShowS
showList :: [Cluster] -> ShowS
Prelude.Show)
mkCluster :: Cluster
mkCluster :: Cluster
mkCluster
  = Cluster
      {haddock_workaround_ :: ()
haddock_workaround_ = (),
       deletionProtectionEnabled :: Maybe (Value Bool)
deletionProtectionEnabled = Maybe (Value Bool)
forall a. Maybe a
Prelude.Nothing,
       kmsEncryptionKey :: Maybe (Value Text)
kmsEncryptionKey = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       multiRegionProperties :: Maybe MultiRegionPropertiesProperty
multiRegionProperties = Maybe MultiRegionPropertiesProperty
forall a. Maybe a
Prelude.Nothing, tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Cluster where
  toResourceProperties :: Cluster -> ResourceProperties
toResourceProperties Cluster {Maybe [Tag]
Maybe (Value Bool)
Maybe (Value Text)
Maybe MultiRegionPropertiesProperty
()
haddock_workaround_ :: Cluster -> ()
deletionProtectionEnabled :: Cluster -> Maybe (Value Bool)
kmsEncryptionKey :: Cluster -> Maybe (Value Text)
multiRegionProperties :: Cluster -> Maybe MultiRegionPropertiesProperty
tags :: Cluster -> Maybe [Tag]
haddock_workaround_ :: ()
deletionProtectionEnabled :: Maybe (Value Bool)
kmsEncryptionKey :: Maybe (Value Text)
multiRegionProperties :: Maybe MultiRegionPropertiesProperty
tags :: Maybe [Tag]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::DSQL::Cluster", supportsTags :: Bool
supportsTags = Bool
Prelude.True,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                           [Key -> Value Bool -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"DeletionProtectionEnabled"
                              (Value Bool -> (Key, Value))
-> Maybe (Value Bool) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Bool)
deletionProtectionEnabled,
                            Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"KmsEncryptionKey" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
kmsEncryptionKey,
                            Key -> MultiRegionPropertiesProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"MultiRegionProperties"
                              (MultiRegionPropertiesProperty -> (Key, Value))
-> Maybe MultiRegionPropertiesProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MultiRegionPropertiesProperty
multiRegionProperties,
                            Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags])}
instance JSON.ToJSON Cluster where
  toJSON :: Cluster -> Value
toJSON Cluster {Maybe [Tag]
Maybe (Value Bool)
Maybe (Value Text)
Maybe MultiRegionPropertiesProperty
()
haddock_workaround_ :: Cluster -> ()
deletionProtectionEnabled :: Cluster -> Maybe (Value Bool)
kmsEncryptionKey :: Cluster -> Maybe (Value Text)
multiRegionProperties :: Cluster -> Maybe MultiRegionPropertiesProperty
tags :: Cluster -> Maybe [Tag]
haddock_workaround_ :: ()
deletionProtectionEnabled :: Maybe (Value Bool)
kmsEncryptionKey :: Maybe (Value Text)
multiRegionProperties :: Maybe MultiRegionPropertiesProperty
tags :: Maybe [Tag]
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
              [Key -> Value Bool -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"DeletionProtectionEnabled"
                 (Value Bool -> (Key, Value))
-> Maybe (Value Bool) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Bool)
deletionProtectionEnabled,
               Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"KmsEncryptionKey" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
kmsEncryptionKey,
               Key -> MultiRegionPropertiesProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"MultiRegionProperties"
                 (MultiRegionPropertiesProperty -> (Key, Value))
-> Maybe MultiRegionPropertiesProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MultiRegionPropertiesProperty
multiRegionProperties,
               Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags]))
instance Property "DeletionProtectionEnabled" Cluster where
  type PropertyType "DeletionProtectionEnabled" Cluster = Value Prelude.Bool
  set :: PropertyType "DeletionProtectionEnabled" Cluster
-> Cluster -> Cluster
set PropertyType "DeletionProtectionEnabled" Cluster
newValue Cluster {Maybe [Tag]
Maybe (Value Bool)
Maybe (Value Text)
Maybe MultiRegionPropertiesProperty
()
haddock_workaround_ :: Cluster -> ()
deletionProtectionEnabled :: Cluster -> Maybe (Value Bool)
kmsEncryptionKey :: Cluster -> Maybe (Value Text)
multiRegionProperties :: Cluster -> Maybe MultiRegionPropertiesProperty
tags :: Cluster -> Maybe [Tag]
haddock_workaround_ :: ()
deletionProtectionEnabled :: Maybe (Value Bool)
kmsEncryptionKey :: Maybe (Value Text)
multiRegionProperties :: Maybe MultiRegionPropertiesProperty
tags :: Maybe [Tag]
..}
    = Cluster {deletionProtectionEnabled :: Maybe (Value Bool)
deletionProtectionEnabled = Value Bool -> Maybe (Value Bool)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "DeletionProtectionEnabled" Cluster
Value Bool
newValue, Maybe [Tag]
Maybe (Value Text)
Maybe MultiRegionPropertiesProperty
()
haddock_workaround_ :: ()
kmsEncryptionKey :: Maybe (Value Text)
multiRegionProperties :: Maybe MultiRegionPropertiesProperty
tags :: Maybe [Tag]
haddock_workaround_ :: ()
kmsEncryptionKey :: Maybe (Value Text)
multiRegionProperties :: Maybe MultiRegionPropertiesProperty
tags :: Maybe [Tag]
..}
instance Property "KmsEncryptionKey" Cluster where
  type PropertyType "KmsEncryptionKey" Cluster = Value Prelude.Text
  set :: PropertyType "KmsEncryptionKey" Cluster -> Cluster -> Cluster
set PropertyType "KmsEncryptionKey" Cluster
newValue Cluster {Maybe [Tag]
Maybe (Value Bool)
Maybe (Value Text)
Maybe MultiRegionPropertiesProperty
()
haddock_workaround_ :: Cluster -> ()
deletionProtectionEnabled :: Cluster -> Maybe (Value Bool)
kmsEncryptionKey :: Cluster -> Maybe (Value Text)
multiRegionProperties :: Cluster -> Maybe MultiRegionPropertiesProperty
tags :: Cluster -> Maybe [Tag]
haddock_workaround_ :: ()
deletionProtectionEnabled :: Maybe (Value Bool)
kmsEncryptionKey :: Maybe (Value Text)
multiRegionProperties :: Maybe MultiRegionPropertiesProperty
tags :: Maybe [Tag]
..}
    = Cluster {kmsEncryptionKey :: Maybe (Value Text)
kmsEncryptionKey = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "KmsEncryptionKey" Cluster
Value Text
newValue, Maybe [Tag]
Maybe (Value Bool)
Maybe MultiRegionPropertiesProperty
()
haddock_workaround_ :: ()
deletionProtectionEnabled :: Maybe (Value Bool)
multiRegionProperties :: Maybe MultiRegionPropertiesProperty
tags :: Maybe [Tag]
haddock_workaround_ :: ()
deletionProtectionEnabled :: Maybe (Value Bool)
multiRegionProperties :: Maybe MultiRegionPropertiesProperty
tags :: Maybe [Tag]
..}
instance Property "MultiRegionProperties" Cluster where
  type PropertyType "MultiRegionProperties" Cluster = MultiRegionPropertiesProperty
  set :: PropertyType "MultiRegionProperties" Cluster -> Cluster -> Cluster
set PropertyType "MultiRegionProperties" Cluster
newValue Cluster {Maybe [Tag]
Maybe (Value Bool)
Maybe (Value Text)
Maybe MultiRegionPropertiesProperty
()
haddock_workaround_ :: Cluster -> ()
deletionProtectionEnabled :: Cluster -> Maybe (Value Bool)
kmsEncryptionKey :: Cluster -> Maybe (Value Text)
multiRegionProperties :: Cluster -> Maybe MultiRegionPropertiesProperty
tags :: Cluster -> Maybe [Tag]
haddock_workaround_ :: ()
deletionProtectionEnabled :: Maybe (Value Bool)
kmsEncryptionKey :: Maybe (Value Text)
multiRegionProperties :: Maybe MultiRegionPropertiesProperty
tags :: Maybe [Tag]
..}
    = Cluster {multiRegionProperties :: Maybe MultiRegionPropertiesProperty
multiRegionProperties = MultiRegionPropertiesProperty
-> Maybe MultiRegionPropertiesProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "MultiRegionProperties" Cluster
MultiRegionPropertiesProperty
newValue, Maybe [Tag]
Maybe (Value Bool)
Maybe (Value Text)
()
haddock_workaround_ :: ()
deletionProtectionEnabled :: Maybe (Value Bool)
kmsEncryptionKey :: Maybe (Value Text)
tags :: Maybe [Tag]
haddock_workaround_ :: ()
deletionProtectionEnabled :: Maybe (Value Bool)
kmsEncryptionKey :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
instance Property "Tags" Cluster where
  type PropertyType "Tags" Cluster = [Tag]
  set :: PropertyType "Tags" Cluster -> Cluster -> Cluster
set PropertyType "Tags" Cluster
newValue Cluster {Maybe [Tag]
Maybe (Value Bool)
Maybe (Value Text)
Maybe MultiRegionPropertiesProperty
()
haddock_workaround_ :: Cluster -> ()
deletionProtectionEnabled :: Cluster -> Maybe (Value Bool)
kmsEncryptionKey :: Cluster -> Maybe (Value Text)
multiRegionProperties :: Cluster -> Maybe MultiRegionPropertiesProperty
tags :: Cluster -> Maybe [Tag]
haddock_workaround_ :: ()
deletionProtectionEnabled :: Maybe (Value Bool)
kmsEncryptionKey :: Maybe (Value Text)
multiRegionProperties :: Maybe MultiRegionPropertiesProperty
tags :: Maybe [Tag]
..}
    = Cluster {tags :: Maybe [Tag]
tags = [Tag] -> Maybe [Tag]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [Tag]
PropertyType "Tags" Cluster
newValue, Maybe (Value Bool)
Maybe (Value Text)
Maybe MultiRegionPropertiesProperty
()
haddock_workaround_ :: ()
deletionProtectionEnabled :: Maybe (Value Bool)
kmsEncryptionKey :: Maybe (Value Text)
multiRegionProperties :: Maybe MultiRegionPropertiesProperty
haddock_workaround_ :: ()
deletionProtectionEnabled :: Maybe (Value Bool)
kmsEncryptionKey :: Maybe (Value Text)
multiRegionProperties :: Maybe MultiRegionPropertiesProperty
..}