{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.AppStream.Types.UserStackAssociation where
import Amazonka.AppStream.Types.AuthenticationType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data UserStackAssociation = UserStackAssociation'
{
UserStackAssociation -> Maybe Bool
sendEmailNotification :: Prelude.Maybe Prelude.Bool,
UserStackAssociation -> Text
stackName :: Prelude.Text,
UserStackAssociation -> Sensitive Text
userName :: Core.Sensitive Prelude.Text,
UserStackAssociation -> AuthenticationType
authenticationType :: AuthenticationType
}
deriving (UserStackAssociation -> UserStackAssociation -> Bool
(UserStackAssociation -> UserStackAssociation -> Bool)
-> (UserStackAssociation -> UserStackAssociation -> Bool)
-> Eq UserStackAssociation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserStackAssociation -> UserStackAssociation -> Bool
$c/= :: UserStackAssociation -> UserStackAssociation -> Bool
== :: UserStackAssociation -> UserStackAssociation -> Bool
$c== :: UserStackAssociation -> UserStackAssociation -> Bool
Prelude.Eq, Int -> UserStackAssociation -> ShowS
[UserStackAssociation] -> ShowS
UserStackAssociation -> String
(Int -> UserStackAssociation -> ShowS)
-> (UserStackAssociation -> String)
-> ([UserStackAssociation] -> ShowS)
-> Show UserStackAssociation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserStackAssociation] -> ShowS
$cshowList :: [UserStackAssociation] -> ShowS
show :: UserStackAssociation -> String
$cshow :: UserStackAssociation -> String
showsPrec :: Int -> UserStackAssociation -> ShowS
$cshowsPrec :: Int -> UserStackAssociation -> ShowS
Prelude.Show, (forall x. UserStackAssociation -> Rep UserStackAssociation x)
-> (forall x. Rep UserStackAssociation x -> UserStackAssociation)
-> Generic UserStackAssociation
forall x. Rep UserStackAssociation x -> UserStackAssociation
forall x. UserStackAssociation -> Rep UserStackAssociation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UserStackAssociation x -> UserStackAssociation
$cfrom :: forall x. UserStackAssociation -> Rep UserStackAssociation x
Prelude.Generic)
newUserStackAssociation ::
Prelude.Text ->
Prelude.Text ->
AuthenticationType ->
UserStackAssociation
newUserStackAssociation :: Text -> Text -> AuthenticationType -> UserStackAssociation
newUserStackAssociation
Text
pStackName_
Text
pUserName_
AuthenticationType
pAuthenticationType_ =
UserStackAssociation' :: Maybe Bool
-> Text
-> Sensitive Text
-> AuthenticationType
-> UserStackAssociation
UserStackAssociation'
{ $sel:sendEmailNotification:UserStackAssociation' :: Maybe Bool
sendEmailNotification =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:stackName:UserStackAssociation' :: Text
stackName = Text
pStackName_,
$sel:userName:UserStackAssociation' :: Sensitive Text
userName = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pUserName_,
$sel:authenticationType:UserStackAssociation' :: AuthenticationType
authenticationType = AuthenticationType
pAuthenticationType_
}
userStackAssociation_sendEmailNotification :: Lens.Lens' UserStackAssociation (Prelude.Maybe Prelude.Bool)
userStackAssociation_sendEmailNotification :: (Maybe Bool -> f (Maybe Bool))
-> UserStackAssociation -> f UserStackAssociation
userStackAssociation_sendEmailNotification = (UserStackAssociation -> Maybe Bool)
-> (UserStackAssociation -> Maybe Bool -> UserStackAssociation)
-> Lens
UserStackAssociation UserStackAssociation (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserStackAssociation' {Maybe Bool
sendEmailNotification :: Maybe Bool
$sel:sendEmailNotification:UserStackAssociation' :: UserStackAssociation -> Maybe Bool
sendEmailNotification} -> Maybe Bool
sendEmailNotification) (\s :: UserStackAssociation
s@UserStackAssociation' {} Maybe Bool
a -> UserStackAssociation
s {$sel:sendEmailNotification:UserStackAssociation' :: Maybe Bool
sendEmailNotification = Maybe Bool
a} :: UserStackAssociation)
userStackAssociation_stackName :: Lens.Lens' UserStackAssociation Prelude.Text
userStackAssociation_stackName :: (Text -> f Text) -> UserStackAssociation -> f UserStackAssociation
userStackAssociation_stackName = (UserStackAssociation -> Text)
-> (UserStackAssociation -> Text -> UserStackAssociation)
-> Lens UserStackAssociation UserStackAssociation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserStackAssociation' {Text
stackName :: Text
$sel:stackName:UserStackAssociation' :: UserStackAssociation -> Text
stackName} -> Text
stackName) (\s :: UserStackAssociation
s@UserStackAssociation' {} Text
a -> UserStackAssociation
s {$sel:stackName:UserStackAssociation' :: Text
stackName = Text
a} :: UserStackAssociation)
userStackAssociation_userName :: Lens.Lens' UserStackAssociation Prelude.Text
userStackAssociation_userName :: (Text -> f Text) -> UserStackAssociation -> f UserStackAssociation
userStackAssociation_userName = (UserStackAssociation -> Sensitive Text)
-> (UserStackAssociation -> Sensitive Text -> UserStackAssociation)
-> Lens
UserStackAssociation
UserStackAssociation
(Sensitive Text)
(Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserStackAssociation' {Sensitive Text
userName :: Sensitive Text
$sel:userName:UserStackAssociation' :: UserStackAssociation -> Sensitive Text
userName} -> Sensitive Text
userName) (\s :: UserStackAssociation
s@UserStackAssociation' {} Sensitive Text
a -> UserStackAssociation
s {$sel:userName:UserStackAssociation' :: Sensitive Text
userName = Sensitive Text
a} :: UserStackAssociation) ((Sensitive Text -> f (Sensitive Text))
-> UserStackAssociation -> f UserStackAssociation)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> UserStackAssociation
-> f UserStackAssociation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive
userStackAssociation_authenticationType :: Lens.Lens' UserStackAssociation AuthenticationType
userStackAssociation_authenticationType :: (AuthenticationType -> f AuthenticationType)
-> UserStackAssociation -> f UserStackAssociation
userStackAssociation_authenticationType = (UserStackAssociation -> AuthenticationType)
-> (UserStackAssociation
-> AuthenticationType -> UserStackAssociation)
-> Lens
UserStackAssociation
UserStackAssociation
AuthenticationType
AuthenticationType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserStackAssociation' {AuthenticationType
authenticationType :: AuthenticationType
$sel:authenticationType:UserStackAssociation' :: UserStackAssociation -> AuthenticationType
authenticationType} -> AuthenticationType
authenticationType) (\s :: UserStackAssociation
s@UserStackAssociation' {} AuthenticationType
a -> UserStackAssociation
s {$sel:authenticationType:UserStackAssociation' :: AuthenticationType
authenticationType = AuthenticationType
a} :: UserStackAssociation)
instance Core.FromJSON UserStackAssociation where
parseJSON :: Value -> Parser UserStackAssociation
parseJSON =
String
-> (Object -> Parser UserStackAssociation)
-> Value
-> Parser UserStackAssociation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"UserStackAssociation"
( \Object
x ->
Maybe Bool
-> Text
-> Sensitive Text
-> AuthenticationType
-> UserStackAssociation
UserStackAssociation'
(Maybe Bool
-> Text
-> Sensitive Text
-> AuthenticationType
-> UserStackAssociation)
-> Parser (Maybe Bool)
-> Parser
(Text
-> Sensitive Text -> AuthenticationType -> UserStackAssociation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SendEmailNotification")
Parser
(Text
-> Sensitive Text -> AuthenticationType -> UserStackAssociation)
-> Parser Text
-> Parser
(Sensitive Text -> AuthenticationType -> UserStackAssociation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"StackName")
Parser
(Sensitive Text -> AuthenticationType -> UserStackAssociation)
-> Parser (Sensitive Text)
-> Parser (AuthenticationType -> UserStackAssociation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Sensitive Text)
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"UserName")
Parser (AuthenticationType -> UserStackAssociation)
-> Parser AuthenticationType -> Parser UserStackAssociation
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser AuthenticationType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"AuthenticationType")
)
instance Prelude.Hashable UserStackAssociation
instance Prelude.NFData UserStackAssociation
instance Core.ToJSON UserStackAssociation where
toJSON :: UserStackAssociation -> Value
toJSON UserStackAssociation' {Maybe Bool
Text
Sensitive Text
AuthenticationType
authenticationType :: AuthenticationType
userName :: Sensitive Text
stackName :: Text
sendEmailNotification :: Maybe Bool
$sel:authenticationType:UserStackAssociation' :: UserStackAssociation -> AuthenticationType
$sel:userName:UserStackAssociation' :: UserStackAssociation -> Sensitive Text
$sel:stackName:UserStackAssociation' :: UserStackAssociation -> Text
$sel:sendEmailNotification:UserStackAssociation' :: UserStackAssociation -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"SendEmailNotification" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
sendEmailNotification,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"StackName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
stackName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"UserName" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
userName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"AuthenticationType" Text -> AuthenticationType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AuthenticationType
authenticationType)
]
)