{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data HostKeyAttributes = HostKeyAttributes'
{
HostKeyAttributes -> Maybe Text
algorithm :: Prelude.Maybe Prelude.Text,
HostKeyAttributes -> Maybe Text
fingerprintSHA1 :: Prelude.Maybe Prelude.Text,
HostKeyAttributes -> Maybe Text
fingerprintSHA256 :: Prelude.Maybe Prelude.Text,
HostKeyAttributes -> Maybe POSIX
notValidAfter :: Prelude.Maybe Data.POSIX,
HostKeyAttributes -> Maybe POSIX
notValidBefore :: Prelude.Maybe Data.POSIX,
HostKeyAttributes -> Maybe Text
publicKey :: Prelude.Maybe Prelude.Text,
HostKeyAttributes -> Maybe POSIX
witnessedAt :: Prelude.Maybe Data.POSIX
}
deriving (HostKeyAttributes -> HostKeyAttributes -> Bool
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]
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
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. 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'
{ $sel:algorithm:HostKeyAttributes' :: Maybe Text
algorithm = forall a. Maybe a
Prelude.Nothing,
$sel:fingerprintSHA1:HostKeyAttributes' :: Maybe Text
fingerprintSHA1 = forall a. Maybe a
Prelude.Nothing,
$sel:fingerprintSHA256:HostKeyAttributes' :: Maybe Text
fingerprintSHA256 = forall a. Maybe a
Prelude.Nothing,
$sel:notValidAfter:HostKeyAttributes' :: Maybe POSIX
notValidAfter = forall a. Maybe a
Prelude.Nothing,
$sel:notValidBefore:HostKeyAttributes' :: Maybe POSIX
notValidBefore = forall a. Maybe a
Prelude.Nothing,
$sel:publicKey:HostKeyAttributes' :: Maybe Text
publicKey = forall a. Maybe a
Prelude.Nothing,
$sel:witnessedAt:HostKeyAttributes' :: Maybe POSIX
witnessedAt = forall a. Maybe a
Prelude.Nothing
}
hostKeyAttributes_algorithm :: Lens.Lens' HostKeyAttributes (Prelude.Maybe Prelude.Text)
hostKeyAttributes_algorithm :: Lens' HostKeyAttributes (Maybe Text)
hostKeyAttributes_algorithm = 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_fingerprintSHA1 :: Lens.Lens' HostKeyAttributes (Prelude.Maybe Prelude.Text)
hostKeyAttributes_fingerprintSHA1 :: Lens' HostKeyAttributes (Maybe Text)
hostKeyAttributes_fingerprintSHA1 = 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_fingerprintSHA256 :: Lens.Lens' HostKeyAttributes (Prelude.Maybe Prelude.Text)
hostKeyAttributes_fingerprintSHA256 :: Lens' HostKeyAttributes (Maybe Text)
hostKeyAttributes_fingerprintSHA256 = 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)
hostKeyAttributes_notValidAfter :: Lens.Lens' HostKeyAttributes (Prelude.Maybe Prelude.UTCTime)
hostKeyAttributes_notValidAfter :: Lens' HostKeyAttributes (Maybe UTCTime)
hostKeyAttributes_notValidAfter = 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) 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
hostKeyAttributes_notValidBefore :: Lens.Lens' HostKeyAttributes (Prelude.Maybe Prelude.UTCTime)
hostKeyAttributes_notValidBefore :: Lens' HostKeyAttributes (Maybe UTCTime)
hostKeyAttributes_notValidBefore = 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) 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
hostKeyAttributes_publicKey :: Lens.Lens' HostKeyAttributes (Prelude.Maybe Prelude.Text)
hostKeyAttributes_publicKey :: Lens' HostKeyAttributes (Maybe Text)
hostKeyAttributes_publicKey = 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_witnessedAt :: Lens.Lens' HostKeyAttributes (Prelude.Maybe Prelude.UTCTime)
hostKeyAttributes_witnessedAt :: Lens' HostKeyAttributes (Maybe UTCTime)
hostKeyAttributes_witnessedAt = 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) 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
instance Data.FromJSON HostKeyAttributes where
parseJSON :: Value -> Parser HostKeyAttributes
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"HostKeyAttributes"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> HostKeyAttributes
HostKeyAttributes'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"algorithm")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"fingerprintSHA1")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"fingerprintSHA256")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"notValidAfter")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"notValidBefore")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"publicKey")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"witnessedAt")
)
instance Prelude.Hashable HostKeyAttributes where
hashWithSalt :: Int -> HostKeyAttributes -> Int
hashWithSalt Int
_salt HostKeyAttributes' {Maybe Text
Maybe POSIX
witnessedAt :: Maybe POSIX
publicKey :: Maybe Text
notValidBefore :: Maybe POSIX
notValidAfter :: Maybe POSIX
fingerprintSHA256 :: Maybe Text
fingerprintSHA1 :: Maybe Text
algorithm :: Maybe Text
$sel:witnessedAt:HostKeyAttributes' :: HostKeyAttributes -> Maybe POSIX
$sel:publicKey:HostKeyAttributes' :: HostKeyAttributes -> Maybe Text
$sel:notValidBefore:HostKeyAttributes' :: HostKeyAttributes -> Maybe POSIX
$sel:notValidAfter:HostKeyAttributes' :: HostKeyAttributes -> Maybe POSIX
$sel:fingerprintSHA256:HostKeyAttributes' :: HostKeyAttributes -> Maybe Text
$sel:fingerprintSHA1:HostKeyAttributes' :: HostKeyAttributes -> Maybe Text
$sel:algorithm:HostKeyAttributes' :: HostKeyAttributes -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
algorithm
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
fingerprintSHA1
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
fingerprintSHA256
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
notValidAfter
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
notValidBefore
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
publicKey
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
witnessedAt
instance Prelude.NFData HostKeyAttributes where
rnf :: HostKeyAttributes -> ()
rnf HostKeyAttributes' {Maybe Text
Maybe POSIX
witnessedAt :: Maybe POSIX
publicKey :: Maybe Text
notValidBefore :: Maybe POSIX
notValidAfter :: Maybe POSIX
fingerprintSHA256 :: Maybe Text
fingerprintSHA1 :: Maybe Text
algorithm :: Maybe Text
$sel:witnessedAt:HostKeyAttributes' :: HostKeyAttributes -> Maybe POSIX
$sel:publicKey:HostKeyAttributes' :: HostKeyAttributes -> Maybe Text
$sel:notValidBefore:HostKeyAttributes' :: HostKeyAttributes -> Maybe POSIX
$sel:notValidAfter:HostKeyAttributes' :: HostKeyAttributes -> Maybe POSIX
$sel:fingerprintSHA256:HostKeyAttributes' :: HostKeyAttributes -> Maybe Text
$sel:fingerprintSHA1:HostKeyAttributes' :: HostKeyAttributes -> Maybe Text
$sel:algorithm:HostKeyAttributes' :: HostKeyAttributes -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
algorithm
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
fingerprintSHA1
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
fingerprintSHA256
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
notValidAfter
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
notValidBefore
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
publicKey
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
witnessedAt