{-# 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.CreateSnapshotSchedule
(
CreateSnapshotSchedule (..),
newCreateSnapshotSchedule,
createSnapshotSchedule_nextInvocations,
createSnapshotSchedule_scheduleDefinitions,
createSnapshotSchedule_scheduleDescription,
createSnapshotSchedule_scheduleIdentifier,
createSnapshotSchedule_dryRun,
createSnapshotSchedule_tags,
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 CreateSnapshotSchedule = CreateSnapshotSchedule'
{ CreateSnapshotSchedule -> Maybe Int
nextInvocations :: Prelude.Maybe Prelude.Int,
CreateSnapshotSchedule -> Maybe [Text]
scheduleDefinitions :: Prelude.Maybe [Prelude.Text],
CreateSnapshotSchedule -> Maybe Text
scheduleDescription :: Prelude.Maybe Prelude.Text,
CreateSnapshotSchedule -> Maybe Text
scheduleIdentifier :: Prelude.Maybe Prelude.Text,
CreateSnapshotSchedule -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
CreateSnapshotSchedule -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
}
deriving (CreateSnapshotSchedule -> CreateSnapshotSchedule -> Bool
(CreateSnapshotSchedule -> CreateSnapshotSchedule -> Bool)
-> (CreateSnapshotSchedule -> CreateSnapshotSchedule -> Bool)
-> Eq CreateSnapshotSchedule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateSnapshotSchedule -> CreateSnapshotSchedule -> Bool
$c/= :: CreateSnapshotSchedule -> CreateSnapshotSchedule -> Bool
== :: CreateSnapshotSchedule -> CreateSnapshotSchedule -> Bool
$c== :: CreateSnapshotSchedule -> CreateSnapshotSchedule -> Bool
Prelude.Eq, ReadPrec [CreateSnapshotSchedule]
ReadPrec CreateSnapshotSchedule
Int -> ReadS CreateSnapshotSchedule
ReadS [CreateSnapshotSchedule]
(Int -> ReadS CreateSnapshotSchedule)
-> ReadS [CreateSnapshotSchedule]
-> ReadPrec CreateSnapshotSchedule
-> ReadPrec [CreateSnapshotSchedule]
-> Read CreateSnapshotSchedule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateSnapshotSchedule]
$creadListPrec :: ReadPrec [CreateSnapshotSchedule]
readPrec :: ReadPrec CreateSnapshotSchedule
$creadPrec :: ReadPrec CreateSnapshotSchedule
readList :: ReadS [CreateSnapshotSchedule]
$creadList :: ReadS [CreateSnapshotSchedule]
readsPrec :: Int -> ReadS CreateSnapshotSchedule
$creadsPrec :: Int -> ReadS CreateSnapshotSchedule
Prelude.Read, Int -> CreateSnapshotSchedule -> ShowS
[CreateSnapshotSchedule] -> ShowS
CreateSnapshotSchedule -> String
(Int -> CreateSnapshotSchedule -> ShowS)
-> (CreateSnapshotSchedule -> String)
-> ([CreateSnapshotSchedule] -> ShowS)
-> Show CreateSnapshotSchedule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateSnapshotSchedule] -> ShowS
$cshowList :: [CreateSnapshotSchedule] -> ShowS
show :: CreateSnapshotSchedule -> String
$cshow :: CreateSnapshotSchedule -> String
showsPrec :: Int -> CreateSnapshotSchedule -> ShowS
$cshowsPrec :: Int -> CreateSnapshotSchedule -> ShowS
Prelude.Show, (forall x. CreateSnapshotSchedule -> Rep CreateSnapshotSchedule x)
-> (forall x.
Rep CreateSnapshotSchedule x -> CreateSnapshotSchedule)
-> Generic CreateSnapshotSchedule
forall x. Rep CreateSnapshotSchedule x -> CreateSnapshotSchedule
forall x. CreateSnapshotSchedule -> Rep CreateSnapshotSchedule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateSnapshotSchedule x -> CreateSnapshotSchedule
$cfrom :: forall x. CreateSnapshotSchedule -> Rep CreateSnapshotSchedule x
Prelude.Generic)
newCreateSnapshotSchedule ::
CreateSnapshotSchedule
newCreateSnapshotSchedule :: CreateSnapshotSchedule
newCreateSnapshotSchedule =
CreateSnapshotSchedule' :: Maybe Int
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe [Tag]
-> CreateSnapshotSchedule
CreateSnapshotSchedule'
{ $sel:nextInvocations:CreateSnapshotSchedule' :: Maybe Int
nextInvocations =
Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:scheduleDefinitions:CreateSnapshotSchedule' :: Maybe [Text]
scheduleDefinitions = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:scheduleDescription:CreateSnapshotSchedule' :: Maybe Text
scheduleDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:scheduleIdentifier:CreateSnapshotSchedule' :: Maybe Text
scheduleIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dryRun:CreateSnapshotSchedule' :: Maybe Bool
dryRun = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateSnapshotSchedule' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing
}
createSnapshotSchedule_nextInvocations :: Lens.Lens' CreateSnapshotSchedule (Prelude.Maybe Prelude.Int)
createSnapshotSchedule_nextInvocations :: (Maybe Int -> f (Maybe Int))
-> CreateSnapshotSchedule -> f CreateSnapshotSchedule
createSnapshotSchedule_nextInvocations = (CreateSnapshotSchedule -> Maybe Int)
-> (CreateSnapshotSchedule -> Maybe Int -> CreateSnapshotSchedule)
-> Lens
CreateSnapshotSchedule
CreateSnapshotSchedule
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSnapshotSchedule' {Maybe Int
nextInvocations :: Maybe Int
$sel:nextInvocations:CreateSnapshotSchedule' :: CreateSnapshotSchedule -> Maybe Int
nextInvocations} -> Maybe Int
nextInvocations) (\s :: CreateSnapshotSchedule
s@CreateSnapshotSchedule' {} Maybe Int
a -> CreateSnapshotSchedule
s {$sel:nextInvocations:CreateSnapshotSchedule' :: Maybe Int
nextInvocations = Maybe Int
a} :: CreateSnapshotSchedule)
createSnapshotSchedule_scheduleDefinitions :: Lens.Lens' CreateSnapshotSchedule (Prelude.Maybe [Prelude.Text])
createSnapshotSchedule_scheduleDefinitions :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateSnapshotSchedule -> f CreateSnapshotSchedule
createSnapshotSchedule_scheduleDefinitions = (CreateSnapshotSchedule -> Maybe [Text])
-> (CreateSnapshotSchedule
-> Maybe [Text] -> CreateSnapshotSchedule)
-> Lens
CreateSnapshotSchedule
CreateSnapshotSchedule
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSnapshotSchedule' {Maybe [Text]
scheduleDefinitions :: Maybe [Text]
$sel:scheduleDefinitions:CreateSnapshotSchedule' :: CreateSnapshotSchedule -> Maybe [Text]
scheduleDefinitions} -> Maybe [Text]
scheduleDefinitions) (\s :: CreateSnapshotSchedule
s@CreateSnapshotSchedule' {} Maybe [Text]
a -> CreateSnapshotSchedule
s {$sel:scheduleDefinitions:CreateSnapshotSchedule' :: Maybe [Text]
scheduleDefinitions = Maybe [Text]
a} :: CreateSnapshotSchedule) ((Maybe [Text] -> f (Maybe [Text]))
-> CreateSnapshotSchedule -> f CreateSnapshotSchedule)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateSnapshotSchedule
-> f CreateSnapshotSchedule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createSnapshotSchedule_scheduleDescription :: Lens.Lens' CreateSnapshotSchedule (Prelude.Maybe Prelude.Text)
createSnapshotSchedule_scheduleDescription :: (Maybe Text -> f (Maybe Text))
-> CreateSnapshotSchedule -> f CreateSnapshotSchedule
createSnapshotSchedule_scheduleDescription = (CreateSnapshotSchedule -> Maybe Text)
-> (CreateSnapshotSchedule -> Maybe Text -> CreateSnapshotSchedule)
-> Lens
CreateSnapshotSchedule
CreateSnapshotSchedule
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSnapshotSchedule' {Maybe Text
scheduleDescription :: Maybe Text
$sel:scheduleDescription:CreateSnapshotSchedule' :: CreateSnapshotSchedule -> Maybe Text
scheduleDescription} -> Maybe Text
scheduleDescription) (\s :: CreateSnapshotSchedule
s@CreateSnapshotSchedule' {} Maybe Text
a -> CreateSnapshotSchedule
s {$sel:scheduleDescription:CreateSnapshotSchedule' :: Maybe Text
scheduleDescription = Maybe Text
a} :: CreateSnapshotSchedule)
createSnapshotSchedule_scheduleIdentifier :: Lens.Lens' CreateSnapshotSchedule (Prelude.Maybe Prelude.Text)
createSnapshotSchedule_scheduleIdentifier :: (Maybe Text -> f (Maybe Text))
-> CreateSnapshotSchedule -> f CreateSnapshotSchedule
createSnapshotSchedule_scheduleIdentifier = (CreateSnapshotSchedule -> Maybe Text)
-> (CreateSnapshotSchedule -> Maybe Text -> CreateSnapshotSchedule)
-> Lens
CreateSnapshotSchedule
CreateSnapshotSchedule
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSnapshotSchedule' {Maybe Text
scheduleIdentifier :: Maybe Text
$sel:scheduleIdentifier:CreateSnapshotSchedule' :: CreateSnapshotSchedule -> Maybe Text
scheduleIdentifier} -> Maybe Text
scheduleIdentifier) (\s :: CreateSnapshotSchedule
s@CreateSnapshotSchedule' {} Maybe Text
a -> CreateSnapshotSchedule
s {$sel:scheduleIdentifier:CreateSnapshotSchedule' :: Maybe Text
scheduleIdentifier = Maybe Text
a} :: CreateSnapshotSchedule)
createSnapshotSchedule_dryRun :: Lens.Lens' CreateSnapshotSchedule (Prelude.Maybe Prelude.Bool)
createSnapshotSchedule_dryRun :: (Maybe Bool -> f (Maybe Bool))
-> CreateSnapshotSchedule -> f CreateSnapshotSchedule
createSnapshotSchedule_dryRun = (CreateSnapshotSchedule -> Maybe Bool)
-> (CreateSnapshotSchedule -> Maybe Bool -> CreateSnapshotSchedule)
-> Lens
CreateSnapshotSchedule
CreateSnapshotSchedule
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSnapshotSchedule' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:CreateSnapshotSchedule' :: CreateSnapshotSchedule -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: CreateSnapshotSchedule
s@CreateSnapshotSchedule' {} Maybe Bool
a -> CreateSnapshotSchedule
s {$sel:dryRun:CreateSnapshotSchedule' :: Maybe Bool
dryRun = Maybe Bool
a} :: CreateSnapshotSchedule)
createSnapshotSchedule_tags :: Lens.Lens' CreateSnapshotSchedule (Prelude.Maybe [Tag])
createSnapshotSchedule_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateSnapshotSchedule -> f CreateSnapshotSchedule
createSnapshotSchedule_tags = (CreateSnapshotSchedule -> Maybe [Tag])
-> (CreateSnapshotSchedule
-> Maybe [Tag] -> CreateSnapshotSchedule)
-> Lens
CreateSnapshotSchedule
CreateSnapshotSchedule
(Maybe [Tag])
(Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSnapshotSchedule' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateSnapshotSchedule' :: CreateSnapshotSchedule -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateSnapshotSchedule
s@CreateSnapshotSchedule' {} Maybe [Tag]
a -> CreateSnapshotSchedule
s {$sel:tags:CreateSnapshotSchedule' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateSnapshotSchedule) ((Maybe [Tag] -> f (Maybe [Tag]))
-> CreateSnapshotSchedule -> f CreateSnapshotSchedule)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateSnapshotSchedule
-> f CreateSnapshotSchedule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest CreateSnapshotSchedule where
type
AWSResponse CreateSnapshotSchedule =
SnapshotSchedule
request :: CreateSnapshotSchedule -> Request CreateSnapshotSchedule
request = Service -> CreateSnapshotSchedule -> Request CreateSnapshotSchedule
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy CreateSnapshotSchedule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateSnapshotSchedule)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse CreateSnapshotSchedule))
-> Logger
-> Service
-> Proxy CreateSnapshotSchedule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateSnapshotSchedule)))
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
"CreateSnapshotScheduleResult"
(\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 CreateSnapshotSchedule
instance Prelude.NFData CreateSnapshotSchedule
instance Core.ToHeaders CreateSnapshotSchedule where
toHeaders :: CreateSnapshotSchedule -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateSnapshotSchedule -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath CreateSnapshotSchedule where
toPath :: CreateSnapshotSchedule -> ByteString
toPath = ByteString -> CreateSnapshotSchedule -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateSnapshotSchedule where
toQuery :: CreateSnapshotSchedule -> QueryString
toQuery CreateSnapshotSchedule' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [Tag]
Maybe Text
tags :: Maybe [Tag]
dryRun :: Maybe Bool
scheduleIdentifier :: Maybe Text
scheduleDescription :: Maybe Text
scheduleDefinitions :: Maybe [Text]
nextInvocations :: Maybe Int
$sel:tags:CreateSnapshotSchedule' :: CreateSnapshotSchedule -> Maybe [Tag]
$sel:dryRun:CreateSnapshotSchedule' :: CreateSnapshotSchedule -> Maybe Bool
$sel:scheduleIdentifier:CreateSnapshotSchedule' :: CreateSnapshotSchedule -> Maybe Text
$sel:scheduleDescription:CreateSnapshotSchedule' :: CreateSnapshotSchedule -> Maybe Text
$sel:scheduleDefinitions:CreateSnapshotSchedule' :: CreateSnapshotSchedule -> Maybe [Text]
$sel:nextInvocations:CreateSnapshotSchedule' :: CreateSnapshotSchedule -> Maybe Int
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"CreateSnapshotSchedule" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
ByteString
"NextInvocations" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
nextInvocations,
ByteString
"ScheduleDefinitions"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"ScheduleDefinition"
([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
scheduleDefinitions
),
ByteString
"ScheduleDescription" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
scheduleDescription,
ByteString
"ScheduleIdentifier" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
scheduleIdentifier,
ByteString
"DryRun" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
dryRun,
ByteString
"Tags"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
(ByteString -> [Tag] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"Tag" ([Tag] -> QueryString) -> Maybe [Tag] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags)
]