{-# 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.OpsWorks.Types.TemporaryCredential where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TemporaryCredential = TemporaryCredential'
{
TemporaryCredential -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
TemporaryCredential -> Maybe Text
username :: Prelude.Maybe Prelude.Text,
TemporaryCredential -> Maybe Text
password :: Prelude.Maybe Prelude.Text,
TemporaryCredential -> Maybe Int
validForInMinutes :: Prelude.Maybe Prelude.Int
}
deriving (TemporaryCredential -> TemporaryCredential -> Bool
(TemporaryCredential -> TemporaryCredential -> Bool)
-> (TemporaryCredential -> TemporaryCredential -> Bool)
-> Eq TemporaryCredential
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TemporaryCredential -> TemporaryCredential -> Bool
$c/= :: TemporaryCredential -> TemporaryCredential -> Bool
== :: TemporaryCredential -> TemporaryCredential -> Bool
$c== :: TemporaryCredential -> TemporaryCredential -> Bool
Prelude.Eq, ReadPrec [TemporaryCredential]
ReadPrec TemporaryCredential
Int -> ReadS TemporaryCredential
ReadS [TemporaryCredential]
(Int -> ReadS TemporaryCredential)
-> ReadS [TemporaryCredential]
-> ReadPrec TemporaryCredential
-> ReadPrec [TemporaryCredential]
-> Read TemporaryCredential
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TemporaryCredential]
$creadListPrec :: ReadPrec [TemporaryCredential]
readPrec :: ReadPrec TemporaryCredential
$creadPrec :: ReadPrec TemporaryCredential
readList :: ReadS [TemporaryCredential]
$creadList :: ReadS [TemporaryCredential]
readsPrec :: Int -> ReadS TemporaryCredential
$creadsPrec :: Int -> ReadS TemporaryCredential
Prelude.Read, Int -> TemporaryCredential -> ShowS
[TemporaryCredential] -> ShowS
TemporaryCredential -> String
(Int -> TemporaryCredential -> ShowS)
-> (TemporaryCredential -> String)
-> ([TemporaryCredential] -> ShowS)
-> Show TemporaryCredential
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TemporaryCredential] -> ShowS
$cshowList :: [TemporaryCredential] -> ShowS
show :: TemporaryCredential -> String
$cshow :: TemporaryCredential -> String
showsPrec :: Int -> TemporaryCredential -> ShowS
$cshowsPrec :: Int -> TemporaryCredential -> ShowS
Prelude.Show, (forall x. TemporaryCredential -> Rep TemporaryCredential x)
-> (forall x. Rep TemporaryCredential x -> TemporaryCredential)
-> Generic TemporaryCredential
forall x. Rep TemporaryCredential x -> TemporaryCredential
forall x. TemporaryCredential -> Rep TemporaryCredential x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TemporaryCredential x -> TemporaryCredential
$cfrom :: forall x. TemporaryCredential -> Rep TemporaryCredential x
Prelude.Generic)
newTemporaryCredential ::
TemporaryCredential
newTemporaryCredential :: TemporaryCredential
newTemporaryCredential =
TemporaryCredential' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Int -> TemporaryCredential
TemporaryCredential'
{ $sel:instanceId:TemporaryCredential' :: Maybe Text
instanceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:username:TemporaryCredential' :: Maybe Text
username = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:password:TemporaryCredential' :: Maybe Text
password = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:validForInMinutes:TemporaryCredential' :: Maybe Int
validForInMinutes = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
temporaryCredential_instanceId :: Lens.Lens' TemporaryCredential (Prelude.Maybe Prelude.Text)
temporaryCredential_instanceId :: (Maybe Text -> f (Maybe Text))
-> TemporaryCredential -> f TemporaryCredential
temporaryCredential_instanceId = (TemporaryCredential -> Maybe Text)
-> (TemporaryCredential -> Maybe Text -> TemporaryCredential)
-> Lens
TemporaryCredential TemporaryCredential (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemporaryCredential' {Maybe Text
instanceId :: Maybe Text
$sel:instanceId:TemporaryCredential' :: TemporaryCredential -> Maybe Text
instanceId} -> Maybe Text
instanceId) (\s :: TemporaryCredential
s@TemporaryCredential' {} Maybe Text
a -> TemporaryCredential
s {$sel:instanceId:TemporaryCredential' :: Maybe Text
instanceId = Maybe Text
a} :: TemporaryCredential)
temporaryCredential_username :: Lens.Lens' TemporaryCredential (Prelude.Maybe Prelude.Text)
temporaryCredential_username :: (Maybe Text -> f (Maybe Text))
-> TemporaryCredential -> f TemporaryCredential
temporaryCredential_username = (TemporaryCredential -> Maybe Text)
-> (TemporaryCredential -> Maybe Text -> TemporaryCredential)
-> Lens
TemporaryCredential TemporaryCredential (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemporaryCredential' {Maybe Text
username :: Maybe Text
$sel:username:TemporaryCredential' :: TemporaryCredential -> Maybe Text
username} -> Maybe Text
username) (\s :: TemporaryCredential
s@TemporaryCredential' {} Maybe Text
a -> TemporaryCredential
s {$sel:username:TemporaryCredential' :: Maybe Text
username = Maybe Text
a} :: TemporaryCredential)
temporaryCredential_password :: Lens.Lens' TemporaryCredential (Prelude.Maybe Prelude.Text)
temporaryCredential_password :: (Maybe Text -> f (Maybe Text))
-> TemporaryCredential -> f TemporaryCredential
temporaryCredential_password = (TemporaryCredential -> Maybe Text)
-> (TemporaryCredential -> Maybe Text -> TemporaryCredential)
-> Lens
TemporaryCredential TemporaryCredential (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemporaryCredential' {Maybe Text
password :: Maybe Text
$sel:password:TemporaryCredential' :: TemporaryCredential -> Maybe Text
password} -> Maybe Text
password) (\s :: TemporaryCredential
s@TemporaryCredential' {} Maybe Text
a -> TemporaryCredential
s {$sel:password:TemporaryCredential' :: Maybe Text
password = Maybe Text
a} :: TemporaryCredential)
temporaryCredential_validForInMinutes :: Lens.Lens' TemporaryCredential (Prelude.Maybe Prelude.Int)
temporaryCredential_validForInMinutes :: (Maybe Int -> f (Maybe Int))
-> TemporaryCredential -> f TemporaryCredential
temporaryCredential_validForInMinutes = (TemporaryCredential -> Maybe Int)
-> (TemporaryCredential -> Maybe Int -> TemporaryCredential)
-> Lens
TemporaryCredential TemporaryCredential (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemporaryCredential' {Maybe Int
validForInMinutes :: Maybe Int
$sel:validForInMinutes:TemporaryCredential' :: TemporaryCredential -> Maybe Int
validForInMinutes} -> Maybe Int
validForInMinutes) (\s :: TemporaryCredential
s@TemporaryCredential' {} Maybe Int
a -> TemporaryCredential
s {$sel:validForInMinutes:TemporaryCredential' :: Maybe Int
validForInMinutes = Maybe Int
a} :: TemporaryCredential)
instance Core.FromJSON TemporaryCredential where
parseJSON :: Value -> Parser TemporaryCredential
parseJSON =
String
-> (Object -> Parser TemporaryCredential)
-> Value
-> Parser TemporaryCredential
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TemporaryCredential"
( \Object
x ->
Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Int -> TemporaryCredential
TemporaryCredential'
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Int -> TemporaryCredential)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Int -> TemporaryCredential)
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
"InstanceId")
Parser
(Maybe Text -> Maybe Text -> Maybe Int -> TemporaryCredential)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Int -> TemporaryCredential)
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
"Username")
Parser (Maybe Text -> Maybe Int -> TemporaryCredential)
-> Parser (Maybe Text) -> Parser (Maybe Int -> TemporaryCredential)
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
"Password")
Parser (Maybe Int -> TemporaryCredential)
-> Parser (Maybe Int) -> Parser TemporaryCredential
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ValidForInMinutes")
)
instance Prelude.Hashable TemporaryCredential
instance Prelude.NFData TemporaryCredential