{-# 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.AppFlow.Types.BasicAuthCredentials where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BasicAuthCredentials = BasicAuthCredentials'
{
BasicAuthCredentials -> Text
username :: Prelude.Text,
BasicAuthCredentials -> Sensitive Text
password :: Core.Sensitive Prelude.Text
}
deriving (BasicAuthCredentials -> BasicAuthCredentials -> Bool
(BasicAuthCredentials -> BasicAuthCredentials -> Bool)
-> (BasicAuthCredentials -> BasicAuthCredentials -> Bool)
-> Eq BasicAuthCredentials
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BasicAuthCredentials -> BasicAuthCredentials -> Bool
$c/= :: BasicAuthCredentials -> BasicAuthCredentials -> Bool
== :: BasicAuthCredentials -> BasicAuthCredentials -> Bool
$c== :: BasicAuthCredentials -> BasicAuthCredentials -> Bool
Prelude.Eq, Int -> BasicAuthCredentials -> ShowS
[BasicAuthCredentials] -> ShowS
BasicAuthCredentials -> String
(Int -> BasicAuthCredentials -> ShowS)
-> (BasicAuthCredentials -> String)
-> ([BasicAuthCredentials] -> ShowS)
-> Show BasicAuthCredentials
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BasicAuthCredentials] -> ShowS
$cshowList :: [BasicAuthCredentials] -> ShowS
show :: BasicAuthCredentials -> String
$cshow :: BasicAuthCredentials -> String
showsPrec :: Int -> BasicAuthCredentials -> ShowS
$cshowsPrec :: Int -> BasicAuthCredentials -> ShowS
Prelude.Show, (forall x. BasicAuthCredentials -> Rep BasicAuthCredentials x)
-> (forall x. Rep BasicAuthCredentials x -> BasicAuthCredentials)
-> Generic BasicAuthCredentials
forall x. Rep BasicAuthCredentials x -> BasicAuthCredentials
forall x. BasicAuthCredentials -> Rep BasicAuthCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BasicAuthCredentials x -> BasicAuthCredentials
$cfrom :: forall x. BasicAuthCredentials -> Rep BasicAuthCredentials x
Prelude.Generic)
newBasicAuthCredentials ::
Prelude.Text ->
Prelude.Text ->
BasicAuthCredentials
newBasicAuthCredentials :: Text -> Text -> BasicAuthCredentials
newBasicAuthCredentials Text
pUsername_ Text
pPassword_ =
BasicAuthCredentials' :: Text -> Sensitive Text -> BasicAuthCredentials
BasicAuthCredentials'
{ $sel:username:BasicAuthCredentials' :: Text
username = Text
pUsername_,
$sel:password:BasicAuthCredentials' :: Sensitive Text
password = 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
pPassword_
}
basicAuthCredentials_username :: Lens.Lens' BasicAuthCredentials Prelude.Text
basicAuthCredentials_username :: (Text -> f Text) -> BasicAuthCredentials -> f BasicAuthCredentials
basicAuthCredentials_username = (BasicAuthCredentials -> Text)
-> (BasicAuthCredentials -> Text -> BasicAuthCredentials)
-> Lens BasicAuthCredentials BasicAuthCredentials Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BasicAuthCredentials' {Text
username :: Text
$sel:username:BasicAuthCredentials' :: BasicAuthCredentials -> Text
username} -> Text
username) (\s :: BasicAuthCredentials
s@BasicAuthCredentials' {} Text
a -> BasicAuthCredentials
s {$sel:username:BasicAuthCredentials' :: Text
username = Text
a} :: BasicAuthCredentials)
basicAuthCredentials_password :: Lens.Lens' BasicAuthCredentials Prelude.Text
basicAuthCredentials_password :: (Text -> f Text) -> BasicAuthCredentials -> f BasicAuthCredentials
basicAuthCredentials_password = (BasicAuthCredentials -> Sensitive Text)
-> (BasicAuthCredentials -> Sensitive Text -> BasicAuthCredentials)
-> Lens
BasicAuthCredentials
BasicAuthCredentials
(Sensitive Text)
(Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BasicAuthCredentials' {Sensitive Text
password :: Sensitive Text
$sel:password:BasicAuthCredentials' :: BasicAuthCredentials -> Sensitive Text
password} -> Sensitive Text
password) (\s :: BasicAuthCredentials
s@BasicAuthCredentials' {} Sensitive Text
a -> BasicAuthCredentials
s {$sel:password:BasicAuthCredentials' :: Sensitive Text
password = Sensitive Text
a} :: BasicAuthCredentials) ((Sensitive Text -> f (Sensitive Text))
-> BasicAuthCredentials -> f BasicAuthCredentials)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> BasicAuthCredentials
-> f BasicAuthCredentials
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 Prelude.Hashable BasicAuthCredentials
instance Prelude.NFData BasicAuthCredentials
instance Core.ToJSON BasicAuthCredentials where
toJSON :: BasicAuthCredentials -> Value
toJSON BasicAuthCredentials' {Text
Sensitive Text
password :: Sensitive Text
username :: Text
$sel:password:BasicAuthCredentials' :: BasicAuthCredentials -> Sensitive Text
$sel:username:BasicAuthCredentials' :: BasicAuthCredentials -> 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
"username" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
username),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"password" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
password)
]
)