{-# 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.SSO.Types.RoleCredentials where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RoleCredentials = RoleCredentials'
{
RoleCredentials -> Maybe (Sensitive Text)
secretAccessKey :: Prelude.Maybe (Core.Sensitive Prelude.Text),
RoleCredentials -> Maybe (Sensitive Text)
sessionToken :: Prelude.Maybe (Core.Sensitive Prelude.Text),
RoleCredentials -> Maybe Integer
expiration :: Prelude.Maybe Prelude.Integer,
RoleCredentials -> Maybe Text
accessKeyId :: Prelude.Maybe Prelude.Text
}
deriving (RoleCredentials -> RoleCredentials -> Bool
(RoleCredentials -> RoleCredentials -> Bool)
-> (RoleCredentials -> RoleCredentials -> Bool)
-> Eq RoleCredentials
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RoleCredentials -> RoleCredentials -> Bool
$c/= :: RoleCredentials -> RoleCredentials -> Bool
== :: RoleCredentials -> RoleCredentials -> Bool
$c== :: RoleCredentials -> RoleCredentials -> Bool
Prelude.Eq, Int -> RoleCredentials -> ShowS
[RoleCredentials] -> ShowS
RoleCredentials -> String
(Int -> RoleCredentials -> ShowS)
-> (RoleCredentials -> String)
-> ([RoleCredentials] -> ShowS)
-> Show RoleCredentials
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RoleCredentials] -> ShowS
$cshowList :: [RoleCredentials] -> ShowS
show :: RoleCredentials -> String
$cshow :: RoleCredentials -> String
showsPrec :: Int -> RoleCredentials -> ShowS
$cshowsPrec :: Int -> RoleCredentials -> ShowS
Prelude.Show, (forall x. RoleCredentials -> Rep RoleCredentials x)
-> (forall x. Rep RoleCredentials x -> RoleCredentials)
-> Generic RoleCredentials
forall x. Rep RoleCredentials x -> RoleCredentials
forall x. RoleCredentials -> Rep RoleCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RoleCredentials x -> RoleCredentials
$cfrom :: forall x. RoleCredentials -> Rep RoleCredentials x
Prelude.Generic)
newRoleCredentials ::
RoleCredentials
newRoleCredentials :: RoleCredentials
newRoleCredentials =
RoleCredentials' :: Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe Integer
-> Maybe Text
-> RoleCredentials
RoleCredentials'
{ $sel:secretAccessKey:RoleCredentials' :: Maybe (Sensitive Text)
secretAccessKey = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:sessionToken:RoleCredentials' :: Maybe (Sensitive Text)
sessionToken = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:expiration:RoleCredentials' :: Maybe Integer
expiration = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:accessKeyId:RoleCredentials' :: Maybe Text
accessKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
roleCredentials_secretAccessKey :: Lens.Lens' RoleCredentials (Prelude.Maybe Prelude.Text)
roleCredentials_secretAccessKey :: (Maybe Text -> f (Maybe Text))
-> RoleCredentials -> f RoleCredentials
roleCredentials_secretAccessKey = (RoleCredentials -> Maybe (Sensitive Text))
-> (RoleCredentials -> Maybe (Sensitive Text) -> RoleCredentials)
-> Lens
RoleCredentials
RoleCredentials
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoleCredentials' {Maybe (Sensitive Text)
secretAccessKey :: Maybe (Sensitive Text)
$sel:secretAccessKey:RoleCredentials' :: RoleCredentials -> Maybe (Sensitive Text)
secretAccessKey} -> Maybe (Sensitive Text)
secretAccessKey) (\s :: RoleCredentials
s@RoleCredentials' {} Maybe (Sensitive Text)
a -> RoleCredentials
s {$sel:secretAccessKey:RoleCredentials' :: Maybe (Sensitive Text)
secretAccessKey = Maybe (Sensitive Text)
a} :: RoleCredentials) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> RoleCredentials -> f RoleCredentials)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> RoleCredentials
-> f RoleCredentials
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
roleCredentials_sessionToken :: Lens.Lens' RoleCredentials (Prelude.Maybe Prelude.Text)
roleCredentials_sessionToken :: (Maybe Text -> f (Maybe Text))
-> RoleCredentials -> f RoleCredentials
roleCredentials_sessionToken = (RoleCredentials -> Maybe (Sensitive Text))
-> (RoleCredentials -> Maybe (Sensitive Text) -> RoleCredentials)
-> Lens
RoleCredentials
RoleCredentials
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoleCredentials' {Maybe (Sensitive Text)
sessionToken :: Maybe (Sensitive Text)
$sel:sessionToken:RoleCredentials' :: RoleCredentials -> Maybe (Sensitive Text)
sessionToken} -> Maybe (Sensitive Text)
sessionToken) (\s :: RoleCredentials
s@RoleCredentials' {} Maybe (Sensitive Text)
a -> RoleCredentials
s {$sel:sessionToken:RoleCredentials' :: Maybe (Sensitive Text)
sessionToken = Maybe (Sensitive Text)
a} :: RoleCredentials) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> RoleCredentials -> f RoleCredentials)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> RoleCredentials
-> f RoleCredentials
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
roleCredentials_expiration :: Lens.Lens' RoleCredentials (Prelude.Maybe Prelude.Integer)
roleCredentials_expiration :: (Maybe Integer -> f (Maybe Integer))
-> RoleCredentials -> f RoleCredentials
roleCredentials_expiration = (RoleCredentials -> Maybe Integer)
-> (RoleCredentials -> Maybe Integer -> RoleCredentials)
-> Lens
RoleCredentials RoleCredentials (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoleCredentials' {Maybe Integer
expiration :: Maybe Integer
$sel:expiration:RoleCredentials' :: RoleCredentials -> Maybe Integer
expiration} -> Maybe Integer
expiration) (\s :: RoleCredentials
s@RoleCredentials' {} Maybe Integer
a -> RoleCredentials
s {$sel:expiration:RoleCredentials' :: Maybe Integer
expiration = Maybe Integer
a} :: RoleCredentials)
roleCredentials_accessKeyId :: Lens.Lens' RoleCredentials (Prelude.Maybe Prelude.Text)
roleCredentials_accessKeyId :: (Maybe Text -> f (Maybe Text))
-> RoleCredentials -> f RoleCredentials
roleCredentials_accessKeyId = (RoleCredentials -> Maybe Text)
-> (RoleCredentials -> Maybe Text -> RoleCredentials)
-> Lens RoleCredentials RoleCredentials (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoleCredentials' {Maybe Text
accessKeyId :: Maybe Text
$sel:accessKeyId:RoleCredentials' :: RoleCredentials -> Maybe Text
accessKeyId} -> Maybe Text
accessKeyId) (\s :: RoleCredentials
s@RoleCredentials' {} Maybe Text
a -> RoleCredentials
s {$sel:accessKeyId:RoleCredentials' :: Maybe Text
accessKeyId = Maybe Text
a} :: RoleCredentials)
instance Core.FromJSON RoleCredentials where
parseJSON :: Value -> Parser RoleCredentials
parseJSON =
String
-> (Object -> Parser RoleCredentials)
-> Value
-> Parser RoleCredentials
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RoleCredentials"
( \Object
x ->
Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe Integer
-> Maybe Text
-> RoleCredentials
RoleCredentials'
(Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe Integer
-> Maybe Text
-> RoleCredentials)
-> Parser (Maybe (Sensitive Text))
-> Parser
(Maybe (Sensitive Text)
-> Maybe Integer -> Maybe Text -> RoleCredentials)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"secretAccessKey")
Parser
(Maybe (Sensitive Text)
-> Maybe Integer -> Maybe Text -> RoleCredentials)
-> Parser (Maybe (Sensitive Text))
-> Parser (Maybe Integer -> Maybe Text -> RoleCredentials)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sessionToken")
Parser (Maybe Integer -> Maybe Text -> RoleCredentials)
-> Parser (Maybe Integer) -> Parser (Maybe Text -> RoleCredentials)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"expiration")
Parser (Maybe Text -> RoleCredentials)
-> Parser (Maybe Text) -> Parser RoleCredentials
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"accessKeyId")
)
instance Prelude.Hashable RoleCredentials
instance Prelude.NFData RoleCredentials