{-# 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.Redshift.Types.SnapshotSchedule 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.Internal
import Amazonka.Redshift.Types.ClusterAssociatedToSchedule
import Amazonka.Redshift.Types.Tag
data SnapshotSchedule = SnapshotSchedule'
{
SnapshotSchedule -> Maybe Int
associatedClusterCount :: Prelude.Maybe Prelude.Int,
SnapshotSchedule -> Maybe [ClusterAssociatedToSchedule]
associatedClusters :: Prelude.Maybe [ClusterAssociatedToSchedule],
SnapshotSchedule -> Maybe [ISO8601]
nextInvocations :: Prelude.Maybe [Data.ISO8601],
SnapshotSchedule -> Maybe [Text]
scheduleDefinitions :: Prelude.Maybe [Prelude.Text],
SnapshotSchedule -> Maybe Text
scheduleDescription :: Prelude.Maybe Prelude.Text,
SnapshotSchedule -> Maybe Text
scheduleIdentifier :: Prelude.Maybe Prelude.Text,
SnapshotSchedule -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
}
deriving (SnapshotSchedule -> SnapshotSchedule -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SnapshotSchedule -> SnapshotSchedule -> Bool
$c/= :: SnapshotSchedule -> SnapshotSchedule -> Bool
== :: SnapshotSchedule -> SnapshotSchedule -> Bool
$c== :: SnapshotSchedule -> SnapshotSchedule -> Bool
Prelude.Eq, ReadPrec [SnapshotSchedule]
ReadPrec SnapshotSchedule
Int -> ReadS SnapshotSchedule
ReadS [SnapshotSchedule]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SnapshotSchedule]
$creadListPrec :: ReadPrec [SnapshotSchedule]
readPrec :: ReadPrec SnapshotSchedule
$creadPrec :: ReadPrec SnapshotSchedule
readList :: ReadS [SnapshotSchedule]
$creadList :: ReadS [SnapshotSchedule]
readsPrec :: Int -> ReadS SnapshotSchedule
$creadsPrec :: Int -> ReadS SnapshotSchedule
Prelude.Read, Int -> SnapshotSchedule -> ShowS
[SnapshotSchedule] -> ShowS
SnapshotSchedule -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SnapshotSchedule] -> ShowS
$cshowList :: [SnapshotSchedule] -> ShowS
show :: SnapshotSchedule -> String
$cshow :: SnapshotSchedule -> String
showsPrec :: Int -> SnapshotSchedule -> ShowS
$cshowsPrec :: Int -> SnapshotSchedule -> ShowS
Prelude.Show, forall x. Rep SnapshotSchedule x -> SnapshotSchedule
forall x. SnapshotSchedule -> Rep SnapshotSchedule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SnapshotSchedule x -> SnapshotSchedule
$cfrom :: forall x. SnapshotSchedule -> Rep SnapshotSchedule x
Prelude.Generic)
newSnapshotSchedule ::
SnapshotSchedule
newSnapshotSchedule :: SnapshotSchedule
newSnapshotSchedule =
SnapshotSchedule'
{ $sel:associatedClusterCount:SnapshotSchedule' :: Maybe Int
associatedClusterCount =
forall a. Maybe a
Prelude.Nothing,
$sel:associatedClusters:SnapshotSchedule' :: Maybe [ClusterAssociatedToSchedule]
associatedClusters = forall a. Maybe a
Prelude.Nothing,
$sel:nextInvocations:SnapshotSchedule' :: Maybe [ISO8601]
nextInvocations = forall a. Maybe a
Prelude.Nothing,
$sel:scheduleDefinitions:SnapshotSchedule' :: Maybe [Text]
scheduleDefinitions = forall a. Maybe a
Prelude.Nothing,
$sel:scheduleDescription:SnapshotSchedule' :: Maybe Text
scheduleDescription = forall a. Maybe a
Prelude.Nothing,
$sel:scheduleIdentifier:SnapshotSchedule' :: Maybe Text
scheduleIdentifier = forall a. Maybe a
Prelude.Nothing,
$sel:tags:SnapshotSchedule' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing
}
snapshotSchedule_associatedClusterCount :: Lens.Lens' SnapshotSchedule (Prelude.Maybe Prelude.Int)
snapshotSchedule_associatedClusterCount :: Lens' SnapshotSchedule (Maybe Int)
snapshotSchedule_associatedClusterCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnapshotSchedule' {Maybe Int
associatedClusterCount :: Maybe Int
$sel:associatedClusterCount:SnapshotSchedule' :: SnapshotSchedule -> Maybe Int
associatedClusterCount} -> Maybe Int
associatedClusterCount) (\s :: SnapshotSchedule
s@SnapshotSchedule' {} Maybe Int
a -> SnapshotSchedule
s {$sel:associatedClusterCount:SnapshotSchedule' :: Maybe Int
associatedClusterCount = Maybe Int
a} :: SnapshotSchedule)
snapshotSchedule_associatedClusters :: Lens.Lens' SnapshotSchedule (Prelude.Maybe [ClusterAssociatedToSchedule])
snapshotSchedule_associatedClusters :: Lens' SnapshotSchedule (Maybe [ClusterAssociatedToSchedule])
snapshotSchedule_associatedClusters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnapshotSchedule' {Maybe [ClusterAssociatedToSchedule]
associatedClusters :: Maybe [ClusterAssociatedToSchedule]
$sel:associatedClusters:SnapshotSchedule' :: SnapshotSchedule -> Maybe [ClusterAssociatedToSchedule]
associatedClusters} -> Maybe [ClusterAssociatedToSchedule]
associatedClusters) (\s :: SnapshotSchedule
s@SnapshotSchedule' {} Maybe [ClusterAssociatedToSchedule]
a -> SnapshotSchedule
s {$sel:associatedClusters:SnapshotSchedule' :: Maybe [ClusterAssociatedToSchedule]
associatedClusters = Maybe [ClusterAssociatedToSchedule]
a} :: SnapshotSchedule) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
snapshotSchedule_nextInvocations :: Lens.Lens' SnapshotSchedule (Prelude.Maybe [Prelude.UTCTime])
snapshotSchedule_nextInvocations :: Lens' SnapshotSchedule (Maybe [UTCTime])
snapshotSchedule_nextInvocations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnapshotSchedule' {Maybe [ISO8601]
nextInvocations :: Maybe [ISO8601]
$sel:nextInvocations:SnapshotSchedule' :: SnapshotSchedule -> Maybe [ISO8601]
nextInvocations} -> Maybe [ISO8601]
nextInvocations) (\s :: SnapshotSchedule
s@SnapshotSchedule' {} Maybe [ISO8601]
a -> SnapshotSchedule
s {$sel:nextInvocations:SnapshotSchedule' :: Maybe [ISO8601]
nextInvocations = Maybe [ISO8601]
a} :: SnapshotSchedule) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
snapshotSchedule_scheduleDefinitions :: Lens.Lens' SnapshotSchedule (Prelude.Maybe [Prelude.Text])
snapshotSchedule_scheduleDefinitions :: Lens' SnapshotSchedule (Maybe [Text])
snapshotSchedule_scheduleDefinitions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnapshotSchedule' {Maybe [Text]
scheduleDefinitions :: Maybe [Text]
$sel:scheduleDefinitions:SnapshotSchedule' :: SnapshotSchedule -> Maybe [Text]
scheduleDefinitions} -> Maybe [Text]
scheduleDefinitions) (\s :: SnapshotSchedule
s@SnapshotSchedule' {} Maybe [Text]
a -> SnapshotSchedule
s {$sel:scheduleDefinitions:SnapshotSchedule' :: Maybe [Text]
scheduleDefinitions = Maybe [Text]
a} :: SnapshotSchedule) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
snapshotSchedule_scheduleDescription :: Lens.Lens' SnapshotSchedule (Prelude.Maybe Prelude.Text)
snapshotSchedule_scheduleDescription :: Lens' SnapshotSchedule (Maybe Text)
snapshotSchedule_scheduleDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnapshotSchedule' {Maybe Text
scheduleDescription :: Maybe Text
$sel:scheduleDescription:SnapshotSchedule' :: SnapshotSchedule -> Maybe Text
scheduleDescription} -> Maybe Text
scheduleDescription) (\s :: SnapshotSchedule
s@SnapshotSchedule' {} Maybe Text
a -> SnapshotSchedule
s {$sel:scheduleDescription:SnapshotSchedule' :: Maybe Text
scheduleDescription = Maybe Text
a} :: SnapshotSchedule)
snapshotSchedule_scheduleIdentifier :: Lens.Lens' SnapshotSchedule (Prelude.Maybe Prelude.Text)
snapshotSchedule_scheduleIdentifier :: Lens' SnapshotSchedule (Maybe Text)
snapshotSchedule_scheduleIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnapshotSchedule' {Maybe Text
scheduleIdentifier :: Maybe Text
$sel:scheduleIdentifier:SnapshotSchedule' :: SnapshotSchedule -> Maybe Text
scheduleIdentifier} -> Maybe Text
scheduleIdentifier) (\s :: SnapshotSchedule
s@SnapshotSchedule' {} Maybe Text
a -> SnapshotSchedule
s {$sel:scheduleIdentifier:SnapshotSchedule' :: Maybe Text
scheduleIdentifier = Maybe Text
a} :: SnapshotSchedule)
snapshotSchedule_tags :: Lens.Lens' SnapshotSchedule (Prelude.Maybe [Tag])
snapshotSchedule_tags :: Lens' SnapshotSchedule (Maybe [Tag])
snapshotSchedule_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnapshotSchedule' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:SnapshotSchedule' :: SnapshotSchedule -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: SnapshotSchedule
s@SnapshotSchedule' {} Maybe [Tag]
a -> SnapshotSchedule
s {$sel:tags:SnapshotSchedule' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: SnapshotSchedule) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromXML SnapshotSchedule where
parseXML :: [Node] -> Either String SnapshotSchedule
parseXML [Node]
x =
Maybe Int
-> Maybe [ClusterAssociatedToSchedule]
-> Maybe [ISO8601]
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> SnapshotSchedule
SnapshotSchedule'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"AssociatedClusterCount")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"AssociatedClusters"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may
(forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"ClusterAssociatedToSchedule")
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"NextInvocations"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"SnapshotTime")
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ScheduleDefinitions"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"ScheduleDefinition")
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ScheduleDescription")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ScheduleIdentifier")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Tags"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"Tag")
)
instance Prelude.Hashable SnapshotSchedule where
hashWithSalt :: Int -> SnapshotSchedule -> Int
hashWithSalt Int
_salt SnapshotSchedule' {Maybe Int
Maybe [Text]
Maybe [ISO8601]
Maybe [ClusterAssociatedToSchedule]
Maybe [Tag]
Maybe Text
tags :: Maybe [Tag]
scheduleIdentifier :: Maybe Text
scheduleDescription :: Maybe Text
scheduleDefinitions :: Maybe [Text]
nextInvocations :: Maybe [ISO8601]
associatedClusters :: Maybe [ClusterAssociatedToSchedule]
associatedClusterCount :: Maybe Int
$sel:tags:SnapshotSchedule' :: SnapshotSchedule -> Maybe [Tag]
$sel:scheduleIdentifier:SnapshotSchedule' :: SnapshotSchedule -> Maybe Text
$sel:scheduleDescription:SnapshotSchedule' :: SnapshotSchedule -> Maybe Text
$sel:scheduleDefinitions:SnapshotSchedule' :: SnapshotSchedule -> Maybe [Text]
$sel:nextInvocations:SnapshotSchedule' :: SnapshotSchedule -> Maybe [ISO8601]
$sel:associatedClusters:SnapshotSchedule' :: SnapshotSchedule -> Maybe [ClusterAssociatedToSchedule]
$sel:associatedClusterCount:SnapshotSchedule' :: SnapshotSchedule -> Maybe Int
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
associatedClusterCount
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ClusterAssociatedToSchedule]
associatedClusters
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ISO8601]
nextInvocations
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
scheduleDefinitions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
scheduleDescription
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
scheduleIdentifier
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
instance Prelude.NFData SnapshotSchedule where
rnf :: SnapshotSchedule -> ()
rnf SnapshotSchedule' {Maybe Int
Maybe [Text]
Maybe [ISO8601]
Maybe [ClusterAssociatedToSchedule]
Maybe [Tag]
Maybe Text
tags :: Maybe [Tag]
scheduleIdentifier :: Maybe Text
scheduleDescription :: Maybe Text
scheduleDefinitions :: Maybe [Text]
nextInvocations :: Maybe [ISO8601]
associatedClusters :: Maybe [ClusterAssociatedToSchedule]
associatedClusterCount :: Maybe Int
$sel:tags:SnapshotSchedule' :: SnapshotSchedule -> Maybe [Tag]
$sel:scheduleIdentifier:SnapshotSchedule' :: SnapshotSchedule -> Maybe Text
$sel:scheduleDescription:SnapshotSchedule' :: SnapshotSchedule -> Maybe Text
$sel:scheduleDefinitions:SnapshotSchedule' :: SnapshotSchedule -> Maybe [Text]
$sel:nextInvocations:SnapshotSchedule' :: SnapshotSchedule -> Maybe [ISO8601]
$sel:associatedClusters:SnapshotSchedule' :: SnapshotSchedule -> Maybe [ClusterAssociatedToSchedule]
$sel:associatedClusterCount:SnapshotSchedule' :: SnapshotSchedule -> Maybe Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
associatedClusterCount
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ClusterAssociatedToSchedule]
associatedClusters
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ISO8601]
nextInvocations
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
scheduleDefinitions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
scheduleDescription
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
scheduleIdentifier
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags