{-# 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.ModifySnapshotSchedule
(
ModifySnapshotSchedule (..),
newModifySnapshotSchedule,
modifySnapshotSchedule_scheduleIdentifier,
modifySnapshotSchedule_scheduleDefinitions,
SnapshotSchedule (..),
newSnapshotSchedule,
snapshotSchedule_associatedClusters,
snapshotSchedule_nextInvocations,
snapshotSchedule_scheduleDefinitions,
snapshotSchedule_scheduleDescription,
snapshotSchedule_scheduleIdentifier,
snapshotSchedule_associatedClusterCount,
snapshotSchedule_tags,
)
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 ModifySnapshotSchedule = ModifySnapshotSchedule'
{
ModifySnapshotSchedule -> Text
scheduleIdentifier :: Prelude.Text,
ModifySnapshotSchedule -> [Text]
scheduleDefinitions :: [Prelude.Text]
}
deriving (ModifySnapshotSchedule -> ModifySnapshotSchedule -> Bool
(ModifySnapshotSchedule -> ModifySnapshotSchedule -> Bool)
-> (ModifySnapshotSchedule -> ModifySnapshotSchedule -> Bool)
-> Eq ModifySnapshotSchedule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifySnapshotSchedule -> ModifySnapshotSchedule -> Bool
$c/= :: ModifySnapshotSchedule -> ModifySnapshotSchedule -> Bool
== :: ModifySnapshotSchedule -> ModifySnapshotSchedule -> Bool
$c== :: ModifySnapshotSchedule -> ModifySnapshotSchedule -> Bool
Prelude.Eq, ReadPrec [ModifySnapshotSchedule]
ReadPrec ModifySnapshotSchedule
Int -> ReadS ModifySnapshotSchedule
ReadS [ModifySnapshotSchedule]
(Int -> ReadS ModifySnapshotSchedule)
-> ReadS [ModifySnapshotSchedule]
-> ReadPrec ModifySnapshotSchedule
-> ReadPrec [ModifySnapshotSchedule]
-> Read ModifySnapshotSchedule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifySnapshotSchedule]
$creadListPrec :: ReadPrec [ModifySnapshotSchedule]
readPrec :: ReadPrec ModifySnapshotSchedule
$creadPrec :: ReadPrec ModifySnapshotSchedule
readList :: ReadS [ModifySnapshotSchedule]
$creadList :: ReadS [ModifySnapshotSchedule]
readsPrec :: Int -> ReadS ModifySnapshotSchedule
$creadsPrec :: Int -> ReadS ModifySnapshotSchedule
Prelude.Read, Int -> ModifySnapshotSchedule -> ShowS
[ModifySnapshotSchedule] -> ShowS
ModifySnapshotSchedule -> String
(Int -> ModifySnapshotSchedule -> ShowS)
-> (ModifySnapshotSchedule -> String)
-> ([ModifySnapshotSchedule] -> ShowS)
-> Show ModifySnapshotSchedule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifySnapshotSchedule] -> ShowS
$cshowList :: [ModifySnapshotSchedule] -> ShowS
show :: ModifySnapshotSchedule -> String
$cshow :: ModifySnapshotSchedule -> String
showsPrec :: Int -> ModifySnapshotSchedule -> ShowS
$cshowsPrec :: Int -> ModifySnapshotSchedule -> ShowS
Prelude.Show, (forall x. ModifySnapshotSchedule -> Rep ModifySnapshotSchedule x)
-> (forall x.
Rep ModifySnapshotSchedule x -> ModifySnapshotSchedule)
-> Generic ModifySnapshotSchedule
forall x. Rep ModifySnapshotSchedule x -> ModifySnapshotSchedule
forall x. ModifySnapshotSchedule -> Rep ModifySnapshotSchedule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModifySnapshotSchedule x -> ModifySnapshotSchedule
$cfrom :: forall x. ModifySnapshotSchedule -> Rep ModifySnapshotSchedule x
Prelude.Generic)
newModifySnapshotSchedule ::
Prelude.Text ->
ModifySnapshotSchedule
newModifySnapshotSchedule :: Text -> ModifySnapshotSchedule
newModifySnapshotSchedule Text
pScheduleIdentifier_ =
ModifySnapshotSchedule' :: Text -> [Text] -> ModifySnapshotSchedule
ModifySnapshotSchedule'
{ $sel:scheduleIdentifier:ModifySnapshotSchedule' :: Text
scheduleIdentifier =
Text
pScheduleIdentifier_,
$sel:scheduleDefinitions:ModifySnapshotSchedule' :: [Text]
scheduleDefinitions = [Text]
forall a. Monoid a => a
Prelude.mempty
}
modifySnapshotSchedule_scheduleIdentifier :: Lens.Lens' ModifySnapshotSchedule Prelude.Text
modifySnapshotSchedule_scheduleIdentifier :: (Text -> f Text)
-> ModifySnapshotSchedule -> f ModifySnapshotSchedule
modifySnapshotSchedule_scheduleIdentifier = (ModifySnapshotSchedule -> Text)
-> (ModifySnapshotSchedule -> Text -> ModifySnapshotSchedule)
-> Lens ModifySnapshotSchedule ModifySnapshotSchedule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifySnapshotSchedule' {Text
scheduleIdentifier :: Text
$sel:scheduleIdentifier:ModifySnapshotSchedule' :: ModifySnapshotSchedule -> Text
scheduleIdentifier} -> Text
scheduleIdentifier) (\s :: ModifySnapshotSchedule
s@ModifySnapshotSchedule' {} Text
a -> ModifySnapshotSchedule
s {$sel:scheduleIdentifier:ModifySnapshotSchedule' :: Text
scheduleIdentifier = Text
a} :: ModifySnapshotSchedule)
modifySnapshotSchedule_scheduleDefinitions :: Lens.Lens' ModifySnapshotSchedule [Prelude.Text]
modifySnapshotSchedule_scheduleDefinitions :: ([Text] -> f [Text])
-> ModifySnapshotSchedule -> f ModifySnapshotSchedule
modifySnapshotSchedule_scheduleDefinitions = (ModifySnapshotSchedule -> [Text])
-> (ModifySnapshotSchedule -> [Text] -> ModifySnapshotSchedule)
-> Lens ModifySnapshotSchedule ModifySnapshotSchedule [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifySnapshotSchedule' {[Text]
scheduleDefinitions :: [Text]
$sel:scheduleDefinitions:ModifySnapshotSchedule' :: ModifySnapshotSchedule -> [Text]
scheduleDefinitions} -> [Text]
scheduleDefinitions) (\s :: ModifySnapshotSchedule
s@ModifySnapshotSchedule' {} [Text]
a -> ModifySnapshotSchedule
s {$sel:scheduleDefinitions:ModifySnapshotSchedule' :: [Text]
scheduleDefinitions = [Text]
a} :: ModifySnapshotSchedule) (([Text] -> f [Text])
-> ModifySnapshotSchedule -> f ModifySnapshotSchedule)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> ModifySnapshotSchedule
-> f ModifySnapshotSchedule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest ModifySnapshotSchedule where
type
AWSResponse ModifySnapshotSchedule =
SnapshotSchedule
request :: ModifySnapshotSchedule -> Request ModifySnapshotSchedule
request = Service -> ModifySnapshotSchedule -> Request ModifySnapshotSchedule
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy ModifySnapshotSchedule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ModifySnapshotSchedule)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse ModifySnapshotSchedule))
-> Logger
-> Service
-> Proxy ModifySnapshotSchedule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ModifySnapshotSchedule)))
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
"ModifySnapshotScheduleResult"
(\Int
s ResponseHeaders
h [Node]
x -> [Node] -> Either String SnapshotSchedule
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
instance Prelude.Hashable ModifySnapshotSchedule
instance Prelude.NFData ModifySnapshotSchedule
instance Core.ToHeaders ModifySnapshotSchedule where
toHeaders :: ModifySnapshotSchedule -> ResponseHeaders
toHeaders = ResponseHeaders -> ModifySnapshotSchedule -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ModifySnapshotSchedule where
toPath :: ModifySnapshotSchedule -> ByteString
toPath = ByteString -> ModifySnapshotSchedule -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ModifySnapshotSchedule where
toQuery :: ModifySnapshotSchedule -> QueryString
toQuery ModifySnapshotSchedule' {[Text]
Text
scheduleDefinitions :: [Text]
scheduleIdentifier :: Text
$sel:scheduleDefinitions:ModifySnapshotSchedule' :: ModifySnapshotSchedule -> [Text]
$sel:scheduleIdentifier:ModifySnapshotSchedule' :: ModifySnapshotSchedule -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"ModifySnapshotSchedule" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
ByteString
"ScheduleIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
scheduleIdentifier,
ByteString
"ScheduleDefinitions"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList
ByteString
"ScheduleDefinition"
[Text]
scheduleDefinitions
]