{-# 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.SSHPublicKey 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 SSHPublicKey = SSHPublicKey'
{
SSHPublicKey -> Maybe ISO8601
uploadDate :: Prelude.Maybe Core.ISO8601,
SSHPublicKey -> Text
userName :: Prelude.Text,
SSHPublicKey -> Text
sSHPublicKeyId :: Prelude.Text,
SSHPublicKey -> Text
fingerprint :: Prelude.Text,
SSHPublicKey -> Text
sSHPublicKeyBody :: Prelude.Text,
SSHPublicKey -> StatusType
status :: StatusType
}
deriving (SSHPublicKey -> SSHPublicKey -> Bool
(SSHPublicKey -> SSHPublicKey -> Bool)
-> (SSHPublicKey -> SSHPublicKey -> Bool) -> Eq SSHPublicKey
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SSHPublicKey -> SSHPublicKey -> Bool
$c/= :: SSHPublicKey -> SSHPublicKey -> Bool
== :: SSHPublicKey -> SSHPublicKey -> Bool
$c== :: SSHPublicKey -> SSHPublicKey -> Bool
Prelude.Eq, ReadPrec [SSHPublicKey]
ReadPrec SSHPublicKey
Int -> ReadS SSHPublicKey
ReadS [SSHPublicKey]
(Int -> ReadS SSHPublicKey)
-> ReadS [SSHPublicKey]
-> ReadPrec SSHPublicKey
-> ReadPrec [SSHPublicKey]
-> Read SSHPublicKey
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SSHPublicKey]
$creadListPrec :: ReadPrec [SSHPublicKey]
readPrec :: ReadPrec SSHPublicKey
$creadPrec :: ReadPrec SSHPublicKey
readList :: ReadS [SSHPublicKey]
$creadList :: ReadS [SSHPublicKey]
readsPrec :: Int -> ReadS SSHPublicKey
$creadsPrec :: Int -> ReadS SSHPublicKey
Prelude.Read, Int -> SSHPublicKey -> ShowS
[SSHPublicKey] -> ShowS
SSHPublicKey -> String
(Int -> SSHPublicKey -> ShowS)
-> (SSHPublicKey -> String)
-> ([SSHPublicKey] -> ShowS)
-> Show SSHPublicKey
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SSHPublicKey] -> ShowS
$cshowList :: [SSHPublicKey] -> ShowS
show :: SSHPublicKey -> String
$cshow :: SSHPublicKey -> String
showsPrec :: Int -> SSHPublicKey -> ShowS
$cshowsPrec :: Int -> SSHPublicKey -> ShowS
Prelude.Show, (forall x. SSHPublicKey -> Rep SSHPublicKey x)
-> (forall x. Rep SSHPublicKey x -> SSHPublicKey)
-> Generic SSHPublicKey
forall x. Rep SSHPublicKey x -> SSHPublicKey
forall x. SSHPublicKey -> Rep SSHPublicKey x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SSHPublicKey x -> SSHPublicKey
$cfrom :: forall x. SSHPublicKey -> Rep SSHPublicKey x
Prelude.Generic)
newSSHPublicKey ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
StatusType ->
SSHPublicKey
newSSHPublicKey :: Text -> Text -> Text -> Text -> StatusType -> SSHPublicKey
newSSHPublicKey
Text
pUserName_
Text
pSSHPublicKeyId_
Text
pFingerprint_
Text
pSSHPublicKeyBody_
StatusType
pStatus_ =
SSHPublicKey' :: Maybe ISO8601
-> Text -> Text -> Text -> Text -> StatusType -> SSHPublicKey
SSHPublicKey'
{ $sel:uploadDate:SSHPublicKey' :: Maybe ISO8601
uploadDate = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
$sel:userName:SSHPublicKey' :: Text
userName = Text
pUserName_,
$sel:sSHPublicKeyId:SSHPublicKey' :: Text
sSHPublicKeyId = Text
pSSHPublicKeyId_,
$sel:fingerprint:SSHPublicKey' :: Text
fingerprint = Text
pFingerprint_,
$sel:sSHPublicKeyBody:SSHPublicKey' :: Text
sSHPublicKeyBody = Text
pSSHPublicKeyBody_,
$sel:status:SSHPublicKey' :: StatusType
status = StatusType
pStatus_
}
sSHPublicKey_uploadDate :: Lens.Lens' SSHPublicKey (Prelude.Maybe Prelude.UTCTime)
sSHPublicKey_uploadDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> SSHPublicKey -> f SSHPublicKey
sSHPublicKey_uploadDate = (SSHPublicKey -> Maybe ISO8601)
-> (SSHPublicKey -> Maybe ISO8601 -> SSHPublicKey)
-> Lens SSHPublicKey SSHPublicKey (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SSHPublicKey' {Maybe ISO8601
uploadDate :: Maybe ISO8601
$sel:uploadDate:SSHPublicKey' :: SSHPublicKey -> Maybe ISO8601
uploadDate} -> Maybe ISO8601
uploadDate) (\s :: SSHPublicKey
s@SSHPublicKey' {} Maybe ISO8601
a -> SSHPublicKey
s {$sel:uploadDate:SSHPublicKey' :: Maybe ISO8601
uploadDate = Maybe ISO8601
a} :: SSHPublicKey) ((Maybe ISO8601 -> f (Maybe ISO8601))
-> SSHPublicKey -> f SSHPublicKey)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> SSHPublicKey
-> f SSHPublicKey
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
(Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
sSHPublicKey_userName :: Lens.Lens' SSHPublicKey Prelude.Text
sSHPublicKey_userName :: (Text -> f Text) -> SSHPublicKey -> f SSHPublicKey
sSHPublicKey_userName = (SSHPublicKey -> Text)
-> (SSHPublicKey -> Text -> SSHPublicKey)
-> Lens SSHPublicKey SSHPublicKey Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SSHPublicKey' {Text
userName :: Text
$sel:userName:SSHPublicKey' :: SSHPublicKey -> Text
userName} -> Text
userName) (\s :: SSHPublicKey
s@SSHPublicKey' {} Text
a -> SSHPublicKey
s {$sel:userName:SSHPublicKey' :: Text
userName = Text
a} :: SSHPublicKey)
sSHPublicKey_sSHPublicKeyId :: Lens.Lens' SSHPublicKey Prelude.Text
sSHPublicKey_sSHPublicKeyId :: (Text -> f Text) -> SSHPublicKey -> f SSHPublicKey
sSHPublicKey_sSHPublicKeyId = (SSHPublicKey -> Text)
-> (SSHPublicKey -> Text -> SSHPublicKey)
-> Lens SSHPublicKey SSHPublicKey Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SSHPublicKey' {Text
sSHPublicKeyId :: Text
$sel:sSHPublicKeyId:SSHPublicKey' :: SSHPublicKey -> Text
sSHPublicKeyId} -> Text
sSHPublicKeyId) (\s :: SSHPublicKey
s@SSHPublicKey' {} Text
a -> SSHPublicKey
s {$sel:sSHPublicKeyId:SSHPublicKey' :: Text
sSHPublicKeyId = Text
a} :: SSHPublicKey)
sSHPublicKey_fingerprint :: Lens.Lens' SSHPublicKey Prelude.Text
sSHPublicKey_fingerprint :: (Text -> f Text) -> SSHPublicKey -> f SSHPublicKey
sSHPublicKey_fingerprint = (SSHPublicKey -> Text)
-> (SSHPublicKey -> Text -> SSHPublicKey)
-> Lens SSHPublicKey SSHPublicKey Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SSHPublicKey' {Text
fingerprint :: Text
$sel:fingerprint:SSHPublicKey' :: SSHPublicKey -> Text
fingerprint} -> Text
fingerprint) (\s :: SSHPublicKey
s@SSHPublicKey' {} Text
a -> SSHPublicKey
s {$sel:fingerprint:SSHPublicKey' :: Text
fingerprint = Text
a} :: SSHPublicKey)
sSHPublicKey_sSHPublicKeyBody :: Lens.Lens' SSHPublicKey Prelude.Text
sSHPublicKey_sSHPublicKeyBody :: (Text -> f Text) -> SSHPublicKey -> f SSHPublicKey
sSHPublicKey_sSHPublicKeyBody = (SSHPublicKey -> Text)
-> (SSHPublicKey -> Text -> SSHPublicKey)
-> Lens SSHPublicKey SSHPublicKey Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SSHPublicKey' {Text
sSHPublicKeyBody :: Text
$sel:sSHPublicKeyBody:SSHPublicKey' :: SSHPublicKey -> Text
sSHPublicKeyBody} -> Text
sSHPublicKeyBody) (\s :: SSHPublicKey
s@SSHPublicKey' {} Text
a -> SSHPublicKey
s {$sel:sSHPublicKeyBody:SSHPublicKey' :: Text
sSHPublicKeyBody = Text
a} :: SSHPublicKey)
sSHPublicKey_status :: Lens.Lens' SSHPublicKey StatusType
sSHPublicKey_status :: (StatusType -> f StatusType) -> SSHPublicKey -> f SSHPublicKey
sSHPublicKey_status = (SSHPublicKey -> StatusType)
-> (SSHPublicKey -> StatusType -> SSHPublicKey)
-> Lens SSHPublicKey SSHPublicKey StatusType StatusType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SSHPublicKey' {StatusType
status :: StatusType
$sel:status:SSHPublicKey' :: SSHPublicKey -> StatusType
status} -> StatusType
status) (\s :: SSHPublicKey
s@SSHPublicKey' {} StatusType
a -> SSHPublicKey
s {$sel:status:SSHPublicKey' :: StatusType
status = StatusType
a} :: SSHPublicKey)
instance Core.FromXML SSHPublicKey where
parseXML :: [Node] -> Either String SSHPublicKey
parseXML [Node]
x =
Maybe ISO8601
-> Text -> Text -> Text -> Text -> StatusType -> SSHPublicKey
SSHPublicKey'
(Maybe ISO8601
-> Text -> Text -> Text -> Text -> StatusType -> SSHPublicKey)
-> Either String (Maybe ISO8601)
-> Either
String (Text -> Text -> Text -> Text -> StatusType -> SSHPublicKey)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"UploadDate")
Either
String (Text -> Text -> Text -> Text -> StatusType -> SSHPublicKey)
-> Either String Text
-> Either
String (Text -> Text -> Text -> StatusType -> SSHPublicKey)
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
"UserName")
Either String (Text -> Text -> Text -> StatusType -> SSHPublicKey)
-> Either String Text
-> Either String (Text -> Text -> StatusType -> SSHPublicKey)
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 (Text -> Text -> StatusType -> SSHPublicKey)
-> Either String Text
-> Either String (Text -> StatusType -> SSHPublicKey)
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
"Fingerprint")
Either String (Text -> StatusType -> SSHPublicKey)
-> Either String Text -> Either String (StatusType -> SSHPublicKey)
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
"SSHPublicKeyBody")
Either String (StatusType -> SSHPublicKey)
-> Either String StatusType -> Either String SSHPublicKey
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")
instance Prelude.Hashable SSHPublicKey
instance Prelude.NFData SSHPublicKey