{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.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
data TopicRuleDestination = TopicRuleDestination'
{
TopicRuleDestination -> Maybe VpcDestinationProperties
vpcProperties :: Prelude.Maybe VpcDestinationProperties,
TopicRuleDestination -> Maybe TopicRuleDestinationStatus
status :: Prelude.Maybe TopicRuleDestinationStatus,
TopicRuleDestination -> Maybe POSIX
lastUpdatedAt :: Prelude.Maybe Core.POSIX,
TopicRuleDestination -> Maybe HttpUrlDestinationProperties
httpUrlProperties :: Prelude.Maybe HttpUrlDestinationProperties,
TopicRuleDestination -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
TopicRuleDestination -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
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)
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
}
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)
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)
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
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)
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)
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
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