{-# 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.Transfer.Types.SshPublicKey where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SshPublicKey = SshPublicKey'
{
SshPublicKey -> POSIX
dateImported :: Core.POSIX,
SshPublicKey -> Text
sshPublicKeyBody :: Prelude.Text,
SshPublicKey -> Text
sshPublicKeyId :: Prelude.Text
}
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.UTCTime ->
Prelude.Text ->
Prelude.Text ->
SshPublicKey
newSshPublicKey :: UTCTime -> Text -> Text -> SshPublicKey
newSshPublicKey
UTCTime
pDateImported_
Text
pSshPublicKeyBody_
Text
pSshPublicKeyId_ =
SshPublicKey' :: POSIX -> Text -> Text -> SshPublicKey
SshPublicKey'
{ $sel:dateImported:SshPublicKey' :: POSIX
dateImported =
Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pDateImported_,
$sel:sshPublicKeyBody:SshPublicKey' :: Text
sshPublicKeyBody = Text
pSshPublicKeyBody_,
$sel:sshPublicKeyId:SshPublicKey' :: Text
sshPublicKeyId = Text
pSshPublicKeyId_
}
sshPublicKey_dateImported :: Lens.Lens' SshPublicKey Prelude.UTCTime
sshPublicKey_dateImported :: (UTCTime -> f UTCTime) -> SshPublicKey -> f SshPublicKey
sshPublicKey_dateImported = (SshPublicKey -> POSIX)
-> (SshPublicKey -> POSIX -> SshPublicKey)
-> Lens SshPublicKey SshPublicKey POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SshPublicKey' {POSIX
dateImported :: POSIX
$sel:dateImported:SshPublicKey' :: SshPublicKey -> POSIX
dateImported} -> POSIX
dateImported) (\s :: SshPublicKey
s@SshPublicKey' {} POSIX
a -> SshPublicKey
s {$sel:dateImported:SshPublicKey' :: POSIX
dateImported = POSIX
a} :: SshPublicKey) ((POSIX -> f POSIX) -> SshPublicKey -> f SshPublicKey)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> SshPublicKey
-> f SshPublicKey
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
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_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)
instance Core.FromJSON SshPublicKey where
parseJSON :: Value -> Parser SshPublicKey
parseJSON =
String
-> (Object -> Parser SshPublicKey) -> Value -> Parser SshPublicKey
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SshPublicKey"
( \Object
x ->
POSIX -> Text -> Text -> SshPublicKey
SshPublicKey'
(POSIX -> Text -> Text -> SshPublicKey)
-> Parser POSIX -> Parser (Text -> Text -> SshPublicKey)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DateImported")
Parser (Text -> Text -> SshPublicKey)
-> Parser Text -> Parser (Text -> SshPublicKey)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"SshPublicKeyBody")
Parser (Text -> SshPublicKey) -> Parser Text -> Parser SshPublicKey
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"SshPublicKeyId")
)
instance Prelude.Hashable SshPublicKey
instance Prelude.NFData SshPublicKey