module Stratosphere.Cognito.UserPool.PoliciesProperty (
module Exports, PoliciesProperty(..), mkPoliciesProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.Cognito.UserPool.PasswordPolicyProperty as Exports
import {-# SOURCE #-} Stratosphere.Cognito.UserPool.SignInPolicyProperty as Exports
import Stratosphere.ResourceProperties
data PoliciesProperty
=
PoliciesProperty {PoliciesProperty -> ()
haddock_workaround_ :: (),
PoliciesProperty -> Maybe PasswordPolicyProperty
passwordPolicy :: (Prelude.Maybe PasswordPolicyProperty),
PoliciesProperty -> Maybe SignInPolicyProperty
signInPolicy :: (Prelude.Maybe SignInPolicyProperty)}
deriving stock (PoliciesProperty -> PoliciesProperty -> Bool
(PoliciesProperty -> PoliciesProperty -> Bool)
-> (PoliciesProperty -> PoliciesProperty -> Bool)
-> Eq PoliciesProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PoliciesProperty -> PoliciesProperty -> Bool
== :: PoliciesProperty -> PoliciesProperty -> Bool
$c/= :: PoliciesProperty -> PoliciesProperty -> Bool
/= :: PoliciesProperty -> PoliciesProperty -> Bool
Prelude.Eq, Int -> PoliciesProperty -> ShowS
[PoliciesProperty] -> ShowS
PoliciesProperty -> String
(Int -> PoliciesProperty -> ShowS)
-> (PoliciesProperty -> String)
-> ([PoliciesProperty] -> ShowS)
-> Show PoliciesProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PoliciesProperty -> ShowS
showsPrec :: Int -> PoliciesProperty -> ShowS
$cshow :: PoliciesProperty -> String
show :: PoliciesProperty -> String
$cshowList :: [PoliciesProperty] -> ShowS
showList :: [PoliciesProperty] -> ShowS
Prelude.Show)
mkPoliciesProperty :: PoliciesProperty
mkPoliciesProperty :: PoliciesProperty
mkPoliciesProperty
= PoliciesProperty
{haddock_workaround_ :: ()
haddock_workaround_ = (), passwordPolicy :: Maybe PasswordPolicyProperty
passwordPolicy = Maybe PasswordPolicyProperty
forall a. Maybe a
Prelude.Nothing,
signInPolicy :: Maybe SignInPolicyProperty
signInPolicy = Maybe SignInPolicyProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties PoliciesProperty where
toResourceProperties :: PoliciesProperty -> ResourceProperties
toResourceProperties PoliciesProperty {Maybe PasswordPolicyProperty
Maybe SignInPolicyProperty
()
haddock_workaround_ :: PoliciesProperty -> ()
passwordPolicy :: PoliciesProperty -> Maybe PasswordPolicyProperty
signInPolicy :: PoliciesProperty -> Maybe SignInPolicyProperty
haddock_workaround_ :: ()
passwordPolicy :: Maybe PasswordPolicyProperty
signInPolicy :: Maybe SignInPolicyProperty
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::Cognito::UserPool.Policies",
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 -> PasswordPolicyProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"PasswordPolicy" (PasswordPolicyProperty -> (Key, Value))
-> Maybe PasswordPolicyProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PasswordPolicyProperty
passwordPolicy,
Key -> SignInPolicyProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"SignInPolicy" (SignInPolicyProperty -> (Key, Value))
-> Maybe SignInPolicyProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SignInPolicyProperty
signInPolicy])}
instance JSON.ToJSON PoliciesProperty where
toJSON :: PoliciesProperty -> Value
toJSON PoliciesProperty {Maybe PasswordPolicyProperty
Maybe SignInPolicyProperty
()
haddock_workaround_ :: PoliciesProperty -> ()
passwordPolicy :: PoliciesProperty -> Maybe PasswordPolicyProperty
signInPolicy :: PoliciesProperty -> Maybe SignInPolicyProperty
haddock_workaround_ :: ()
passwordPolicy :: Maybe PasswordPolicyProperty
signInPolicy :: Maybe SignInPolicyProperty
..}
= [(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 -> PasswordPolicyProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"PasswordPolicy" (PasswordPolicyProperty -> (Key, Value))
-> Maybe PasswordPolicyProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PasswordPolicyProperty
passwordPolicy,
Key -> SignInPolicyProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"SignInPolicy" (SignInPolicyProperty -> (Key, Value))
-> Maybe SignInPolicyProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SignInPolicyProperty
signInPolicy]))
instance Property "PasswordPolicy" PoliciesProperty where
type PropertyType "PasswordPolicy" PoliciesProperty = PasswordPolicyProperty
set :: PropertyType "PasswordPolicy" PoliciesProperty
-> PoliciesProperty -> PoliciesProperty
set PropertyType "PasswordPolicy" PoliciesProperty
newValue PoliciesProperty {Maybe PasswordPolicyProperty
Maybe SignInPolicyProperty
()
haddock_workaround_ :: PoliciesProperty -> ()
passwordPolicy :: PoliciesProperty -> Maybe PasswordPolicyProperty
signInPolicy :: PoliciesProperty -> Maybe SignInPolicyProperty
haddock_workaround_ :: ()
passwordPolicy :: Maybe PasswordPolicyProperty
signInPolicy :: Maybe SignInPolicyProperty
..}
= PoliciesProperty {passwordPolicy :: Maybe PasswordPolicyProperty
passwordPolicy = PasswordPolicyProperty -> Maybe PasswordPolicyProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "PasswordPolicy" PoliciesProperty
PasswordPolicyProperty
newValue, Maybe SignInPolicyProperty
()
haddock_workaround_ :: ()
signInPolicy :: Maybe SignInPolicyProperty
haddock_workaround_ :: ()
signInPolicy :: Maybe SignInPolicyProperty
..}
instance Property "SignInPolicy" PoliciesProperty where
type PropertyType "SignInPolicy" PoliciesProperty = SignInPolicyProperty
set :: PropertyType "SignInPolicy" PoliciesProperty
-> PoliciesProperty -> PoliciesProperty
set PropertyType "SignInPolicy" PoliciesProperty
newValue PoliciesProperty {Maybe PasswordPolicyProperty
Maybe SignInPolicyProperty
()
haddock_workaround_ :: PoliciesProperty -> ()
passwordPolicy :: PoliciesProperty -> Maybe PasswordPolicyProperty
signInPolicy :: PoliciesProperty -> Maybe SignInPolicyProperty
haddock_workaround_ :: ()
passwordPolicy :: Maybe PasswordPolicyProperty
signInPolicy :: Maybe SignInPolicyProperty
..}
= PoliciesProperty {signInPolicy :: Maybe SignInPolicyProperty
signInPolicy = SignInPolicyProperty -> Maybe SignInPolicyProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "SignInPolicy" PoliciesProperty
SignInPolicyProperty
newValue, Maybe PasswordPolicyProperty
()
haddock_workaround_ :: ()
passwordPolicy :: Maybe PasswordPolicyProperty
haddock_workaround_ :: ()
passwordPolicy :: Maybe PasswordPolicyProperty
..}