{-# 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.SecurityHub.Types.AwsEc2VpnConnectionVgwTelemetryDetails
-- 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.SecurityHub.Types.AwsEc2VpnConnectionVgwTelemetryDetails where

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

-- | Information about the VPN tunnel.
--
-- /See:/ 'newAwsEc2VpnConnectionVgwTelemetryDetails' smart constructor.
data AwsEc2VpnConnectionVgwTelemetryDetails = AwsEc2VpnConnectionVgwTelemetryDetails'
  { -- | The status of the VPN tunnel.
    AwsEc2VpnConnectionVgwTelemetryDetails -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The Internet-routable IP address of the virtual private gateway\'s
    -- outside interface.
    AwsEc2VpnConnectionVgwTelemetryDetails -> Maybe Text
outsideIpAddress :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the VPN tunnel endpoint certificate.
    AwsEc2VpnConnectionVgwTelemetryDetails -> Maybe Text
certificateArn :: Prelude.Maybe Prelude.Text,
    -- | The date and time of the last change in status.
    --
    -- Uses the @date-time@ format specified in
    -- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
    -- The value cannot contain spaces. For example,
    -- @2020-03-22T13:22:13.933Z@.
    AwsEc2VpnConnectionVgwTelemetryDetails -> Maybe Text
lastStatusChange :: Prelude.Maybe Prelude.Text,
    -- | The number of accepted routes.
    AwsEc2VpnConnectionVgwTelemetryDetails -> Maybe Int
acceptedRouteCount :: Prelude.Maybe Prelude.Int,
    -- | If an error occurs, a description of the error.
    AwsEc2VpnConnectionVgwTelemetryDetails -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsEc2VpnConnectionVgwTelemetryDetails
-> AwsEc2VpnConnectionVgwTelemetryDetails -> Bool
(AwsEc2VpnConnectionVgwTelemetryDetails
 -> AwsEc2VpnConnectionVgwTelemetryDetails -> Bool)
-> (AwsEc2VpnConnectionVgwTelemetryDetails
    -> AwsEc2VpnConnectionVgwTelemetryDetails -> Bool)
-> Eq AwsEc2VpnConnectionVgwTelemetryDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsEc2VpnConnectionVgwTelemetryDetails
-> AwsEc2VpnConnectionVgwTelemetryDetails -> Bool
$c/= :: AwsEc2VpnConnectionVgwTelemetryDetails
-> AwsEc2VpnConnectionVgwTelemetryDetails -> Bool
== :: AwsEc2VpnConnectionVgwTelemetryDetails
-> AwsEc2VpnConnectionVgwTelemetryDetails -> Bool
$c== :: AwsEc2VpnConnectionVgwTelemetryDetails
-> AwsEc2VpnConnectionVgwTelemetryDetails -> Bool
Prelude.Eq, ReadPrec [AwsEc2VpnConnectionVgwTelemetryDetails]
ReadPrec AwsEc2VpnConnectionVgwTelemetryDetails
Int -> ReadS AwsEc2VpnConnectionVgwTelemetryDetails
ReadS [AwsEc2VpnConnectionVgwTelemetryDetails]
(Int -> ReadS AwsEc2VpnConnectionVgwTelemetryDetails)
-> ReadS [AwsEc2VpnConnectionVgwTelemetryDetails]
-> ReadPrec AwsEc2VpnConnectionVgwTelemetryDetails
-> ReadPrec [AwsEc2VpnConnectionVgwTelemetryDetails]
-> Read AwsEc2VpnConnectionVgwTelemetryDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsEc2VpnConnectionVgwTelemetryDetails]
$creadListPrec :: ReadPrec [AwsEc2VpnConnectionVgwTelemetryDetails]
readPrec :: ReadPrec AwsEc2VpnConnectionVgwTelemetryDetails
$creadPrec :: ReadPrec AwsEc2VpnConnectionVgwTelemetryDetails
readList :: ReadS [AwsEc2VpnConnectionVgwTelemetryDetails]
$creadList :: ReadS [AwsEc2VpnConnectionVgwTelemetryDetails]
readsPrec :: Int -> ReadS AwsEc2VpnConnectionVgwTelemetryDetails
$creadsPrec :: Int -> ReadS AwsEc2VpnConnectionVgwTelemetryDetails
Prelude.Read, Int -> AwsEc2VpnConnectionVgwTelemetryDetails -> ShowS
[AwsEc2VpnConnectionVgwTelemetryDetails] -> ShowS
AwsEc2VpnConnectionVgwTelemetryDetails -> String
(Int -> AwsEc2VpnConnectionVgwTelemetryDetails -> ShowS)
-> (AwsEc2VpnConnectionVgwTelemetryDetails -> String)
-> ([AwsEc2VpnConnectionVgwTelemetryDetails] -> ShowS)
-> Show AwsEc2VpnConnectionVgwTelemetryDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsEc2VpnConnectionVgwTelemetryDetails] -> ShowS
$cshowList :: [AwsEc2VpnConnectionVgwTelemetryDetails] -> ShowS
show :: AwsEc2VpnConnectionVgwTelemetryDetails -> String
$cshow :: AwsEc2VpnConnectionVgwTelemetryDetails -> String
showsPrec :: Int -> AwsEc2VpnConnectionVgwTelemetryDetails -> ShowS
$cshowsPrec :: Int -> AwsEc2VpnConnectionVgwTelemetryDetails -> ShowS
Prelude.Show, (forall x.
 AwsEc2VpnConnectionVgwTelemetryDetails
 -> Rep AwsEc2VpnConnectionVgwTelemetryDetails x)
-> (forall x.
    Rep AwsEc2VpnConnectionVgwTelemetryDetails x
    -> AwsEc2VpnConnectionVgwTelemetryDetails)
-> Generic AwsEc2VpnConnectionVgwTelemetryDetails
forall x.
Rep AwsEc2VpnConnectionVgwTelemetryDetails x
-> AwsEc2VpnConnectionVgwTelemetryDetails
forall x.
AwsEc2VpnConnectionVgwTelemetryDetails
-> Rep AwsEc2VpnConnectionVgwTelemetryDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsEc2VpnConnectionVgwTelemetryDetails x
-> AwsEc2VpnConnectionVgwTelemetryDetails
$cfrom :: forall x.
AwsEc2VpnConnectionVgwTelemetryDetails
-> Rep AwsEc2VpnConnectionVgwTelemetryDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsEc2VpnConnectionVgwTelemetryDetails' 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:
--
-- 'status', 'awsEc2VpnConnectionVgwTelemetryDetails_status' - The status of the VPN tunnel.
--
-- 'outsideIpAddress', 'awsEc2VpnConnectionVgwTelemetryDetails_outsideIpAddress' - The Internet-routable IP address of the virtual private gateway\'s
-- outside interface.
--
-- 'certificateArn', 'awsEc2VpnConnectionVgwTelemetryDetails_certificateArn' - The ARN of the VPN tunnel endpoint certificate.
--
-- 'lastStatusChange', 'awsEc2VpnConnectionVgwTelemetryDetails_lastStatusChange' - The date and time of the last change in status.
--
-- Uses the @date-time@ format specified in
-- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
-- The value cannot contain spaces. For example,
-- @2020-03-22T13:22:13.933Z@.
--
-- 'acceptedRouteCount', 'awsEc2VpnConnectionVgwTelemetryDetails_acceptedRouteCount' - The number of accepted routes.
--
-- 'statusMessage', 'awsEc2VpnConnectionVgwTelemetryDetails_statusMessage' - If an error occurs, a description of the error.
newAwsEc2VpnConnectionVgwTelemetryDetails ::
  AwsEc2VpnConnectionVgwTelemetryDetails
newAwsEc2VpnConnectionVgwTelemetryDetails :: AwsEc2VpnConnectionVgwTelemetryDetails
newAwsEc2VpnConnectionVgwTelemetryDetails =
  AwsEc2VpnConnectionVgwTelemetryDetails' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> AwsEc2VpnConnectionVgwTelemetryDetails
AwsEc2VpnConnectionVgwTelemetryDetails'
    { $sel:status:AwsEc2VpnConnectionVgwTelemetryDetails' :: Maybe Text
status =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:outsideIpAddress:AwsEc2VpnConnectionVgwTelemetryDetails' :: Maybe Text
outsideIpAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:certificateArn:AwsEc2VpnConnectionVgwTelemetryDetails' :: Maybe Text
certificateArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastStatusChange:AwsEc2VpnConnectionVgwTelemetryDetails' :: Maybe Text
lastStatusChange = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:acceptedRouteCount:AwsEc2VpnConnectionVgwTelemetryDetails' :: Maybe Int
acceptedRouteCount =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:AwsEc2VpnConnectionVgwTelemetryDetails' :: Maybe Text
statusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the VPN tunnel.
awsEc2VpnConnectionVgwTelemetryDetails_status :: Lens.Lens' AwsEc2VpnConnectionVgwTelemetryDetails (Prelude.Maybe Prelude.Text)
awsEc2VpnConnectionVgwTelemetryDetails_status :: (Maybe Text -> f (Maybe Text))
-> AwsEc2VpnConnectionVgwTelemetryDetails
-> f AwsEc2VpnConnectionVgwTelemetryDetails
awsEc2VpnConnectionVgwTelemetryDetails_status = (AwsEc2VpnConnectionVgwTelemetryDetails -> Maybe Text)
-> (AwsEc2VpnConnectionVgwTelemetryDetails
    -> Maybe Text -> AwsEc2VpnConnectionVgwTelemetryDetails)
-> Lens
     AwsEc2VpnConnectionVgwTelemetryDetails
     AwsEc2VpnConnectionVgwTelemetryDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2VpnConnectionVgwTelemetryDetails' {Maybe Text
status :: Maybe Text
$sel:status:AwsEc2VpnConnectionVgwTelemetryDetails' :: AwsEc2VpnConnectionVgwTelemetryDetails -> Maybe Text
status} -> Maybe Text
status) (\s :: AwsEc2VpnConnectionVgwTelemetryDetails
s@AwsEc2VpnConnectionVgwTelemetryDetails' {} Maybe Text
a -> AwsEc2VpnConnectionVgwTelemetryDetails
s {$sel:status:AwsEc2VpnConnectionVgwTelemetryDetails' :: Maybe Text
status = Maybe Text
a} :: AwsEc2VpnConnectionVgwTelemetryDetails)

-- | The Internet-routable IP address of the virtual private gateway\'s
-- outside interface.
awsEc2VpnConnectionVgwTelemetryDetails_outsideIpAddress :: Lens.Lens' AwsEc2VpnConnectionVgwTelemetryDetails (Prelude.Maybe Prelude.Text)
awsEc2VpnConnectionVgwTelemetryDetails_outsideIpAddress :: (Maybe Text -> f (Maybe Text))
-> AwsEc2VpnConnectionVgwTelemetryDetails
-> f AwsEc2VpnConnectionVgwTelemetryDetails
awsEc2VpnConnectionVgwTelemetryDetails_outsideIpAddress = (AwsEc2VpnConnectionVgwTelemetryDetails -> Maybe Text)
-> (AwsEc2VpnConnectionVgwTelemetryDetails
    -> Maybe Text -> AwsEc2VpnConnectionVgwTelemetryDetails)
-> Lens
     AwsEc2VpnConnectionVgwTelemetryDetails
     AwsEc2VpnConnectionVgwTelemetryDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2VpnConnectionVgwTelemetryDetails' {Maybe Text
outsideIpAddress :: Maybe Text
$sel:outsideIpAddress:AwsEc2VpnConnectionVgwTelemetryDetails' :: AwsEc2VpnConnectionVgwTelemetryDetails -> Maybe Text
outsideIpAddress} -> Maybe Text
outsideIpAddress) (\s :: AwsEc2VpnConnectionVgwTelemetryDetails
s@AwsEc2VpnConnectionVgwTelemetryDetails' {} Maybe Text
a -> AwsEc2VpnConnectionVgwTelemetryDetails
s {$sel:outsideIpAddress:AwsEc2VpnConnectionVgwTelemetryDetails' :: Maybe Text
outsideIpAddress = Maybe Text
a} :: AwsEc2VpnConnectionVgwTelemetryDetails)

-- | The ARN of the VPN tunnel endpoint certificate.
awsEc2VpnConnectionVgwTelemetryDetails_certificateArn :: Lens.Lens' AwsEc2VpnConnectionVgwTelemetryDetails (Prelude.Maybe Prelude.Text)
awsEc2VpnConnectionVgwTelemetryDetails_certificateArn :: (Maybe Text -> f (Maybe Text))
-> AwsEc2VpnConnectionVgwTelemetryDetails
-> f AwsEc2VpnConnectionVgwTelemetryDetails
awsEc2VpnConnectionVgwTelemetryDetails_certificateArn = (AwsEc2VpnConnectionVgwTelemetryDetails -> Maybe Text)
-> (AwsEc2VpnConnectionVgwTelemetryDetails
    -> Maybe Text -> AwsEc2VpnConnectionVgwTelemetryDetails)
-> Lens
     AwsEc2VpnConnectionVgwTelemetryDetails
     AwsEc2VpnConnectionVgwTelemetryDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2VpnConnectionVgwTelemetryDetails' {Maybe Text
certificateArn :: Maybe Text
$sel:certificateArn:AwsEc2VpnConnectionVgwTelemetryDetails' :: AwsEc2VpnConnectionVgwTelemetryDetails -> Maybe Text
certificateArn} -> Maybe Text
certificateArn) (\s :: AwsEc2VpnConnectionVgwTelemetryDetails
s@AwsEc2VpnConnectionVgwTelemetryDetails' {} Maybe Text
a -> AwsEc2VpnConnectionVgwTelemetryDetails
s {$sel:certificateArn:AwsEc2VpnConnectionVgwTelemetryDetails' :: Maybe Text
certificateArn = Maybe Text
a} :: AwsEc2VpnConnectionVgwTelemetryDetails)

-- | The date and time of the last change in status.
--
-- Uses the @date-time@ format specified in
-- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
-- The value cannot contain spaces. For example,
-- @2020-03-22T13:22:13.933Z@.
awsEc2VpnConnectionVgwTelemetryDetails_lastStatusChange :: Lens.Lens' AwsEc2VpnConnectionVgwTelemetryDetails (Prelude.Maybe Prelude.Text)
awsEc2VpnConnectionVgwTelemetryDetails_lastStatusChange :: (Maybe Text -> f (Maybe Text))
-> AwsEc2VpnConnectionVgwTelemetryDetails
-> f AwsEc2VpnConnectionVgwTelemetryDetails
awsEc2VpnConnectionVgwTelemetryDetails_lastStatusChange = (AwsEc2VpnConnectionVgwTelemetryDetails -> Maybe Text)
-> (AwsEc2VpnConnectionVgwTelemetryDetails
    -> Maybe Text -> AwsEc2VpnConnectionVgwTelemetryDetails)
-> Lens
     AwsEc2VpnConnectionVgwTelemetryDetails
     AwsEc2VpnConnectionVgwTelemetryDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2VpnConnectionVgwTelemetryDetails' {Maybe Text
lastStatusChange :: Maybe Text
$sel:lastStatusChange:AwsEc2VpnConnectionVgwTelemetryDetails' :: AwsEc2VpnConnectionVgwTelemetryDetails -> Maybe Text
lastStatusChange} -> Maybe Text
lastStatusChange) (\s :: AwsEc2VpnConnectionVgwTelemetryDetails
s@AwsEc2VpnConnectionVgwTelemetryDetails' {} Maybe Text
a -> AwsEc2VpnConnectionVgwTelemetryDetails
s {$sel:lastStatusChange:AwsEc2VpnConnectionVgwTelemetryDetails' :: Maybe Text
lastStatusChange = Maybe Text
a} :: AwsEc2VpnConnectionVgwTelemetryDetails)

-- | The number of accepted routes.
awsEc2VpnConnectionVgwTelemetryDetails_acceptedRouteCount :: Lens.Lens' AwsEc2VpnConnectionVgwTelemetryDetails (Prelude.Maybe Prelude.Int)
awsEc2VpnConnectionVgwTelemetryDetails_acceptedRouteCount :: (Maybe Int -> f (Maybe Int))
-> AwsEc2VpnConnectionVgwTelemetryDetails
-> f AwsEc2VpnConnectionVgwTelemetryDetails
awsEc2VpnConnectionVgwTelemetryDetails_acceptedRouteCount = (AwsEc2VpnConnectionVgwTelemetryDetails -> Maybe Int)
-> (AwsEc2VpnConnectionVgwTelemetryDetails
    -> Maybe Int -> AwsEc2VpnConnectionVgwTelemetryDetails)
-> Lens
     AwsEc2VpnConnectionVgwTelemetryDetails
     AwsEc2VpnConnectionVgwTelemetryDetails
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2VpnConnectionVgwTelemetryDetails' {Maybe Int
acceptedRouteCount :: Maybe Int
$sel:acceptedRouteCount:AwsEc2VpnConnectionVgwTelemetryDetails' :: AwsEc2VpnConnectionVgwTelemetryDetails -> Maybe Int
acceptedRouteCount} -> Maybe Int
acceptedRouteCount) (\s :: AwsEc2VpnConnectionVgwTelemetryDetails
s@AwsEc2VpnConnectionVgwTelemetryDetails' {} Maybe Int
a -> AwsEc2VpnConnectionVgwTelemetryDetails
s {$sel:acceptedRouteCount:AwsEc2VpnConnectionVgwTelemetryDetails' :: Maybe Int
acceptedRouteCount = Maybe Int
a} :: AwsEc2VpnConnectionVgwTelemetryDetails)

-- | If an error occurs, a description of the error.
awsEc2VpnConnectionVgwTelemetryDetails_statusMessage :: Lens.Lens' AwsEc2VpnConnectionVgwTelemetryDetails (Prelude.Maybe Prelude.Text)
awsEc2VpnConnectionVgwTelemetryDetails_statusMessage :: (Maybe Text -> f (Maybe Text))
-> AwsEc2VpnConnectionVgwTelemetryDetails
-> f AwsEc2VpnConnectionVgwTelemetryDetails
awsEc2VpnConnectionVgwTelemetryDetails_statusMessage = (AwsEc2VpnConnectionVgwTelemetryDetails -> Maybe Text)
-> (AwsEc2VpnConnectionVgwTelemetryDetails
    -> Maybe Text -> AwsEc2VpnConnectionVgwTelemetryDetails)
-> Lens
     AwsEc2VpnConnectionVgwTelemetryDetails
     AwsEc2VpnConnectionVgwTelemetryDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2VpnConnectionVgwTelemetryDetails' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:AwsEc2VpnConnectionVgwTelemetryDetails' :: AwsEc2VpnConnectionVgwTelemetryDetails -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: AwsEc2VpnConnectionVgwTelemetryDetails
s@AwsEc2VpnConnectionVgwTelemetryDetails' {} Maybe Text
a -> AwsEc2VpnConnectionVgwTelemetryDetails
s {$sel:statusMessage:AwsEc2VpnConnectionVgwTelemetryDetails' :: Maybe Text
statusMessage = Maybe Text
a} :: AwsEc2VpnConnectionVgwTelemetryDetails)

instance
  Core.FromJSON
    AwsEc2VpnConnectionVgwTelemetryDetails
  where
  parseJSON :: Value -> Parser AwsEc2VpnConnectionVgwTelemetryDetails
parseJSON =
    String
-> (Object -> Parser AwsEc2VpnConnectionVgwTelemetryDetails)
-> Value
-> Parser AwsEc2VpnConnectionVgwTelemetryDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsEc2VpnConnectionVgwTelemetryDetails"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> AwsEc2VpnConnectionVgwTelemetryDetails
AwsEc2VpnConnectionVgwTelemetryDetails'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Int
 -> Maybe Text
 -> AwsEc2VpnConnectionVgwTelemetryDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> AwsEc2VpnConnectionVgwTelemetryDetails)
forall (f :: * -> *) a b. Functor 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
"Status")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> AwsEc2VpnConnectionVgwTelemetryDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> AwsEc2VpnConnectionVgwTelemetryDetails)
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
"OutsideIpAddress")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> AwsEc2VpnConnectionVgwTelemetryDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> AwsEc2VpnConnectionVgwTelemetryDetails)
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
"CertificateArn")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> AwsEc2VpnConnectionVgwTelemetryDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int -> Maybe Text -> AwsEc2VpnConnectionVgwTelemetryDetails)
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
"LastStatusChange")
            Parser
  (Maybe Int -> Maybe Text -> AwsEc2VpnConnectionVgwTelemetryDetails)
-> Parser (Maybe Int)
-> Parser (Maybe Text -> AwsEc2VpnConnectionVgwTelemetryDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AcceptedRouteCount")
            Parser (Maybe Text -> AwsEc2VpnConnectionVgwTelemetryDetails)
-> Parser (Maybe Text)
-> Parser AwsEc2VpnConnectionVgwTelemetryDetails
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
"StatusMessage")
      )

instance
  Prelude.Hashable
    AwsEc2VpnConnectionVgwTelemetryDetails

instance
  Prelude.NFData
    AwsEc2VpnConnectionVgwTelemetryDetails

instance
  Core.ToJSON
    AwsEc2VpnConnectionVgwTelemetryDetails
  where
  toJSON :: AwsEc2VpnConnectionVgwTelemetryDetails -> Value
toJSON AwsEc2VpnConnectionVgwTelemetryDetails' {Maybe Int
Maybe Text
statusMessage :: Maybe Text
acceptedRouteCount :: Maybe Int
lastStatusChange :: Maybe Text
certificateArn :: Maybe Text
outsideIpAddress :: Maybe Text
status :: Maybe Text
$sel:statusMessage:AwsEc2VpnConnectionVgwTelemetryDetails' :: AwsEc2VpnConnectionVgwTelemetryDetails -> Maybe Text
$sel:acceptedRouteCount:AwsEc2VpnConnectionVgwTelemetryDetails' :: AwsEc2VpnConnectionVgwTelemetryDetails -> Maybe Int
$sel:lastStatusChange:AwsEc2VpnConnectionVgwTelemetryDetails' :: AwsEc2VpnConnectionVgwTelemetryDetails -> Maybe Text
$sel:certificateArn:AwsEc2VpnConnectionVgwTelemetryDetails' :: AwsEc2VpnConnectionVgwTelemetryDetails -> Maybe Text
$sel:outsideIpAddress:AwsEc2VpnConnectionVgwTelemetryDetails' :: AwsEc2VpnConnectionVgwTelemetryDetails -> Maybe Text
$sel:status:AwsEc2VpnConnectionVgwTelemetryDetails' :: AwsEc2VpnConnectionVgwTelemetryDetails -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Status" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
status,
            (Text
"OutsideIpAddress" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
outsideIpAddress,
            (Text
"CertificateArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
certificateArn,
            (Text
"LastStatusChange" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
lastStatusChange,
            (Text
"AcceptedRouteCount" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
acceptedRouteCount,
            (Text
"StatusMessage" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
statusMessage
          ]
      )