{-# 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.Connect.Types.RuleSummary where
import Amazonka.Connect.Types.ActionSummary
import Amazonka.Connect.Types.EventSourceName
import Amazonka.Connect.Types.RulePublishStatus
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 RuleSummary = RuleSummary'
{
RuleSummary -> Text
name :: Prelude.Text,
RuleSummary -> Text
ruleId :: Prelude.Text,
RuleSummary -> Text
ruleArn :: Prelude.Text,
RuleSummary -> EventSourceName
eventSourceName :: EventSourceName,
RuleSummary -> RulePublishStatus
publishStatus :: RulePublishStatus,
RuleSummary -> [ActionSummary]
actionSummaries :: [ActionSummary],
RuleSummary -> POSIX
createdTime :: Data.POSIX,
RuleSummary -> POSIX
lastUpdatedTime :: Data.POSIX
}
deriving (RuleSummary -> RuleSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RuleSummary -> RuleSummary -> Bool
$c/= :: RuleSummary -> RuleSummary -> Bool
== :: RuleSummary -> RuleSummary -> Bool
$c== :: RuleSummary -> RuleSummary -> Bool
Prelude.Eq, ReadPrec [RuleSummary]
ReadPrec RuleSummary
Int -> ReadS RuleSummary
ReadS [RuleSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RuleSummary]
$creadListPrec :: ReadPrec [RuleSummary]
readPrec :: ReadPrec RuleSummary
$creadPrec :: ReadPrec RuleSummary
readList :: ReadS [RuleSummary]
$creadList :: ReadS [RuleSummary]
readsPrec :: Int -> ReadS RuleSummary
$creadsPrec :: Int -> ReadS RuleSummary
Prelude.Read, Int -> RuleSummary -> ShowS
[RuleSummary] -> ShowS
RuleSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RuleSummary] -> ShowS
$cshowList :: [RuleSummary] -> ShowS
show :: RuleSummary -> String
$cshow :: RuleSummary -> String
showsPrec :: Int -> RuleSummary -> ShowS
$cshowsPrec :: Int -> RuleSummary -> ShowS
Prelude.Show, forall x. Rep RuleSummary x -> RuleSummary
forall x. RuleSummary -> Rep RuleSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RuleSummary x -> RuleSummary
$cfrom :: forall x. RuleSummary -> Rep RuleSummary x
Prelude.Generic)
newRuleSummary ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
EventSourceName ->
RulePublishStatus ->
Prelude.UTCTime ->
Prelude.UTCTime ->
RuleSummary
newRuleSummary :: Text
-> Text
-> Text
-> EventSourceName
-> RulePublishStatus
-> UTCTime
-> UTCTime
-> RuleSummary
newRuleSummary
Text
pName_
Text
pRuleId_
Text
pRuleArn_
EventSourceName
pEventSourceName_
RulePublishStatus
pPublishStatus_
UTCTime
pCreatedTime_
UTCTime
pLastUpdatedTime_ =
RuleSummary'
{ $sel:name:RuleSummary' :: Text
name = Text
pName_,
$sel:ruleId:RuleSummary' :: Text
ruleId = Text
pRuleId_,
$sel:ruleArn:RuleSummary' :: Text
ruleArn = Text
pRuleArn_,
$sel:eventSourceName:RuleSummary' :: EventSourceName
eventSourceName = EventSourceName
pEventSourceName_,
$sel:publishStatus:RuleSummary' :: RulePublishStatus
publishStatus = RulePublishStatus
pPublishStatus_,
$sel:actionSummaries:RuleSummary' :: [ActionSummary]
actionSummaries = forall a. Monoid a => a
Prelude.mempty,
$sel:createdTime:RuleSummary' :: POSIX
createdTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedTime_,
$sel:lastUpdatedTime:RuleSummary' :: POSIX
lastUpdatedTime =
forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastUpdatedTime_
}
ruleSummary_name :: Lens.Lens' RuleSummary Prelude.Text
ruleSummary_name :: Lens' RuleSummary Text
ruleSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleSummary' {Text
name :: Text
$sel:name:RuleSummary' :: RuleSummary -> Text
name} -> Text
name) (\s :: RuleSummary
s@RuleSummary' {} Text
a -> RuleSummary
s {$sel:name:RuleSummary' :: Text
name = Text
a} :: RuleSummary)
ruleSummary_ruleId :: Lens.Lens' RuleSummary Prelude.Text
ruleSummary_ruleId :: Lens' RuleSummary Text
ruleSummary_ruleId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleSummary' {Text
ruleId :: Text
$sel:ruleId:RuleSummary' :: RuleSummary -> Text
ruleId} -> Text
ruleId) (\s :: RuleSummary
s@RuleSummary' {} Text
a -> RuleSummary
s {$sel:ruleId:RuleSummary' :: Text
ruleId = Text
a} :: RuleSummary)
ruleSummary_ruleArn :: Lens.Lens' RuleSummary Prelude.Text
ruleSummary_ruleArn :: Lens' RuleSummary Text
ruleSummary_ruleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleSummary' {Text
ruleArn :: Text
$sel:ruleArn:RuleSummary' :: RuleSummary -> Text
ruleArn} -> Text
ruleArn) (\s :: RuleSummary
s@RuleSummary' {} Text
a -> RuleSummary
s {$sel:ruleArn:RuleSummary' :: Text
ruleArn = Text
a} :: RuleSummary)
ruleSummary_eventSourceName :: Lens.Lens' RuleSummary EventSourceName
ruleSummary_eventSourceName :: Lens' RuleSummary EventSourceName
ruleSummary_eventSourceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleSummary' {EventSourceName
eventSourceName :: EventSourceName
$sel:eventSourceName:RuleSummary' :: RuleSummary -> EventSourceName
eventSourceName} -> EventSourceName
eventSourceName) (\s :: RuleSummary
s@RuleSummary' {} EventSourceName
a -> RuleSummary
s {$sel:eventSourceName:RuleSummary' :: EventSourceName
eventSourceName = EventSourceName
a} :: RuleSummary)
ruleSummary_publishStatus :: Lens.Lens' RuleSummary RulePublishStatus
ruleSummary_publishStatus :: Lens' RuleSummary RulePublishStatus
ruleSummary_publishStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleSummary' {RulePublishStatus
publishStatus :: RulePublishStatus
$sel:publishStatus:RuleSummary' :: RuleSummary -> RulePublishStatus
publishStatus} -> RulePublishStatus
publishStatus) (\s :: RuleSummary
s@RuleSummary' {} RulePublishStatus
a -> RuleSummary
s {$sel:publishStatus:RuleSummary' :: RulePublishStatus
publishStatus = RulePublishStatus
a} :: RuleSummary)
ruleSummary_actionSummaries :: Lens.Lens' RuleSummary [ActionSummary]
ruleSummary_actionSummaries :: Lens' RuleSummary [ActionSummary]
ruleSummary_actionSummaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleSummary' {[ActionSummary]
actionSummaries :: [ActionSummary]
$sel:actionSummaries:RuleSummary' :: RuleSummary -> [ActionSummary]
actionSummaries} -> [ActionSummary]
actionSummaries) (\s :: RuleSummary
s@RuleSummary' {} [ActionSummary]
a -> RuleSummary
s {$sel:actionSummaries:RuleSummary' :: [ActionSummary]
actionSummaries = [ActionSummary]
a} :: RuleSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
ruleSummary_createdTime :: Lens.Lens' RuleSummary Prelude.UTCTime
ruleSummary_createdTime :: Lens' RuleSummary UTCTime
ruleSummary_createdTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleSummary' {POSIX
createdTime :: POSIX
$sel:createdTime:RuleSummary' :: RuleSummary -> POSIX
createdTime} -> POSIX
createdTime) (\s :: RuleSummary
s@RuleSummary' {} POSIX
a -> RuleSummary
s {$sel:createdTime:RuleSummary' :: POSIX
createdTime = POSIX
a} :: RuleSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
ruleSummary_lastUpdatedTime :: Lens.Lens' RuleSummary Prelude.UTCTime
ruleSummary_lastUpdatedTime :: Lens' RuleSummary UTCTime
ruleSummary_lastUpdatedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleSummary' {POSIX
lastUpdatedTime :: POSIX
$sel:lastUpdatedTime:RuleSummary' :: RuleSummary -> POSIX
lastUpdatedTime} -> POSIX
lastUpdatedTime) (\s :: RuleSummary
s@RuleSummary' {} POSIX
a -> RuleSummary
s {$sel:lastUpdatedTime:RuleSummary' :: POSIX
lastUpdatedTime = POSIX
a} :: RuleSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Data.FromJSON RuleSummary where
parseJSON :: Value -> Parser RuleSummary
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RuleSummary"
( \Object
x ->
Text
-> Text
-> Text
-> EventSourceName
-> RulePublishStatus
-> [ActionSummary]
-> POSIX
-> POSIX
-> RuleSummary
RuleSummary'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"RuleId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser 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 a
Data..: Key
"EventSourceName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"PublishStatus")
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
"ActionSummaries"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"CreatedTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"LastUpdatedTime")
)
instance Prelude.Hashable RuleSummary where
hashWithSalt :: Int -> RuleSummary -> Int
hashWithSalt Int
_salt RuleSummary' {[ActionSummary]
Text
POSIX
EventSourceName
RulePublishStatus
lastUpdatedTime :: POSIX
createdTime :: POSIX
actionSummaries :: [ActionSummary]
publishStatus :: RulePublishStatus
eventSourceName :: EventSourceName
ruleArn :: Text
ruleId :: Text
name :: Text
$sel:lastUpdatedTime:RuleSummary' :: RuleSummary -> POSIX
$sel:createdTime:RuleSummary' :: RuleSummary -> POSIX
$sel:actionSummaries:RuleSummary' :: RuleSummary -> [ActionSummary]
$sel:publishStatus:RuleSummary' :: RuleSummary -> RulePublishStatus
$sel:eventSourceName:RuleSummary' :: RuleSummary -> EventSourceName
$sel:ruleArn:RuleSummary' :: RuleSummary -> Text
$sel:ruleId:RuleSummary' :: RuleSummary -> Text
$sel:name:RuleSummary' :: RuleSummary -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ruleId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ruleArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` EventSourceName
eventSourceName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RulePublishStatus
publishStatus
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [ActionSummary]
actionSummaries
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
createdTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
lastUpdatedTime
instance Prelude.NFData RuleSummary where
rnf :: RuleSummary -> ()
rnf RuleSummary' {[ActionSummary]
Text
POSIX
EventSourceName
RulePublishStatus
lastUpdatedTime :: POSIX
createdTime :: POSIX
actionSummaries :: [ActionSummary]
publishStatus :: RulePublishStatus
eventSourceName :: EventSourceName
ruleArn :: Text
ruleId :: Text
name :: Text
$sel:lastUpdatedTime:RuleSummary' :: RuleSummary -> POSIX
$sel:createdTime:RuleSummary' :: RuleSummary -> POSIX
$sel:actionSummaries:RuleSummary' :: RuleSummary -> [ActionSummary]
$sel:publishStatus:RuleSummary' :: RuleSummary -> RulePublishStatus
$sel:eventSourceName:RuleSummary' :: RuleSummary -> EventSourceName
$sel:ruleArn:RuleSummary' :: RuleSummary -> Text
$sel:ruleId:RuleSummary' :: RuleSummary -> Text
$sel:name:RuleSummary' :: RuleSummary -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
ruleId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
ruleArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf EventSourceName
eventSourceName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf RulePublishStatus
publishStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [ActionSummary]
actionSummaries
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
createdTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
lastUpdatedTime