{-# 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_associatedClusterCount,
snapshotSchedule_associatedClusters,
snapshotSchedule_nextInvocations,
snapshotSchedule_scheduleDefinitions,
snapshotSchedule_scheduleDescription,
snapshotSchedule_scheduleIdentifier,
snapshotSchedule_tags,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:scheduleIdentifier:ModifySnapshotSchedule' :: Text
scheduleIdentifier =
Text
pScheduleIdentifier_,
$sel:scheduleDefinitions:ModifySnapshotSchedule' :: [Text]
scheduleDefinitions = forall a. Monoid a => a
Prelude.mempty
}
modifySnapshotSchedule_scheduleIdentifier :: Lens.Lens' ModifySnapshotSchedule Prelude.Text
modifySnapshotSchedule_scheduleIdentifier :: Lens' ModifySnapshotSchedule Text
modifySnapshotSchedule_scheduleIdentifier = 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 :: Lens' ModifySnapshotSchedule [Text]
modifySnapshotSchedule_scheduleDefinitions = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 :: (Service -> Service)
-> ModifySnapshotSchedule -> Request ModifySnapshotSchedule
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ModifySnapshotSchedule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ModifySnapshotSchedule)))
response =
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"ModifySnapshotScheduleResult"
(\Int
s ResponseHeaders
h [Node]
x -> forall a. FromXML a => [Node] -> Either String a
Data.parseXML [Node]
x)
instance Prelude.Hashable ModifySnapshotSchedule where
hashWithSalt :: Int -> ModifySnapshotSchedule -> Int
hashWithSalt Int
_salt ModifySnapshotSchedule' {[Text]
Text
scheduleDefinitions :: [Text]
scheduleIdentifier :: Text
$sel:scheduleDefinitions:ModifySnapshotSchedule' :: ModifySnapshotSchedule -> [Text]
$sel:scheduleIdentifier:ModifySnapshotSchedule' :: ModifySnapshotSchedule -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
scheduleIdentifier
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
scheduleDefinitions
instance Prelude.NFData ModifySnapshotSchedule where
rnf :: ModifySnapshotSchedule -> ()
rnf ModifySnapshotSchedule' {[Text]
Text
scheduleDefinitions :: [Text]
scheduleIdentifier :: Text
$sel:scheduleDefinitions:ModifySnapshotSchedule' :: ModifySnapshotSchedule -> [Text]
$sel:scheduleIdentifier:ModifySnapshotSchedule' :: ModifySnapshotSchedule -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
scheduleIdentifier
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
scheduleDefinitions
instance Data.ToHeaders ModifySnapshotSchedule where
toHeaders :: ModifySnapshotSchedule -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ModifySnapshotSchedule where
toPath :: ModifySnapshotSchedule -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ModifySnapshotSchedule where
toQuery :: ModifySnapshotSchedule -> QueryString
toQuery ModifySnapshotSchedule' {[Text]
Text
scheduleDefinitions :: [Text]
scheduleIdentifier :: Text
$sel:scheduleDefinitions:ModifySnapshotSchedule' :: ModifySnapshotSchedule -> [Text]
$sel:scheduleIdentifier:ModifySnapshotSchedule' :: ModifySnapshotSchedule -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ModifySnapshotSchedule" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
ByteString
"ScheduleIdentifier" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
scheduleIdentifier,
ByteString
"ScheduleDefinitions"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList
ByteString
"ScheduleDefinition"
[Text]
scheduleDefinitions
]