{-# 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.IoT.Types.TopicRuleDestinationSummary
-- 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.IoT.Types.TopicRuleDestinationSummary where

import qualified Amazonka.Core as Core
import Amazonka.IoT.Types.HttpUrlDestinationSummary
import Amazonka.IoT.Types.TopicRuleDestinationStatus
import Amazonka.IoT.Types.VpcDestinationSummary
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about the topic rule destination.
--
-- /See:/ 'newTopicRuleDestinationSummary' smart constructor.
data TopicRuleDestinationSummary = TopicRuleDestinationSummary'
  { -- | The status of the topic rule destination. Valid values are:
    --
    -- [IN_PROGRESS]
    --     A topic rule destination was created but has not been confirmed. You
    --     can set @status@ to @IN_PROGRESS@ by calling
    --     @UpdateTopicRuleDestination@. Calling @UpdateTopicRuleDestination@
    --     causes a new confirmation challenge to be sent to your confirmation
    --     endpoint.
    --
    -- [ENABLED]
    --     Confirmation was completed, and traffic to this destination is
    --     allowed. You can set @status@ to @DISABLED@ by calling
    --     @UpdateTopicRuleDestination@.
    --
    -- [DISABLED]
    --     Confirmation was completed, and traffic to this destination is not
    --     allowed. You can set @status@ to @ENABLED@ by calling
    --     @UpdateTopicRuleDestination@.
    --
    -- [ERROR]
    --     Confirmation could not be completed, for example if the confirmation
    --     timed out. You can call @GetTopicRuleDestination@ for details about
    --     the error. You can set @status@ to @IN_PROGRESS@ by calling
    --     @UpdateTopicRuleDestination@. Calling @UpdateTopicRuleDestination@
    --     causes a new confirmation challenge to be sent to your confirmation
    --     endpoint.
    TopicRuleDestinationSummary -> Maybe TopicRuleDestinationStatus
status :: Prelude.Maybe TopicRuleDestinationStatus,
    -- | Information about the HTTP URL.
    TopicRuleDestinationSummary -> Maybe HttpUrlDestinationSummary
httpUrlSummary :: Prelude.Maybe HttpUrlDestinationSummary,
    -- | The date and time when the topic rule destination was last updated.
    TopicRuleDestinationSummary -> Maybe POSIX
lastUpdatedAt :: Prelude.Maybe Core.POSIX,
    -- | The topic rule destination ARN.
    TopicRuleDestinationSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The date and time when the topic rule destination was created.
    TopicRuleDestinationSummary -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | Information about the virtual private cloud (VPC) connection.
    TopicRuleDestinationSummary -> Maybe VpcDestinationSummary
vpcDestinationSummary :: Prelude.Maybe VpcDestinationSummary,
    -- | The reason the topic rule destination is in the current status.
    TopicRuleDestinationSummary -> Maybe Text
statusReason :: Prelude.Maybe Prelude.Text
  }
  deriving (TopicRuleDestinationSummary -> TopicRuleDestinationSummary -> Bool
(TopicRuleDestinationSummary
 -> TopicRuleDestinationSummary -> Bool)
-> (TopicRuleDestinationSummary
    -> TopicRuleDestinationSummary -> Bool)
-> Eq TopicRuleDestinationSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TopicRuleDestinationSummary -> TopicRuleDestinationSummary -> Bool
$c/= :: TopicRuleDestinationSummary -> TopicRuleDestinationSummary -> Bool
== :: TopicRuleDestinationSummary -> TopicRuleDestinationSummary -> Bool
$c== :: TopicRuleDestinationSummary -> TopicRuleDestinationSummary -> Bool
Prelude.Eq, ReadPrec [TopicRuleDestinationSummary]
ReadPrec TopicRuleDestinationSummary
Int -> ReadS TopicRuleDestinationSummary
ReadS [TopicRuleDestinationSummary]
(Int -> ReadS TopicRuleDestinationSummary)
-> ReadS [TopicRuleDestinationSummary]
-> ReadPrec TopicRuleDestinationSummary
-> ReadPrec [TopicRuleDestinationSummary]
-> Read TopicRuleDestinationSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TopicRuleDestinationSummary]
$creadListPrec :: ReadPrec [TopicRuleDestinationSummary]
readPrec :: ReadPrec TopicRuleDestinationSummary
$creadPrec :: ReadPrec TopicRuleDestinationSummary
readList :: ReadS [TopicRuleDestinationSummary]
$creadList :: ReadS [TopicRuleDestinationSummary]
readsPrec :: Int -> ReadS TopicRuleDestinationSummary
$creadsPrec :: Int -> ReadS TopicRuleDestinationSummary
Prelude.Read, Int -> TopicRuleDestinationSummary -> ShowS
[TopicRuleDestinationSummary] -> ShowS
TopicRuleDestinationSummary -> String
(Int -> TopicRuleDestinationSummary -> ShowS)
-> (TopicRuleDestinationSummary -> String)
-> ([TopicRuleDestinationSummary] -> ShowS)
-> Show TopicRuleDestinationSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TopicRuleDestinationSummary] -> ShowS
$cshowList :: [TopicRuleDestinationSummary] -> ShowS
show :: TopicRuleDestinationSummary -> String
$cshow :: TopicRuleDestinationSummary -> String
showsPrec :: Int -> TopicRuleDestinationSummary -> ShowS
$cshowsPrec :: Int -> TopicRuleDestinationSummary -> ShowS
Prelude.Show, (forall x.
 TopicRuleDestinationSummary -> Rep TopicRuleDestinationSummary x)
-> (forall x.
    Rep TopicRuleDestinationSummary x -> TopicRuleDestinationSummary)
-> Generic TopicRuleDestinationSummary
forall x.
Rep TopicRuleDestinationSummary x -> TopicRuleDestinationSummary
forall x.
TopicRuleDestinationSummary -> Rep TopicRuleDestinationSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TopicRuleDestinationSummary x -> TopicRuleDestinationSummary
$cfrom :: forall x.
TopicRuleDestinationSummary -> Rep TopicRuleDestinationSummary x
Prelude.Generic)

-- |
-- Create a value of 'TopicRuleDestinationSummary' 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', 'topicRuleDestinationSummary_status' - The status of the topic rule destination. Valid values are:
--
-- [IN_PROGRESS]
--     A topic rule destination was created but has not been confirmed. You
--     can set @status@ to @IN_PROGRESS@ by calling
--     @UpdateTopicRuleDestination@. Calling @UpdateTopicRuleDestination@
--     causes a new confirmation challenge to be sent to your confirmation
--     endpoint.
--
-- [ENABLED]
--     Confirmation was completed, and traffic to this destination is
--     allowed. You can set @status@ to @DISABLED@ by calling
--     @UpdateTopicRuleDestination@.
--
-- [DISABLED]
--     Confirmation was completed, and traffic to this destination is not
--     allowed. You can set @status@ to @ENABLED@ by calling
--     @UpdateTopicRuleDestination@.
--
-- [ERROR]
--     Confirmation could not be completed, for example if the confirmation
--     timed out. You can call @GetTopicRuleDestination@ for details about
--     the error. You can set @status@ to @IN_PROGRESS@ by calling
--     @UpdateTopicRuleDestination@. Calling @UpdateTopicRuleDestination@
--     causes a new confirmation challenge to be sent to your confirmation
--     endpoint.
--
-- 'httpUrlSummary', 'topicRuleDestinationSummary_httpUrlSummary' - Information about the HTTP URL.
--
-- 'lastUpdatedAt', 'topicRuleDestinationSummary_lastUpdatedAt' - The date and time when the topic rule destination was last updated.
--
-- 'arn', 'topicRuleDestinationSummary_arn' - The topic rule destination ARN.
--
-- 'createdAt', 'topicRuleDestinationSummary_createdAt' - The date and time when the topic rule destination was created.
--
-- 'vpcDestinationSummary', 'topicRuleDestinationSummary_vpcDestinationSummary' - Information about the virtual private cloud (VPC) connection.
--
-- 'statusReason', 'topicRuleDestinationSummary_statusReason' - The reason the topic rule destination is in the current status.
newTopicRuleDestinationSummary ::
  TopicRuleDestinationSummary
newTopicRuleDestinationSummary :: TopicRuleDestinationSummary
newTopicRuleDestinationSummary =
  TopicRuleDestinationSummary' :: Maybe TopicRuleDestinationStatus
-> Maybe HttpUrlDestinationSummary
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe VpcDestinationSummary
-> Maybe Text
-> TopicRuleDestinationSummary
TopicRuleDestinationSummary'
    { $sel:status:TopicRuleDestinationSummary' :: Maybe TopicRuleDestinationStatus
status =
        Maybe TopicRuleDestinationStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:httpUrlSummary:TopicRuleDestinationSummary' :: Maybe HttpUrlDestinationSummary
httpUrlSummary = Maybe HttpUrlDestinationSummary
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedAt:TopicRuleDestinationSummary' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:TopicRuleDestinationSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:TopicRuleDestinationSummary' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcDestinationSummary:TopicRuleDestinationSummary' :: Maybe VpcDestinationSummary
vpcDestinationSummary = Maybe VpcDestinationSummary
forall a. Maybe a
Prelude.Nothing,
      $sel:statusReason:TopicRuleDestinationSummary' :: Maybe Text
statusReason = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the topic rule destination. Valid values are:
--
-- [IN_PROGRESS]
--     A topic rule destination was created but has not been confirmed. You
--     can set @status@ to @IN_PROGRESS@ by calling
--     @UpdateTopicRuleDestination@. Calling @UpdateTopicRuleDestination@
--     causes a new confirmation challenge to be sent to your confirmation
--     endpoint.
--
-- [ENABLED]
--     Confirmation was completed, and traffic to this destination is
--     allowed. You can set @status@ to @DISABLED@ by calling
--     @UpdateTopicRuleDestination@.
--
-- [DISABLED]
--     Confirmation was completed, and traffic to this destination is not
--     allowed. You can set @status@ to @ENABLED@ by calling
--     @UpdateTopicRuleDestination@.
--
-- [ERROR]
--     Confirmation could not be completed, for example if the confirmation
--     timed out. You can call @GetTopicRuleDestination@ for details about
--     the error. You can set @status@ to @IN_PROGRESS@ by calling
--     @UpdateTopicRuleDestination@. Calling @UpdateTopicRuleDestination@
--     causes a new confirmation challenge to be sent to your confirmation
--     endpoint.
topicRuleDestinationSummary_status :: Lens.Lens' TopicRuleDestinationSummary (Prelude.Maybe TopicRuleDestinationStatus)
topicRuleDestinationSummary_status :: (Maybe TopicRuleDestinationStatus
 -> f (Maybe TopicRuleDestinationStatus))
-> TopicRuleDestinationSummary -> f TopicRuleDestinationSummary
topicRuleDestinationSummary_status = (TopicRuleDestinationSummary -> Maybe TopicRuleDestinationStatus)
-> (TopicRuleDestinationSummary
    -> Maybe TopicRuleDestinationStatus -> TopicRuleDestinationSummary)
-> Lens
     TopicRuleDestinationSummary
     TopicRuleDestinationSummary
     (Maybe TopicRuleDestinationStatus)
     (Maybe TopicRuleDestinationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TopicRuleDestinationSummary' {Maybe TopicRuleDestinationStatus
status :: Maybe TopicRuleDestinationStatus
$sel:status:TopicRuleDestinationSummary' :: TopicRuleDestinationSummary -> Maybe TopicRuleDestinationStatus
status} -> Maybe TopicRuleDestinationStatus
status) (\s :: TopicRuleDestinationSummary
s@TopicRuleDestinationSummary' {} Maybe TopicRuleDestinationStatus
a -> TopicRuleDestinationSummary
s {$sel:status:TopicRuleDestinationSummary' :: Maybe TopicRuleDestinationStatus
status = Maybe TopicRuleDestinationStatus
a} :: TopicRuleDestinationSummary)

-- | Information about the HTTP URL.
topicRuleDestinationSummary_httpUrlSummary :: Lens.Lens' TopicRuleDestinationSummary (Prelude.Maybe HttpUrlDestinationSummary)
topicRuleDestinationSummary_httpUrlSummary :: (Maybe HttpUrlDestinationSummary
 -> f (Maybe HttpUrlDestinationSummary))
-> TopicRuleDestinationSummary -> f TopicRuleDestinationSummary
topicRuleDestinationSummary_httpUrlSummary = (TopicRuleDestinationSummary -> Maybe HttpUrlDestinationSummary)
-> (TopicRuleDestinationSummary
    -> Maybe HttpUrlDestinationSummary -> TopicRuleDestinationSummary)
-> Lens
     TopicRuleDestinationSummary
     TopicRuleDestinationSummary
     (Maybe HttpUrlDestinationSummary)
     (Maybe HttpUrlDestinationSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TopicRuleDestinationSummary' {Maybe HttpUrlDestinationSummary
httpUrlSummary :: Maybe HttpUrlDestinationSummary
$sel:httpUrlSummary:TopicRuleDestinationSummary' :: TopicRuleDestinationSummary -> Maybe HttpUrlDestinationSummary
httpUrlSummary} -> Maybe HttpUrlDestinationSummary
httpUrlSummary) (\s :: TopicRuleDestinationSummary
s@TopicRuleDestinationSummary' {} Maybe HttpUrlDestinationSummary
a -> TopicRuleDestinationSummary
s {$sel:httpUrlSummary:TopicRuleDestinationSummary' :: Maybe HttpUrlDestinationSummary
httpUrlSummary = Maybe HttpUrlDestinationSummary
a} :: TopicRuleDestinationSummary)

-- | The date and time when the topic rule destination was last updated.
topicRuleDestinationSummary_lastUpdatedAt :: Lens.Lens' TopicRuleDestinationSummary (Prelude.Maybe Prelude.UTCTime)
topicRuleDestinationSummary_lastUpdatedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> TopicRuleDestinationSummary -> f TopicRuleDestinationSummary
topicRuleDestinationSummary_lastUpdatedAt = (TopicRuleDestinationSummary -> Maybe POSIX)
-> (TopicRuleDestinationSummary
    -> Maybe POSIX -> TopicRuleDestinationSummary)
-> Lens
     TopicRuleDestinationSummary
     TopicRuleDestinationSummary
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TopicRuleDestinationSummary' {Maybe POSIX
lastUpdatedAt :: Maybe POSIX
$sel:lastUpdatedAt:TopicRuleDestinationSummary' :: TopicRuleDestinationSummary -> Maybe POSIX
lastUpdatedAt} -> Maybe POSIX
lastUpdatedAt) (\s :: TopicRuleDestinationSummary
s@TopicRuleDestinationSummary' {} Maybe POSIX
a -> TopicRuleDestinationSummary
s {$sel:lastUpdatedAt:TopicRuleDestinationSummary' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
a} :: TopicRuleDestinationSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> TopicRuleDestinationSummary -> f TopicRuleDestinationSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> TopicRuleDestinationSummary
-> f TopicRuleDestinationSummary
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 topic rule destination ARN.
topicRuleDestinationSummary_arn :: Lens.Lens' TopicRuleDestinationSummary (Prelude.Maybe Prelude.Text)
topicRuleDestinationSummary_arn :: (Maybe Text -> f (Maybe Text))
-> TopicRuleDestinationSummary -> f TopicRuleDestinationSummary
topicRuleDestinationSummary_arn = (TopicRuleDestinationSummary -> Maybe Text)
-> (TopicRuleDestinationSummary
    -> Maybe Text -> TopicRuleDestinationSummary)
-> Lens
     TopicRuleDestinationSummary
     TopicRuleDestinationSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TopicRuleDestinationSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:TopicRuleDestinationSummary' :: TopicRuleDestinationSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: TopicRuleDestinationSummary
s@TopicRuleDestinationSummary' {} Maybe Text
a -> TopicRuleDestinationSummary
s {$sel:arn:TopicRuleDestinationSummary' :: Maybe Text
arn = Maybe Text
a} :: TopicRuleDestinationSummary)

-- | The date and time when the topic rule destination was created.
topicRuleDestinationSummary_createdAt :: Lens.Lens' TopicRuleDestinationSummary (Prelude.Maybe Prelude.UTCTime)
topicRuleDestinationSummary_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> TopicRuleDestinationSummary -> f TopicRuleDestinationSummary
topicRuleDestinationSummary_createdAt = (TopicRuleDestinationSummary -> Maybe POSIX)
-> (TopicRuleDestinationSummary
    -> Maybe POSIX -> TopicRuleDestinationSummary)
-> Lens
     TopicRuleDestinationSummary
     TopicRuleDestinationSummary
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TopicRuleDestinationSummary' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:TopicRuleDestinationSummary' :: TopicRuleDestinationSummary -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: TopicRuleDestinationSummary
s@TopicRuleDestinationSummary' {} Maybe POSIX
a -> TopicRuleDestinationSummary
s {$sel:createdAt:TopicRuleDestinationSummary' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: TopicRuleDestinationSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> TopicRuleDestinationSummary -> f TopicRuleDestinationSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> TopicRuleDestinationSummary
-> f TopicRuleDestinationSummary
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

-- | Information about the virtual private cloud (VPC) connection.
topicRuleDestinationSummary_vpcDestinationSummary :: Lens.Lens' TopicRuleDestinationSummary (Prelude.Maybe VpcDestinationSummary)
topicRuleDestinationSummary_vpcDestinationSummary :: (Maybe VpcDestinationSummary -> f (Maybe VpcDestinationSummary))
-> TopicRuleDestinationSummary -> f TopicRuleDestinationSummary
topicRuleDestinationSummary_vpcDestinationSummary = (TopicRuleDestinationSummary -> Maybe VpcDestinationSummary)
-> (TopicRuleDestinationSummary
    -> Maybe VpcDestinationSummary -> TopicRuleDestinationSummary)
-> Lens
     TopicRuleDestinationSummary
     TopicRuleDestinationSummary
     (Maybe VpcDestinationSummary)
     (Maybe VpcDestinationSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TopicRuleDestinationSummary' {Maybe VpcDestinationSummary
vpcDestinationSummary :: Maybe VpcDestinationSummary
$sel:vpcDestinationSummary:TopicRuleDestinationSummary' :: TopicRuleDestinationSummary -> Maybe VpcDestinationSummary
vpcDestinationSummary} -> Maybe VpcDestinationSummary
vpcDestinationSummary) (\s :: TopicRuleDestinationSummary
s@TopicRuleDestinationSummary' {} Maybe VpcDestinationSummary
a -> TopicRuleDestinationSummary
s {$sel:vpcDestinationSummary:TopicRuleDestinationSummary' :: Maybe VpcDestinationSummary
vpcDestinationSummary = Maybe VpcDestinationSummary
a} :: TopicRuleDestinationSummary)

-- | The reason the topic rule destination is in the current status.
topicRuleDestinationSummary_statusReason :: Lens.Lens' TopicRuleDestinationSummary (Prelude.Maybe Prelude.Text)
topicRuleDestinationSummary_statusReason :: (Maybe Text -> f (Maybe Text))
-> TopicRuleDestinationSummary -> f TopicRuleDestinationSummary
topicRuleDestinationSummary_statusReason = (TopicRuleDestinationSummary -> Maybe Text)
-> (TopicRuleDestinationSummary
    -> Maybe Text -> TopicRuleDestinationSummary)
-> Lens
     TopicRuleDestinationSummary
     TopicRuleDestinationSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TopicRuleDestinationSummary' {Maybe Text
statusReason :: Maybe Text
$sel:statusReason:TopicRuleDestinationSummary' :: TopicRuleDestinationSummary -> Maybe Text
statusReason} -> Maybe Text
statusReason) (\s :: TopicRuleDestinationSummary
s@TopicRuleDestinationSummary' {} Maybe Text
a -> TopicRuleDestinationSummary
s {$sel:statusReason:TopicRuleDestinationSummary' :: Maybe Text
statusReason = Maybe Text
a} :: TopicRuleDestinationSummary)

instance Core.FromJSON TopicRuleDestinationSummary where
  parseJSON :: Value -> Parser TopicRuleDestinationSummary
parseJSON =
    String
-> (Object -> Parser TopicRuleDestinationSummary)
-> Value
-> Parser TopicRuleDestinationSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"TopicRuleDestinationSummary"
      ( \Object
x ->
          Maybe TopicRuleDestinationStatus
-> Maybe HttpUrlDestinationSummary
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe VpcDestinationSummary
-> Maybe Text
-> TopicRuleDestinationSummary
TopicRuleDestinationSummary'
            (Maybe TopicRuleDestinationStatus
 -> Maybe HttpUrlDestinationSummary
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe VpcDestinationSummary
 -> Maybe Text
 -> TopicRuleDestinationSummary)
-> Parser (Maybe TopicRuleDestinationStatus)
-> Parser
     (Maybe HttpUrlDestinationSummary
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe VpcDestinationSummary
      -> Maybe Text
      -> TopicRuleDestinationSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe TopicRuleDestinationStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe HttpUrlDestinationSummary
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe VpcDestinationSummary
   -> Maybe Text
   -> TopicRuleDestinationSummary)
-> Parser (Maybe HttpUrlDestinationSummary)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe VpcDestinationSummary
      -> Maybe Text
      -> TopicRuleDestinationSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HttpUrlDestinationSummary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"httpUrlSummary")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe VpcDestinationSummary
   -> Maybe Text
   -> TopicRuleDestinationSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe VpcDestinationSummary
      -> Maybe Text
      -> TopicRuleDestinationSummary)
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
"lastUpdatedAt")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe VpcDestinationSummary
   -> Maybe Text
   -> TopicRuleDestinationSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe VpcDestinationSummary
      -> Maybe Text
      -> TopicRuleDestinationSummary)
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
"arn")
            Parser
  (Maybe POSIX
   -> Maybe VpcDestinationSummary
   -> Maybe Text
   -> TopicRuleDestinationSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe VpcDestinationSummary
      -> Maybe Text -> TopicRuleDestinationSummary)
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
"createdAt")
            Parser
  (Maybe VpcDestinationSummary
   -> Maybe Text -> TopicRuleDestinationSummary)
-> Parser (Maybe VpcDestinationSummary)
-> Parser (Maybe Text -> TopicRuleDestinationSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe VpcDestinationSummary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"vpcDestinationSummary")
            Parser (Maybe Text -> TopicRuleDestinationSummary)
-> Parser (Maybe Text) -> Parser TopicRuleDestinationSummary
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
"statusReason")
      )

instance Prelude.Hashable TopicRuleDestinationSummary

instance Prelude.NFData TopicRuleDestinationSummary