{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Redshift.Types.SnapshotSchedule
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Redshift.Types.SnapshotSchedule where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Internal
import Amazonka.Redshift.Types.ClusterAssociatedToSchedule
import Amazonka.Redshift.Types.Tag

-- | Describes a snapshot schedule. You can set a regular interval for
-- creating snapshots of a cluster. You can also schedule snapshots for
-- specific dates.
--
-- /See:/ 'newSnapshotSchedule' smart constructor.
data SnapshotSchedule = SnapshotSchedule'
  { -- | A list of clusters associated with the schedule. A maximum of 100
    -- clusters is returned.
    SnapshotSchedule -> Maybe [ClusterAssociatedToSchedule]
associatedClusters :: Prelude.Maybe [ClusterAssociatedToSchedule],
    SnapshotSchedule -> Maybe [ISO8601]
nextInvocations :: Prelude.Maybe [Core.ISO8601],
    -- | A list of ScheduleDefinitions.
    SnapshotSchedule -> Maybe [Text]
scheduleDefinitions :: Prelude.Maybe [Prelude.Text],
    -- | The description of the schedule.
    SnapshotSchedule -> Maybe Text
scheduleDescription :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for the schedule.
    SnapshotSchedule -> Maybe Text
scheduleIdentifier :: Prelude.Maybe Prelude.Text,
    -- | The number of clusters associated with the schedule.
    SnapshotSchedule -> Maybe Int
associatedClusterCount :: Prelude.Maybe Prelude.Int,
    -- | An optional set of tags describing the schedule.
    SnapshotSchedule -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
  }
  deriving (SnapshotSchedule -> SnapshotSchedule -> Bool
(SnapshotSchedule -> SnapshotSchedule -> Bool)
-> (SnapshotSchedule -> SnapshotSchedule -> Bool)
-> Eq SnapshotSchedule
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]
(Int -> ReadS SnapshotSchedule)
-> ReadS [SnapshotSchedule]
-> ReadPrec SnapshotSchedule
-> ReadPrec [SnapshotSchedule]
-> Read 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
(Int -> SnapshotSchedule -> ShowS)
-> (SnapshotSchedule -> String)
-> ([SnapshotSchedule] -> ShowS)
-> Show SnapshotSchedule
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. SnapshotSchedule -> Rep SnapshotSchedule x)
-> (forall x. Rep SnapshotSchedule x -> SnapshotSchedule)
-> Generic SnapshotSchedule
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)

-- |
-- Create a value of 'SnapshotSchedule' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'associatedClusters', 'snapshotSchedule_associatedClusters' - A list of clusters associated with the schedule. A maximum of 100
-- clusters is returned.
--
-- 'nextInvocations', 'snapshotSchedule_nextInvocations' -
--
-- 'scheduleDefinitions', 'snapshotSchedule_scheduleDefinitions' - A list of ScheduleDefinitions.
--
-- 'scheduleDescription', 'snapshotSchedule_scheduleDescription' - The description of the schedule.
--
-- 'scheduleIdentifier', 'snapshotSchedule_scheduleIdentifier' - A unique identifier for the schedule.
--
-- 'associatedClusterCount', 'snapshotSchedule_associatedClusterCount' - The number of clusters associated with the schedule.
--
-- 'tags', 'snapshotSchedule_tags' - An optional set of tags describing the schedule.
newSnapshotSchedule ::
  SnapshotSchedule
newSnapshotSchedule :: SnapshotSchedule
newSnapshotSchedule =
  SnapshotSchedule' :: Maybe [ClusterAssociatedToSchedule]
-> Maybe [ISO8601]
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> SnapshotSchedule
SnapshotSchedule'
    { $sel:associatedClusters:SnapshotSchedule' :: Maybe [ClusterAssociatedToSchedule]
associatedClusters =
        Maybe [ClusterAssociatedToSchedule]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextInvocations:SnapshotSchedule' :: Maybe [ISO8601]
nextInvocations = Maybe [ISO8601]
forall a. Maybe a
Prelude.Nothing,
      $sel:scheduleDefinitions:SnapshotSchedule' :: Maybe [Text]
scheduleDefinitions = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:scheduleDescription:SnapshotSchedule' :: Maybe Text
scheduleDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:scheduleIdentifier:SnapshotSchedule' :: Maybe Text
scheduleIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:associatedClusterCount:SnapshotSchedule' :: Maybe Int
associatedClusterCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:SnapshotSchedule' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing
    }

-- | A list of clusters associated with the schedule. A maximum of 100
-- clusters is returned.
snapshotSchedule_associatedClusters :: Lens.Lens' SnapshotSchedule (Prelude.Maybe [ClusterAssociatedToSchedule])
snapshotSchedule_associatedClusters :: (Maybe [ClusterAssociatedToSchedule]
 -> f (Maybe [ClusterAssociatedToSchedule]))
-> SnapshotSchedule -> f SnapshotSchedule
snapshotSchedule_associatedClusters = (SnapshotSchedule -> Maybe [ClusterAssociatedToSchedule])
-> (SnapshotSchedule
    -> Maybe [ClusterAssociatedToSchedule] -> SnapshotSchedule)
-> Lens
     SnapshotSchedule
     SnapshotSchedule
     (Maybe [ClusterAssociatedToSchedule])
     (Maybe [ClusterAssociatedToSchedule])
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) ((Maybe [ClusterAssociatedToSchedule]
  -> f (Maybe [ClusterAssociatedToSchedule]))
 -> SnapshotSchedule -> f SnapshotSchedule)
-> ((Maybe [ClusterAssociatedToSchedule]
     -> f (Maybe [ClusterAssociatedToSchedule]))
    -> Maybe [ClusterAssociatedToSchedule]
    -> f (Maybe [ClusterAssociatedToSchedule]))
-> (Maybe [ClusterAssociatedToSchedule]
    -> f (Maybe [ClusterAssociatedToSchedule]))
-> SnapshotSchedule
-> f SnapshotSchedule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ClusterAssociatedToSchedule]
  [ClusterAssociatedToSchedule]
  [ClusterAssociatedToSchedule]
  [ClusterAssociatedToSchedule]
-> Iso
     (Maybe [ClusterAssociatedToSchedule])
     (Maybe [ClusterAssociatedToSchedule])
     (Maybe [ClusterAssociatedToSchedule])
     (Maybe [ClusterAssociatedToSchedule])
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
  [ClusterAssociatedToSchedule]
  [ClusterAssociatedToSchedule]
  [ClusterAssociatedToSchedule]
  [ClusterAssociatedToSchedule]
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 :: (Maybe [UTCTime] -> f (Maybe [UTCTime]))
-> SnapshotSchedule -> f SnapshotSchedule
snapshotSchedule_nextInvocations = (SnapshotSchedule -> Maybe [ISO8601])
-> (SnapshotSchedule -> Maybe [ISO8601] -> SnapshotSchedule)
-> Lens
     SnapshotSchedule
     SnapshotSchedule
     (Maybe [ISO8601])
     (Maybe [ISO8601])
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) ((Maybe [ISO8601] -> f (Maybe [ISO8601]))
 -> SnapshotSchedule -> f SnapshotSchedule)
-> ((Maybe [UTCTime] -> f (Maybe [UTCTime]))
    -> Maybe [ISO8601] -> f (Maybe [ISO8601]))
-> (Maybe [UTCTime] -> f (Maybe [UTCTime]))
-> SnapshotSchedule
-> f SnapshotSchedule
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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of ScheduleDefinitions.
snapshotSchedule_scheduleDefinitions :: Lens.Lens' SnapshotSchedule (Prelude.Maybe [Prelude.Text])
snapshotSchedule_scheduleDefinitions :: (Maybe [Text] -> f (Maybe [Text]))
-> SnapshotSchedule -> f SnapshotSchedule
snapshotSchedule_scheduleDefinitions = (SnapshotSchedule -> Maybe [Text])
-> (SnapshotSchedule -> Maybe [Text] -> SnapshotSchedule)
-> Lens
     SnapshotSchedule SnapshotSchedule (Maybe [Text]) (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
 -> SnapshotSchedule -> f SnapshotSchedule)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> SnapshotSchedule
-> f SnapshotSchedule
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

-- | The description of the schedule.
snapshotSchedule_scheduleDescription :: Lens.Lens' SnapshotSchedule (Prelude.Maybe Prelude.Text)
snapshotSchedule_scheduleDescription :: (Maybe Text -> f (Maybe Text))
-> SnapshotSchedule -> f SnapshotSchedule
snapshotSchedule_scheduleDescription = (SnapshotSchedule -> Maybe Text)
-> (SnapshotSchedule -> Maybe Text -> SnapshotSchedule)
-> Lens SnapshotSchedule SnapshotSchedule (Maybe Text) (Maybe Text)
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)

-- | A unique identifier for the schedule.
snapshotSchedule_scheduleIdentifier :: Lens.Lens' SnapshotSchedule (Prelude.Maybe Prelude.Text)
snapshotSchedule_scheduleIdentifier :: (Maybe Text -> f (Maybe Text))
-> SnapshotSchedule -> f SnapshotSchedule
snapshotSchedule_scheduleIdentifier = (SnapshotSchedule -> Maybe Text)
-> (SnapshotSchedule -> Maybe Text -> SnapshotSchedule)
-> Lens SnapshotSchedule SnapshotSchedule (Maybe Text) (Maybe Text)
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)

-- | The number of clusters associated with the schedule.
snapshotSchedule_associatedClusterCount :: Lens.Lens' SnapshotSchedule (Prelude.Maybe Prelude.Int)
snapshotSchedule_associatedClusterCount :: (Maybe Int -> f (Maybe Int))
-> SnapshotSchedule -> f SnapshotSchedule
snapshotSchedule_associatedClusterCount = (SnapshotSchedule -> Maybe Int)
-> (SnapshotSchedule -> Maybe Int -> SnapshotSchedule)
-> Lens SnapshotSchedule SnapshotSchedule (Maybe Int) (Maybe Int)
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)

-- | An optional set of tags describing the schedule.
snapshotSchedule_tags :: Lens.Lens' SnapshotSchedule (Prelude.Maybe [Tag])
snapshotSchedule_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> SnapshotSchedule -> f SnapshotSchedule
snapshotSchedule_tags = (SnapshotSchedule -> Maybe [Tag])
-> (SnapshotSchedule -> Maybe [Tag] -> SnapshotSchedule)
-> Lens
     SnapshotSchedule SnapshotSchedule (Maybe [Tag]) (Maybe [Tag])
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) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> SnapshotSchedule -> f SnapshotSchedule)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> SnapshotSchedule
-> f SnapshotSchedule
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.FromXML SnapshotSchedule where
  parseXML :: [Node] -> Either String SnapshotSchedule
parseXML [Node]
x =
    Maybe [ClusterAssociatedToSchedule]
-> Maybe [ISO8601]
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> SnapshotSchedule
SnapshotSchedule'
      (Maybe [ClusterAssociatedToSchedule]
 -> Maybe [ISO8601]
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Int
 -> Maybe [Tag]
 -> SnapshotSchedule)
-> Either String (Maybe [ClusterAssociatedToSchedule])
-> Either
     String
     (Maybe [ISO8601]
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe [Tag]
      -> SnapshotSchedule)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AssociatedClusters"
                      Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [ClusterAssociatedToSchedule]))
-> Either String (Maybe [ClusterAssociatedToSchedule])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [ClusterAssociatedToSchedule])
-> [Node] -> Either String (Maybe [ClusterAssociatedToSchedule])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may
                        (Text -> [Node] -> Either String [ClusterAssociatedToSchedule]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"ClusterAssociatedToSchedule")
                  )
      Either
  String
  (Maybe [ISO8601]
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe [Tag]
   -> SnapshotSchedule)
-> Either String (Maybe [ISO8601])
-> Either
     String
     (Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe [Tag]
      -> SnapshotSchedule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NextInvocations" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [ISO8601]))
-> Either String (Maybe [ISO8601])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [ISO8601])
-> [Node] -> Either String (Maybe [ISO8601])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [ISO8601]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"SnapshotTime")
                  )
      Either
  String
  (Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe [Tag]
   -> SnapshotSchedule)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Maybe Int -> Maybe [Tag] -> SnapshotSchedule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ScheduleDefinitions"
                      Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"ScheduleDefinition")
                  )
      Either
  String
  (Maybe Text
   -> Maybe Text -> Maybe Int -> Maybe [Tag] -> SnapshotSchedule)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Maybe Int -> Maybe [Tag] -> SnapshotSchedule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ScheduleDescription")
      Either
  String (Maybe Text -> Maybe Int -> Maybe [Tag] -> SnapshotSchedule)
-> Either String (Maybe Text)
-> Either String (Maybe Int -> Maybe [Tag] -> SnapshotSchedule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ScheduleIdentifier")
      Either String (Maybe Int -> Maybe [Tag] -> SnapshotSchedule)
-> Either String (Maybe Int)
-> Either String (Maybe [Tag] -> SnapshotSchedule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AssociatedClusterCount")
      Either String (Maybe [Tag] -> SnapshotSchedule)
-> Either String (Maybe [Tag]) -> Either String SnapshotSchedule
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Tags" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [Tag]))
-> Either String (Maybe [Tag])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Tag])
-> [Node] -> Either String (Maybe [Tag])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Tag]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"Tag")
                  )

instance Prelude.Hashable SnapshotSchedule

instance Prelude.NFData SnapshotSchedule