{-# 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.GameLift.Types.AwsCredentials where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AwsCredentials = AwsCredentials'
{
AwsCredentials -> Maybe Text
secretAccessKey :: Prelude.Maybe Prelude.Text,
AwsCredentials -> Maybe Text
sessionToken :: Prelude.Maybe Prelude.Text,
AwsCredentials -> Maybe Text
accessKeyId :: Prelude.Maybe Prelude.Text
}
deriving (AwsCredentials -> AwsCredentials -> Bool
(AwsCredentials -> AwsCredentials -> Bool)
-> (AwsCredentials -> AwsCredentials -> Bool) -> Eq AwsCredentials
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsCredentials -> AwsCredentials -> Bool
$c/= :: AwsCredentials -> AwsCredentials -> Bool
== :: AwsCredentials -> AwsCredentials -> Bool
$c== :: AwsCredentials -> AwsCredentials -> Bool
Prelude.Eq, Int -> AwsCredentials -> ShowS
[AwsCredentials] -> ShowS
AwsCredentials -> String
(Int -> AwsCredentials -> ShowS)
-> (AwsCredentials -> String)
-> ([AwsCredentials] -> ShowS)
-> Show AwsCredentials
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsCredentials] -> ShowS
$cshowList :: [AwsCredentials] -> ShowS
show :: AwsCredentials -> String
$cshow :: AwsCredentials -> String
showsPrec :: Int -> AwsCredentials -> ShowS
$cshowsPrec :: Int -> AwsCredentials -> ShowS
Prelude.Show, (forall x. AwsCredentials -> Rep AwsCredentials x)
-> (forall x. Rep AwsCredentials x -> AwsCredentials)
-> Generic AwsCredentials
forall x. Rep AwsCredentials x -> AwsCredentials
forall x. AwsCredentials -> Rep AwsCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AwsCredentials x -> AwsCredentials
$cfrom :: forall x. AwsCredentials -> Rep AwsCredentials x
Prelude.Generic)
newAwsCredentials ::
AwsCredentials
newAwsCredentials :: AwsCredentials
newAwsCredentials =
AwsCredentials' :: Maybe Text -> Maybe Text -> Maybe Text -> AwsCredentials
AwsCredentials'
{ $sel:secretAccessKey:AwsCredentials' :: Maybe Text
secretAccessKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sessionToken:AwsCredentials' :: Maybe Text
sessionToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:accessKeyId:AwsCredentials' :: Maybe Text
accessKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
awsCredentials_secretAccessKey :: Lens.Lens' AwsCredentials (Prelude.Maybe Prelude.Text)
awsCredentials_secretAccessKey :: (Maybe Text -> f (Maybe Text))
-> AwsCredentials -> f AwsCredentials
awsCredentials_secretAccessKey = (AwsCredentials -> Maybe Text)
-> (AwsCredentials -> Maybe Text -> AwsCredentials)
-> Lens AwsCredentials AwsCredentials (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCredentials' {Maybe Text
secretAccessKey :: Maybe Text
$sel:secretAccessKey:AwsCredentials' :: AwsCredentials -> Maybe Text
secretAccessKey} -> Maybe Text
secretAccessKey) (\s :: AwsCredentials
s@AwsCredentials' {} Maybe Text
a -> AwsCredentials
s {$sel:secretAccessKey:AwsCredentials' :: Maybe Text
secretAccessKey = Maybe Text
a} :: AwsCredentials)
awsCredentials_sessionToken :: Lens.Lens' AwsCredentials (Prelude.Maybe Prelude.Text)
awsCredentials_sessionToken :: (Maybe Text -> f (Maybe Text))
-> AwsCredentials -> f AwsCredentials
awsCredentials_sessionToken = (AwsCredentials -> Maybe Text)
-> (AwsCredentials -> Maybe Text -> AwsCredentials)
-> Lens AwsCredentials AwsCredentials (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCredentials' {Maybe Text
sessionToken :: Maybe Text
$sel:sessionToken:AwsCredentials' :: AwsCredentials -> Maybe Text
sessionToken} -> Maybe Text
sessionToken) (\s :: AwsCredentials
s@AwsCredentials' {} Maybe Text
a -> AwsCredentials
s {$sel:sessionToken:AwsCredentials' :: Maybe Text
sessionToken = Maybe Text
a} :: AwsCredentials)
awsCredentials_accessKeyId :: Lens.Lens' AwsCredentials (Prelude.Maybe Prelude.Text)
awsCredentials_accessKeyId :: (Maybe Text -> f (Maybe Text))
-> AwsCredentials -> f AwsCredentials
awsCredentials_accessKeyId = (AwsCredentials -> Maybe Text)
-> (AwsCredentials -> Maybe Text -> AwsCredentials)
-> Lens AwsCredentials AwsCredentials (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCredentials' {Maybe Text
accessKeyId :: Maybe Text
$sel:accessKeyId:AwsCredentials' :: AwsCredentials -> Maybe Text
accessKeyId} -> Maybe Text
accessKeyId) (\s :: AwsCredentials
s@AwsCredentials' {} Maybe Text
a -> AwsCredentials
s {$sel:accessKeyId:AwsCredentials' :: Maybe Text
accessKeyId = Maybe Text
a} :: AwsCredentials)
instance Core.FromJSON AwsCredentials where
parseJSON :: Value -> Parser AwsCredentials
parseJSON =
String
-> (Object -> Parser AwsCredentials)
-> Value
-> Parser AwsCredentials
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AwsCredentials"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> AwsCredentials
AwsCredentials'
(Maybe Text -> Maybe Text -> Maybe Text -> AwsCredentials)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> AwsCredentials)
forall (f :: * -> *) a b. Functor 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
"SecretAccessKey")
Parser (Maybe Text -> Maybe Text -> AwsCredentials)
-> Parser (Maybe Text) -> Parser (Maybe Text -> AwsCredentials)
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
"SessionToken")
Parser (Maybe Text -> AwsCredentials)
-> Parser (Maybe Text) -> Parser AwsCredentials
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 AwsCredentials
instance Prelude.NFData AwsCredentials