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

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

-- |
-- Module      : Amazonka.Redshift.BatchModifyClusterSnapshots
-- 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)
--
-- Modifies the settings for a set of cluster snapshots.
module Amazonka.Redshift.BatchModifyClusterSnapshots
  ( -- * Creating a Request
    BatchModifyClusterSnapshots (..),
    newBatchModifyClusterSnapshots,

    -- * Request Lenses
    batchModifyClusterSnapshots_manualSnapshotRetentionPeriod,
    batchModifyClusterSnapshots_force,
    batchModifyClusterSnapshots_snapshotIdentifierList,

    -- * Destructuring the Response
    BatchModifyClusterSnapshotsResponse (..),
    newBatchModifyClusterSnapshotsResponse,

    -- * Response Lenses
    batchModifyClusterSnapshotsResponse_resources,
    batchModifyClusterSnapshotsResponse_errors,
    batchModifyClusterSnapshotsResponse_httpStatus,
  )
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

-- | /See:/ 'newBatchModifyClusterSnapshots' smart constructor.
data BatchModifyClusterSnapshots = BatchModifyClusterSnapshots'
  { -- | The number of days that a manual snapshot is retained. If you specify
    -- the value -1, the manual snapshot is retained indefinitely.
    --
    -- The number must be either -1 or an integer between 1 and 3,653.
    --
    -- If you decrease the manual snapshot retention period from its current
    -- value, existing manual snapshots that fall outside of the new retention
    -- period will return an error. If you want to suppress the errors and
    -- delete the snapshots, use the force option.
    BatchModifyClusterSnapshots -> Maybe Int
manualSnapshotRetentionPeriod :: Prelude.Maybe Prelude.Int,
    -- | A boolean value indicating whether to override an exception if the
    -- retention period has passed.
    BatchModifyClusterSnapshots -> Maybe Bool
force :: Prelude.Maybe Prelude.Bool,
    -- | A list of snapshot identifiers you want to modify.
    BatchModifyClusterSnapshots -> [Text]
snapshotIdentifierList :: [Prelude.Text]
  }
  deriving (BatchModifyClusterSnapshots -> BatchModifyClusterSnapshots -> Bool
(BatchModifyClusterSnapshots
 -> BatchModifyClusterSnapshots -> Bool)
-> (BatchModifyClusterSnapshots
    -> BatchModifyClusterSnapshots -> Bool)
-> Eq BatchModifyClusterSnapshots
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchModifyClusterSnapshots -> BatchModifyClusterSnapshots -> Bool
$c/= :: BatchModifyClusterSnapshots -> BatchModifyClusterSnapshots -> Bool
== :: BatchModifyClusterSnapshots -> BatchModifyClusterSnapshots -> Bool
$c== :: BatchModifyClusterSnapshots -> BatchModifyClusterSnapshots -> Bool
Prelude.Eq, ReadPrec [BatchModifyClusterSnapshots]
ReadPrec BatchModifyClusterSnapshots
Int -> ReadS BatchModifyClusterSnapshots
ReadS [BatchModifyClusterSnapshots]
(Int -> ReadS BatchModifyClusterSnapshots)
-> ReadS [BatchModifyClusterSnapshots]
-> ReadPrec BatchModifyClusterSnapshots
-> ReadPrec [BatchModifyClusterSnapshots]
-> Read BatchModifyClusterSnapshots
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchModifyClusterSnapshots]
$creadListPrec :: ReadPrec [BatchModifyClusterSnapshots]
readPrec :: ReadPrec BatchModifyClusterSnapshots
$creadPrec :: ReadPrec BatchModifyClusterSnapshots
readList :: ReadS [BatchModifyClusterSnapshots]
$creadList :: ReadS [BatchModifyClusterSnapshots]
readsPrec :: Int -> ReadS BatchModifyClusterSnapshots
$creadsPrec :: Int -> ReadS BatchModifyClusterSnapshots
Prelude.Read, Int -> BatchModifyClusterSnapshots -> ShowS
[BatchModifyClusterSnapshots] -> ShowS
BatchModifyClusterSnapshots -> String
(Int -> BatchModifyClusterSnapshots -> ShowS)
-> (BatchModifyClusterSnapshots -> String)
-> ([BatchModifyClusterSnapshots] -> ShowS)
-> Show BatchModifyClusterSnapshots
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchModifyClusterSnapshots] -> ShowS
$cshowList :: [BatchModifyClusterSnapshots] -> ShowS
show :: BatchModifyClusterSnapshots -> String
$cshow :: BatchModifyClusterSnapshots -> String
showsPrec :: Int -> BatchModifyClusterSnapshots -> ShowS
$cshowsPrec :: Int -> BatchModifyClusterSnapshots -> ShowS
Prelude.Show, (forall x.
 BatchModifyClusterSnapshots -> Rep BatchModifyClusterSnapshots x)
-> (forall x.
    Rep BatchModifyClusterSnapshots x -> BatchModifyClusterSnapshots)
-> Generic BatchModifyClusterSnapshots
forall x.
Rep BatchModifyClusterSnapshots x -> BatchModifyClusterSnapshots
forall x.
BatchModifyClusterSnapshots -> Rep BatchModifyClusterSnapshots x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchModifyClusterSnapshots x -> BatchModifyClusterSnapshots
$cfrom :: forall x.
BatchModifyClusterSnapshots -> Rep BatchModifyClusterSnapshots x
Prelude.Generic)

-- |
-- Create a value of 'BatchModifyClusterSnapshots' 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:
--
-- 'manualSnapshotRetentionPeriod', 'batchModifyClusterSnapshots_manualSnapshotRetentionPeriod' - The number of days that a manual snapshot is retained. If you specify
-- the value -1, the manual snapshot is retained indefinitely.
--
-- The number must be either -1 or an integer between 1 and 3,653.
--
-- If you decrease the manual snapshot retention period from its current
-- value, existing manual snapshots that fall outside of the new retention
-- period will return an error. If you want to suppress the errors and
-- delete the snapshots, use the force option.
--
-- 'force', 'batchModifyClusterSnapshots_force' - A boolean value indicating whether to override an exception if the
-- retention period has passed.
--
-- 'snapshotIdentifierList', 'batchModifyClusterSnapshots_snapshotIdentifierList' - A list of snapshot identifiers you want to modify.
newBatchModifyClusterSnapshots ::
  BatchModifyClusterSnapshots
newBatchModifyClusterSnapshots :: BatchModifyClusterSnapshots
newBatchModifyClusterSnapshots =
  BatchModifyClusterSnapshots' :: Maybe Int -> Maybe Bool -> [Text] -> BatchModifyClusterSnapshots
BatchModifyClusterSnapshots'
    { $sel:manualSnapshotRetentionPeriod:BatchModifyClusterSnapshots' :: Maybe Int
manualSnapshotRetentionPeriod =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:force:BatchModifyClusterSnapshots' :: Maybe Bool
force = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotIdentifierList:BatchModifyClusterSnapshots' :: [Text]
snapshotIdentifierList = [Text]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The number of days that a manual snapshot is retained. If you specify
-- the value -1, the manual snapshot is retained indefinitely.
--
-- The number must be either -1 or an integer between 1 and 3,653.
--
-- If you decrease the manual snapshot retention period from its current
-- value, existing manual snapshots that fall outside of the new retention
-- period will return an error. If you want to suppress the errors and
-- delete the snapshots, use the force option.
batchModifyClusterSnapshots_manualSnapshotRetentionPeriod :: Lens.Lens' BatchModifyClusterSnapshots (Prelude.Maybe Prelude.Int)
batchModifyClusterSnapshots_manualSnapshotRetentionPeriod :: (Maybe Int -> f (Maybe Int))
-> BatchModifyClusterSnapshots -> f BatchModifyClusterSnapshots
batchModifyClusterSnapshots_manualSnapshotRetentionPeriod = (BatchModifyClusterSnapshots -> Maybe Int)
-> (BatchModifyClusterSnapshots
    -> Maybe Int -> BatchModifyClusterSnapshots)
-> Lens
     BatchModifyClusterSnapshots
     BatchModifyClusterSnapshots
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchModifyClusterSnapshots' {Maybe Int
manualSnapshotRetentionPeriod :: Maybe Int
$sel:manualSnapshotRetentionPeriod:BatchModifyClusterSnapshots' :: BatchModifyClusterSnapshots -> Maybe Int
manualSnapshotRetentionPeriod} -> Maybe Int
manualSnapshotRetentionPeriod) (\s :: BatchModifyClusterSnapshots
s@BatchModifyClusterSnapshots' {} Maybe Int
a -> BatchModifyClusterSnapshots
s {$sel:manualSnapshotRetentionPeriod:BatchModifyClusterSnapshots' :: Maybe Int
manualSnapshotRetentionPeriod = Maybe Int
a} :: BatchModifyClusterSnapshots)

-- | A boolean value indicating whether to override an exception if the
-- retention period has passed.
batchModifyClusterSnapshots_force :: Lens.Lens' BatchModifyClusterSnapshots (Prelude.Maybe Prelude.Bool)
batchModifyClusterSnapshots_force :: (Maybe Bool -> f (Maybe Bool))
-> BatchModifyClusterSnapshots -> f BatchModifyClusterSnapshots
batchModifyClusterSnapshots_force = (BatchModifyClusterSnapshots -> Maybe Bool)
-> (BatchModifyClusterSnapshots
    -> Maybe Bool -> BatchModifyClusterSnapshots)
-> Lens
     BatchModifyClusterSnapshots
     BatchModifyClusterSnapshots
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchModifyClusterSnapshots' {Maybe Bool
force :: Maybe Bool
$sel:force:BatchModifyClusterSnapshots' :: BatchModifyClusterSnapshots -> Maybe Bool
force} -> Maybe Bool
force) (\s :: BatchModifyClusterSnapshots
s@BatchModifyClusterSnapshots' {} Maybe Bool
a -> BatchModifyClusterSnapshots
s {$sel:force:BatchModifyClusterSnapshots' :: Maybe Bool
force = Maybe Bool
a} :: BatchModifyClusterSnapshots)

-- | A list of snapshot identifiers you want to modify.
batchModifyClusterSnapshots_snapshotIdentifierList :: Lens.Lens' BatchModifyClusterSnapshots [Prelude.Text]
batchModifyClusterSnapshots_snapshotIdentifierList :: ([Text] -> f [Text])
-> BatchModifyClusterSnapshots -> f BatchModifyClusterSnapshots
batchModifyClusterSnapshots_snapshotIdentifierList = (BatchModifyClusterSnapshots -> [Text])
-> (BatchModifyClusterSnapshots
    -> [Text] -> BatchModifyClusterSnapshots)
-> Lens
     BatchModifyClusterSnapshots
     BatchModifyClusterSnapshots
     [Text]
     [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchModifyClusterSnapshots' {[Text]
snapshotIdentifierList :: [Text]
$sel:snapshotIdentifierList:BatchModifyClusterSnapshots' :: BatchModifyClusterSnapshots -> [Text]
snapshotIdentifierList} -> [Text]
snapshotIdentifierList) (\s :: BatchModifyClusterSnapshots
s@BatchModifyClusterSnapshots' {} [Text]
a -> BatchModifyClusterSnapshots
s {$sel:snapshotIdentifierList:BatchModifyClusterSnapshots' :: [Text]
snapshotIdentifierList = [Text]
a} :: BatchModifyClusterSnapshots) (([Text] -> f [Text])
 -> BatchModifyClusterSnapshots -> f BatchModifyClusterSnapshots)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> BatchModifyClusterSnapshots
-> f BatchModifyClusterSnapshots
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 BatchModifyClusterSnapshots where
  type
    AWSResponse BatchModifyClusterSnapshots =
      BatchModifyClusterSnapshotsResponse
  request :: BatchModifyClusterSnapshots -> Request BatchModifyClusterSnapshots
request = Service
-> BatchModifyClusterSnapshots
-> Request BatchModifyClusterSnapshots
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy BatchModifyClusterSnapshots
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse BatchModifyClusterSnapshots)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse BatchModifyClusterSnapshots))
-> Logger
-> Service
-> Proxy BatchModifyClusterSnapshots
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse BatchModifyClusterSnapshots)))
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
"BatchModifyClusterSnapshotsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [Text]
-> Maybe [SnapshotErrorMessage]
-> Int
-> BatchModifyClusterSnapshotsResponse
BatchModifyClusterSnapshotsResponse'
            (Maybe [Text]
 -> Maybe [SnapshotErrorMessage]
 -> Int
 -> BatchModifyClusterSnapshotsResponse)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe [SnapshotErrorMessage]
      -> Int -> BatchModifyClusterSnapshotsResponse)
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
"Resources" 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
"String")
                        )
            Either
  String
  (Maybe [SnapshotErrorMessage]
   -> Int -> BatchModifyClusterSnapshotsResponse)
-> Either String (Maybe [SnapshotErrorMessage])
-> Either String (Int -> BatchModifyClusterSnapshotsResponse)
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
"Errors" 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 [SnapshotErrorMessage]))
-> Either String (Maybe [SnapshotErrorMessage])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [SnapshotErrorMessage])
-> [Node] -> Either String (Maybe [SnapshotErrorMessage])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [SnapshotErrorMessage]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"SnapshotErrorMessage")
                        )
            Either String (Int -> BatchModifyClusterSnapshotsResponse)
-> Either String Int
-> Either String BatchModifyClusterSnapshotsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable BatchModifyClusterSnapshots

instance Prelude.NFData BatchModifyClusterSnapshots

instance Core.ToHeaders BatchModifyClusterSnapshots where
  toHeaders :: BatchModifyClusterSnapshots -> ResponseHeaders
toHeaders = ResponseHeaders -> BatchModifyClusterSnapshots -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath BatchModifyClusterSnapshots where
  toPath :: BatchModifyClusterSnapshots -> ByteString
toPath = ByteString -> BatchModifyClusterSnapshots -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery BatchModifyClusterSnapshots where
  toQuery :: BatchModifyClusterSnapshots -> QueryString
toQuery BatchModifyClusterSnapshots' {[Text]
Maybe Bool
Maybe Int
snapshotIdentifierList :: [Text]
force :: Maybe Bool
manualSnapshotRetentionPeriod :: Maybe Int
$sel:snapshotIdentifierList:BatchModifyClusterSnapshots' :: BatchModifyClusterSnapshots -> [Text]
$sel:force:BatchModifyClusterSnapshots' :: BatchModifyClusterSnapshots -> Maybe Bool
$sel:manualSnapshotRetentionPeriod:BatchModifyClusterSnapshots' :: BatchModifyClusterSnapshots -> 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
"BatchModifyClusterSnapshots" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
        ByteString
"ManualSnapshotRetentionPeriod"
          ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
manualSnapshotRetentionPeriod,
        ByteString
"Force" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
force,
        ByteString
"SnapshotIdentifierList"
          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
"String" [Text]
snapshotIdentifierList
      ]

-- | /See:/ 'newBatchModifyClusterSnapshotsResponse' smart constructor.
data BatchModifyClusterSnapshotsResponse = BatchModifyClusterSnapshotsResponse'
  { -- | A list of the snapshots that were modified.
    BatchModifyClusterSnapshotsResponse -> Maybe [Text]
resources :: Prelude.Maybe [Prelude.Text],
    -- | A list of any errors returned.
    BatchModifyClusterSnapshotsResponse -> Maybe [SnapshotErrorMessage]
errors :: Prelude.Maybe [SnapshotErrorMessage],
    -- | The response's http status code.
    BatchModifyClusterSnapshotsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (BatchModifyClusterSnapshotsResponse
-> BatchModifyClusterSnapshotsResponse -> Bool
(BatchModifyClusterSnapshotsResponse
 -> BatchModifyClusterSnapshotsResponse -> Bool)
-> (BatchModifyClusterSnapshotsResponse
    -> BatchModifyClusterSnapshotsResponse -> Bool)
-> Eq BatchModifyClusterSnapshotsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchModifyClusterSnapshotsResponse
-> BatchModifyClusterSnapshotsResponse -> Bool
$c/= :: BatchModifyClusterSnapshotsResponse
-> BatchModifyClusterSnapshotsResponse -> Bool
== :: BatchModifyClusterSnapshotsResponse
-> BatchModifyClusterSnapshotsResponse -> Bool
$c== :: BatchModifyClusterSnapshotsResponse
-> BatchModifyClusterSnapshotsResponse -> Bool
Prelude.Eq, ReadPrec [BatchModifyClusterSnapshotsResponse]
ReadPrec BatchModifyClusterSnapshotsResponse
Int -> ReadS BatchModifyClusterSnapshotsResponse
ReadS [BatchModifyClusterSnapshotsResponse]
(Int -> ReadS BatchModifyClusterSnapshotsResponse)
-> ReadS [BatchModifyClusterSnapshotsResponse]
-> ReadPrec BatchModifyClusterSnapshotsResponse
-> ReadPrec [BatchModifyClusterSnapshotsResponse]
-> Read BatchModifyClusterSnapshotsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchModifyClusterSnapshotsResponse]
$creadListPrec :: ReadPrec [BatchModifyClusterSnapshotsResponse]
readPrec :: ReadPrec BatchModifyClusterSnapshotsResponse
$creadPrec :: ReadPrec BatchModifyClusterSnapshotsResponse
readList :: ReadS [BatchModifyClusterSnapshotsResponse]
$creadList :: ReadS [BatchModifyClusterSnapshotsResponse]
readsPrec :: Int -> ReadS BatchModifyClusterSnapshotsResponse
$creadsPrec :: Int -> ReadS BatchModifyClusterSnapshotsResponse
Prelude.Read, Int -> BatchModifyClusterSnapshotsResponse -> ShowS
[BatchModifyClusterSnapshotsResponse] -> ShowS
BatchModifyClusterSnapshotsResponse -> String
(Int -> BatchModifyClusterSnapshotsResponse -> ShowS)
-> (BatchModifyClusterSnapshotsResponse -> String)
-> ([BatchModifyClusterSnapshotsResponse] -> ShowS)
-> Show BatchModifyClusterSnapshotsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchModifyClusterSnapshotsResponse] -> ShowS
$cshowList :: [BatchModifyClusterSnapshotsResponse] -> ShowS
show :: BatchModifyClusterSnapshotsResponse -> String
$cshow :: BatchModifyClusterSnapshotsResponse -> String
showsPrec :: Int -> BatchModifyClusterSnapshotsResponse -> ShowS
$cshowsPrec :: Int -> BatchModifyClusterSnapshotsResponse -> ShowS
Prelude.Show, (forall x.
 BatchModifyClusterSnapshotsResponse
 -> Rep BatchModifyClusterSnapshotsResponse x)
-> (forall x.
    Rep BatchModifyClusterSnapshotsResponse x
    -> BatchModifyClusterSnapshotsResponse)
-> Generic BatchModifyClusterSnapshotsResponse
forall x.
Rep BatchModifyClusterSnapshotsResponse x
-> BatchModifyClusterSnapshotsResponse
forall x.
BatchModifyClusterSnapshotsResponse
-> Rep BatchModifyClusterSnapshotsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchModifyClusterSnapshotsResponse x
-> BatchModifyClusterSnapshotsResponse
$cfrom :: forall x.
BatchModifyClusterSnapshotsResponse
-> Rep BatchModifyClusterSnapshotsResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchModifyClusterSnapshotsResponse' 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:
--
-- 'resources', 'batchModifyClusterSnapshotsResponse_resources' - A list of the snapshots that were modified.
--
-- 'errors', 'batchModifyClusterSnapshotsResponse_errors' - A list of any errors returned.
--
-- 'httpStatus', 'batchModifyClusterSnapshotsResponse_httpStatus' - The response's http status code.
newBatchModifyClusterSnapshotsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  BatchModifyClusterSnapshotsResponse
newBatchModifyClusterSnapshotsResponse :: Int -> BatchModifyClusterSnapshotsResponse
newBatchModifyClusterSnapshotsResponse Int
pHttpStatus_ =
  BatchModifyClusterSnapshotsResponse' :: Maybe [Text]
-> Maybe [SnapshotErrorMessage]
-> Int
-> BatchModifyClusterSnapshotsResponse
BatchModifyClusterSnapshotsResponse'
    { $sel:resources:BatchModifyClusterSnapshotsResponse' :: Maybe [Text]
resources =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:errors:BatchModifyClusterSnapshotsResponse' :: Maybe [SnapshotErrorMessage]
errors = Maybe [SnapshotErrorMessage]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:BatchModifyClusterSnapshotsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of the snapshots that were modified.
batchModifyClusterSnapshotsResponse_resources :: Lens.Lens' BatchModifyClusterSnapshotsResponse (Prelude.Maybe [Prelude.Text])
batchModifyClusterSnapshotsResponse_resources :: (Maybe [Text] -> f (Maybe [Text]))
-> BatchModifyClusterSnapshotsResponse
-> f BatchModifyClusterSnapshotsResponse
batchModifyClusterSnapshotsResponse_resources = (BatchModifyClusterSnapshotsResponse -> Maybe [Text])
-> (BatchModifyClusterSnapshotsResponse
    -> Maybe [Text] -> BatchModifyClusterSnapshotsResponse)
-> Lens
     BatchModifyClusterSnapshotsResponse
     BatchModifyClusterSnapshotsResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchModifyClusterSnapshotsResponse' {Maybe [Text]
resources :: Maybe [Text]
$sel:resources:BatchModifyClusterSnapshotsResponse' :: BatchModifyClusterSnapshotsResponse -> Maybe [Text]
resources} -> Maybe [Text]
resources) (\s :: BatchModifyClusterSnapshotsResponse
s@BatchModifyClusterSnapshotsResponse' {} Maybe [Text]
a -> BatchModifyClusterSnapshotsResponse
s {$sel:resources:BatchModifyClusterSnapshotsResponse' :: Maybe [Text]
resources = Maybe [Text]
a} :: BatchModifyClusterSnapshotsResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> BatchModifyClusterSnapshotsResponse
 -> f BatchModifyClusterSnapshotsResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> BatchModifyClusterSnapshotsResponse
-> f BatchModifyClusterSnapshotsResponse
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

-- | A list of any errors returned.
batchModifyClusterSnapshotsResponse_errors :: Lens.Lens' BatchModifyClusterSnapshotsResponse (Prelude.Maybe [SnapshotErrorMessage])
batchModifyClusterSnapshotsResponse_errors :: (Maybe [SnapshotErrorMessage] -> f (Maybe [SnapshotErrorMessage]))
-> BatchModifyClusterSnapshotsResponse
-> f BatchModifyClusterSnapshotsResponse
batchModifyClusterSnapshotsResponse_errors = (BatchModifyClusterSnapshotsResponse
 -> Maybe [SnapshotErrorMessage])
-> (BatchModifyClusterSnapshotsResponse
    -> Maybe [SnapshotErrorMessage]
    -> BatchModifyClusterSnapshotsResponse)
-> Lens
     BatchModifyClusterSnapshotsResponse
     BatchModifyClusterSnapshotsResponse
     (Maybe [SnapshotErrorMessage])
     (Maybe [SnapshotErrorMessage])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchModifyClusterSnapshotsResponse' {Maybe [SnapshotErrorMessage]
errors :: Maybe [SnapshotErrorMessage]
$sel:errors:BatchModifyClusterSnapshotsResponse' :: BatchModifyClusterSnapshotsResponse -> Maybe [SnapshotErrorMessage]
errors} -> Maybe [SnapshotErrorMessage]
errors) (\s :: BatchModifyClusterSnapshotsResponse
s@BatchModifyClusterSnapshotsResponse' {} Maybe [SnapshotErrorMessage]
a -> BatchModifyClusterSnapshotsResponse
s {$sel:errors:BatchModifyClusterSnapshotsResponse' :: Maybe [SnapshotErrorMessage]
errors = Maybe [SnapshotErrorMessage]
a} :: BatchModifyClusterSnapshotsResponse) ((Maybe [SnapshotErrorMessage] -> f (Maybe [SnapshotErrorMessage]))
 -> BatchModifyClusterSnapshotsResponse
 -> f BatchModifyClusterSnapshotsResponse)
-> ((Maybe [SnapshotErrorMessage]
     -> f (Maybe [SnapshotErrorMessage]))
    -> Maybe [SnapshotErrorMessage]
    -> f (Maybe [SnapshotErrorMessage]))
-> (Maybe [SnapshotErrorMessage]
    -> f (Maybe [SnapshotErrorMessage]))
-> BatchModifyClusterSnapshotsResponse
-> f BatchModifyClusterSnapshotsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SnapshotErrorMessage]
  [SnapshotErrorMessage]
  [SnapshotErrorMessage]
  [SnapshotErrorMessage]
-> Iso
     (Maybe [SnapshotErrorMessage])
     (Maybe [SnapshotErrorMessage])
     (Maybe [SnapshotErrorMessage])
     (Maybe [SnapshotErrorMessage])
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
  [SnapshotErrorMessage]
  [SnapshotErrorMessage]
  [SnapshotErrorMessage]
  [SnapshotErrorMessage]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
batchModifyClusterSnapshotsResponse_httpStatus :: Lens.Lens' BatchModifyClusterSnapshotsResponse Prelude.Int
batchModifyClusterSnapshotsResponse_httpStatus :: (Int -> f Int)
-> BatchModifyClusterSnapshotsResponse
-> f BatchModifyClusterSnapshotsResponse
batchModifyClusterSnapshotsResponse_httpStatus = (BatchModifyClusterSnapshotsResponse -> Int)
-> (BatchModifyClusterSnapshotsResponse
    -> Int -> BatchModifyClusterSnapshotsResponse)
-> Lens
     BatchModifyClusterSnapshotsResponse
     BatchModifyClusterSnapshotsResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchModifyClusterSnapshotsResponse' {Int
httpStatus :: Int
$sel:httpStatus:BatchModifyClusterSnapshotsResponse' :: BatchModifyClusterSnapshotsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: BatchModifyClusterSnapshotsResponse
s@BatchModifyClusterSnapshotsResponse' {} Int
a -> BatchModifyClusterSnapshotsResponse
s {$sel:httpStatus:BatchModifyClusterSnapshotsResponse' :: Int
httpStatus = Int
a} :: BatchModifyClusterSnapshotsResponse)

instance
  Prelude.NFData
    BatchModifyClusterSnapshotsResponse