{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data ServiceAccountCredentials = ServiceAccountCredentials'
{
ServiceAccountCredentials -> Sensitive Text
accountName :: Data.Sensitive Prelude.Text,
ServiceAccountCredentials -> Sensitive Text
accountPassword :: Data.Sensitive Prelude.Text
}
deriving (ServiceAccountCredentials -> ServiceAccountCredentials -> Bool
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
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.
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'
{ $sel:accountName:ServiceAccountCredentials' :: Sensitive Text
accountName =
forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pAccountName_,
$sel:accountPassword:ServiceAccountCredentials' :: Sensitive Text
accountPassword =
forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pAccountPassword_
}
serviceAccountCredentials_accountName :: Lens.Lens' ServiceAccountCredentials Prelude.Text
serviceAccountCredentials_accountName :: Lens' ServiceAccountCredentials Text
serviceAccountCredentials_accountName = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive
serviceAccountCredentials_accountPassword :: Lens.Lens' ServiceAccountCredentials Prelude.Text
serviceAccountCredentials_accountPassword :: Lens' ServiceAccountCredentials Text
serviceAccountCredentials_accountPassword = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive
instance Data.FromJSON ServiceAccountCredentials where
parseJSON :: Value -> Parser ServiceAccountCredentials
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ServiceAccountCredentials"
( \Object
x ->
Sensitive Text -> Sensitive Text -> ServiceAccountCredentials
ServiceAccountCredentials'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"AccountName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"AccountPassword")
)
instance Prelude.Hashable ServiceAccountCredentials where
hashWithSalt :: Int -> ServiceAccountCredentials -> Int
hashWithSalt Int
_salt ServiceAccountCredentials' {Sensitive Text
accountPassword :: Sensitive Text
accountName :: Sensitive Text
$sel:accountPassword:ServiceAccountCredentials' :: ServiceAccountCredentials -> Sensitive Text
$sel:accountName:ServiceAccountCredentials' :: ServiceAccountCredentials -> Sensitive Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
accountName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
accountPassword
instance Prelude.NFData ServiceAccountCredentials where
rnf :: ServiceAccountCredentials -> ()
rnf ServiceAccountCredentials' {Sensitive Text
accountPassword :: Sensitive Text
accountName :: Sensitive Text
$sel:accountPassword:ServiceAccountCredentials' :: ServiceAccountCredentials -> Sensitive Text
$sel:accountName:ServiceAccountCredentials' :: ServiceAccountCredentials -> Sensitive Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
accountName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
accountPassword
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"AccountName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
accountName),
forall a. a -> Maybe a
Prelude.Just
(Key
"AccountPassword" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
accountPassword)
]
)