module Stratosphere.DSQL.Cluster.MultiRegionPropertiesProperty (
        MultiRegionPropertiesProperty(..), mkMultiRegionPropertiesProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data MultiRegionPropertiesProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dsql-cluster-multiregionproperties.html>
    MultiRegionPropertiesProperty {MultiRegionPropertiesProperty -> ()
haddock_workaround_ :: (),
                                   -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dsql-cluster-multiregionproperties.html#cfn-dsql-cluster-multiregionproperties-clusters>
                                   MultiRegionPropertiesProperty -> Maybe (ValueList Text)
clusters :: (Prelude.Maybe (ValueList Prelude.Text)),
                                   -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dsql-cluster-multiregionproperties.html#cfn-dsql-cluster-multiregionproperties-witnessregion>
                                   MultiRegionPropertiesProperty -> Maybe (Value Text)
witnessRegion :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (MultiRegionPropertiesProperty
-> MultiRegionPropertiesProperty -> Bool
(MultiRegionPropertiesProperty
 -> MultiRegionPropertiesProperty -> Bool)
-> (MultiRegionPropertiesProperty
    -> MultiRegionPropertiesProperty -> Bool)
-> Eq MultiRegionPropertiesProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MultiRegionPropertiesProperty
-> MultiRegionPropertiesProperty -> Bool
== :: MultiRegionPropertiesProperty
-> MultiRegionPropertiesProperty -> Bool
$c/= :: MultiRegionPropertiesProperty
-> MultiRegionPropertiesProperty -> Bool
/= :: MultiRegionPropertiesProperty
-> MultiRegionPropertiesProperty -> Bool
Prelude.Eq, Int -> MultiRegionPropertiesProperty -> ShowS
[MultiRegionPropertiesProperty] -> ShowS
MultiRegionPropertiesProperty -> String
(Int -> MultiRegionPropertiesProperty -> ShowS)
-> (MultiRegionPropertiesProperty -> String)
-> ([MultiRegionPropertiesProperty] -> ShowS)
-> Show MultiRegionPropertiesProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MultiRegionPropertiesProperty -> ShowS
showsPrec :: Int -> MultiRegionPropertiesProperty -> ShowS
$cshow :: MultiRegionPropertiesProperty -> String
show :: MultiRegionPropertiesProperty -> String
$cshowList :: [MultiRegionPropertiesProperty] -> ShowS
showList :: [MultiRegionPropertiesProperty] -> ShowS
Prelude.Show)
mkMultiRegionPropertiesProperty :: MultiRegionPropertiesProperty
mkMultiRegionPropertiesProperty :: MultiRegionPropertiesProperty
mkMultiRegionPropertiesProperty
  = MultiRegionPropertiesProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), clusters :: Maybe (ValueList Text)
clusters = Maybe (ValueList Text)
forall a. Maybe a
Prelude.Nothing,
       witnessRegion :: Maybe (Value Text)
witnessRegion = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties MultiRegionPropertiesProperty where
  toResourceProperties :: MultiRegionPropertiesProperty -> ResourceProperties
toResourceProperties MultiRegionPropertiesProperty {Maybe (ValueList Text)
Maybe (Value Text)
()
haddock_workaround_ :: MultiRegionPropertiesProperty -> ()
clusters :: MultiRegionPropertiesProperty -> Maybe (ValueList Text)
witnessRegion :: MultiRegionPropertiesProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
clusters :: Maybe (ValueList Text)
witnessRegion :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::DSQL::Cluster.MultiRegionProperties",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         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 -> ValueList 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
"Clusters" (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
clusters,
                            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
"WitnessRegion" (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)
witnessRegion])}
instance JSON.ToJSON MultiRegionPropertiesProperty where
  toJSON :: MultiRegionPropertiesProperty -> Value
toJSON MultiRegionPropertiesProperty {Maybe (ValueList Text)
Maybe (Value Text)
()
haddock_workaround_ :: MultiRegionPropertiesProperty -> ()
clusters :: MultiRegionPropertiesProperty -> Maybe (ValueList Text)
witnessRegion :: MultiRegionPropertiesProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
clusters :: Maybe (ValueList Text)
witnessRegion :: Maybe (Value Text)
..}
    = [(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 -> ValueList 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
"Clusters" (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
clusters,
               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
"WitnessRegion" (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)
witnessRegion]))
instance Property "Clusters" MultiRegionPropertiesProperty where
  type PropertyType "Clusters" MultiRegionPropertiesProperty = ValueList Prelude.Text
  set :: PropertyType "Clusters" MultiRegionPropertiesProperty
-> MultiRegionPropertiesProperty -> MultiRegionPropertiesProperty
set PropertyType "Clusters" MultiRegionPropertiesProperty
newValue MultiRegionPropertiesProperty {Maybe (ValueList Text)
Maybe (Value Text)
()
haddock_workaround_ :: MultiRegionPropertiesProperty -> ()
clusters :: MultiRegionPropertiesProperty -> Maybe (ValueList Text)
witnessRegion :: MultiRegionPropertiesProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
clusters :: Maybe (ValueList Text)
witnessRegion :: Maybe (Value Text)
..}
    = MultiRegionPropertiesProperty
        {clusters :: Maybe (ValueList Text)
clusters = ValueList Text -> Maybe (ValueList Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Clusters" MultiRegionPropertiesProperty
ValueList Text
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
witnessRegion :: Maybe (Value Text)
haddock_workaround_ :: ()
witnessRegion :: Maybe (Value Text)
..}
instance Property "WitnessRegion" MultiRegionPropertiesProperty where
  type PropertyType "WitnessRegion" MultiRegionPropertiesProperty = Value Prelude.Text
  set :: PropertyType "WitnessRegion" MultiRegionPropertiesProperty
-> MultiRegionPropertiesProperty -> MultiRegionPropertiesProperty
set PropertyType "WitnessRegion" MultiRegionPropertiesProperty
newValue MultiRegionPropertiesProperty {Maybe (ValueList Text)
Maybe (Value Text)
()
haddock_workaround_ :: MultiRegionPropertiesProperty -> ()
clusters :: MultiRegionPropertiesProperty -> Maybe (ValueList Text)
witnessRegion :: MultiRegionPropertiesProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
clusters :: Maybe (ValueList Text)
witnessRegion :: Maybe (Value Text)
..}
    = MultiRegionPropertiesProperty
        {witnessRegion :: Maybe (Value Text)
witnessRegion = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "WitnessRegion" MultiRegionPropertiesProperty
Value Text
newValue, Maybe (ValueList Text)
()
haddock_workaround_ :: ()
clusters :: Maybe (ValueList Text)
haddock_workaround_ :: ()
clusters :: Maybe (ValueList Text)
..}