module Stratosphere.SMSVOICE.ProtectConfiguration (
        module Exports, ProtectConfiguration(..), mkProtectConfiguration
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.SMSVOICE.ProtectConfiguration.CountryRuleSetProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data ProtectConfiguration
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-smsvoice-protectconfiguration.html>
    ProtectConfiguration {ProtectConfiguration -> ()
haddock_workaround_ :: (),
                          -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-smsvoice-protectconfiguration.html#cfn-smsvoice-protectconfiguration-countryruleset>
                          ProtectConfiguration -> Maybe CountryRuleSetProperty
countryRuleSet :: (Prelude.Maybe CountryRuleSetProperty),
                          -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-smsvoice-protectconfiguration.html#cfn-smsvoice-protectconfiguration-deletionprotectionenabled>
                          ProtectConfiguration -> Maybe (Value Bool)
deletionProtectionEnabled :: (Prelude.Maybe (Value Prelude.Bool)),
                          -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-smsvoice-protectconfiguration.html#cfn-smsvoice-protectconfiguration-tags>
                          ProtectConfiguration -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
  deriving stock (ProtectConfiguration -> ProtectConfiguration -> Bool
(ProtectConfiguration -> ProtectConfiguration -> Bool)
-> (ProtectConfiguration -> ProtectConfiguration -> Bool)
-> Eq ProtectConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ProtectConfiguration -> ProtectConfiguration -> Bool
== :: ProtectConfiguration -> ProtectConfiguration -> Bool
$c/= :: ProtectConfiguration -> ProtectConfiguration -> Bool
/= :: ProtectConfiguration -> ProtectConfiguration -> Bool
Prelude.Eq, Int -> ProtectConfiguration -> ShowS
[ProtectConfiguration] -> ShowS
ProtectConfiguration -> String
(Int -> ProtectConfiguration -> ShowS)
-> (ProtectConfiguration -> String)
-> ([ProtectConfiguration] -> ShowS)
-> Show ProtectConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ProtectConfiguration -> ShowS
showsPrec :: Int -> ProtectConfiguration -> ShowS
$cshow :: ProtectConfiguration -> String
show :: ProtectConfiguration -> String
$cshowList :: [ProtectConfiguration] -> ShowS
showList :: [ProtectConfiguration] -> ShowS
Prelude.Show)
mkProtectConfiguration :: ProtectConfiguration
mkProtectConfiguration :: ProtectConfiguration
mkProtectConfiguration
  = ProtectConfiguration
      {haddock_workaround_ :: ()
haddock_workaround_ = (), countryRuleSet :: Maybe CountryRuleSetProperty
countryRuleSet = Maybe CountryRuleSetProperty
forall a. Maybe a
Prelude.Nothing,
       deletionProtectionEnabled :: Maybe (Value Bool)
deletionProtectionEnabled = Maybe (Value Bool)
forall a. Maybe a
Prelude.Nothing,
       tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties ProtectConfiguration where
  toResourceProperties :: ProtectConfiguration -> ResourceProperties
toResourceProperties ProtectConfiguration {Maybe [Tag]
Maybe (Value Bool)
Maybe CountryRuleSetProperty
()
haddock_workaround_ :: ProtectConfiguration -> ()
countryRuleSet :: ProtectConfiguration -> Maybe CountryRuleSetProperty
deletionProtectionEnabled :: ProtectConfiguration -> Maybe (Value Bool)
tags :: ProtectConfiguration -> Maybe [Tag]
haddock_workaround_ :: ()
countryRuleSet :: Maybe CountryRuleSetProperty
deletionProtectionEnabled :: Maybe (Value Bool)
tags :: Maybe [Tag]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::SMSVOICE::ProtectConfiguration",
         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 -> CountryRuleSetProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"CountryRuleSet" (CountryRuleSetProperty -> (Key, Value))
-> Maybe CountryRuleSetProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CountryRuleSetProperty
countryRuleSet,
                            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 -> [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 ProtectConfiguration where
  toJSON :: ProtectConfiguration -> Value
toJSON ProtectConfiguration {Maybe [Tag]
Maybe (Value Bool)
Maybe CountryRuleSetProperty
()
haddock_workaround_ :: ProtectConfiguration -> ()
countryRuleSet :: ProtectConfiguration -> Maybe CountryRuleSetProperty
deletionProtectionEnabled :: ProtectConfiguration -> Maybe (Value Bool)
tags :: ProtectConfiguration -> Maybe [Tag]
haddock_workaround_ :: ()
countryRuleSet :: Maybe CountryRuleSetProperty
deletionProtectionEnabled :: Maybe (Value Bool)
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 -> CountryRuleSetProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"CountryRuleSet" (CountryRuleSetProperty -> (Key, Value))
-> Maybe CountryRuleSetProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CountryRuleSetProperty
countryRuleSet,
               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 -> [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 "CountryRuleSet" ProtectConfiguration where
  type PropertyType "CountryRuleSet" ProtectConfiguration = CountryRuleSetProperty
  set :: PropertyType "CountryRuleSet" ProtectConfiguration
-> ProtectConfiguration -> ProtectConfiguration
set PropertyType "CountryRuleSet" ProtectConfiguration
newValue ProtectConfiguration {Maybe [Tag]
Maybe (Value Bool)
Maybe CountryRuleSetProperty
()
haddock_workaround_ :: ProtectConfiguration -> ()
countryRuleSet :: ProtectConfiguration -> Maybe CountryRuleSetProperty
deletionProtectionEnabled :: ProtectConfiguration -> Maybe (Value Bool)
tags :: ProtectConfiguration -> Maybe [Tag]
haddock_workaround_ :: ()
countryRuleSet :: Maybe CountryRuleSetProperty
deletionProtectionEnabled :: Maybe (Value Bool)
tags :: Maybe [Tag]
..}
    = ProtectConfiguration {countryRuleSet :: Maybe CountryRuleSetProperty
countryRuleSet = CountryRuleSetProperty -> Maybe CountryRuleSetProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "CountryRuleSet" ProtectConfiguration
CountryRuleSetProperty
newValue, Maybe [Tag]
Maybe (Value Bool)
()
haddock_workaround_ :: ()
deletionProtectionEnabled :: Maybe (Value Bool)
tags :: Maybe [Tag]
haddock_workaround_ :: ()
deletionProtectionEnabled :: Maybe (Value Bool)
tags :: Maybe [Tag]
..}
instance Property "DeletionProtectionEnabled" ProtectConfiguration where
  type PropertyType "DeletionProtectionEnabled" ProtectConfiguration = Value Prelude.Bool
  set :: PropertyType "DeletionProtectionEnabled" ProtectConfiguration
-> ProtectConfiguration -> ProtectConfiguration
set PropertyType "DeletionProtectionEnabled" ProtectConfiguration
newValue ProtectConfiguration {Maybe [Tag]
Maybe (Value Bool)
Maybe CountryRuleSetProperty
()
haddock_workaround_ :: ProtectConfiguration -> ()
countryRuleSet :: ProtectConfiguration -> Maybe CountryRuleSetProperty
deletionProtectionEnabled :: ProtectConfiguration -> Maybe (Value Bool)
tags :: ProtectConfiguration -> Maybe [Tag]
haddock_workaround_ :: ()
countryRuleSet :: Maybe CountryRuleSetProperty
deletionProtectionEnabled :: Maybe (Value Bool)
tags :: Maybe [Tag]
..}
    = ProtectConfiguration
        {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" ProtectConfiguration
Value Bool
newValue, Maybe [Tag]
Maybe CountryRuleSetProperty
()
haddock_workaround_ :: ()
countryRuleSet :: Maybe CountryRuleSetProperty
tags :: Maybe [Tag]
haddock_workaround_ :: ()
countryRuleSet :: Maybe CountryRuleSetProperty
tags :: Maybe [Tag]
..}
instance Property "Tags" ProtectConfiguration where
  type PropertyType "Tags" ProtectConfiguration = [Tag]
  set :: PropertyType "Tags" ProtectConfiguration
-> ProtectConfiguration -> ProtectConfiguration
set PropertyType "Tags" ProtectConfiguration
newValue ProtectConfiguration {Maybe [Tag]
Maybe (Value Bool)
Maybe CountryRuleSetProperty
()
haddock_workaround_ :: ProtectConfiguration -> ()
countryRuleSet :: ProtectConfiguration -> Maybe CountryRuleSetProperty
deletionProtectionEnabled :: ProtectConfiguration -> Maybe (Value Bool)
tags :: ProtectConfiguration -> Maybe [Tag]
haddock_workaround_ :: ()
countryRuleSet :: Maybe CountryRuleSetProperty
deletionProtectionEnabled :: Maybe (Value Bool)
tags :: Maybe [Tag]
..}
    = ProtectConfiguration {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" ProtectConfiguration
newValue, Maybe (Value Bool)
Maybe CountryRuleSetProperty
()
haddock_workaround_ :: ()
countryRuleSet :: Maybe CountryRuleSetProperty
deletionProtectionEnabled :: Maybe (Value Bool)
haddock_workaround_ :: ()
countryRuleSet :: Maybe CountryRuleSetProperty
deletionProtectionEnabled :: Maybe (Value Bool)
..}