{-# 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.MediaLive.Types.ScheduleAction where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaLive.Types.ScheduleActionSettings
import Amazonka.MediaLive.Types.ScheduleActionStartSettings
import qualified Amazonka.Prelude as Prelude
data ScheduleAction = ScheduleAction'
{
ScheduleAction -> Text
actionName :: Prelude.Text,
ScheduleAction -> ScheduleActionStartSettings
scheduleActionStartSettings :: ScheduleActionStartSettings,
ScheduleAction -> ScheduleActionSettings
scheduleActionSettings :: ScheduleActionSettings
}
deriving (ScheduleAction -> ScheduleAction -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ScheduleAction -> ScheduleAction -> Bool
$c/= :: ScheduleAction -> ScheduleAction -> Bool
== :: ScheduleAction -> ScheduleAction -> Bool
$c== :: ScheduleAction -> ScheduleAction -> Bool
Prelude.Eq, ReadPrec [ScheduleAction]
ReadPrec ScheduleAction
Int -> ReadS ScheduleAction
ReadS [ScheduleAction]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ScheduleAction]
$creadListPrec :: ReadPrec [ScheduleAction]
readPrec :: ReadPrec ScheduleAction
$creadPrec :: ReadPrec ScheduleAction
readList :: ReadS [ScheduleAction]
$creadList :: ReadS [ScheduleAction]
readsPrec :: Int -> ReadS ScheduleAction
$creadsPrec :: Int -> ReadS ScheduleAction
Prelude.Read, Int -> ScheduleAction -> ShowS
[ScheduleAction] -> ShowS
ScheduleAction -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ScheduleAction] -> ShowS
$cshowList :: [ScheduleAction] -> ShowS
show :: ScheduleAction -> String
$cshow :: ScheduleAction -> String
showsPrec :: Int -> ScheduleAction -> ShowS
$cshowsPrec :: Int -> ScheduleAction -> ShowS
Prelude.Show, forall x. Rep ScheduleAction x -> ScheduleAction
forall x. ScheduleAction -> Rep ScheduleAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ScheduleAction x -> ScheduleAction
$cfrom :: forall x. ScheduleAction -> Rep ScheduleAction x
Prelude.Generic)
newScheduleAction ::
Prelude.Text ->
ScheduleActionStartSettings ->
ScheduleActionSettings ->
ScheduleAction
newScheduleAction :: Text
-> ScheduleActionStartSettings
-> ScheduleActionSettings
-> ScheduleAction
newScheduleAction
Text
pActionName_
ScheduleActionStartSettings
pScheduleActionStartSettings_
ScheduleActionSettings
pScheduleActionSettings_ =
ScheduleAction'
{ $sel:actionName:ScheduleAction' :: Text
actionName = Text
pActionName_,
$sel:scheduleActionStartSettings:ScheduleAction' :: ScheduleActionStartSettings
scheduleActionStartSettings =
ScheduleActionStartSettings
pScheduleActionStartSettings_,
$sel:scheduleActionSettings:ScheduleAction' :: ScheduleActionSettings
scheduleActionSettings = ScheduleActionSettings
pScheduleActionSettings_
}
scheduleAction_actionName :: Lens.Lens' ScheduleAction Prelude.Text
scheduleAction_actionName :: Lens' ScheduleAction Text
scheduleAction_actionName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduleAction' {Text
actionName :: Text
$sel:actionName:ScheduleAction' :: ScheduleAction -> Text
actionName} -> Text
actionName) (\s :: ScheduleAction
s@ScheduleAction' {} Text
a -> ScheduleAction
s {$sel:actionName:ScheduleAction' :: Text
actionName = Text
a} :: ScheduleAction)
scheduleAction_scheduleActionStartSettings :: Lens.Lens' ScheduleAction ScheduleActionStartSettings
scheduleAction_scheduleActionStartSettings :: Lens' ScheduleAction ScheduleActionStartSettings
scheduleAction_scheduleActionStartSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduleAction' {ScheduleActionStartSettings
scheduleActionStartSettings :: ScheduleActionStartSettings
$sel:scheduleActionStartSettings:ScheduleAction' :: ScheduleAction -> ScheduleActionStartSettings
scheduleActionStartSettings} -> ScheduleActionStartSettings
scheduleActionStartSettings) (\s :: ScheduleAction
s@ScheduleAction' {} ScheduleActionStartSettings
a -> ScheduleAction
s {$sel:scheduleActionStartSettings:ScheduleAction' :: ScheduleActionStartSettings
scheduleActionStartSettings = ScheduleActionStartSettings
a} :: ScheduleAction)
scheduleAction_scheduleActionSettings :: Lens.Lens' ScheduleAction ScheduleActionSettings
scheduleAction_scheduleActionSettings :: Lens' ScheduleAction ScheduleActionSettings
scheduleAction_scheduleActionSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduleAction' {ScheduleActionSettings
scheduleActionSettings :: ScheduleActionSettings
$sel:scheduleActionSettings:ScheduleAction' :: ScheduleAction -> ScheduleActionSettings
scheduleActionSettings} -> ScheduleActionSettings
scheduleActionSettings) (\s :: ScheduleAction
s@ScheduleAction' {} ScheduleActionSettings
a -> ScheduleAction
s {$sel:scheduleActionSettings:ScheduleAction' :: ScheduleActionSettings
scheduleActionSettings = ScheduleActionSettings
a} :: ScheduleAction)
instance Data.FromJSON ScheduleAction where
parseJSON :: Value -> Parser ScheduleAction
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ScheduleAction"
( \Object
x ->
Text
-> ScheduleActionStartSettings
-> ScheduleActionSettings
-> ScheduleAction
ScheduleAction'
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
"actionName")
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
"scheduleActionStartSettings")
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
"scheduleActionSettings")
)
instance Prelude.Hashable ScheduleAction where
hashWithSalt :: Int -> ScheduleAction -> Int
hashWithSalt Int
_salt ScheduleAction' {Text
ScheduleActionStartSettings
ScheduleActionSettings
scheduleActionSettings :: ScheduleActionSettings
scheduleActionStartSettings :: ScheduleActionStartSettings
actionName :: Text
$sel:scheduleActionSettings:ScheduleAction' :: ScheduleAction -> ScheduleActionSettings
$sel:scheduleActionStartSettings:ScheduleAction' :: ScheduleAction -> ScheduleActionStartSettings
$sel:actionName:ScheduleAction' :: ScheduleAction -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
actionName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ScheduleActionStartSettings
scheduleActionStartSettings
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ScheduleActionSettings
scheduleActionSettings
instance Prelude.NFData ScheduleAction where
rnf :: ScheduleAction -> ()
rnf ScheduleAction' {Text
ScheduleActionStartSettings
ScheduleActionSettings
scheduleActionSettings :: ScheduleActionSettings
scheduleActionStartSettings :: ScheduleActionStartSettings
actionName :: Text
$sel:scheduleActionSettings:ScheduleAction' :: ScheduleAction -> ScheduleActionSettings
$sel:scheduleActionStartSettings:ScheduleAction' :: ScheduleAction -> ScheduleActionStartSettings
$sel:actionName:ScheduleAction' :: ScheduleAction -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
actionName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ScheduleActionStartSettings
scheduleActionStartSettings
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ScheduleActionSettings
scheduleActionSettings
instance Data.ToJSON ScheduleAction where
toJSON :: ScheduleAction -> Value
toJSON ScheduleAction' {Text
ScheduleActionStartSettings
ScheduleActionSettings
scheduleActionSettings :: ScheduleActionSettings
scheduleActionStartSettings :: ScheduleActionStartSettings
actionName :: Text
$sel:scheduleActionSettings:ScheduleAction' :: ScheduleAction -> ScheduleActionSettings
$sel:scheduleActionStartSettings:ScheduleAction' :: ScheduleAction -> ScheduleActionStartSettings
$sel:actionName:ScheduleAction' :: ScheduleAction -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"actionName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
actionName),
forall a. a -> Maybe a
Prelude.Just
( Key
"scheduleActionStartSettings"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ScheduleActionStartSettings
scheduleActionStartSettings
),
forall a. a -> Maybe a
Prelude.Just
( Key
"scheduleActionSettings"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ScheduleActionSettings
scheduleActionSettings
)
]
)