{-# 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 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CustomerAction = CustomerAction'
{
CustomerAction -> Maybe ResetActionConfiguration
resetActionConfiguration :: Prelude.Maybe ResetActionConfiguration,
CustomerAction -> Maybe CustomerActionName
actionName :: Prelude.Maybe CustomerActionName,
CustomerAction -> Maybe SnoozeActionConfiguration
snoozeActionConfiguration :: Prelude.Maybe SnoozeActionConfiguration,
CustomerAction -> Maybe EnableActionConfiguration
enableActionConfiguration :: Prelude.Maybe EnableActionConfiguration,
CustomerAction -> Maybe DisableActionConfiguration
disableActionConfiguration :: Prelude.Maybe DisableActionConfiguration,
CustomerAction -> Maybe AcknowledgeActionConfiguration
acknowledgeActionConfiguration :: Prelude.Maybe AcknowledgeActionConfiguration
}
deriving (CustomerAction -> CustomerAction -> Bool
(CustomerAction -> CustomerAction -> Bool)
-> (CustomerAction -> CustomerAction -> Bool) -> Eq CustomerAction
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]
(Int -> ReadS CustomerAction)
-> ReadS [CustomerAction]
-> ReadPrec CustomerAction
-> ReadPrec [CustomerAction]
-> Read 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
(Int -> CustomerAction -> ShowS)
-> (CustomerAction -> String)
-> ([CustomerAction] -> ShowS)
-> Show CustomerAction
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. CustomerAction -> Rep CustomerAction x)
-> (forall x. Rep CustomerAction x -> CustomerAction)
-> Generic CustomerAction
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' :: Maybe ResetActionConfiguration
-> Maybe CustomerActionName
-> Maybe SnoozeActionConfiguration
-> Maybe EnableActionConfiguration
-> Maybe DisableActionConfiguration
-> Maybe AcknowledgeActionConfiguration
-> CustomerAction
CustomerAction'
{ $sel:resetActionConfiguration:CustomerAction' :: Maybe ResetActionConfiguration
resetActionConfiguration =
Maybe ResetActionConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:actionName:CustomerAction' :: Maybe CustomerActionName
actionName = Maybe CustomerActionName
forall a. Maybe a
Prelude.Nothing,
$sel:snoozeActionConfiguration:CustomerAction' :: Maybe SnoozeActionConfiguration
snoozeActionConfiguration = Maybe SnoozeActionConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:enableActionConfiguration:CustomerAction' :: Maybe EnableActionConfiguration
enableActionConfiguration = Maybe EnableActionConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:disableActionConfiguration:CustomerAction' :: Maybe DisableActionConfiguration
disableActionConfiguration = Maybe DisableActionConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:acknowledgeActionConfiguration:CustomerAction' :: Maybe AcknowledgeActionConfiguration
acknowledgeActionConfiguration = Maybe AcknowledgeActionConfiguration
forall a. Maybe a
Prelude.Nothing
}
customerAction_resetActionConfiguration :: Lens.Lens' CustomerAction (Prelude.Maybe ResetActionConfiguration)
customerAction_resetActionConfiguration :: (Maybe ResetActionConfiguration
-> f (Maybe ResetActionConfiguration))
-> CustomerAction -> f CustomerAction
customerAction_resetActionConfiguration = (CustomerAction -> Maybe ResetActionConfiguration)
-> (CustomerAction
-> Maybe ResetActionConfiguration -> CustomerAction)
-> Lens
CustomerAction
CustomerAction
(Maybe ResetActionConfiguration)
(Maybe 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_actionName :: Lens.Lens' CustomerAction (Prelude.Maybe CustomerActionName)
customerAction_actionName :: (Maybe CustomerActionName -> f (Maybe CustomerActionName))
-> CustomerAction -> f CustomerAction
customerAction_actionName = (CustomerAction -> Maybe CustomerActionName)
-> (CustomerAction -> Maybe CustomerActionName -> CustomerAction)
-> Lens
CustomerAction
CustomerAction
(Maybe CustomerActionName)
(Maybe CustomerActionName)
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_snoozeActionConfiguration :: Lens.Lens' CustomerAction (Prelude.Maybe SnoozeActionConfiguration)
customerAction_snoozeActionConfiguration :: (Maybe SnoozeActionConfiguration
-> f (Maybe SnoozeActionConfiguration))
-> CustomerAction -> f CustomerAction
customerAction_snoozeActionConfiguration = (CustomerAction -> Maybe SnoozeActionConfiguration)
-> (CustomerAction
-> Maybe SnoozeActionConfiguration -> CustomerAction)
-> Lens
CustomerAction
CustomerAction
(Maybe SnoozeActionConfiguration)
(Maybe 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)
customerAction_enableActionConfiguration :: Lens.Lens' CustomerAction (Prelude.Maybe EnableActionConfiguration)
customerAction_enableActionConfiguration :: (Maybe EnableActionConfiguration
-> f (Maybe EnableActionConfiguration))
-> CustomerAction -> f CustomerAction
customerAction_enableActionConfiguration = (CustomerAction -> Maybe EnableActionConfiguration)
-> (CustomerAction
-> Maybe EnableActionConfiguration -> CustomerAction)
-> Lens
CustomerAction
CustomerAction
(Maybe EnableActionConfiguration)
(Maybe 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_disableActionConfiguration :: Lens.Lens' CustomerAction (Prelude.Maybe DisableActionConfiguration)
customerAction_disableActionConfiguration :: (Maybe DisableActionConfiguration
-> f (Maybe DisableActionConfiguration))
-> CustomerAction -> f CustomerAction
customerAction_disableActionConfiguration = (CustomerAction -> Maybe DisableActionConfiguration)
-> (CustomerAction
-> Maybe DisableActionConfiguration -> CustomerAction)
-> Lens
CustomerAction
CustomerAction
(Maybe DisableActionConfiguration)
(Maybe 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_acknowledgeActionConfiguration :: Lens.Lens' CustomerAction (Prelude.Maybe AcknowledgeActionConfiguration)
customerAction_acknowledgeActionConfiguration :: (Maybe AcknowledgeActionConfiguration
-> f (Maybe AcknowledgeActionConfiguration))
-> CustomerAction -> f CustomerAction
customerAction_acknowledgeActionConfiguration = (CustomerAction -> Maybe AcknowledgeActionConfiguration)
-> (CustomerAction
-> Maybe AcknowledgeActionConfiguration -> CustomerAction)
-> Lens
CustomerAction
CustomerAction
(Maybe AcknowledgeActionConfiguration)
(Maybe 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)
instance Core.FromJSON CustomerAction where
parseJSON :: Value -> Parser CustomerAction
parseJSON =
String
-> (Object -> Parser CustomerAction)
-> Value
-> Parser CustomerAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CustomerAction"
( \Object
x ->
Maybe ResetActionConfiguration
-> Maybe CustomerActionName
-> Maybe SnoozeActionConfiguration
-> Maybe EnableActionConfiguration
-> Maybe DisableActionConfiguration
-> Maybe AcknowledgeActionConfiguration
-> CustomerAction
CustomerAction'
(Maybe ResetActionConfiguration
-> Maybe CustomerActionName
-> Maybe SnoozeActionConfiguration
-> Maybe EnableActionConfiguration
-> Maybe DisableActionConfiguration
-> Maybe AcknowledgeActionConfiguration
-> CustomerAction)
-> Parser (Maybe ResetActionConfiguration)
-> Parser
(Maybe CustomerActionName
-> Maybe SnoozeActionConfiguration
-> Maybe EnableActionConfiguration
-> Maybe DisableActionConfiguration
-> Maybe AcknowledgeActionConfiguration
-> CustomerAction)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ResetActionConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resetActionConfiguration")
Parser
(Maybe CustomerActionName
-> Maybe SnoozeActionConfiguration
-> Maybe EnableActionConfiguration
-> Maybe DisableActionConfiguration
-> Maybe AcknowledgeActionConfiguration
-> CustomerAction)
-> Parser (Maybe CustomerActionName)
-> Parser
(Maybe SnoozeActionConfiguration
-> Maybe EnableActionConfiguration
-> Maybe DisableActionConfiguration
-> Maybe AcknowledgeActionConfiguration
-> CustomerAction)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CustomerActionName)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"actionName")
Parser
(Maybe SnoozeActionConfiguration
-> Maybe EnableActionConfiguration
-> Maybe DisableActionConfiguration
-> Maybe AcknowledgeActionConfiguration
-> CustomerAction)
-> Parser (Maybe SnoozeActionConfiguration)
-> Parser
(Maybe EnableActionConfiguration
-> Maybe DisableActionConfiguration
-> Maybe AcknowledgeActionConfiguration
-> CustomerAction)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SnoozeActionConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"snoozeActionConfiguration")
Parser
(Maybe EnableActionConfiguration
-> Maybe DisableActionConfiguration
-> Maybe AcknowledgeActionConfiguration
-> CustomerAction)
-> Parser (Maybe EnableActionConfiguration)
-> Parser
(Maybe DisableActionConfiguration
-> Maybe AcknowledgeActionConfiguration -> CustomerAction)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EnableActionConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"enableActionConfiguration")
Parser
(Maybe DisableActionConfiguration
-> Maybe AcknowledgeActionConfiguration -> CustomerAction)
-> Parser (Maybe DisableActionConfiguration)
-> Parser (Maybe AcknowledgeActionConfiguration -> CustomerAction)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DisableActionConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"disableActionConfiguration")
Parser (Maybe AcknowledgeActionConfiguration -> CustomerAction)
-> Parser (Maybe AcknowledgeActionConfiguration)
-> Parser CustomerAction
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AcknowledgeActionConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"acknowledgeActionConfiguration")
)
instance Prelude.Hashable CustomerAction
instance Prelude.NFData CustomerAction