{-# 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.CodePipeline.Types.AWSSessionCredentials where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AWSSessionCredentials = AWSSessionCredentials'
{
AWSSessionCredentials -> Sensitive Text
accessKeyId :: Core.Sensitive Prelude.Text,
AWSSessionCredentials -> Sensitive Text
secretAccessKey :: Core.Sensitive Prelude.Text,
AWSSessionCredentials -> Sensitive Text
sessionToken :: Core.Sensitive Prelude.Text
}
deriving (AWSSessionCredentials -> AWSSessionCredentials -> Bool
(AWSSessionCredentials -> AWSSessionCredentials -> Bool)
-> (AWSSessionCredentials -> AWSSessionCredentials -> Bool)
-> Eq AWSSessionCredentials
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AWSSessionCredentials -> AWSSessionCredentials -> Bool
$c/= :: AWSSessionCredentials -> AWSSessionCredentials -> Bool
== :: AWSSessionCredentials -> AWSSessionCredentials -> Bool
$c== :: AWSSessionCredentials -> AWSSessionCredentials -> Bool
Prelude.Eq, Int -> AWSSessionCredentials -> ShowS
[AWSSessionCredentials] -> ShowS
AWSSessionCredentials -> String
(Int -> AWSSessionCredentials -> ShowS)
-> (AWSSessionCredentials -> String)
-> ([AWSSessionCredentials] -> ShowS)
-> Show AWSSessionCredentials
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AWSSessionCredentials] -> ShowS
$cshowList :: [AWSSessionCredentials] -> ShowS
show :: AWSSessionCredentials -> String
$cshow :: AWSSessionCredentials -> String
showsPrec :: Int -> AWSSessionCredentials -> ShowS
$cshowsPrec :: Int -> AWSSessionCredentials -> ShowS
Prelude.Show, (forall x. AWSSessionCredentials -> Rep AWSSessionCredentials x)
-> (forall x. Rep AWSSessionCredentials x -> AWSSessionCredentials)
-> Generic AWSSessionCredentials
forall x. Rep AWSSessionCredentials x -> AWSSessionCredentials
forall x. AWSSessionCredentials -> Rep AWSSessionCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AWSSessionCredentials x -> AWSSessionCredentials
$cfrom :: forall x. AWSSessionCredentials -> Rep AWSSessionCredentials x
Prelude.Generic)
newAWSSessionCredentials ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
AWSSessionCredentials
newAWSSessionCredentials :: Text -> Text -> Text -> AWSSessionCredentials
newAWSSessionCredentials
Text
pAccessKeyId_
Text
pSecretAccessKey_
Text
pSessionToken_ =
AWSSessionCredentials' :: Sensitive Text
-> Sensitive Text -> Sensitive Text -> AWSSessionCredentials
AWSSessionCredentials'
{ $sel:accessKeyId:AWSSessionCredentials' :: Sensitive Text
accessKeyId =
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
pAccessKeyId_,
$sel:secretAccessKey:AWSSessionCredentials' :: Sensitive Text
secretAccessKey =
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
pSecretAccessKey_,
$sel:sessionToken:AWSSessionCredentials' :: Sensitive Text
sessionToken = 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
pSessionToken_
}
aWSSessionCredentials_accessKeyId :: Lens.Lens' AWSSessionCredentials Prelude.Text
aWSSessionCredentials_accessKeyId :: (Text -> f Text)
-> AWSSessionCredentials -> f AWSSessionCredentials
aWSSessionCredentials_accessKeyId = (AWSSessionCredentials -> Sensitive Text)
-> (AWSSessionCredentials
-> Sensitive Text -> AWSSessionCredentials)
-> Lens
AWSSessionCredentials
AWSSessionCredentials
(Sensitive Text)
(Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AWSSessionCredentials' {Sensitive Text
accessKeyId :: Sensitive Text
$sel:accessKeyId:AWSSessionCredentials' :: AWSSessionCredentials -> Sensitive Text
accessKeyId} -> Sensitive Text
accessKeyId) (\s :: AWSSessionCredentials
s@AWSSessionCredentials' {} Sensitive Text
a -> AWSSessionCredentials
s {$sel:accessKeyId:AWSSessionCredentials' :: Sensitive Text
accessKeyId = Sensitive Text
a} :: AWSSessionCredentials) ((Sensitive Text -> f (Sensitive Text))
-> AWSSessionCredentials -> f AWSSessionCredentials)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> AWSSessionCredentials
-> f AWSSessionCredentials
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
aWSSessionCredentials_secretAccessKey :: Lens.Lens' AWSSessionCredentials Prelude.Text
aWSSessionCredentials_secretAccessKey :: (Text -> f Text)
-> AWSSessionCredentials -> f AWSSessionCredentials
aWSSessionCredentials_secretAccessKey = (AWSSessionCredentials -> Sensitive Text)
-> (AWSSessionCredentials
-> Sensitive Text -> AWSSessionCredentials)
-> Lens
AWSSessionCredentials
AWSSessionCredentials
(Sensitive Text)
(Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AWSSessionCredentials' {Sensitive Text
secretAccessKey :: Sensitive Text
$sel:secretAccessKey:AWSSessionCredentials' :: AWSSessionCredentials -> Sensitive Text
secretAccessKey} -> Sensitive Text
secretAccessKey) (\s :: AWSSessionCredentials
s@AWSSessionCredentials' {} Sensitive Text
a -> AWSSessionCredentials
s {$sel:secretAccessKey:AWSSessionCredentials' :: Sensitive Text
secretAccessKey = Sensitive Text
a} :: AWSSessionCredentials) ((Sensitive Text -> f (Sensitive Text))
-> AWSSessionCredentials -> f AWSSessionCredentials)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> AWSSessionCredentials
-> f AWSSessionCredentials
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
aWSSessionCredentials_sessionToken :: Lens.Lens' AWSSessionCredentials Prelude.Text
aWSSessionCredentials_sessionToken :: (Text -> f Text)
-> AWSSessionCredentials -> f AWSSessionCredentials
aWSSessionCredentials_sessionToken = (AWSSessionCredentials -> Sensitive Text)
-> (AWSSessionCredentials
-> Sensitive Text -> AWSSessionCredentials)
-> Lens
AWSSessionCredentials
AWSSessionCredentials
(Sensitive Text)
(Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AWSSessionCredentials' {Sensitive Text
sessionToken :: Sensitive Text
$sel:sessionToken:AWSSessionCredentials' :: AWSSessionCredentials -> Sensitive Text
sessionToken} -> Sensitive Text
sessionToken) (\s :: AWSSessionCredentials
s@AWSSessionCredentials' {} Sensitive Text
a -> AWSSessionCredentials
s {$sel:sessionToken:AWSSessionCredentials' :: Sensitive Text
sessionToken = Sensitive Text
a} :: AWSSessionCredentials) ((Sensitive Text -> f (Sensitive Text))
-> AWSSessionCredentials -> f AWSSessionCredentials)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> AWSSessionCredentials
-> f AWSSessionCredentials
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 AWSSessionCredentials where
parseJSON :: Value -> Parser AWSSessionCredentials
parseJSON =
String
-> (Object -> Parser AWSSessionCredentials)
-> Value
-> Parser AWSSessionCredentials
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AWSSessionCredentials"
( \Object
x ->
Sensitive Text
-> Sensitive Text -> Sensitive Text -> AWSSessionCredentials
AWSSessionCredentials'
(Sensitive Text
-> Sensitive Text -> Sensitive Text -> AWSSessionCredentials)
-> Parser (Sensitive Text)
-> Parser
(Sensitive Text -> Sensitive Text -> AWSSessionCredentials)
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
"accessKeyId")
Parser (Sensitive Text -> Sensitive Text -> AWSSessionCredentials)
-> Parser (Sensitive Text)
-> Parser (Sensitive Text -> AWSSessionCredentials)
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
"secretAccessKey")
Parser (Sensitive Text -> AWSSessionCredentials)
-> Parser (Sensitive Text) -> Parser AWSSessionCredentials
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
"sessionToken")
)
instance Prelude.Hashable AWSSessionCredentials
instance Prelude.NFData AWSSessionCredentials