{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Lightsail.Types.HostKeyAttributes
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Lightsail.Types.HostKeyAttributes where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes the public SSH host keys or the RDP certificate.
--
-- /See:/ 'newHostKeyAttributes' smart constructor.
data HostKeyAttributes = HostKeyAttributes'
  { -- | The returned RDP certificate is not valid after this point in time.
    --
    -- This value is listed only for RDP certificates.
    HostKeyAttributes -> Maybe POSIX
notValidAfter :: Prelude.Maybe Core.POSIX,
    -- | The returned RDP certificate is valid after this point in time.
    --
    -- This value is listed only for RDP certificates.
    HostKeyAttributes -> Maybe POSIX
notValidBefore :: Prelude.Maybe Core.POSIX,
    -- | The SHA-1 fingerprint of the returned SSH host key or RDP certificate.
    --
    -- -   Example of an SHA-1 SSH fingerprint:
    --
    --     @SHA1:1CHH6FaAaXjtFOsR\/t83vf91SR0@
    --
    -- -   Example of an SHA-1 RDP fingerprint:
    --
    --     @af:34:51:fe:09:f0:e0:da:b8:4e:56:ca:60:c2:10:ff:38:06:db:45@
    HostKeyAttributes -> Maybe Text
fingerprintSHA1 :: Prelude.Maybe Prelude.Text,
    -- | The public SSH host key or the RDP certificate.
    HostKeyAttributes -> Maybe Text
publicKey :: Prelude.Maybe Prelude.Text,
    -- | The SSH host key algorithm or the RDP certificate format.
    --
    -- For SSH host keys, the algorithm may be @ssh-rsa@,
    -- @ecdsa-sha2-nistp256@, @ssh-ed25519@, etc. For RDP certificates, the
    -- algorithm is always @x509-cert@.
    HostKeyAttributes -> Maybe Text
algorithm :: Prelude.Maybe Prelude.Text,
    -- | The time that the SSH host key or RDP certificate was recorded by
    -- Lightsail.
    HostKeyAttributes -> Maybe POSIX
witnessedAt :: Prelude.Maybe Core.POSIX,
    -- | The SHA-256 fingerprint of the returned SSH host key or RDP certificate.
    --
    -- -   Example of an SHA-256 SSH fingerprint:
    --
    --     @SHA256:KTsMnRBh1IhD17HpdfsbzeGA4jOijm5tyXsMjKVbB8o@
    --
    -- -   Example of an SHA-256 RDP fingerprint:
    --
    --     @03:9b:36:9f:4b:de:4e:61:70:fc:7c:c9:78:e7:d2:1a:1c:25:a8:0c:91:f6:7c:e4:d6:a0:85:c8:b4:53:99:68@
    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)

-- |
-- Create a value of 'HostKeyAttributes' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'notValidAfter', 'hostKeyAttributes_notValidAfter' - The returned RDP certificate is not valid after this point in time.
--
-- This value is listed only for RDP certificates.
--
-- 'notValidBefore', 'hostKeyAttributes_notValidBefore' - The returned RDP certificate is valid after this point in time.
--
-- This value is listed only for RDP certificates.
--
-- 'fingerprintSHA1', 'hostKeyAttributes_fingerprintSHA1' - The SHA-1 fingerprint of the returned SSH host key or RDP certificate.
--
-- -   Example of an SHA-1 SSH fingerprint:
--
--     @SHA1:1CHH6FaAaXjtFOsR\/t83vf91SR0@
--
-- -   Example of an SHA-1 RDP fingerprint:
--
--     @af:34:51:fe:09:f0:e0:da:b8:4e:56:ca:60:c2:10:ff:38:06:db:45@
--
-- 'publicKey', 'hostKeyAttributes_publicKey' - The public SSH host key or the RDP certificate.
--
-- 'algorithm', 'hostKeyAttributes_algorithm' - The SSH host key algorithm or the RDP certificate format.
--
-- For SSH host keys, the algorithm may be @ssh-rsa@,
-- @ecdsa-sha2-nistp256@, @ssh-ed25519@, etc. For RDP certificates, the
-- algorithm is always @x509-cert@.
--
-- 'witnessedAt', 'hostKeyAttributes_witnessedAt' - The time that the SSH host key or RDP certificate was recorded by
-- Lightsail.
--
-- 'fingerprintSHA256', 'hostKeyAttributes_fingerprintSHA256' - The SHA-256 fingerprint of the returned SSH host key or RDP certificate.
--
-- -   Example of an SHA-256 SSH fingerprint:
--
--     @SHA256:KTsMnRBh1IhD17HpdfsbzeGA4jOijm5tyXsMjKVbB8o@
--
-- -   Example of an SHA-256 RDP fingerprint:
--
--     @03:9b:36:9f:4b:de:4e:61:70:fc:7c:c9:78:e7:d2:1a:1c:25:a8:0c:91:f6:7c:e4:d6:a0:85:c8:b4:53:99:68@
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
    }

-- | The returned RDP certificate is not valid after this point in time.
--
-- This value is listed only for RDP certificates.
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

-- | The returned RDP certificate is valid after this point in time.
--
-- This value is listed only for RDP certificates.
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

-- | The SHA-1 fingerprint of the returned SSH host key or RDP certificate.
--
-- -   Example of an SHA-1 SSH fingerprint:
--
--     @SHA1:1CHH6FaAaXjtFOsR\/t83vf91SR0@
--
-- -   Example of an SHA-1 RDP fingerprint:
--
--     @af:34:51:fe:09:f0:e0:da:b8:4e:56:ca:60:c2:10:ff:38:06:db:45@
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)

-- | The public SSH host key or the RDP certificate.
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)

-- | The SSH host key algorithm or the RDP certificate format.
--
-- For SSH host keys, the algorithm may be @ssh-rsa@,
-- @ecdsa-sha2-nistp256@, @ssh-ed25519@, etc. For RDP certificates, the
-- algorithm is always @x509-cert@.
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)

-- | The time that the SSH host key or RDP certificate was recorded by
-- Lightsail.
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

-- | The SHA-256 fingerprint of the returned SSH host key or RDP certificate.
--
-- -   Example of an SHA-256 SSH fingerprint:
--
--     @SHA256:KTsMnRBh1IhD17HpdfsbzeGA4jOijm5tyXsMjKVbB8o@
--
-- -   Example of an SHA-256 RDP fingerprint:
--
--     @03:9b:36:9f:4b:de:4e:61:70:fc:7c:c9:78:e7:d2:1a:1c:25:a8:0c:91:f6:7c:e4:d6:a0:85:c8:b4:53:99:68@
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