{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IAM.Types.StatusType
import qualified Amazonka.Prelude as Prelude
data SSHPublicKey = SSHPublicKey'
{
SSHPublicKey -> Maybe ISO8601
uploadDate :: Prelude.Maybe Data.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
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]
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
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. 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'
{ $sel:uploadDate:SSHPublicKey' :: Maybe ISO8601
uploadDate = 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 :: Lens' SSHPublicKey (Maybe UTCTime)
sSHPublicKey_uploadDate = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
sSHPublicKey_userName :: Lens.Lens' SSHPublicKey Prelude.Text
sSHPublicKey_userName :: Lens' SSHPublicKey Text
sSHPublicKey_userName = 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 :: Lens' SSHPublicKey Text
sSHPublicKey_sSHPublicKeyId = 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 :: Lens' SSHPublicKey Text
sSHPublicKey_fingerprint = 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 :: Lens' SSHPublicKey Text
sSHPublicKey_sSHPublicKeyBody = 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 :: Lens' SSHPublicKey StatusType
sSHPublicKey_status = 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 Data.FromXML SSHPublicKey where
parseXML :: [Node] -> Either String SSHPublicKey
parseXML [Node]
x =
Maybe ISO8601
-> Text -> Text -> Text -> Text -> StatusType -> SSHPublicKey
SSHPublicKey'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"UploadDate")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"UserName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"SSHPublicKeyId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Fingerprint")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"SSHPublicKeyBody")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Status")
instance Prelude.Hashable SSHPublicKey where
hashWithSalt :: Int -> SSHPublicKey -> Int
hashWithSalt Int
_salt SSHPublicKey' {Maybe ISO8601
Text
StatusType
status :: StatusType
sSHPublicKeyBody :: Text
fingerprint :: Text
sSHPublicKeyId :: Text
userName :: Text
uploadDate :: Maybe ISO8601
$sel:status:SSHPublicKey' :: SSHPublicKey -> StatusType
$sel:sSHPublicKeyBody:SSHPublicKey' :: SSHPublicKey -> Text
$sel:fingerprint:SSHPublicKey' :: SSHPublicKey -> Text
$sel:sSHPublicKeyId:SSHPublicKey' :: SSHPublicKey -> Text
$sel:userName:SSHPublicKey' :: SSHPublicKey -> Text
$sel:uploadDate:SSHPublicKey' :: SSHPublicKey -> Maybe ISO8601
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
uploadDate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
userName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sSHPublicKeyId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
fingerprint
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sSHPublicKeyBody
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` StatusType
status
instance Prelude.NFData SSHPublicKey where
rnf :: SSHPublicKey -> ()
rnf SSHPublicKey' {Maybe ISO8601
Text
StatusType
status :: StatusType
sSHPublicKeyBody :: Text
fingerprint :: Text
sSHPublicKeyId :: Text
userName :: Text
uploadDate :: Maybe ISO8601
$sel:status:SSHPublicKey' :: SSHPublicKey -> StatusType
$sel:sSHPublicKeyBody:SSHPublicKey' :: SSHPublicKey -> Text
$sel:fingerprint:SSHPublicKey' :: SSHPublicKey -> Text
$sel:sSHPublicKeyId:SSHPublicKey' :: SSHPublicKey -> Text
$sel:userName:SSHPublicKey' :: SSHPublicKey -> Text
$sel:uploadDate:SSHPublicKey' :: SSHPublicKey -> Maybe ISO8601
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
uploadDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
userName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
sSHPublicKeyId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
fingerprint
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
sSHPublicKeyBody
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf StatusType
status