{-# 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.InstanceCredentials where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InstanceCredentials = InstanceCredentials'
{
InstanceCredentials -> Maybe Text
userName :: Prelude.Maybe Prelude.Text,
InstanceCredentials -> Maybe Text
secret :: Prelude.Maybe Prelude.Text
}
deriving (InstanceCredentials -> InstanceCredentials -> Bool
(InstanceCredentials -> InstanceCredentials -> Bool)
-> (InstanceCredentials -> InstanceCredentials -> Bool)
-> Eq InstanceCredentials
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceCredentials -> InstanceCredentials -> Bool
$c/= :: InstanceCredentials -> InstanceCredentials -> Bool
== :: InstanceCredentials -> InstanceCredentials -> Bool
$c== :: InstanceCredentials -> InstanceCredentials -> Bool
Prelude.Eq, Int -> InstanceCredentials -> ShowS
[InstanceCredentials] -> ShowS
InstanceCredentials -> String
(Int -> InstanceCredentials -> ShowS)
-> (InstanceCredentials -> String)
-> ([InstanceCredentials] -> ShowS)
-> Show InstanceCredentials
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceCredentials] -> ShowS
$cshowList :: [InstanceCredentials] -> ShowS
show :: InstanceCredentials -> String
$cshow :: InstanceCredentials -> String
showsPrec :: Int -> InstanceCredentials -> ShowS
$cshowsPrec :: Int -> InstanceCredentials -> ShowS
Prelude.Show, (forall x. InstanceCredentials -> Rep InstanceCredentials x)
-> (forall x. Rep InstanceCredentials x -> InstanceCredentials)
-> Generic InstanceCredentials
forall x. Rep InstanceCredentials x -> InstanceCredentials
forall x. InstanceCredentials -> Rep InstanceCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceCredentials x -> InstanceCredentials
$cfrom :: forall x. InstanceCredentials -> Rep InstanceCredentials x
Prelude.Generic)
newInstanceCredentials ::
InstanceCredentials
newInstanceCredentials :: InstanceCredentials
newInstanceCredentials =
InstanceCredentials' :: Maybe Text -> Maybe Text -> InstanceCredentials
InstanceCredentials'
{ $sel:userName:InstanceCredentials' :: Maybe Text
userName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:secret:InstanceCredentials' :: Maybe Text
secret = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
instanceCredentials_userName :: Lens.Lens' InstanceCredentials (Prelude.Maybe Prelude.Text)
instanceCredentials_userName :: (Maybe Text -> f (Maybe Text))
-> InstanceCredentials -> f InstanceCredentials
instanceCredentials_userName = (InstanceCredentials -> Maybe Text)
-> (InstanceCredentials -> Maybe Text -> InstanceCredentials)
-> Lens
InstanceCredentials InstanceCredentials (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceCredentials' {Maybe Text
userName :: Maybe Text
$sel:userName:InstanceCredentials' :: InstanceCredentials -> Maybe Text
userName} -> Maybe Text
userName) (\s :: InstanceCredentials
s@InstanceCredentials' {} Maybe Text
a -> InstanceCredentials
s {$sel:userName:InstanceCredentials' :: Maybe Text
userName = Maybe Text
a} :: InstanceCredentials)
instanceCredentials_secret :: Lens.Lens' InstanceCredentials (Prelude.Maybe Prelude.Text)
instanceCredentials_secret :: (Maybe Text -> f (Maybe Text))
-> InstanceCredentials -> f InstanceCredentials
instanceCredentials_secret = (InstanceCredentials -> Maybe Text)
-> (InstanceCredentials -> Maybe Text -> InstanceCredentials)
-> Lens
InstanceCredentials InstanceCredentials (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceCredentials' {Maybe Text
secret :: Maybe Text
$sel:secret:InstanceCredentials' :: InstanceCredentials -> Maybe Text
secret} -> Maybe Text
secret) (\s :: InstanceCredentials
s@InstanceCredentials' {} Maybe Text
a -> InstanceCredentials
s {$sel:secret:InstanceCredentials' :: Maybe Text
secret = Maybe Text
a} :: InstanceCredentials)
instance Core.FromJSON InstanceCredentials where
parseJSON :: Value -> Parser InstanceCredentials
parseJSON =
String
-> (Object -> Parser InstanceCredentials)
-> Value
-> Parser InstanceCredentials
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InstanceCredentials"
( \Object
x ->
Maybe Text -> Maybe Text -> InstanceCredentials
InstanceCredentials'
(Maybe Text -> Maybe Text -> InstanceCredentials)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> InstanceCredentials)
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
"UserName")
Parser (Maybe Text -> InstanceCredentials)
-> Parser (Maybe Text) -> Parser InstanceCredentials
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
"Secret")
)
instance Prelude.Hashable InstanceCredentials
instance Prelude.NFData InstanceCredentials