{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Redshift.ModifyScheduledAction
(
ModifyScheduledAction (..),
newModifyScheduledAction,
modifyScheduledAction_targetAction,
modifyScheduledAction_startTime,
modifyScheduledAction_schedule,
modifyScheduledAction_scheduledActionDescription,
modifyScheduledAction_enable,
modifyScheduledAction_endTime,
modifyScheduledAction_iamRole,
modifyScheduledAction_scheduledActionName,
ScheduledAction (..),
newScheduledAction,
scheduledAction_state,
scheduledAction_targetAction,
scheduledAction_startTime,
scheduledAction_schedule,
scheduledAction_scheduledActionName,
scheduledAction_scheduledActionDescription,
scheduledAction_nextInvocations,
scheduledAction_endTime,
scheduledAction_iamRole,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ModifyScheduledAction = ModifyScheduledAction'
{
ModifyScheduledAction -> Maybe ScheduledActionType
targetAction :: Prelude.Maybe ScheduledActionType,
ModifyScheduledAction -> Maybe ISO8601
startTime :: Prelude.Maybe Core.ISO8601,
ModifyScheduledAction -> Maybe Text
schedule :: Prelude.Maybe Prelude.Text,
ModifyScheduledAction -> Maybe Text
scheduledActionDescription :: Prelude.Maybe Prelude.Text,
ModifyScheduledAction -> Maybe Bool
enable :: Prelude.Maybe Prelude.Bool,
ModifyScheduledAction -> Maybe ISO8601
endTime :: Prelude.Maybe Core.ISO8601,
ModifyScheduledAction -> Maybe Text
iamRole :: Prelude.Maybe Prelude.Text,
ModifyScheduledAction -> Text
scheduledActionName :: Prelude.Text
}
deriving (ModifyScheduledAction -> ModifyScheduledAction -> Bool
(ModifyScheduledAction -> ModifyScheduledAction -> Bool)
-> (ModifyScheduledAction -> ModifyScheduledAction -> Bool)
-> Eq ModifyScheduledAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyScheduledAction -> ModifyScheduledAction -> Bool
$c/= :: ModifyScheduledAction -> ModifyScheduledAction -> Bool
== :: ModifyScheduledAction -> ModifyScheduledAction -> Bool
$c== :: ModifyScheduledAction -> ModifyScheduledAction -> Bool
Prelude.Eq, ReadPrec [ModifyScheduledAction]
ReadPrec ModifyScheduledAction
Int -> ReadS ModifyScheduledAction
ReadS [ModifyScheduledAction]
(Int -> ReadS ModifyScheduledAction)
-> ReadS [ModifyScheduledAction]
-> ReadPrec ModifyScheduledAction
-> ReadPrec [ModifyScheduledAction]
-> Read ModifyScheduledAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyScheduledAction]
$creadListPrec :: ReadPrec [ModifyScheduledAction]
readPrec :: ReadPrec ModifyScheduledAction
$creadPrec :: ReadPrec ModifyScheduledAction
readList :: ReadS [ModifyScheduledAction]
$creadList :: ReadS [ModifyScheduledAction]
readsPrec :: Int -> ReadS ModifyScheduledAction
$creadsPrec :: Int -> ReadS ModifyScheduledAction
Prelude.Read, Int -> ModifyScheduledAction -> ShowS
[ModifyScheduledAction] -> ShowS
ModifyScheduledAction -> String
(Int -> ModifyScheduledAction -> ShowS)
-> (ModifyScheduledAction -> String)
-> ([ModifyScheduledAction] -> ShowS)
-> Show ModifyScheduledAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyScheduledAction] -> ShowS
$cshowList :: [ModifyScheduledAction] -> ShowS
show :: ModifyScheduledAction -> String
$cshow :: ModifyScheduledAction -> String
showsPrec :: Int -> ModifyScheduledAction -> ShowS
$cshowsPrec :: Int -> ModifyScheduledAction -> ShowS
Prelude.Show, (forall x. ModifyScheduledAction -> Rep ModifyScheduledAction x)
-> (forall x. Rep ModifyScheduledAction x -> ModifyScheduledAction)
-> Generic ModifyScheduledAction
forall x. Rep ModifyScheduledAction x -> ModifyScheduledAction
forall x. ModifyScheduledAction -> Rep ModifyScheduledAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModifyScheduledAction x -> ModifyScheduledAction
$cfrom :: forall x. ModifyScheduledAction -> Rep ModifyScheduledAction x
Prelude.Generic)
newModifyScheduledAction ::
Prelude.Text ->
ModifyScheduledAction
newModifyScheduledAction :: Text -> ModifyScheduledAction
newModifyScheduledAction Text
pScheduledActionName_ =
ModifyScheduledAction' :: Maybe ScheduledActionType
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe ISO8601
-> Maybe Text
-> Text
-> ModifyScheduledAction
ModifyScheduledAction'
{ $sel:targetAction:ModifyScheduledAction' :: Maybe ScheduledActionType
targetAction =
Maybe ScheduledActionType
forall a. Maybe a
Prelude.Nothing,
$sel:startTime:ModifyScheduledAction' :: Maybe ISO8601
startTime = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
$sel:schedule:ModifyScheduledAction' :: Maybe Text
schedule = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:scheduledActionDescription:ModifyScheduledAction' :: Maybe Text
scheduledActionDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:enable:ModifyScheduledAction' :: Maybe Bool
enable = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:endTime:ModifyScheduledAction' :: Maybe ISO8601
endTime = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
$sel:iamRole:ModifyScheduledAction' :: Maybe Text
iamRole = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:scheduledActionName:ModifyScheduledAction' :: Text
scheduledActionName = Text
pScheduledActionName_
}
modifyScheduledAction_targetAction :: Lens.Lens' ModifyScheduledAction (Prelude.Maybe ScheduledActionType)
modifyScheduledAction_targetAction :: (Maybe ScheduledActionType -> f (Maybe ScheduledActionType))
-> ModifyScheduledAction -> f ModifyScheduledAction
modifyScheduledAction_targetAction = (ModifyScheduledAction -> Maybe ScheduledActionType)
-> (ModifyScheduledAction
-> Maybe ScheduledActionType -> ModifyScheduledAction)
-> Lens
ModifyScheduledAction
ModifyScheduledAction
(Maybe ScheduledActionType)
(Maybe ScheduledActionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyScheduledAction' {Maybe ScheduledActionType
targetAction :: Maybe ScheduledActionType
$sel:targetAction:ModifyScheduledAction' :: ModifyScheduledAction -> Maybe ScheduledActionType
targetAction} -> Maybe ScheduledActionType
targetAction) (\s :: ModifyScheduledAction
s@ModifyScheduledAction' {} Maybe ScheduledActionType
a -> ModifyScheduledAction
s {$sel:targetAction:ModifyScheduledAction' :: Maybe ScheduledActionType
targetAction = Maybe ScheduledActionType
a} :: ModifyScheduledAction)
modifyScheduledAction_startTime :: Lens.Lens' ModifyScheduledAction (Prelude.Maybe Prelude.UTCTime)
modifyScheduledAction_startTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ModifyScheduledAction -> f ModifyScheduledAction
modifyScheduledAction_startTime = (ModifyScheduledAction -> Maybe ISO8601)
-> (ModifyScheduledAction
-> Maybe ISO8601 -> ModifyScheduledAction)
-> Lens
ModifyScheduledAction
ModifyScheduledAction
(Maybe ISO8601)
(Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyScheduledAction' {Maybe ISO8601
startTime :: Maybe ISO8601
$sel:startTime:ModifyScheduledAction' :: ModifyScheduledAction -> Maybe ISO8601
startTime} -> Maybe ISO8601
startTime) (\s :: ModifyScheduledAction
s@ModifyScheduledAction' {} Maybe ISO8601
a -> ModifyScheduledAction
s {$sel:startTime:ModifyScheduledAction' :: Maybe ISO8601
startTime = Maybe ISO8601
a} :: ModifyScheduledAction) ((Maybe ISO8601 -> f (Maybe ISO8601))
-> ModifyScheduledAction -> f ModifyScheduledAction)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ModifyScheduledAction
-> f ModifyScheduledAction
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
(Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
modifyScheduledAction_schedule :: Lens.Lens' ModifyScheduledAction (Prelude.Maybe Prelude.Text)
modifyScheduledAction_schedule :: (Maybe Text -> f (Maybe Text))
-> ModifyScheduledAction -> f ModifyScheduledAction
modifyScheduledAction_schedule = (ModifyScheduledAction -> Maybe Text)
-> (ModifyScheduledAction -> Maybe Text -> ModifyScheduledAction)
-> Lens
ModifyScheduledAction
ModifyScheduledAction
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyScheduledAction' {Maybe Text
schedule :: Maybe Text
$sel:schedule:ModifyScheduledAction' :: ModifyScheduledAction -> Maybe Text
schedule} -> Maybe Text
schedule) (\s :: ModifyScheduledAction
s@ModifyScheduledAction' {} Maybe Text
a -> ModifyScheduledAction
s {$sel:schedule:ModifyScheduledAction' :: Maybe Text
schedule = Maybe Text
a} :: ModifyScheduledAction)
modifyScheduledAction_scheduledActionDescription :: Lens.Lens' ModifyScheduledAction (Prelude.Maybe Prelude.Text)
modifyScheduledAction_scheduledActionDescription :: (Maybe Text -> f (Maybe Text))
-> ModifyScheduledAction -> f ModifyScheduledAction
modifyScheduledAction_scheduledActionDescription = (ModifyScheduledAction -> Maybe Text)
-> (ModifyScheduledAction -> Maybe Text -> ModifyScheduledAction)
-> Lens
ModifyScheduledAction
ModifyScheduledAction
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyScheduledAction' {Maybe Text
scheduledActionDescription :: Maybe Text
$sel:scheduledActionDescription:ModifyScheduledAction' :: ModifyScheduledAction -> Maybe Text
scheduledActionDescription} -> Maybe Text
scheduledActionDescription) (\s :: ModifyScheduledAction
s@ModifyScheduledAction' {} Maybe Text
a -> ModifyScheduledAction
s {$sel:scheduledActionDescription:ModifyScheduledAction' :: Maybe Text
scheduledActionDescription = Maybe Text
a} :: ModifyScheduledAction)
modifyScheduledAction_enable :: Lens.Lens' ModifyScheduledAction (Prelude.Maybe Prelude.Bool)
modifyScheduledAction_enable :: (Maybe Bool -> f (Maybe Bool))
-> ModifyScheduledAction -> f ModifyScheduledAction
modifyScheduledAction_enable = (ModifyScheduledAction -> Maybe Bool)
-> (ModifyScheduledAction -> Maybe Bool -> ModifyScheduledAction)
-> Lens
ModifyScheduledAction
ModifyScheduledAction
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyScheduledAction' {Maybe Bool
enable :: Maybe Bool
$sel:enable:ModifyScheduledAction' :: ModifyScheduledAction -> Maybe Bool
enable} -> Maybe Bool
enable) (\s :: ModifyScheduledAction
s@ModifyScheduledAction' {} Maybe Bool
a -> ModifyScheduledAction
s {$sel:enable:ModifyScheduledAction' :: Maybe Bool
enable = Maybe Bool
a} :: ModifyScheduledAction)
modifyScheduledAction_endTime :: Lens.Lens' ModifyScheduledAction (Prelude.Maybe Prelude.UTCTime)
modifyScheduledAction_endTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ModifyScheduledAction -> f ModifyScheduledAction
modifyScheduledAction_endTime = (ModifyScheduledAction -> Maybe ISO8601)
-> (ModifyScheduledAction
-> Maybe ISO8601 -> ModifyScheduledAction)
-> Lens
ModifyScheduledAction
ModifyScheduledAction
(Maybe ISO8601)
(Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyScheduledAction' {Maybe ISO8601
endTime :: Maybe ISO8601
$sel:endTime:ModifyScheduledAction' :: ModifyScheduledAction -> Maybe ISO8601
endTime} -> Maybe ISO8601
endTime) (\s :: ModifyScheduledAction
s@ModifyScheduledAction' {} Maybe ISO8601
a -> ModifyScheduledAction
s {$sel:endTime:ModifyScheduledAction' :: Maybe ISO8601
endTime = Maybe ISO8601
a} :: ModifyScheduledAction) ((Maybe ISO8601 -> f (Maybe ISO8601))
-> ModifyScheduledAction -> f ModifyScheduledAction)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ModifyScheduledAction
-> f ModifyScheduledAction
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
(Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
modifyScheduledAction_iamRole :: Lens.Lens' ModifyScheduledAction (Prelude.Maybe Prelude.Text)
modifyScheduledAction_iamRole :: (Maybe Text -> f (Maybe Text))
-> ModifyScheduledAction -> f ModifyScheduledAction
modifyScheduledAction_iamRole = (ModifyScheduledAction -> Maybe Text)
-> (ModifyScheduledAction -> Maybe Text -> ModifyScheduledAction)
-> Lens
ModifyScheduledAction
ModifyScheduledAction
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyScheduledAction' {Maybe Text
iamRole :: Maybe Text
$sel:iamRole:ModifyScheduledAction' :: ModifyScheduledAction -> Maybe Text
iamRole} -> Maybe Text
iamRole) (\s :: ModifyScheduledAction
s@ModifyScheduledAction' {} Maybe Text
a -> ModifyScheduledAction
s {$sel:iamRole:ModifyScheduledAction' :: Maybe Text
iamRole = Maybe Text
a} :: ModifyScheduledAction)
modifyScheduledAction_scheduledActionName :: Lens.Lens' ModifyScheduledAction Prelude.Text
modifyScheduledAction_scheduledActionName :: (Text -> f Text)
-> ModifyScheduledAction -> f ModifyScheduledAction
modifyScheduledAction_scheduledActionName = (ModifyScheduledAction -> Text)
-> (ModifyScheduledAction -> Text -> ModifyScheduledAction)
-> Lens ModifyScheduledAction ModifyScheduledAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyScheduledAction' {Text
scheduledActionName :: Text
$sel:scheduledActionName:ModifyScheduledAction' :: ModifyScheduledAction -> Text
scheduledActionName} -> Text
scheduledActionName) (\s :: ModifyScheduledAction
s@ModifyScheduledAction' {} Text
a -> ModifyScheduledAction
s {$sel:scheduledActionName:ModifyScheduledAction' :: Text
scheduledActionName = Text
a} :: ModifyScheduledAction)
instance Core.AWSRequest ModifyScheduledAction where
type
AWSResponse ModifyScheduledAction =
ScheduledAction
request :: ModifyScheduledAction -> Request ModifyScheduledAction
request = Service -> ModifyScheduledAction -> Request ModifyScheduledAction
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy ModifyScheduledAction
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ModifyScheduledAction)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse ModifyScheduledAction))
-> Logger
-> Service
-> Proxy ModifyScheduledAction
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ModifyScheduledAction)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"ModifyScheduledActionResult"
(\Int
s ResponseHeaders
h [Node]
x -> [Node] -> Either String ScheduledAction
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
instance Prelude.Hashable ModifyScheduledAction
instance Prelude.NFData ModifyScheduledAction
instance Core.ToHeaders ModifyScheduledAction where
toHeaders :: ModifyScheduledAction -> ResponseHeaders
toHeaders = ResponseHeaders -> ModifyScheduledAction -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ModifyScheduledAction where
toPath :: ModifyScheduledAction -> ByteString
toPath = ByteString -> ModifyScheduledAction -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ModifyScheduledAction where
toQuery :: ModifyScheduledAction -> QueryString
toQuery ModifyScheduledAction' {Maybe Bool
Maybe Text
Maybe ISO8601
Maybe ScheduledActionType
Text
scheduledActionName :: Text
iamRole :: Maybe Text
endTime :: Maybe ISO8601
enable :: Maybe Bool
scheduledActionDescription :: Maybe Text
schedule :: Maybe Text
startTime :: Maybe ISO8601
targetAction :: Maybe ScheduledActionType
$sel:scheduledActionName:ModifyScheduledAction' :: ModifyScheduledAction -> Text
$sel:iamRole:ModifyScheduledAction' :: ModifyScheduledAction -> Maybe Text
$sel:endTime:ModifyScheduledAction' :: ModifyScheduledAction -> Maybe ISO8601
$sel:enable:ModifyScheduledAction' :: ModifyScheduledAction -> Maybe Bool
$sel:scheduledActionDescription:ModifyScheduledAction' :: ModifyScheduledAction -> Maybe Text
$sel:schedule:ModifyScheduledAction' :: ModifyScheduledAction -> Maybe Text
$sel:startTime:ModifyScheduledAction' :: ModifyScheduledAction -> Maybe ISO8601
$sel:targetAction:ModifyScheduledAction' :: ModifyScheduledAction -> Maybe ScheduledActionType
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"ModifyScheduledAction" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
ByteString
"TargetAction" ByteString -> Maybe ScheduledActionType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ScheduledActionType
targetAction,
ByteString
"StartTime" ByteString -> Maybe ISO8601 -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ISO8601
startTime,
ByteString
"Schedule" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
schedule,
ByteString
"ScheduledActionDescription"
ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
scheduledActionDescription,
ByteString
"Enable" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
enable,
ByteString
"EndTime" ByteString -> Maybe ISO8601 -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ISO8601
endTime,
ByteString
"IamRole" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
iamRole,
ByteString
"ScheduledActionName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
scheduledActionName
]