{-# 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.IAM.Types.SSHPublicKeyMetadata where
import qualified Amazonka.Core as Core
import Amazonka.IAM.Types.StatusType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SSHPublicKeyMetadata = SSHPublicKeyMetadata'
{
SSHPublicKeyMetadata -> Text
userName :: Prelude.Text,
SSHPublicKeyMetadata -> Text
sSHPublicKeyId :: Prelude.Text,
SSHPublicKeyMetadata -> StatusType
status :: StatusType,
SSHPublicKeyMetadata -> ISO8601
uploadDate :: Core.ISO8601
}
deriving (SSHPublicKeyMetadata -> SSHPublicKeyMetadata -> Bool
(SSHPublicKeyMetadata -> SSHPublicKeyMetadata -> Bool)
-> (SSHPublicKeyMetadata -> SSHPublicKeyMetadata -> Bool)
-> Eq SSHPublicKeyMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SSHPublicKeyMetadata -> SSHPublicKeyMetadata -> Bool
$c/= :: SSHPublicKeyMetadata -> SSHPublicKeyMetadata -> Bool
== :: SSHPublicKeyMetadata -> SSHPublicKeyMetadata -> Bool
$c== :: SSHPublicKeyMetadata -> SSHPublicKeyMetadata -> Bool
Prelude.Eq, ReadPrec [SSHPublicKeyMetadata]
ReadPrec SSHPublicKeyMetadata
Int -> ReadS SSHPublicKeyMetadata
ReadS [SSHPublicKeyMetadata]
(Int -> ReadS SSHPublicKeyMetadata)
-> ReadS [SSHPublicKeyMetadata]
-> ReadPrec SSHPublicKeyMetadata
-> ReadPrec [SSHPublicKeyMetadata]
-> Read SSHPublicKeyMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SSHPublicKeyMetadata]
$creadListPrec :: ReadPrec [SSHPublicKeyMetadata]
readPrec :: ReadPrec SSHPublicKeyMetadata
$creadPrec :: ReadPrec SSHPublicKeyMetadata
readList :: ReadS [SSHPublicKeyMetadata]
$creadList :: ReadS [SSHPublicKeyMetadata]
readsPrec :: Int -> ReadS SSHPublicKeyMetadata
$creadsPrec :: Int -> ReadS SSHPublicKeyMetadata
Prelude.Read, Int -> SSHPublicKeyMetadata -> ShowS
[SSHPublicKeyMetadata] -> ShowS
SSHPublicKeyMetadata -> String
(Int -> SSHPublicKeyMetadata -> ShowS)
-> (SSHPublicKeyMetadata -> String)
-> ([SSHPublicKeyMetadata] -> ShowS)
-> Show SSHPublicKeyMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SSHPublicKeyMetadata] -> ShowS
$cshowList :: [SSHPublicKeyMetadata] -> ShowS
show :: SSHPublicKeyMetadata -> String
$cshow :: SSHPublicKeyMetadata -> String
showsPrec :: Int -> SSHPublicKeyMetadata -> ShowS
$cshowsPrec :: Int -> SSHPublicKeyMetadata -> ShowS
Prelude.Show, (forall x. SSHPublicKeyMetadata -> Rep SSHPublicKeyMetadata x)
-> (forall x. Rep SSHPublicKeyMetadata x -> SSHPublicKeyMetadata)
-> Generic SSHPublicKeyMetadata
forall x. Rep SSHPublicKeyMetadata x -> SSHPublicKeyMetadata
forall x. SSHPublicKeyMetadata -> Rep SSHPublicKeyMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SSHPublicKeyMetadata x -> SSHPublicKeyMetadata
$cfrom :: forall x. SSHPublicKeyMetadata -> Rep SSHPublicKeyMetadata x
Prelude.Generic)
newSSHPublicKeyMetadata ::
Prelude.Text ->
Prelude.Text ->
StatusType ->
Prelude.UTCTime ->
SSHPublicKeyMetadata
newSSHPublicKeyMetadata :: Text -> Text -> StatusType -> UTCTime -> SSHPublicKeyMetadata
newSSHPublicKeyMetadata
Text
pUserName_
Text
pSSHPublicKeyId_
StatusType
pStatus_
UTCTime
pUploadDate_ =
SSHPublicKeyMetadata' :: Text -> Text -> StatusType -> ISO8601 -> SSHPublicKeyMetadata
SSHPublicKeyMetadata'
{ $sel:userName:SSHPublicKeyMetadata' :: Text
userName = Text
pUserName_,
$sel:sSHPublicKeyId:SSHPublicKeyMetadata' :: Text
sSHPublicKeyId = Text
pSSHPublicKeyId_,
$sel:status:SSHPublicKeyMetadata' :: StatusType
status = StatusType
pStatus_,
$sel:uploadDate:SSHPublicKeyMetadata' :: ISO8601
uploadDate = Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601))
-> UTCTime -> ISO8601
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pUploadDate_
}
sSHPublicKeyMetadata_userName :: Lens.Lens' SSHPublicKeyMetadata Prelude.Text
sSHPublicKeyMetadata_userName :: (Text -> f Text) -> SSHPublicKeyMetadata -> f SSHPublicKeyMetadata
sSHPublicKeyMetadata_userName = (SSHPublicKeyMetadata -> Text)
-> (SSHPublicKeyMetadata -> Text -> SSHPublicKeyMetadata)
-> Lens SSHPublicKeyMetadata SSHPublicKeyMetadata Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SSHPublicKeyMetadata' {Text
userName :: Text
$sel:userName:SSHPublicKeyMetadata' :: SSHPublicKeyMetadata -> Text
userName} -> Text
userName) (\s :: SSHPublicKeyMetadata
s@SSHPublicKeyMetadata' {} Text
a -> SSHPublicKeyMetadata
s {$sel:userName:SSHPublicKeyMetadata' :: Text
userName = Text
a} :: SSHPublicKeyMetadata)
sSHPublicKeyMetadata_sSHPublicKeyId :: Lens.Lens' SSHPublicKeyMetadata Prelude.Text
sSHPublicKeyMetadata_sSHPublicKeyId :: (Text -> f Text) -> SSHPublicKeyMetadata -> f SSHPublicKeyMetadata
sSHPublicKeyMetadata_sSHPublicKeyId = (SSHPublicKeyMetadata -> Text)
-> (SSHPublicKeyMetadata -> Text -> SSHPublicKeyMetadata)
-> Lens SSHPublicKeyMetadata SSHPublicKeyMetadata Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SSHPublicKeyMetadata' {Text
sSHPublicKeyId :: Text
$sel:sSHPublicKeyId:SSHPublicKeyMetadata' :: SSHPublicKeyMetadata -> Text
sSHPublicKeyId} -> Text
sSHPublicKeyId) (\s :: SSHPublicKeyMetadata
s@SSHPublicKeyMetadata' {} Text
a -> SSHPublicKeyMetadata
s {$sel:sSHPublicKeyId:SSHPublicKeyMetadata' :: Text
sSHPublicKeyId = Text
a} :: SSHPublicKeyMetadata)
sSHPublicKeyMetadata_status :: Lens.Lens' SSHPublicKeyMetadata StatusType
sSHPublicKeyMetadata_status :: (StatusType -> f StatusType)
-> SSHPublicKeyMetadata -> f SSHPublicKeyMetadata
sSHPublicKeyMetadata_status = (SSHPublicKeyMetadata -> StatusType)
-> (SSHPublicKeyMetadata -> StatusType -> SSHPublicKeyMetadata)
-> Lens
SSHPublicKeyMetadata SSHPublicKeyMetadata StatusType StatusType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SSHPublicKeyMetadata' {StatusType
status :: StatusType
$sel:status:SSHPublicKeyMetadata' :: SSHPublicKeyMetadata -> StatusType
status} -> StatusType
status) (\s :: SSHPublicKeyMetadata
s@SSHPublicKeyMetadata' {} StatusType
a -> SSHPublicKeyMetadata
s {$sel:status:SSHPublicKeyMetadata' :: StatusType
status = StatusType
a} :: SSHPublicKeyMetadata)
sSHPublicKeyMetadata_uploadDate :: Lens.Lens' SSHPublicKeyMetadata Prelude.UTCTime
sSHPublicKeyMetadata_uploadDate :: (UTCTime -> f UTCTime)
-> SSHPublicKeyMetadata -> f SSHPublicKeyMetadata
sSHPublicKeyMetadata_uploadDate = (SSHPublicKeyMetadata -> ISO8601)
-> (SSHPublicKeyMetadata -> ISO8601 -> SSHPublicKeyMetadata)
-> Lens SSHPublicKeyMetadata SSHPublicKeyMetadata ISO8601 ISO8601
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SSHPublicKeyMetadata' {ISO8601
uploadDate :: ISO8601
$sel:uploadDate:SSHPublicKeyMetadata' :: SSHPublicKeyMetadata -> ISO8601
uploadDate} -> ISO8601
uploadDate) (\s :: SSHPublicKeyMetadata
s@SSHPublicKeyMetadata' {} ISO8601
a -> SSHPublicKeyMetadata
s {$sel:uploadDate:SSHPublicKeyMetadata' :: ISO8601
uploadDate = ISO8601
a} :: SSHPublicKeyMetadata) ((ISO8601 -> f ISO8601)
-> SSHPublicKeyMetadata -> f SSHPublicKeyMetadata)
-> ((UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601)
-> (UTCTime -> f UTCTime)
-> SSHPublicKeyMetadata
-> f SSHPublicKeyMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromXML SSHPublicKeyMetadata where
parseXML :: [Node] -> Either String SSHPublicKeyMetadata
parseXML [Node]
x =
Text -> Text -> StatusType -> ISO8601 -> SSHPublicKeyMetadata
SSHPublicKeyMetadata'
(Text -> Text -> StatusType -> ISO8601 -> SSHPublicKeyMetadata)
-> Either String Text
-> Either
String (Text -> StatusType -> ISO8601 -> SSHPublicKeyMetadata)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"UserName")
Either
String (Text -> StatusType -> ISO8601 -> SSHPublicKeyMetadata)
-> Either String Text
-> Either String (StatusType -> ISO8601 -> SSHPublicKeyMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"SSHPublicKeyId")
Either String (StatusType -> ISO8601 -> SSHPublicKeyMetadata)
-> Either String StatusType
-> Either String (ISO8601 -> SSHPublicKeyMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String StatusType
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Status")
Either String (ISO8601 -> SSHPublicKeyMetadata)
-> Either String ISO8601 -> Either String SSHPublicKeyMetadata
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ISO8601
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"UploadDate")
instance Prelude.Hashable SSHPublicKeyMetadata
instance Prelude.NFData SSHPublicKeyMetadata