{-# 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.TopicRuleDestination
-- 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.TopicRuleDestination where

import qualified Amazonka.Core as Core
import Amazonka.IoT.Types.HttpUrlDestinationProperties
import Amazonka.IoT.Types.TopicRuleDestinationStatus
import Amazonka.IoT.Types.VpcDestinationProperties
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A topic rule destination.
--
-- /See:/ 'newTopicRuleDestination' smart constructor.
data TopicRuleDestination = TopicRuleDestination'
  { -- | Properties of the virtual private cloud (VPC) connection.
    TopicRuleDestination -> Maybe VpcDestinationProperties
vpcProperties :: Prelude.Maybe VpcDestinationProperties,
    -- | 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.
    TopicRuleDestination -> Maybe TopicRuleDestinationStatus
status :: Prelude.Maybe TopicRuleDestinationStatus,
    -- | The date and time when the topic rule destination was last updated.
    TopicRuleDestination -> Maybe POSIX
lastUpdatedAt :: Prelude.Maybe Core.POSIX,
    -- | Properties of the HTTP URL.
    TopicRuleDestination -> Maybe HttpUrlDestinationProperties
httpUrlProperties :: Prelude.Maybe HttpUrlDestinationProperties,
    -- | The topic rule destination URL.
    TopicRuleDestination -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The date and time when the topic rule destination was created.
    TopicRuleDestination -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | Additional details or reason why the topic rule destination is in the
    -- current status.
    TopicRuleDestination -> Maybe Text
statusReason :: Prelude.Maybe Prelude.Text
  }
  deriving (TopicRuleDestination -> TopicRuleDestination -> Bool
(TopicRuleDestination -> TopicRuleDestination -> Bool)
-> (TopicRuleDestination -> TopicRuleDestination -> Bool)
-> Eq TopicRuleDestination
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TopicRuleDestination -> TopicRuleDestination -> Bool
$c/= :: TopicRuleDestination -> TopicRuleDestination -> Bool
== :: TopicRuleDestination -> TopicRuleDestination -> Bool
$c== :: TopicRuleDestination -> TopicRuleDestination -> Bool
Prelude.Eq, ReadPrec [TopicRuleDestination]
ReadPrec TopicRuleDestination
Int -> ReadS TopicRuleDestination
ReadS [TopicRuleDestination]
(Int -> ReadS TopicRuleDestination)
-> ReadS [TopicRuleDestination]
-> ReadPrec TopicRuleDestination
-> ReadPrec [TopicRuleDestination]
-> Read TopicRuleDestination
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TopicRuleDestination]
$creadListPrec :: ReadPrec [TopicRuleDestination]
readPrec :: ReadPrec TopicRuleDestination
$creadPrec :: ReadPrec TopicRuleDestination
readList :: ReadS [TopicRuleDestination]
$creadList :: ReadS [TopicRuleDestination]
readsPrec :: Int -> ReadS TopicRuleDestination
$creadsPrec :: Int -> ReadS TopicRuleDestination
Prelude.Read, Int -> TopicRuleDestination -> ShowS
[TopicRuleDestination] -> ShowS
TopicRuleDestination -> String
(Int -> TopicRuleDestination -> ShowS)
-> (TopicRuleDestination -> String)
-> ([TopicRuleDestination] -> ShowS)
-> Show TopicRuleDestination
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TopicRuleDestination] -> ShowS
$cshowList :: [TopicRuleDestination] -> ShowS
show :: TopicRuleDestination -> String
$cshow :: TopicRuleDestination -> String
showsPrec :: Int -> TopicRuleDestination -> ShowS
$cshowsPrec :: Int -> TopicRuleDestination -> ShowS
Prelude.Show, (forall x. TopicRuleDestination -> Rep TopicRuleDestination x)
-> (forall x. Rep TopicRuleDestination x -> TopicRuleDestination)
-> Generic TopicRuleDestination
forall x. Rep TopicRuleDestination x -> TopicRuleDestination
forall x. TopicRuleDestination -> Rep TopicRuleDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TopicRuleDestination x -> TopicRuleDestination
$cfrom :: forall x. TopicRuleDestination -> Rep TopicRuleDestination x
Prelude.Generic)

-- |
-- Create a value of 'TopicRuleDestination' 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:
--
-- 'vpcProperties', 'topicRuleDestination_vpcProperties' - Properties of the virtual private cloud (VPC) connection.
--
-- 'status', 'topicRuleDestination_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.
--
-- 'lastUpdatedAt', 'topicRuleDestination_lastUpdatedAt' - The date and time when the topic rule destination was last updated.
--
-- 'httpUrlProperties', 'topicRuleDestination_httpUrlProperties' - Properties of the HTTP URL.
--
-- 'arn', 'topicRuleDestination_arn' - The topic rule destination URL.
--
-- 'createdAt', 'topicRuleDestination_createdAt' - The date and time when the topic rule destination was created.
--
-- 'statusReason', 'topicRuleDestination_statusReason' - Additional details or reason why the topic rule destination is in the
-- current status.
newTopicRuleDestination ::
  TopicRuleDestination
newTopicRuleDestination :: TopicRuleDestination
newTopicRuleDestination =
  TopicRuleDestination' :: Maybe VpcDestinationProperties
-> Maybe TopicRuleDestinationStatus
-> Maybe POSIX
-> Maybe HttpUrlDestinationProperties
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> TopicRuleDestination
TopicRuleDestination'
    { $sel:vpcProperties:TopicRuleDestination' :: Maybe VpcDestinationProperties
vpcProperties =
        Maybe VpcDestinationProperties
forall a. Maybe a
Prelude.Nothing,
      $sel:status:TopicRuleDestination' :: Maybe TopicRuleDestinationStatus
status = Maybe TopicRuleDestinationStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedAt:TopicRuleDestination' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:httpUrlProperties:TopicRuleDestination' :: Maybe HttpUrlDestinationProperties
httpUrlProperties = Maybe HttpUrlDestinationProperties
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:TopicRuleDestination' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:TopicRuleDestination' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:statusReason:TopicRuleDestination' :: Maybe Text
statusReason = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Properties of the virtual private cloud (VPC) connection.
topicRuleDestination_vpcProperties :: Lens.Lens' TopicRuleDestination (Prelude.Maybe VpcDestinationProperties)
topicRuleDestination_vpcProperties :: (Maybe VpcDestinationProperties
 -> f (Maybe VpcDestinationProperties))
-> TopicRuleDestination -> f TopicRuleDestination
topicRuleDestination_vpcProperties = (TopicRuleDestination -> Maybe VpcDestinationProperties)
-> (TopicRuleDestination
    -> Maybe VpcDestinationProperties -> TopicRuleDestination)
-> Lens
     TopicRuleDestination
     TopicRuleDestination
     (Maybe VpcDestinationProperties)
     (Maybe VpcDestinationProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TopicRuleDestination' {Maybe VpcDestinationProperties
vpcProperties :: Maybe VpcDestinationProperties
$sel:vpcProperties:TopicRuleDestination' :: TopicRuleDestination -> Maybe VpcDestinationProperties
vpcProperties} -> Maybe VpcDestinationProperties
vpcProperties) (\s :: TopicRuleDestination
s@TopicRuleDestination' {} Maybe VpcDestinationProperties
a -> TopicRuleDestination
s {$sel:vpcProperties:TopicRuleDestination' :: Maybe VpcDestinationProperties
vpcProperties = Maybe VpcDestinationProperties
a} :: TopicRuleDestination)

-- | 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.
topicRuleDestination_status :: Lens.Lens' TopicRuleDestination (Prelude.Maybe TopicRuleDestinationStatus)
topicRuleDestination_status :: (Maybe TopicRuleDestinationStatus
 -> f (Maybe TopicRuleDestinationStatus))
-> TopicRuleDestination -> f TopicRuleDestination
topicRuleDestination_status = (TopicRuleDestination -> Maybe TopicRuleDestinationStatus)
-> (TopicRuleDestination
    -> Maybe TopicRuleDestinationStatus -> TopicRuleDestination)
-> Lens
     TopicRuleDestination
     TopicRuleDestination
     (Maybe TopicRuleDestinationStatus)
     (Maybe TopicRuleDestinationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TopicRuleDestination' {Maybe TopicRuleDestinationStatus
status :: Maybe TopicRuleDestinationStatus
$sel:status:TopicRuleDestination' :: TopicRuleDestination -> Maybe TopicRuleDestinationStatus
status} -> Maybe TopicRuleDestinationStatus
status) (\s :: TopicRuleDestination
s@TopicRuleDestination' {} Maybe TopicRuleDestinationStatus
a -> TopicRuleDestination
s {$sel:status:TopicRuleDestination' :: Maybe TopicRuleDestinationStatus
status = Maybe TopicRuleDestinationStatus
a} :: TopicRuleDestination)

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

-- | Properties of the HTTP URL.
topicRuleDestination_httpUrlProperties :: Lens.Lens' TopicRuleDestination (Prelude.Maybe HttpUrlDestinationProperties)
topicRuleDestination_httpUrlProperties :: (Maybe HttpUrlDestinationProperties
 -> f (Maybe HttpUrlDestinationProperties))
-> TopicRuleDestination -> f TopicRuleDestination
topicRuleDestination_httpUrlProperties = (TopicRuleDestination -> Maybe HttpUrlDestinationProperties)
-> (TopicRuleDestination
    -> Maybe HttpUrlDestinationProperties -> TopicRuleDestination)
-> Lens
     TopicRuleDestination
     TopicRuleDestination
     (Maybe HttpUrlDestinationProperties)
     (Maybe HttpUrlDestinationProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TopicRuleDestination' {Maybe HttpUrlDestinationProperties
httpUrlProperties :: Maybe HttpUrlDestinationProperties
$sel:httpUrlProperties:TopicRuleDestination' :: TopicRuleDestination -> Maybe HttpUrlDestinationProperties
httpUrlProperties} -> Maybe HttpUrlDestinationProperties
httpUrlProperties) (\s :: TopicRuleDestination
s@TopicRuleDestination' {} Maybe HttpUrlDestinationProperties
a -> TopicRuleDestination
s {$sel:httpUrlProperties:TopicRuleDestination' :: Maybe HttpUrlDestinationProperties
httpUrlProperties = Maybe HttpUrlDestinationProperties
a} :: TopicRuleDestination)

-- | The topic rule destination URL.
topicRuleDestination_arn :: Lens.Lens' TopicRuleDestination (Prelude.Maybe Prelude.Text)
topicRuleDestination_arn :: (Maybe Text -> f (Maybe Text))
-> TopicRuleDestination -> f TopicRuleDestination
topicRuleDestination_arn = (TopicRuleDestination -> Maybe Text)
-> (TopicRuleDestination -> Maybe Text -> TopicRuleDestination)
-> Lens
     TopicRuleDestination TopicRuleDestination (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TopicRuleDestination' {Maybe Text
arn :: Maybe Text
$sel:arn:TopicRuleDestination' :: TopicRuleDestination -> Maybe Text
arn} -> Maybe Text
arn) (\s :: TopicRuleDestination
s@TopicRuleDestination' {} Maybe Text
a -> TopicRuleDestination
s {$sel:arn:TopicRuleDestination' :: Maybe Text
arn = Maybe Text
a} :: TopicRuleDestination)

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

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

instance Core.FromJSON TopicRuleDestination where
  parseJSON :: Value -> Parser TopicRuleDestination
parseJSON =
    String
-> (Object -> Parser TopicRuleDestination)
-> Value
-> Parser TopicRuleDestination
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"TopicRuleDestination"
      ( \Object
x ->
          Maybe VpcDestinationProperties
-> Maybe TopicRuleDestinationStatus
-> Maybe POSIX
-> Maybe HttpUrlDestinationProperties
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> TopicRuleDestination
TopicRuleDestination'
            (Maybe VpcDestinationProperties
 -> Maybe TopicRuleDestinationStatus
 -> Maybe POSIX
 -> Maybe HttpUrlDestinationProperties
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> TopicRuleDestination)
-> Parser (Maybe VpcDestinationProperties)
-> Parser
     (Maybe TopicRuleDestinationStatus
      -> Maybe POSIX
      -> Maybe HttpUrlDestinationProperties
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> TopicRuleDestination)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe VpcDestinationProperties)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"vpcProperties")
            Parser
  (Maybe TopicRuleDestinationStatus
   -> Maybe POSIX
   -> Maybe HttpUrlDestinationProperties
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> TopicRuleDestination)
-> Parser (Maybe TopicRuleDestinationStatus)
-> Parser
     (Maybe POSIX
      -> Maybe HttpUrlDestinationProperties
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> TopicRuleDestination)
forall (f :: * -> *) a b. Applicative f => 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 POSIX
   -> Maybe HttpUrlDestinationProperties
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> TopicRuleDestination)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe HttpUrlDestinationProperties
      -> Maybe Text -> Maybe POSIX -> Maybe Text -> TopicRuleDestination)
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 HttpUrlDestinationProperties
   -> Maybe Text -> Maybe POSIX -> Maybe Text -> TopicRuleDestination)
-> Parser (Maybe HttpUrlDestinationProperties)
-> Parser
     (Maybe Text -> Maybe POSIX -> Maybe Text -> TopicRuleDestination)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HttpUrlDestinationProperties)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"httpUrlProperties")
            Parser
  (Maybe Text -> Maybe POSIX -> Maybe Text -> TopicRuleDestination)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> TopicRuleDestination)
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 Text -> TopicRuleDestination)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> TopicRuleDestination)
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 Text -> TopicRuleDestination)
-> Parser (Maybe Text) -> Parser TopicRuleDestination
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 TopicRuleDestination

instance Prelude.NFData TopicRuleDestination