{-# 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.TopicRuleListItem where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data TopicRuleListItem = TopicRuleListItem'
{
TopicRuleListItem -> Maybe POSIX
createdAt :: Prelude.Maybe Data.POSIX,
TopicRuleListItem -> Maybe Text
ruleArn :: Prelude.Maybe Prelude.Text,
TopicRuleListItem -> Maybe Bool
ruleDisabled :: Prelude.Maybe Prelude.Bool,
TopicRuleListItem -> Maybe Text
ruleName :: Prelude.Maybe Prelude.Text,
TopicRuleListItem -> Maybe Text
topicPattern :: Prelude.Maybe Prelude.Text
}
deriving (TopicRuleListItem -> TopicRuleListItem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TopicRuleListItem -> TopicRuleListItem -> Bool
$c/= :: TopicRuleListItem -> TopicRuleListItem -> Bool
== :: TopicRuleListItem -> TopicRuleListItem -> Bool
$c== :: TopicRuleListItem -> TopicRuleListItem -> Bool
Prelude.Eq, ReadPrec [TopicRuleListItem]
ReadPrec TopicRuleListItem
Int -> ReadS TopicRuleListItem
ReadS [TopicRuleListItem]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TopicRuleListItem]
$creadListPrec :: ReadPrec [TopicRuleListItem]
readPrec :: ReadPrec TopicRuleListItem
$creadPrec :: ReadPrec TopicRuleListItem
readList :: ReadS [TopicRuleListItem]
$creadList :: ReadS [TopicRuleListItem]
readsPrec :: Int -> ReadS TopicRuleListItem
$creadsPrec :: Int -> ReadS TopicRuleListItem
Prelude.Read, Int -> TopicRuleListItem -> ShowS
[TopicRuleListItem] -> ShowS
TopicRuleListItem -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TopicRuleListItem] -> ShowS
$cshowList :: [TopicRuleListItem] -> ShowS
show :: TopicRuleListItem -> String
$cshow :: TopicRuleListItem -> String
showsPrec :: Int -> TopicRuleListItem -> ShowS
$cshowsPrec :: Int -> TopicRuleListItem -> ShowS
Prelude.Show, forall x. Rep TopicRuleListItem x -> TopicRuleListItem
forall x. TopicRuleListItem -> Rep TopicRuleListItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TopicRuleListItem x -> TopicRuleListItem
$cfrom :: forall x. TopicRuleListItem -> Rep TopicRuleListItem x
Prelude.Generic)
newTopicRuleListItem ::
TopicRuleListItem
newTopicRuleListItem :: TopicRuleListItem
newTopicRuleListItem =
TopicRuleListItem'
{ $sel:createdAt:TopicRuleListItem' :: Maybe POSIX
createdAt = forall a. Maybe a
Prelude.Nothing,
$sel:ruleArn:TopicRuleListItem' :: Maybe Text
ruleArn = forall a. Maybe a
Prelude.Nothing,
$sel:ruleDisabled:TopicRuleListItem' :: Maybe Bool
ruleDisabled = forall a. Maybe a
Prelude.Nothing,
$sel:ruleName:TopicRuleListItem' :: Maybe Text
ruleName = forall a. Maybe a
Prelude.Nothing,
$sel:topicPattern:TopicRuleListItem' :: Maybe Text
topicPattern = forall a. Maybe a
Prelude.Nothing
}
topicRuleListItem_createdAt :: Lens.Lens' TopicRuleListItem (Prelude.Maybe Prelude.UTCTime)
topicRuleListItem_createdAt :: Lens' TopicRuleListItem (Maybe UTCTime)
topicRuleListItem_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TopicRuleListItem' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:TopicRuleListItem' :: TopicRuleListItem -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: TopicRuleListItem
s@TopicRuleListItem' {} Maybe POSIX
a -> TopicRuleListItem
s {$sel:createdAt:TopicRuleListItem' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: TopicRuleListItem) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
topicRuleListItem_ruleArn :: Lens.Lens' TopicRuleListItem (Prelude.Maybe Prelude.Text)
topicRuleListItem_ruleArn :: Lens' TopicRuleListItem (Maybe Text)
topicRuleListItem_ruleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TopicRuleListItem' {Maybe Text
ruleArn :: Maybe Text
$sel:ruleArn:TopicRuleListItem' :: TopicRuleListItem -> Maybe Text
ruleArn} -> Maybe Text
ruleArn) (\s :: TopicRuleListItem
s@TopicRuleListItem' {} Maybe Text
a -> TopicRuleListItem
s {$sel:ruleArn:TopicRuleListItem' :: Maybe Text
ruleArn = Maybe Text
a} :: TopicRuleListItem)
topicRuleListItem_ruleDisabled :: Lens.Lens' TopicRuleListItem (Prelude.Maybe Prelude.Bool)
topicRuleListItem_ruleDisabled :: Lens' TopicRuleListItem (Maybe Bool)
topicRuleListItem_ruleDisabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TopicRuleListItem' {Maybe Bool
ruleDisabled :: Maybe Bool
$sel:ruleDisabled:TopicRuleListItem' :: TopicRuleListItem -> Maybe Bool
ruleDisabled} -> Maybe Bool
ruleDisabled) (\s :: TopicRuleListItem
s@TopicRuleListItem' {} Maybe Bool
a -> TopicRuleListItem
s {$sel:ruleDisabled:TopicRuleListItem' :: Maybe Bool
ruleDisabled = Maybe Bool
a} :: TopicRuleListItem)
topicRuleListItem_ruleName :: Lens.Lens' TopicRuleListItem (Prelude.Maybe Prelude.Text)
topicRuleListItem_ruleName :: Lens' TopicRuleListItem (Maybe Text)
topicRuleListItem_ruleName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TopicRuleListItem' {Maybe Text
ruleName :: Maybe Text
$sel:ruleName:TopicRuleListItem' :: TopicRuleListItem -> Maybe Text
ruleName} -> Maybe Text
ruleName) (\s :: TopicRuleListItem
s@TopicRuleListItem' {} Maybe Text
a -> TopicRuleListItem
s {$sel:ruleName:TopicRuleListItem' :: Maybe Text
ruleName = Maybe Text
a} :: TopicRuleListItem)
topicRuleListItem_topicPattern :: Lens.Lens' TopicRuleListItem (Prelude.Maybe Prelude.Text)
topicRuleListItem_topicPattern :: Lens' TopicRuleListItem (Maybe Text)
topicRuleListItem_topicPattern = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TopicRuleListItem' {Maybe Text
topicPattern :: Maybe Text
$sel:topicPattern:TopicRuleListItem' :: TopicRuleListItem -> Maybe Text
topicPattern} -> Maybe Text
topicPattern) (\s :: TopicRuleListItem
s@TopicRuleListItem' {} Maybe Text
a -> TopicRuleListItem
s {$sel:topicPattern:TopicRuleListItem' :: Maybe Text
topicPattern = Maybe Text
a} :: TopicRuleListItem)
instance Data.FromJSON TopicRuleListItem where
parseJSON :: Value -> Parser TopicRuleListItem
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"TopicRuleListItem"
( \Object
x ->
Maybe POSIX
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> TopicRuleListItem
TopicRuleListItem'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"createdAt")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ruleArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ruleDisabled")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ruleName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"topicPattern")
)
instance Prelude.Hashable TopicRuleListItem where
hashWithSalt :: Int -> TopicRuleListItem -> Int
hashWithSalt Int
_salt TopicRuleListItem' {Maybe Bool
Maybe Text
Maybe POSIX
topicPattern :: Maybe Text
ruleName :: Maybe Text
ruleDisabled :: Maybe Bool
ruleArn :: Maybe Text
createdAt :: Maybe POSIX
$sel:topicPattern:TopicRuleListItem' :: TopicRuleListItem -> Maybe Text
$sel:ruleName:TopicRuleListItem' :: TopicRuleListItem -> Maybe Text
$sel:ruleDisabled:TopicRuleListItem' :: TopicRuleListItem -> Maybe Bool
$sel:ruleArn:TopicRuleListItem' :: TopicRuleListItem -> Maybe Text
$sel:createdAt:TopicRuleListItem' :: TopicRuleListItem -> Maybe POSIX
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdAt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ruleArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
ruleDisabled
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ruleName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
topicPattern
instance Prelude.NFData TopicRuleListItem where
rnf :: TopicRuleListItem -> ()
rnf TopicRuleListItem' {Maybe Bool
Maybe Text
Maybe POSIX
topicPattern :: Maybe Text
ruleName :: Maybe Text
ruleDisabled :: Maybe Bool
ruleArn :: Maybe Text
createdAt :: Maybe POSIX
$sel:topicPattern:TopicRuleListItem' :: TopicRuleListItem -> Maybe Text
$sel:ruleName:TopicRuleListItem' :: TopicRuleListItem -> Maybe Text
$sel:ruleDisabled:TopicRuleListItem' :: TopicRuleListItem -> Maybe Bool
$sel:ruleArn:TopicRuleListItem' :: TopicRuleListItem -> Maybe Text
$sel:createdAt:TopicRuleListItem' :: TopicRuleListItem -> Maybe POSIX
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdAt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ruleArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
ruleDisabled
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ruleName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
topicPattern