{-# 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.Lightsail.Types.HostKeyAttributes where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data HostKeyAttributes = HostKeyAttributes'
{
HostKeyAttributes -> Maybe POSIX
notValidAfter :: Prelude.Maybe Core.POSIX,
HostKeyAttributes -> Maybe POSIX
notValidBefore :: Prelude.Maybe Core.POSIX,
HostKeyAttributes -> Maybe Text
fingerprintSHA1 :: Prelude.Maybe Prelude.Text,
HostKeyAttributes -> Maybe Text
publicKey :: Prelude.Maybe Prelude.Text,
HostKeyAttributes -> Maybe Text
algorithm :: Prelude.Maybe Prelude.Text,
HostKeyAttributes -> Maybe POSIX
witnessedAt :: Prelude.Maybe Core.POSIX,
HostKeyAttributes -> Maybe Text
fingerprintSHA256 :: Prelude.Maybe Prelude.Text
}
deriving (HostKeyAttributes -> HostKeyAttributes -> Bool
(HostKeyAttributes -> HostKeyAttributes -> Bool)
-> (HostKeyAttributes -> HostKeyAttributes -> Bool)
-> Eq HostKeyAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HostKeyAttributes -> HostKeyAttributes -> Bool
$c/= :: HostKeyAttributes -> HostKeyAttributes -> Bool
== :: HostKeyAttributes -> HostKeyAttributes -> Bool
$c== :: HostKeyAttributes -> HostKeyAttributes -> Bool
Prelude.Eq, ReadPrec [HostKeyAttributes]
ReadPrec HostKeyAttributes
Int -> ReadS HostKeyAttributes
ReadS [HostKeyAttributes]
(Int -> ReadS HostKeyAttributes)
-> ReadS [HostKeyAttributes]
-> ReadPrec HostKeyAttributes
-> ReadPrec [HostKeyAttributes]
-> Read HostKeyAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HostKeyAttributes]
$creadListPrec :: ReadPrec [HostKeyAttributes]
readPrec :: ReadPrec HostKeyAttributes
$creadPrec :: ReadPrec HostKeyAttributes
readList :: ReadS [HostKeyAttributes]
$creadList :: ReadS [HostKeyAttributes]
readsPrec :: Int -> ReadS HostKeyAttributes
$creadsPrec :: Int -> ReadS HostKeyAttributes
Prelude.Read, Int -> HostKeyAttributes -> ShowS
[HostKeyAttributes] -> ShowS
HostKeyAttributes -> String
(Int -> HostKeyAttributes -> ShowS)
-> (HostKeyAttributes -> String)
-> ([HostKeyAttributes] -> ShowS)
-> Show HostKeyAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HostKeyAttributes] -> ShowS
$cshowList :: [HostKeyAttributes] -> ShowS
show :: HostKeyAttributes -> String
$cshow :: HostKeyAttributes -> String
showsPrec :: Int -> HostKeyAttributes -> ShowS
$cshowsPrec :: Int -> HostKeyAttributes -> ShowS
Prelude.Show, (forall x. HostKeyAttributes -> Rep HostKeyAttributes x)
-> (forall x. Rep HostKeyAttributes x -> HostKeyAttributes)
-> Generic HostKeyAttributes
forall x. Rep HostKeyAttributes x -> HostKeyAttributes
forall x. HostKeyAttributes -> Rep HostKeyAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HostKeyAttributes x -> HostKeyAttributes
$cfrom :: forall x. HostKeyAttributes -> Rep HostKeyAttributes x
Prelude.Generic)
newHostKeyAttributes ::
HostKeyAttributes
newHostKeyAttributes :: HostKeyAttributes
newHostKeyAttributes =
HostKeyAttributes' :: Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> HostKeyAttributes
HostKeyAttributes'
{ $sel:notValidAfter:HostKeyAttributes' :: Maybe POSIX
notValidAfter = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:notValidBefore:HostKeyAttributes' :: Maybe POSIX
notValidBefore = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:fingerprintSHA1:HostKeyAttributes' :: Maybe Text
fingerprintSHA1 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:publicKey:HostKeyAttributes' :: Maybe Text
publicKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:algorithm:HostKeyAttributes' :: Maybe Text
algorithm = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:witnessedAt:HostKeyAttributes' :: Maybe POSIX
witnessedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:fingerprintSHA256:HostKeyAttributes' :: Maybe Text
fingerprintSHA256 = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
hostKeyAttributes_notValidAfter :: Lens.Lens' HostKeyAttributes (Prelude.Maybe Prelude.UTCTime)
hostKeyAttributes_notValidAfter :: (Maybe UTCTime -> f (Maybe UTCTime))
-> HostKeyAttributes -> f HostKeyAttributes
hostKeyAttributes_notValidAfter = (HostKeyAttributes -> Maybe POSIX)
-> (HostKeyAttributes -> Maybe POSIX -> HostKeyAttributes)
-> Lens
HostKeyAttributes HostKeyAttributes (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostKeyAttributes' {Maybe POSIX
notValidAfter :: Maybe POSIX
$sel:notValidAfter:HostKeyAttributes' :: HostKeyAttributes -> Maybe POSIX
notValidAfter} -> Maybe POSIX
notValidAfter) (\s :: HostKeyAttributes
s@HostKeyAttributes' {} Maybe POSIX
a -> HostKeyAttributes
s {$sel:notValidAfter:HostKeyAttributes' :: Maybe POSIX
notValidAfter = Maybe POSIX
a} :: HostKeyAttributes) ((Maybe POSIX -> f (Maybe POSIX))
-> HostKeyAttributes -> f HostKeyAttributes)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> HostKeyAttributes
-> f HostKeyAttributes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
hostKeyAttributes_notValidBefore :: Lens.Lens' HostKeyAttributes (Prelude.Maybe Prelude.UTCTime)
hostKeyAttributes_notValidBefore :: (Maybe UTCTime -> f (Maybe UTCTime))
-> HostKeyAttributes -> f HostKeyAttributes
hostKeyAttributes_notValidBefore = (HostKeyAttributes -> Maybe POSIX)
-> (HostKeyAttributes -> Maybe POSIX -> HostKeyAttributes)
-> Lens
HostKeyAttributes HostKeyAttributes (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostKeyAttributes' {Maybe POSIX
notValidBefore :: Maybe POSIX
$sel:notValidBefore:HostKeyAttributes' :: HostKeyAttributes -> Maybe POSIX
notValidBefore} -> Maybe POSIX
notValidBefore) (\s :: HostKeyAttributes
s@HostKeyAttributes' {} Maybe POSIX
a -> HostKeyAttributes
s {$sel:notValidBefore:HostKeyAttributes' :: Maybe POSIX
notValidBefore = Maybe POSIX
a} :: HostKeyAttributes) ((Maybe POSIX -> f (Maybe POSIX))
-> HostKeyAttributes -> f HostKeyAttributes)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> HostKeyAttributes
-> f HostKeyAttributes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
hostKeyAttributes_fingerprintSHA1 :: Lens.Lens' HostKeyAttributes (Prelude.Maybe Prelude.Text)
hostKeyAttributes_fingerprintSHA1 :: (Maybe Text -> f (Maybe Text))
-> HostKeyAttributes -> f HostKeyAttributes
hostKeyAttributes_fingerprintSHA1 = (HostKeyAttributes -> Maybe Text)
-> (HostKeyAttributes -> Maybe Text -> HostKeyAttributes)
-> Lens
HostKeyAttributes HostKeyAttributes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostKeyAttributes' {Maybe Text
fingerprintSHA1 :: Maybe Text
$sel:fingerprintSHA1:HostKeyAttributes' :: HostKeyAttributes -> Maybe Text
fingerprintSHA1} -> Maybe Text
fingerprintSHA1) (\s :: HostKeyAttributes
s@HostKeyAttributes' {} Maybe Text
a -> HostKeyAttributes
s {$sel:fingerprintSHA1:HostKeyAttributes' :: Maybe Text
fingerprintSHA1 = Maybe Text
a} :: HostKeyAttributes)
hostKeyAttributes_publicKey :: Lens.Lens' HostKeyAttributes (Prelude.Maybe Prelude.Text)
hostKeyAttributes_publicKey :: (Maybe Text -> f (Maybe Text))
-> HostKeyAttributes -> f HostKeyAttributes
hostKeyAttributes_publicKey = (HostKeyAttributes -> Maybe Text)
-> (HostKeyAttributes -> Maybe Text -> HostKeyAttributes)
-> Lens
HostKeyAttributes HostKeyAttributes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostKeyAttributes' {Maybe Text
publicKey :: Maybe Text
$sel:publicKey:HostKeyAttributes' :: HostKeyAttributes -> Maybe Text
publicKey} -> Maybe Text
publicKey) (\s :: HostKeyAttributes
s@HostKeyAttributes' {} Maybe Text
a -> HostKeyAttributes
s {$sel:publicKey:HostKeyAttributes' :: Maybe Text
publicKey = Maybe Text
a} :: HostKeyAttributes)
hostKeyAttributes_algorithm :: Lens.Lens' HostKeyAttributes (Prelude.Maybe Prelude.Text)
hostKeyAttributes_algorithm :: (Maybe Text -> f (Maybe Text))
-> HostKeyAttributes -> f HostKeyAttributes
hostKeyAttributes_algorithm = (HostKeyAttributes -> Maybe Text)
-> (HostKeyAttributes -> Maybe Text -> HostKeyAttributes)
-> Lens
HostKeyAttributes HostKeyAttributes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostKeyAttributes' {Maybe Text
algorithm :: Maybe Text
$sel:algorithm:HostKeyAttributes' :: HostKeyAttributes -> Maybe Text
algorithm} -> Maybe Text
algorithm) (\s :: HostKeyAttributes
s@HostKeyAttributes' {} Maybe Text
a -> HostKeyAttributes
s {$sel:algorithm:HostKeyAttributes' :: Maybe Text
algorithm = Maybe Text
a} :: HostKeyAttributes)
hostKeyAttributes_witnessedAt :: Lens.Lens' HostKeyAttributes (Prelude.Maybe Prelude.UTCTime)
hostKeyAttributes_witnessedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> HostKeyAttributes -> f HostKeyAttributes
hostKeyAttributes_witnessedAt = (HostKeyAttributes -> Maybe POSIX)
-> (HostKeyAttributes -> Maybe POSIX -> HostKeyAttributes)
-> Lens
HostKeyAttributes HostKeyAttributes (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostKeyAttributes' {Maybe POSIX
witnessedAt :: Maybe POSIX
$sel:witnessedAt:HostKeyAttributes' :: HostKeyAttributes -> Maybe POSIX
witnessedAt} -> Maybe POSIX
witnessedAt) (\s :: HostKeyAttributes
s@HostKeyAttributes' {} Maybe POSIX
a -> HostKeyAttributes
s {$sel:witnessedAt:HostKeyAttributes' :: Maybe POSIX
witnessedAt = Maybe POSIX
a} :: HostKeyAttributes) ((Maybe POSIX -> f (Maybe POSIX))
-> HostKeyAttributes -> f HostKeyAttributes)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> HostKeyAttributes
-> f HostKeyAttributes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
hostKeyAttributes_fingerprintSHA256 :: Lens.Lens' HostKeyAttributes (Prelude.Maybe Prelude.Text)
hostKeyAttributes_fingerprintSHA256 :: (Maybe Text -> f (Maybe Text))
-> HostKeyAttributes -> f HostKeyAttributes
hostKeyAttributes_fingerprintSHA256 = (HostKeyAttributes -> Maybe Text)
-> (HostKeyAttributes -> Maybe Text -> HostKeyAttributes)
-> Lens
HostKeyAttributes HostKeyAttributes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostKeyAttributes' {Maybe Text
fingerprintSHA256 :: Maybe Text
$sel:fingerprintSHA256:HostKeyAttributes' :: HostKeyAttributes -> Maybe Text
fingerprintSHA256} -> Maybe Text
fingerprintSHA256) (\s :: HostKeyAttributes
s@HostKeyAttributes' {} Maybe Text
a -> HostKeyAttributes
s {$sel:fingerprintSHA256:HostKeyAttributes' :: Maybe Text
fingerprintSHA256 = Maybe Text
a} :: HostKeyAttributes)
instance Core.FromJSON HostKeyAttributes where
parseJSON :: Value -> Parser HostKeyAttributes
parseJSON =
String
-> (Object -> Parser HostKeyAttributes)
-> Value
-> Parser HostKeyAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"HostKeyAttributes"
( \Object
x ->
Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> HostKeyAttributes
HostKeyAttributes'
(Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> HostKeyAttributes)
-> Parser (Maybe POSIX)
-> Parser
(Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> HostKeyAttributes)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"notValidAfter")
Parser
(Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> HostKeyAttributes)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> HostKeyAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"notValidBefore")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> HostKeyAttributes)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe POSIX -> Maybe Text -> HostKeyAttributes)
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
"fingerprintSHA1")
Parser
(Maybe Text
-> Maybe Text -> Maybe POSIX -> Maybe Text -> HostKeyAttributes)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe POSIX -> Maybe Text -> HostKeyAttributes)
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
"publicKey")
Parser
(Maybe Text -> Maybe POSIX -> Maybe Text -> HostKeyAttributes)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> HostKeyAttributes)
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
"algorithm")
Parser (Maybe POSIX -> Maybe Text -> HostKeyAttributes)
-> Parser (Maybe POSIX) -> Parser (Maybe Text -> HostKeyAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"witnessedAt")
Parser (Maybe Text -> HostKeyAttributes)
-> Parser (Maybe Text) -> Parser HostKeyAttributes
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
"fingerprintSHA256")
)
instance Prelude.Hashable HostKeyAttributes
instance Prelude.NFData HostKeyAttributes