{-# 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.IoTEventsData.Types.CustomerAction where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTEventsData.Types.AcknowledgeActionConfiguration
import Amazonka.IoTEventsData.Types.CustomerActionName
import Amazonka.IoTEventsData.Types.DisableActionConfiguration
import Amazonka.IoTEventsData.Types.EnableActionConfiguration
import Amazonka.IoTEventsData.Types.ResetActionConfiguration
import Amazonka.IoTEventsData.Types.SnoozeActionConfiguration
import qualified Amazonka.Prelude as Prelude
data CustomerAction = CustomerAction'
{
CustomerAction -> Maybe AcknowledgeActionConfiguration
acknowledgeActionConfiguration :: Prelude.Maybe AcknowledgeActionConfiguration,
CustomerAction -> Maybe CustomerActionName
actionName :: Prelude.Maybe CustomerActionName,
CustomerAction -> Maybe DisableActionConfiguration
disableActionConfiguration :: Prelude.Maybe DisableActionConfiguration,
CustomerAction -> Maybe EnableActionConfiguration
enableActionConfiguration :: Prelude.Maybe EnableActionConfiguration,
CustomerAction -> Maybe ResetActionConfiguration
resetActionConfiguration :: Prelude.Maybe ResetActionConfiguration,
CustomerAction -> Maybe SnoozeActionConfiguration
snoozeActionConfiguration :: Prelude.Maybe SnoozeActionConfiguration
}
deriving (CustomerAction -> CustomerAction -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomerAction -> CustomerAction -> Bool
$c/= :: CustomerAction -> CustomerAction -> Bool
== :: CustomerAction -> CustomerAction -> Bool
$c== :: CustomerAction -> CustomerAction -> Bool
Prelude.Eq, ReadPrec [CustomerAction]
ReadPrec CustomerAction
Int -> ReadS CustomerAction
ReadS [CustomerAction]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomerAction]
$creadListPrec :: ReadPrec [CustomerAction]
readPrec :: ReadPrec CustomerAction
$creadPrec :: ReadPrec CustomerAction
readList :: ReadS [CustomerAction]
$creadList :: ReadS [CustomerAction]
readsPrec :: Int -> ReadS CustomerAction
$creadsPrec :: Int -> ReadS CustomerAction
Prelude.Read, Int -> CustomerAction -> ShowS
[CustomerAction] -> ShowS
CustomerAction -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomerAction] -> ShowS
$cshowList :: [CustomerAction] -> ShowS
show :: CustomerAction -> String
$cshow :: CustomerAction -> String
showsPrec :: Int -> CustomerAction -> ShowS
$cshowsPrec :: Int -> CustomerAction -> ShowS
Prelude.Show, forall x. Rep CustomerAction x -> CustomerAction
forall x. CustomerAction -> Rep CustomerAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CustomerAction x -> CustomerAction
$cfrom :: forall x. CustomerAction -> Rep CustomerAction x
Prelude.Generic)
newCustomerAction ::
CustomerAction
newCustomerAction :: CustomerAction
newCustomerAction =
CustomerAction'
{ $sel:acknowledgeActionConfiguration:CustomerAction' :: Maybe AcknowledgeActionConfiguration
acknowledgeActionConfiguration =
forall a. Maybe a
Prelude.Nothing,
$sel:actionName:CustomerAction' :: Maybe CustomerActionName
actionName = forall a. Maybe a
Prelude.Nothing,
$sel:disableActionConfiguration:CustomerAction' :: Maybe DisableActionConfiguration
disableActionConfiguration = forall a. Maybe a
Prelude.Nothing,
$sel:enableActionConfiguration:CustomerAction' :: Maybe EnableActionConfiguration
enableActionConfiguration = forall a. Maybe a
Prelude.Nothing,
$sel:resetActionConfiguration:CustomerAction' :: Maybe ResetActionConfiguration
resetActionConfiguration = forall a. Maybe a
Prelude.Nothing,
$sel:snoozeActionConfiguration:CustomerAction' :: Maybe SnoozeActionConfiguration
snoozeActionConfiguration = forall a. Maybe a
Prelude.Nothing
}
customerAction_acknowledgeActionConfiguration :: Lens.Lens' CustomerAction (Prelude.Maybe AcknowledgeActionConfiguration)
customerAction_acknowledgeActionConfiguration :: Lens' CustomerAction (Maybe AcknowledgeActionConfiguration)
customerAction_acknowledgeActionConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomerAction' {Maybe AcknowledgeActionConfiguration
acknowledgeActionConfiguration :: Maybe AcknowledgeActionConfiguration
$sel:acknowledgeActionConfiguration:CustomerAction' :: CustomerAction -> Maybe AcknowledgeActionConfiguration
acknowledgeActionConfiguration} -> Maybe AcknowledgeActionConfiguration
acknowledgeActionConfiguration) (\s :: CustomerAction
s@CustomerAction' {} Maybe AcknowledgeActionConfiguration
a -> CustomerAction
s {$sel:acknowledgeActionConfiguration:CustomerAction' :: Maybe AcknowledgeActionConfiguration
acknowledgeActionConfiguration = Maybe AcknowledgeActionConfiguration
a} :: CustomerAction)
customerAction_actionName :: Lens.Lens' CustomerAction (Prelude.Maybe CustomerActionName)
customerAction_actionName :: Lens' CustomerAction (Maybe CustomerActionName)
customerAction_actionName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomerAction' {Maybe CustomerActionName
actionName :: Maybe CustomerActionName
$sel:actionName:CustomerAction' :: CustomerAction -> Maybe CustomerActionName
actionName} -> Maybe CustomerActionName
actionName) (\s :: CustomerAction
s@CustomerAction' {} Maybe CustomerActionName
a -> CustomerAction
s {$sel:actionName:CustomerAction' :: Maybe CustomerActionName
actionName = Maybe CustomerActionName
a} :: CustomerAction)
customerAction_disableActionConfiguration :: Lens.Lens' CustomerAction (Prelude.Maybe DisableActionConfiguration)
customerAction_disableActionConfiguration :: Lens' CustomerAction (Maybe DisableActionConfiguration)
customerAction_disableActionConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomerAction' {Maybe DisableActionConfiguration
disableActionConfiguration :: Maybe DisableActionConfiguration
$sel:disableActionConfiguration:CustomerAction' :: CustomerAction -> Maybe DisableActionConfiguration
disableActionConfiguration} -> Maybe DisableActionConfiguration
disableActionConfiguration) (\s :: CustomerAction
s@CustomerAction' {} Maybe DisableActionConfiguration
a -> CustomerAction
s {$sel:disableActionConfiguration:CustomerAction' :: Maybe DisableActionConfiguration
disableActionConfiguration = Maybe DisableActionConfiguration
a} :: CustomerAction)
customerAction_enableActionConfiguration :: Lens.Lens' CustomerAction (Prelude.Maybe EnableActionConfiguration)
customerAction_enableActionConfiguration :: Lens' CustomerAction (Maybe EnableActionConfiguration)
customerAction_enableActionConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomerAction' {Maybe EnableActionConfiguration
enableActionConfiguration :: Maybe EnableActionConfiguration
$sel:enableActionConfiguration:CustomerAction' :: CustomerAction -> Maybe EnableActionConfiguration
enableActionConfiguration} -> Maybe EnableActionConfiguration
enableActionConfiguration) (\s :: CustomerAction
s@CustomerAction' {} Maybe EnableActionConfiguration
a -> CustomerAction
s {$sel:enableActionConfiguration:CustomerAction' :: Maybe EnableActionConfiguration
enableActionConfiguration = Maybe EnableActionConfiguration
a} :: CustomerAction)
customerAction_resetActionConfiguration :: Lens.Lens' CustomerAction (Prelude.Maybe ResetActionConfiguration)
customerAction_resetActionConfiguration :: Lens' CustomerAction (Maybe ResetActionConfiguration)
customerAction_resetActionConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomerAction' {Maybe ResetActionConfiguration
resetActionConfiguration :: Maybe ResetActionConfiguration
$sel:resetActionConfiguration:CustomerAction' :: CustomerAction -> Maybe ResetActionConfiguration
resetActionConfiguration} -> Maybe ResetActionConfiguration
resetActionConfiguration) (\s :: CustomerAction
s@CustomerAction' {} Maybe ResetActionConfiguration
a -> CustomerAction
s {$sel:resetActionConfiguration:CustomerAction' :: Maybe ResetActionConfiguration
resetActionConfiguration = Maybe ResetActionConfiguration
a} :: CustomerAction)
customerAction_snoozeActionConfiguration :: Lens.Lens' CustomerAction (Prelude.Maybe SnoozeActionConfiguration)
customerAction_snoozeActionConfiguration :: Lens' CustomerAction (Maybe SnoozeActionConfiguration)
customerAction_snoozeActionConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomerAction' {Maybe SnoozeActionConfiguration
snoozeActionConfiguration :: Maybe SnoozeActionConfiguration
$sel:snoozeActionConfiguration:CustomerAction' :: CustomerAction -> Maybe SnoozeActionConfiguration
snoozeActionConfiguration} -> Maybe SnoozeActionConfiguration
snoozeActionConfiguration) (\s :: CustomerAction
s@CustomerAction' {} Maybe SnoozeActionConfiguration
a -> CustomerAction
s {$sel:snoozeActionConfiguration:CustomerAction' :: Maybe SnoozeActionConfiguration
snoozeActionConfiguration = Maybe SnoozeActionConfiguration
a} :: CustomerAction)
instance Data.FromJSON CustomerAction where
parseJSON :: Value -> Parser CustomerAction
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CustomerAction"
( \Object
x ->
Maybe AcknowledgeActionConfiguration
-> Maybe CustomerActionName
-> Maybe DisableActionConfiguration
-> Maybe EnableActionConfiguration
-> Maybe ResetActionConfiguration
-> Maybe SnoozeActionConfiguration
-> CustomerAction
CustomerAction'
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
"acknowledgeActionConfiguration")
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
"actionName")
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
"disableActionConfiguration")
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
"enableActionConfiguration")
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
"resetActionConfiguration")
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
"snoozeActionConfiguration")
)
instance Prelude.Hashable CustomerAction where
hashWithSalt :: Int -> CustomerAction -> Int
hashWithSalt Int
_salt CustomerAction' {Maybe AcknowledgeActionConfiguration
Maybe CustomerActionName
Maybe DisableActionConfiguration
Maybe EnableActionConfiguration
Maybe ResetActionConfiguration
Maybe SnoozeActionConfiguration
snoozeActionConfiguration :: Maybe SnoozeActionConfiguration
resetActionConfiguration :: Maybe ResetActionConfiguration
enableActionConfiguration :: Maybe EnableActionConfiguration
disableActionConfiguration :: Maybe DisableActionConfiguration
actionName :: Maybe CustomerActionName
acknowledgeActionConfiguration :: Maybe AcknowledgeActionConfiguration
$sel:snoozeActionConfiguration:CustomerAction' :: CustomerAction -> Maybe SnoozeActionConfiguration
$sel:resetActionConfiguration:CustomerAction' :: CustomerAction -> Maybe ResetActionConfiguration
$sel:enableActionConfiguration:CustomerAction' :: CustomerAction -> Maybe EnableActionConfiguration
$sel:disableActionConfiguration:CustomerAction' :: CustomerAction -> Maybe DisableActionConfiguration
$sel:actionName:CustomerAction' :: CustomerAction -> Maybe CustomerActionName
$sel:acknowledgeActionConfiguration:CustomerAction' :: CustomerAction -> Maybe AcknowledgeActionConfiguration
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AcknowledgeActionConfiguration
acknowledgeActionConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CustomerActionName
actionName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DisableActionConfiguration
disableActionConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EnableActionConfiguration
enableActionConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResetActionConfiguration
resetActionConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SnoozeActionConfiguration
snoozeActionConfiguration
instance Prelude.NFData CustomerAction where
rnf :: CustomerAction -> ()
rnf CustomerAction' {Maybe AcknowledgeActionConfiguration
Maybe CustomerActionName
Maybe DisableActionConfiguration
Maybe EnableActionConfiguration
Maybe ResetActionConfiguration
Maybe SnoozeActionConfiguration
snoozeActionConfiguration :: Maybe SnoozeActionConfiguration
resetActionConfiguration :: Maybe ResetActionConfiguration
enableActionConfiguration :: Maybe EnableActionConfiguration
disableActionConfiguration :: Maybe DisableActionConfiguration
actionName :: Maybe CustomerActionName
acknowledgeActionConfiguration :: Maybe AcknowledgeActionConfiguration
$sel:snoozeActionConfiguration:CustomerAction' :: CustomerAction -> Maybe SnoozeActionConfiguration
$sel:resetActionConfiguration:CustomerAction' :: CustomerAction -> Maybe ResetActionConfiguration
$sel:enableActionConfiguration:CustomerAction' :: CustomerAction -> Maybe EnableActionConfiguration
$sel:disableActionConfiguration:CustomerAction' :: CustomerAction -> Maybe DisableActionConfiguration
$sel:actionName:CustomerAction' :: CustomerAction -> Maybe CustomerActionName
$sel:acknowledgeActionConfiguration:CustomerAction' :: CustomerAction -> Maybe AcknowledgeActionConfiguration
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AcknowledgeActionConfiguration
acknowledgeActionConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CustomerActionName
actionName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DisableActionConfiguration
disableActionConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EnableActionConfiguration
enableActionConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResetActionConfiguration
resetActionConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SnoozeActionConfiguration
snoozeActionConfiguration