{-# 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.ServiceAccountCredentials where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ServiceAccountCredentials = ServiceAccountCredentials'
{
ServiceAccountCredentials -> Sensitive Text
accountName :: Core.Sensitive Prelude.Text,
ServiceAccountCredentials -> Sensitive Text
accountPassword :: Core.Sensitive Prelude.Text
}
deriving (ServiceAccountCredentials -> ServiceAccountCredentials -> Bool
(ServiceAccountCredentials -> ServiceAccountCredentials -> Bool)
-> (ServiceAccountCredentials -> ServiceAccountCredentials -> Bool)
-> Eq ServiceAccountCredentials
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceAccountCredentials -> ServiceAccountCredentials -> Bool
$c/= :: ServiceAccountCredentials -> ServiceAccountCredentials -> Bool
== :: ServiceAccountCredentials -> ServiceAccountCredentials -> Bool
$c== :: ServiceAccountCredentials -> ServiceAccountCredentials -> Bool
Prelude.Eq, Int -> ServiceAccountCredentials -> ShowS
[ServiceAccountCredentials] -> ShowS
ServiceAccountCredentials -> String
(Int -> ServiceAccountCredentials -> ShowS)
-> (ServiceAccountCredentials -> String)
-> ([ServiceAccountCredentials] -> ShowS)
-> Show ServiceAccountCredentials
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceAccountCredentials] -> ShowS
$cshowList :: [ServiceAccountCredentials] -> ShowS
show :: ServiceAccountCredentials -> String
$cshow :: ServiceAccountCredentials -> String
showsPrec :: Int -> ServiceAccountCredentials -> ShowS
$cshowsPrec :: Int -> ServiceAccountCredentials -> ShowS
Prelude.Show, (forall x.
ServiceAccountCredentials -> Rep ServiceAccountCredentials x)
-> (forall x.
Rep ServiceAccountCredentials x -> ServiceAccountCredentials)
-> Generic ServiceAccountCredentials
forall x.
Rep ServiceAccountCredentials x -> ServiceAccountCredentials
forall x.
ServiceAccountCredentials -> Rep ServiceAccountCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ServiceAccountCredentials x -> ServiceAccountCredentials
$cfrom :: forall x.
ServiceAccountCredentials -> Rep ServiceAccountCredentials x
Prelude.Generic)
newServiceAccountCredentials ::
Prelude.Text ->
Prelude.Text ->
ServiceAccountCredentials
newServiceAccountCredentials :: Text -> Text -> ServiceAccountCredentials
newServiceAccountCredentials
Text
pAccountName_
Text
pAccountPassword_ =
ServiceAccountCredentials' :: Sensitive Text -> Sensitive Text -> ServiceAccountCredentials
ServiceAccountCredentials'
{ $sel:accountName:ServiceAccountCredentials' :: Sensitive Text
accountName =
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
pAccountName_,
$sel:accountPassword:ServiceAccountCredentials' :: Sensitive Text
accountPassword =
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
pAccountPassword_
}
serviceAccountCredentials_accountName :: Lens.Lens' ServiceAccountCredentials Prelude.Text
serviceAccountCredentials_accountName :: (Text -> f Text)
-> ServiceAccountCredentials -> f ServiceAccountCredentials
serviceAccountCredentials_accountName = (ServiceAccountCredentials -> Sensitive Text)
-> (ServiceAccountCredentials
-> Sensitive Text -> ServiceAccountCredentials)
-> Lens
ServiceAccountCredentials
ServiceAccountCredentials
(Sensitive Text)
(Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceAccountCredentials' {Sensitive Text
accountName :: Sensitive Text
$sel:accountName:ServiceAccountCredentials' :: ServiceAccountCredentials -> Sensitive Text
accountName} -> Sensitive Text
accountName) (\s :: ServiceAccountCredentials
s@ServiceAccountCredentials' {} Sensitive Text
a -> ServiceAccountCredentials
s {$sel:accountName:ServiceAccountCredentials' :: Sensitive Text
accountName = Sensitive Text
a} :: ServiceAccountCredentials) ((Sensitive Text -> f (Sensitive Text))
-> ServiceAccountCredentials -> f ServiceAccountCredentials)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> ServiceAccountCredentials
-> f ServiceAccountCredentials
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
serviceAccountCredentials_accountPassword :: Lens.Lens' ServiceAccountCredentials Prelude.Text
serviceAccountCredentials_accountPassword :: (Text -> f Text)
-> ServiceAccountCredentials -> f ServiceAccountCredentials
serviceAccountCredentials_accountPassword = (ServiceAccountCredentials -> Sensitive Text)
-> (ServiceAccountCredentials
-> Sensitive Text -> ServiceAccountCredentials)
-> Lens
ServiceAccountCredentials
ServiceAccountCredentials
(Sensitive Text)
(Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceAccountCredentials' {Sensitive Text
accountPassword :: Sensitive Text
$sel:accountPassword:ServiceAccountCredentials' :: ServiceAccountCredentials -> Sensitive Text
accountPassword} -> Sensitive Text
accountPassword) (\s :: ServiceAccountCredentials
s@ServiceAccountCredentials' {} Sensitive Text
a -> ServiceAccountCredentials
s {$sel:accountPassword:ServiceAccountCredentials' :: Sensitive Text
accountPassword = Sensitive Text
a} :: ServiceAccountCredentials) ((Sensitive Text -> f (Sensitive Text))
-> ServiceAccountCredentials -> f ServiceAccountCredentials)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> ServiceAccountCredentials
-> f ServiceAccountCredentials
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
instance Core.FromJSON ServiceAccountCredentials where
parseJSON :: Value -> Parser ServiceAccountCredentials
parseJSON =
String
-> (Object -> Parser ServiceAccountCredentials)
-> Value
-> Parser ServiceAccountCredentials
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ServiceAccountCredentials"
( \Object
x ->
Sensitive Text -> Sensitive Text -> ServiceAccountCredentials
ServiceAccountCredentials'
(Sensitive Text -> Sensitive Text -> ServiceAccountCredentials)
-> Parser (Sensitive Text)
-> Parser (Sensitive Text -> ServiceAccountCredentials)
forall (f :: * -> *) a b. Functor 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
"AccountName")
Parser (Sensitive Text -> ServiceAccountCredentials)
-> Parser (Sensitive Text) -> Parser ServiceAccountCredentials
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
"AccountPassword")
)
instance Prelude.Hashable ServiceAccountCredentials
instance Prelude.NFData ServiceAccountCredentials
instance Core.ToJSON ServiceAccountCredentials where
toJSON :: ServiceAccountCredentials -> Value
toJSON ServiceAccountCredentials' {Sensitive Text
accountPassword :: Sensitive Text
accountName :: Sensitive Text
$sel:accountPassword:ServiceAccountCredentials' :: ServiceAccountCredentials -> Sensitive Text
$sel:accountName:ServiceAccountCredentials' :: ServiceAccountCredentials -> Sensitive Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"AccountName" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
accountName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"AccountPassword" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
accountPassword)
]
)