module Stratosphere.MemoryDB.User (
        module Exports, User(..), mkUser
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.MemoryDB.User.AuthenticationModeProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data User
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-memorydb-user.html>
    User {User -> ()
haddock_workaround_ :: (),
          -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-memorydb-user.html#cfn-memorydb-user-accessstring>
          User -> Maybe (Value Text)
accessString :: (Prelude.Maybe (Value Prelude.Text)),
          -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-memorydb-user.html#cfn-memorydb-user-authenticationmode>
          User -> Maybe AuthenticationModeProperty
authenticationMode :: (Prelude.Maybe AuthenticationModeProperty),
          -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-memorydb-user.html#cfn-memorydb-user-tags>
          User -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag]),
          -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-memorydb-user.html#cfn-memorydb-user-username>
          User -> Value Text
userName :: (Value Prelude.Text)}
  deriving stock (User -> User -> Bool
(User -> User -> Bool) -> (User -> User -> Bool) -> Eq User
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: User -> User -> Bool
== :: User -> User -> Bool
$c/= :: User -> User -> Bool
/= :: User -> User -> Bool
Prelude.Eq, Int -> User -> ShowS
[User] -> ShowS
User -> String
(Int -> User -> ShowS)
-> (User -> String) -> ([User] -> ShowS) -> Show User
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> User -> ShowS
showsPrec :: Int -> User -> ShowS
$cshow :: User -> String
show :: User -> String
$cshowList :: [User] -> ShowS
showList :: [User] -> ShowS
Prelude.Show)
mkUser :: Value Prelude.Text -> User
mkUser :: Value Text -> User
mkUser Value Text
userName
  = User
      {haddock_workaround_ :: ()
haddock_workaround_ = (), userName :: Value Text
userName = Value Text
userName,
       accessString :: Maybe (Value Text)
accessString = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       authenticationMode :: Maybe AuthenticationModeProperty
authenticationMode = Maybe AuthenticationModeProperty
forall a. Maybe a
Prelude.Nothing, tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties User where
  toResourceProperties :: User -> ResourceProperties
toResourceProperties User {Maybe [Tag]
Maybe (Value Text)
Maybe AuthenticationModeProperty
()
Value Text
haddock_workaround_ :: User -> ()
accessString :: User -> Maybe (Value Text)
authenticationMode :: User -> Maybe AuthenticationModeProperty
tags :: User -> Maybe [Tag]
userName :: User -> Value Text
haddock_workaround_ :: ()
accessString :: Maybe (Value Text)
authenticationMode :: Maybe AuthenticationModeProperty
tags :: Maybe [Tag]
userName :: Value Text
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::MemoryDB::User", supportsTags :: Bool
supportsTags = Bool
Prelude.True,
         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
"UserName" 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..= Value Text
userName]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [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
"AccessString" (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)
accessString,
                               Key -> AuthenticationModeProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"AuthenticationMode" (AuthenticationModeProperty -> (Key, Value))
-> Maybe AuthenticationModeProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AuthenticationModeProperty
authenticationMode,
                               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 User where
  toJSON :: User -> Value
toJSON User {Maybe [Tag]
Maybe (Value Text)
Maybe AuthenticationModeProperty
()
Value Text
haddock_workaround_ :: User -> ()
accessString :: User -> Maybe (Value Text)
authenticationMode :: User -> Maybe AuthenticationModeProperty
tags :: User -> Maybe [Tag]
userName :: User -> Value Text
haddock_workaround_ :: ()
accessString :: Maybe (Value Text)
authenticationMode :: Maybe AuthenticationModeProperty
tags :: Maybe [Tag]
userName :: Value Text
..}
    = [(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
"UserName" 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..= Value Text
userName]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [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
"AccessString" (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)
accessString,
                  Key -> AuthenticationModeProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"AuthenticationMode" (AuthenticationModeProperty -> (Key, Value))
-> Maybe AuthenticationModeProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AuthenticationModeProperty
authenticationMode,
                  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 "AccessString" User where
  type PropertyType "AccessString" User = Value Prelude.Text
  set :: PropertyType "AccessString" User -> User -> User
set PropertyType "AccessString" User
newValue User {Maybe [Tag]
Maybe (Value Text)
Maybe AuthenticationModeProperty
()
Value Text
haddock_workaround_ :: User -> ()
accessString :: User -> Maybe (Value Text)
authenticationMode :: User -> Maybe AuthenticationModeProperty
tags :: User -> Maybe [Tag]
userName :: User -> Value Text
haddock_workaround_ :: ()
accessString :: Maybe (Value Text)
authenticationMode :: Maybe AuthenticationModeProperty
tags :: Maybe [Tag]
userName :: Value Text
..}
    = User {accessString :: Maybe (Value Text)
accessString = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "AccessString" User
Value Text
newValue, Maybe [Tag]
Maybe AuthenticationModeProperty
()
Value Text
haddock_workaround_ :: ()
authenticationMode :: Maybe AuthenticationModeProperty
tags :: Maybe [Tag]
userName :: Value Text
haddock_workaround_ :: ()
authenticationMode :: Maybe AuthenticationModeProperty
tags :: Maybe [Tag]
userName :: Value Text
..}
instance Property "AuthenticationMode" User where
  type PropertyType "AuthenticationMode" User = AuthenticationModeProperty
  set :: PropertyType "AuthenticationMode" User -> User -> User
set PropertyType "AuthenticationMode" User
newValue User {Maybe [Tag]
Maybe (Value Text)
Maybe AuthenticationModeProperty
()
Value Text
haddock_workaround_ :: User -> ()
accessString :: User -> Maybe (Value Text)
authenticationMode :: User -> Maybe AuthenticationModeProperty
tags :: User -> Maybe [Tag]
userName :: User -> Value Text
haddock_workaround_ :: ()
accessString :: Maybe (Value Text)
authenticationMode :: Maybe AuthenticationModeProperty
tags :: Maybe [Tag]
userName :: Value Text
..}
    = User {authenticationMode :: Maybe AuthenticationModeProperty
authenticationMode = AuthenticationModeProperty -> Maybe AuthenticationModeProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "AuthenticationMode" User
AuthenticationModeProperty
newValue, Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
accessString :: Maybe (Value Text)
tags :: Maybe [Tag]
userName :: Value Text
haddock_workaround_ :: ()
accessString :: Maybe (Value Text)
tags :: Maybe [Tag]
userName :: Value Text
..}
instance Property "Tags" User where
  type PropertyType "Tags" User = [Tag]
  set :: PropertyType "Tags" User -> User -> User
set PropertyType "Tags" User
newValue User {Maybe [Tag]
Maybe (Value Text)
Maybe AuthenticationModeProperty
()
Value Text
haddock_workaround_ :: User -> ()
accessString :: User -> Maybe (Value Text)
authenticationMode :: User -> Maybe AuthenticationModeProperty
tags :: User -> Maybe [Tag]
userName :: User -> Value Text
haddock_workaround_ :: ()
accessString :: Maybe (Value Text)
authenticationMode :: Maybe AuthenticationModeProperty
tags :: Maybe [Tag]
userName :: Value Text
..} = User {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" User
newValue, Maybe (Value Text)
Maybe AuthenticationModeProperty
()
Value Text
haddock_workaround_ :: ()
accessString :: Maybe (Value Text)
authenticationMode :: Maybe AuthenticationModeProperty
userName :: Value Text
haddock_workaround_ :: ()
accessString :: Maybe (Value Text)
authenticationMode :: Maybe AuthenticationModeProperty
userName :: Value Text
..}
instance Property "UserName" User where
  type PropertyType "UserName" User = Value Prelude.Text
  set :: PropertyType "UserName" User -> User -> User
set PropertyType "UserName" User
newValue User {Maybe [Tag]
Maybe (Value Text)
Maybe AuthenticationModeProperty
()
Value Text
haddock_workaround_ :: User -> ()
accessString :: User -> Maybe (Value Text)
authenticationMode :: User -> Maybe AuthenticationModeProperty
tags :: User -> Maybe [Tag]
userName :: User -> Value Text
haddock_workaround_ :: ()
accessString :: Maybe (Value Text)
authenticationMode :: Maybe AuthenticationModeProperty
tags :: Maybe [Tag]
userName :: Value Text
..} = User {userName :: Value Text
userName = PropertyType "UserName" User
Value Text
newValue, Maybe [Tag]
Maybe (Value Text)
Maybe AuthenticationModeProperty
()
haddock_workaround_ :: ()
accessString :: Maybe (Value Text)
authenticationMode :: Maybe AuthenticationModeProperty
tags :: Maybe [Tag]
haddock_workaround_ :: ()
accessString :: Maybe (Value Text)
authenticationMode :: Maybe AuthenticationModeProperty
tags :: Maybe [Tag]
..}