{-# 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.RDS.ModifyDBClusterSnapshotAttribute
-- 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)
--
-- Adds an attribute and values to, or removes an attribute and values
-- from, a manual DB cluster snapshot.
--
-- To share a manual DB cluster snapshot with other Amazon Web Services
-- accounts, specify @restore@ as the @AttributeName@ and use the
-- @ValuesToAdd@ parameter to add a list of IDs of the Amazon Web Services
-- accounts that are authorized to restore the manual DB cluster snapshot.
-- Use the value @all@ to make the manual DB cluster snapshot public, which
-- means that it can be copied or restored by all Amazon Web Services
-- accounts.
--
-- Don\'t add the @all@ value for any manual DB cluster snapshots that
-- contain private information that you don\'t want available to all Amazon
-- Web Services accounts.
--
-- If a manual DB cluster snapshot is encrypted, it can be shared, but only
-- by specifying a list of authorized Amazon Web Services account IDs for
-- the @ValuesToAdd@ parameter. You can\'t use @all@ as a value for that
-- parameter in this case.
--
-- To view which Amazon Web Services accounts have access to copy or
-- restore a manual DB cluster snapshot, or whether a manual DB cluster
-- snapshot is public or private, use the
-- DescribeDBClusterSnapshotAttributes API action. The accounts are
-- returned as values for the @restore@ attribute.
--
-- This action only applies to Aurora DB clusters.
module Amazonka.RDS.ModifyDBClusterSnapshotAttribute
  ( -- * Creating a Request
    ModifyDBClusterSnapshotAttribute (..),
    newModifyDBClusterSnapshotAttribute,

    -- * Request Lenses
    modifyDBClusterSnapshotAttribute_valuesToAdd,
    modifyDBClusterSnapshotAttribute_valuesToRemove,
    modifyDBClusterSnapshotAttribute_dbClusterSnapshotIdentifier,
    modifyDBClusterSnapshotAttribute_attributeName,

    -- * Destructuring the Response
    ModifyDBClusterSnapshotAttributeResponse (..),
    newModifyDBClusterSnapshotAttributeResponse,

    -- * Response Lenses
    modifyDBClusterSnapshotAttributeResponse_dbClusterSnapshotAttributesResult,
    modifyDBClusterSnapshotAttributeResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RDS.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- |
--
-- /See:/ 'newModifyDBClusterSnapshotAttribute' smart constructor.
data ModifyDBClusterSnapshotAttribute = ModifyDBClusterSnapshotAttribute'
  { -- | A list of DB cluster snapshot attributes to add to the attribute
    -- specified by @AttributeName@.
    --
    -- To authorize other Amazon Web Services accounts to copy or restore a
    -- manual DB cluster snapshot, set this list to include one or more Amazon
    -- Web Services account IDs, or @all@ to make the manual DB cluster
    -- snapshot restorable by any Amazon Web Services account. Do not add the
    -- @all@ value for any manual DB cluster snapshots that contain private
    -- information that you don\'t want available to all Amazon Web Services
    -- accounts.
    ModifyDBClusterSnapshotAttribute -> Maybe [Text]
valuesToAdd :: Prelude.Maybe [Prelude.Text],
    -- | A list of DB cluster snapshot attributes to remove from the attribute
    -- specified by @AttributeName@.
    --
    -- To remove authorization for other Amazon Web Services accounts to copy
    -- or restore a manual DB cluster snapshot, set this list to include one or
    -- more Amazon Web Services account identifiers, or @all@ to remove
    -- authorization for any Amazon Web Services account to copy or restore the
    -- DB cluster snapshot. If you specify @all@, an Amazon Web Services
    -- account whose account ID is explicitly added to the @restore@ attribute
    -- can still copy or restore a manual DB cluster snapshot.
    ModifyDBClusterSnapshotAttribute -> Maybe [Text]
valuesToRemove :: Prelude.Maybe [Prelude.Text],
    -- | The identifier for the DB cluster snapshot to modify the attributes for.
    ModifyDBClusterSnapshotAttribute -> Text
dbClusterSnapshotIdentifier :: Prelude.Text,
    -- | The name of the DB cluster snapshot attribute to modify.
    --
    -- To manage authorization for other Amazon Web Services accounts to copy
    -- or restore a manual DB cluster snapshot, set this value to @restore@.
    --
    -- To view the list of attributes available to modify, use the
    -- DescribeDBClusterSnapshotAttributes API action.
    ModifyDBClusterSnapshotAttribute -> Text
attributeName :: Prelude.Text
  }
  deriving (ModifyDBClusterSnapshotAttribute
-> ModifyDBClusterSnapshotAttribute -> Bool
(ModifyDBClusterSnapshotAttribute
 -> ModifyDBClusterSnapshotAttribute -> Bool)
-> (ModifyDBClusterSnapshotAttribute
    -> ModifyDBClusterSnapshotAttribute -> Bool)
-> Eq ModifyDBClusterSnapshotAttribute
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyDBClusterSnapshotAttribute
-> ModifyDBClusterSnapshotAttribute -> Bool
$c/= :: ModifyDBClusterSnapshotAttribute
-> ModifyDBClusterSnapshotAttribute -> Bool
== :: ModifyDBClusterSnapshotAttribute
-> ModifyDBClusterSnapshotAttribute -> Bool
$c== :: ModifyDBClusterSnapshotAttribute
-> ModifyDBClusterSnapshotAttribute -> Bool
Prelude.Eq, ReadPrec [ModifyDBClusterSnapshotAttribute]
ReadPrec ModifyDBClusterSnapshotAttribute
Int -> ReadS ModifyDBClusterSnapshotAttribute
ReadS [ModifyDBClusterSnapshotAttribute]
(Int -> ReadS ModifyDBClusterSnapshotAttribute)
-> ReadS [ModifyDBClusterSnapshotAttribute]
-> ReadPrec ModifyDBClusterSnapshotAttribute
-> ReadPrec [ModifyDBClusterSnapshotAttribute]
-> Read ModifyDBClusterSnapshotAttribute
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyDBClusterSnapshotAttribute]
$creadListPrec :: ReadPrec [ModifyDBClusterSnapshotAttribute]
readPrec :: ReadPrec ModifyDBClusterSnapshotAttribute
$creadPrec :: ReadPrec ModifyDBClusterSnapshotAttribute
readList :: ReadS [ModifyDBClusterSnapshotAttribute]
$creadList :: ReadS [ModifyDBClusterSnapshotAttribute]
readsPrec :: Int -> ReadS ModifyDBClusterSnapshotAttribute
$creadsPrec :: Int -> ReadS ModifyDBClusterSnapshotAttribute
Prelude.Read, Int -> ModifyDBClusterSnapshotAttribute -> ShowS
[ModifyDBClusterSnapshotAttribute] -> ShowS
ModifyDBClusterSnapshotAttribute -> String
(Int -> ModifyDBClusterSnapshotAttribute -> ShowS)
-> (ModifyDBClusterSnapshotAttribute -> String)
-> ([ModifyDBClusterSnapshotAttribute] -> ShowS)
-> Show ModifyDBClusterSnapshotAttribute
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyDBClusterSnapshotAttribute] -> ShowS
$cshowList :: [ModifyDBClusterSnapshotAttribute] -> ShowS
show :: ModifyDBClusterSnapshotAttribute -> String
$cshow :: ModifyDBClusterSnapshotAttribute -> String
showsPrec :: Int -> ModifyDBClusterSnapshotAttribute -> ShowS
$cshowsPrec :: Int -> ModifyDBClusterSnapshotAttribute -> ShowS
Prelude.Show, (forall x.
 ModifyDBClusterSnapshotAttribute
 -> Rep ModifyDBClusterSnapshotAttribute x)
-> (forall x.
    Rep ModifyDBClusterSnapshotAttribute x
    -> ModifyDBClusterSnapshotAttribute)
-> Generic ModifyDBClusterSnapshotAttribute
forall x.
Rep ModifyDBClusterSnapshotAttribute x
-> ModifyDBClusterSnapshotAttribute
forall x.
ModifyDBClusterSnapshotAttribute
-> Rep ModifyDBClusterSnapshotAttribute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyDBClusterSnapshotAttribute x
-> ModifyDBClusterSnapshotAttribute
$cfrom :: forall x.
ModifyDBClusterSnapshotAttribute
-> Rep ModifyDBClusterSnapshotAttribute x
Prelude.Generic)

-- |
-- Create a value of 'ModifyDBClusterSnapshotAttribute' 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:
--
-- 'valuesToAdd', 'modifyDBClusterSnapshotAttribute_valuesToAdd' - A list of DB cluster snapshot attributes to add to the attribute
-- specified by @AttributeName@.
--
-- To authorize other Amazon Web Services accounts to copy or restore a
-- manual DB cluster snapshot, set this list to include one or more Amazon
-- Web Services account IDs, or @all@ to make the manual DB cluster
-- snapshot restorable by any Amazon Web Services account. Do not add the
-- @all@ value for any manual DB cluster snapshots that contain private
-- information that you don\'t want available to all Amazon Web Services
-- accounts.
--
-- 'valuesToRemove', 'modifyDBClusterSnapshotAttribute_valuesToRemove' - A list of DB cluster snapshot attributes to remove from the attribute
-- specified by @AttributeName@.
--
-- To remove authorization for other Amazon Web Services accounts to copy
-- or restore a manual DB cluster snapshot, set this list to include one or
-- more Amazon Web Services account identifiers, or @all@ to remove
-- authorization for any Amazon Web Services account to copy or restore the
-- DB cluster snapshot. If you specify @all@, an Amazon Web Services
-- account whose account ID is explicitly added to the @restore@ attribute
-- can still copy or restore a manual DB cluster snapshot.
--
-- 'dbClusterSnapshotIdentifier', 'modifyDBClusterSnapshotAttribute_dbClusterSnapshotIdentifier' - The identifier for the DB cluster snapshot to modify the attributes for.
--
-- 'attributeName', 'modifyDBClusterSnapshotAttribute_attributeName' - The name of the DB cluster snapshot attribute to modify.
--
-- To manage authorization for other Amazon Web Services accounts to copy
-- or restore a manual DB cluster snapshot, set this value to @restore@.
--
-- To view the list of attributes available to modify, use the
-- DescribeDBClusterSnapshotAttributes API action.
newModifyDBClusterSnapshotAttribute ::
  -- | 'dbClusterSnapshotIdentifier'
  Prelude.Text ->
  -- | 'attributeName'
  Prelude.Text ->
  ModifyDBClusterSnapshotAttribute
newModifyDBClusterSnapshotAttribute :: Text -> Text -> ModifyDBClusterSnapshotAttribute
newModifyDBClusterSnapshotAttribute
  Text
pDBClusterSnapshotIdentifier_
  Text
pAttributeName_ =
    ModifyDBClusterSnapshotAttribute' :: Maybe [Text]
-> Maybe [Text] -> Text -> Text -> ModifyDBClusterSnapshotAttribute
ModifyDBClusterSnapshotAttribute'
      { $sel:valuesToAdd:ModifyDBClusterSnapshotAttribute' :: Maybe [Text]
valuesToAdd =
          Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:valuesToRemove:ModifyDBClusterSnapshotAttribute' :: Maybe [Text]
valuesToRemove = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:dbClusterSnapshotIdentifier:ModifyDBClusterSnapshotAttribute' :: Text
dbClusterSnapshotIdentifier =
          Text
pDBClusterSnapshotIdentifier_,
        $sel:attributeName:ModifyDBClusterSnapshotAttribute' :: Text
attributeName = Text
pAttributeName_
      }

-- | A list of DB cluster snapshot attributes to add to the attribute
-- specified by @AttributeName@.
--
-- To authorize other Amazon Web Services accounts to copy or restore a
-- manual DB cluster snapshot, set this list to include one or more Amazon
-- Web Services account IDs, or @all@ to make the manual DB cluster
-- snapshot restorable by any Amazon Web Services account. Do not add the
-- @all@ value for any manual DB cluster snapshots that contain private
-- information that you don\'t want available to all Amazon Web Services
-- accounts.
modifyDBClusterSnapshotAttribute_valuesToAdd :: Lens.Lens' ModifyDBClusterSnapshotAttribute (Prelude.Maybe [Prelude.Text])
modifyDBClusterSnapshotAttribute_valuesToAdd :: (Maybe [Text] -> f (Maybe [Text]))
-> ModifyDBClusterSnapshotAttribute
-> f ModifyDBClusterSnapshotAttribute
modifyDBClusterSnapshotAttribute_valuesToAdd = (ModifyDBClusterSnapshotAttribute -> Maybe [Text])
-> (ModifyDBClusterSnapshotAttribute
    -> Maybe [Text] -> ModifyDBClusterSnapshotAttribute)
-> Lens
     ModifyDBClusterSnapshotAttribute
     ModifyDBClusterSnapshotAttribute
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyDBClusterSnapshotAttribute' {Maybe [Text]
valuesToAdd :: Maybe [Text]
$sel:valuesToAdd:ModifyDBClusterSnapshotAttribute' :: ModifyDBClusterSnapshotAttribute -> Maybe [Text]
valuesToAdd} -> Maybe [Text]
valuesToAdd) (\s :: ModifyDBClusterSnapshotAttribute
s@ModifyDBClusterSnapshotAttribute' {} Maybe [Text]
a -> ModifyDBClusterSnapshotAttribute
s {$sel:valuesToAdd:ModifyDBClusterSnapshotAttribute' :: Maybe [Text]
valuesToAdd = Maybe [Text]
a} :: ModifyDBClusterSnapshotAttribute) ((Maybe [Text] -> f (Maybe [Text]))
 -> ModifyDBClusterSnapshotAttribute
 -> f ModifyDBClusterSnapshotAttribute)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ModifyDBClusterSnapshotAttribute
-> f ModifyDBClusterSnapshotAttribute
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 DB cluster snapshot attributes to remove from the attribute
-- specified by @AttributeName@.
--
-- To remove authorization for other Amazon Web Services accounts to copy
-- or restore a manual DB cluster snapshot, set this list to include one or
-- more Amazon Web Services account identifiers, or @all@ to remove
-- authorization for any Amazon Web Services account to copy or restore the
-- DB cluster snapshot. If you specify @all@, an Amazon Web Services
-- account whose account ID is explicitly added to the @restore@ attribute
-- can still copy or restore a manual DB cluster snapshot.
modifyDBClusterSnapshotAttribute_valuesToRemove :: Lens.Lens' ModifyDBClusterSnapshotAttribute (Prelude.Maybe [Prelude.Text])
modifyDBClusterSnapshotAttribute_valuesToRemove :: (Maybe [Text] -> f (Maybe [Text]))
-> ModifyDBClusterSnapshotAttribute
-> f ModifyDBClusterSnapshotAttribute
modifyDBClusterSnapshotAttribute_valuesToRemove = (ModifyDBClusterSnapshotAttribute -> Maybe [Text])
-> (ModifyDBClusterSnapshotAttribute
    -> Maybe [Text] -> ModifyDBClusterSnapshotAttribute)
-> Lens
     ModifyDBClusterSnapshotAttribute
     ModifyDBClusterSnapshotAttribute
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyDBClusterSnapshotAttribute' {Maybe [Text]
valuesToRemove :: Maybe [Text]
$sel:valuesToRemove:ModifyDBClusterSnapshotAttribute' :: ModifyDBClusterSnapshotAttribute -> Maybe [Text]
valuesToRemove} -> Maybe [Text]
valuesToRemove) (\s :: ModifyDBClusterSnapshotAttribute
s@ModifyDBClusterSnapshotAttribute' {} Maybe [Text]
a -> ModifyDBClusterSnapshotAttribute
s {$sel:valuesToRemove:ModifyDBClusterSnapshotAttribute' :: Maybe [Text]
valuesToRemove = Maybe [Text]
a} :: ModifyDBClusterSnapshotAttribute) ((Maybe [Text] -> f (Maybe [Text]))
 -> ModifyDBClusterSnapshotAttribute
 -> f ModifyDBClusterSnapshotAttribute)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ModifyDBClusterSnapshotAttribute
-> f ModifyDBClusterSnapshotAttribute
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 identifier for the DB cluster snapshot to modify the attributes for.
modifyDBClusterSnapshotAttribute_dbClusterSnapshotIdentifier :: Lens.Lens' ModifyDBClusterSnapshotAttribute Prelude.Text
modifyDBClusterSnapshotAttribute_dbClusterSnapshotIdentifier :: (Text -> f Text)
-> ModifyDBClusterSnapshotAttribute
-> f ModifyDBClusterSnapshotAttribute
modifyDBClusterSnapshotAttribute_dbClusterSnapshotIdentifier = (ModifyDBClusterSnapshotAttribute -> Text)
-> (ModifyDBClusterSnapshotAttribute
    -> Text -> ModifyDBClusterSnapshotAttribute)
-> Lens
     ModifyDBClusterSnapshotAttribute
     ModifyDBClusterSnapshotAttribute
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyDBClusterSnapshotAttribute' {Text
dbClusterSnapshotIdentifier :: Text
$sel:dbClusterSnapshotIdentifier:ModifyDBClusterSnapshotAttribute' :: ModifyDBClusterSnapshotAttribute -> Text
dbClusterSnapshotIdentifier} -> Text
dbClusterSnapshotIdentifier) (\s :: ModifyDBClusterSnapshotAttribute
s@ModifyDBClusterSnapshotAttribute' {} Text
a -> ModifyDBClusterSnapshotAttribute
s {$sel:dbClusterSnapshotIdentifier:ModifyDBClusterSnapshotAttribute' :: Text
dbClusterSnapshotIdentifier = Text
a} :: ModifyDBClusterSnapshotAttribute)

-- | The name of the DB cluster snapshot attribute to modify.
--
-- To manage authorization for other Amazon Web Services accounts to copy
-- or restore a manual DB cluster snapshot, set this value to @restore@.
--
-- To view the list of attributes available to modify, use the
-- DescribeDBClusterSnapshotAttributes API action.
modifyDBClusterSnapshotAttribute_attributeName :: Lens.Lens' ModifyDBClusterSnapshotAttribute Prelude.Text
modifyDBClusterSnapshotAttribute_attributeName :: (Text -> f Text)
-> ModifyDBClusterSnapshotAttribute
-> f ModifyDBClusterSnapshotAttribute
modifyDBClusterSnapshotAttribute_attributeName = (ModifyDBClusterSnapshotAttribute -> Text)
-> (ModifyDBClusterSnapshotAttribute
    -> Text -> ModifyDBClusterSnapshotAttribute)
-> Lens
     ModifyDBClusterSnapshotAttribute
     ModifyDBClusterSnapshotAttribute
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyDBClusterSnapshotAttribute' {Text
attributeName :: Text
$sel:attributeName:ModifyDBClusterSnapshotAttribute' :: ModifyDBClusterSnapshotAttribute -> Text
attributeName} -> Text
attributeName) (\s :: ModifyDBClusterSnapshotAttribute
s@ModifyDBClusterSnapshotAttribute' {} Text
a -> ModifyDBClusterSnapshotAttribute
s {$sel:attributeName:ModifyDBClusterSnapshotAttribute' :: Text
attributeName = Text
a} :: ModifyDBClusterSnapshotAttribute)

instance
  Core.AWSRequest
    ModifyDBClusterSnapshotAttribute
  where
  type
    AWSResponse ModifyDBClusterSnapshotAttribute =
      ModifyDBClusterSnapshotAttributeResponse
  request :: ModifyDBClusterSnapshotAttribute
-> Request ModifyDBClusterSnapshotAttribute
request = Service
-> ModifyDBClusterSnapshotAttribute
-> Request ModifyDBClusterSnapshotAttribute
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ModifyDBClusterSnapshotAttribute
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ModifyDBClusterSnapshotAttribute)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ModifyDBClusterSnapshotAttribute))
-> Logger
-> Service
-> Proxy ModifyDBClusterSnapshotAttribute
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ModifyDBClusterSnapshotAttribute)))
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
"ModifyDBClusterSnapshotAttributeResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe DBClusterSnapshotAttributesResult
-> Int -> ModifyDBClusterSnapshotAttributeResponse
ModifyDBClusterSnapshotAttributeResponse'
            (Maybe DBClusterSnapshotAttributesResult
 -> Int -> ModifyDBClusterSnapshotAttributeResponse)
-> Either String (Maybe DBClusterSnapshotAttributesResult)
-> Either String (Int -> ModifyDBClusterSnapshotAttributeResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node]
-> Text -> Either String (Maybe DBClusterSnapshotAttributesResult)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DBClusterSnapshotAttributesResult")
            Either String (Int -> ModifyDBClusterSnapshotAttributeResponse)
-> Either String Int
-> Either String ModifyDBClusterSnapshotAttributeResponse
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
    ModifyDBClusterSnapshotAttribute

instance
  Prelude.NFData
    ModifyDBClusterSnapshotAttribute

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

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

instance
  Core.ToQuery
    ModifyDBClusterSnapshotAttribute
  where
  toQuery :: ModifyDBClusterSnapshotAttribute -> QueryString
toQuery ModifyDBClusterSnapshotAttribute' {Maybe [Text]
Text
attributeName :: Text
dbClusterSnapshotIdentifier :: Text
valuesToRemove :: Maybe [Text]
valuesToAdd :: Maybe [Text]
$sel:attributeName:ModifyDBClusterSnapshotAttribute' :: ModifyDBClusterSnapshotAttribute -> Text
$sel:dbClusterSnapshotIdentifier:ModifyDBClusterSnapshotAttribute' :: ModifyDBClusterSnapshotAttribute -> Text
$sel:valuesToRemove:ModifyDBClusterSnapshotAttribute' :: ModifyDBClusterSnapshotAttribute -> Maybe [Text]
$sel:valuesToAdd:ModifyDBClusterSnapshotAttribute' :: ModifyDBClusterSnapshotAttribute -> Maybe [Text]
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"ModifyDBClusterSnapshotAttribute" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
        ByteString
"ValuesToAdd"
          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
"AttributeValue"
                ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
valuesToAdd
            ),
        ByteString
"ValuesToRemove"
          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
"AttributeValue"
                ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
valuesToRemove
            ),
        ByteString
"DBClusterSnapshotIdentifier"
          ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
dbClusterSnapshotIdentifier,
        ByteString
"AttributeName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
attributeName
      ]

-- | /See:/ 'newModifyDBClusterSnapshotAttributeResponse' smart constructor.
data ModifyDBClusterSnapshotAttributeResponse = ModifyDBClusterSnapshotAttributeResponse'
  { ModifyDBClusterSnapshotAttributeResponse
-> Maybe DBClusterSnapshotAttributesResult
dbClusterSnapshotAttributesResult :: Prelude.Maybe DBClusterSnapshotAttributesResult,
    -- | The response's http status code.
    ModifyDBClusterSnapshotAttributeResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ModifyDBClusterSnapshotAttributeResponse
-> ModifyDBClusterSnapshotAttributeResponse -> Bool
(ModifyDBClusterSnapshotAttributeResponse
 -> ModifyDBClusterSnapshotAttributeResponse -> Bool)
-> (ModifyDBClusterSnapshotAttributeResponse
    -> ModifyDBClusterSnapshotAttributeResponse -> Bool)
-> Eq ModifyDBClusterSnapshotAttributeResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyDBClusterSnapshotAttributeResponse
-> ModifyDBClusterSnapshotAttributeResponse -> Bool
$c/= :: ModifyDBClusterSnapshotAttributeResponse
-> ModifyDBClusterSnapshotAttributeResponse -> Bool
== :: ModifyDBClusterSnapshotAttributeResponse
-> ModifyDBClusterSnapshotAttributeResponse -> Bool
$c== :: ModifyDBClusterSnapshotAttributeResponse
-> ModifyDBClusterSnapshotAttributeResponse -> Bool
Prelude.Eq, ReadPrec [ModifyDBClusterSnapshotAttributeResponse]
ReadPrec ModifyDBClusterSnapshotAttributeResponse
Int -> ReadS ModifyDBClusterSnapshotAttributeResponse
ReadS [ModifyDBClusterSnapshotAttributeResponse]
(Int -> ReadS ModifyDBClusterSnapshotAttributeResponse)
-> ReadS [ModifyDBClusterSnapshotAttributeResponse]
-> ReadPrec ModifyDBClusterSnapshotAttributeResponse
-> ReadPrec [ModifyDBClusterSnapshotAttributeResponse]
-> Read ModifyDBClusterSnapshotAttributeResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyDBClusterSnapshotAttributeResponse]
$creadListPrec :: ReadPrec [ModifyDBClusterSnapshotAttributeResponse]
readPrec :: ReadPrec ModifyDBClusterSnapshotAttributeResponse
$creadPrec :: ReadPrec ModifyDBClusterSnapshotAttributeResponse
readList :: ReadS [ModifyDBClusterSnapshotAttributeResponse]
$creadList :: ReadS [ModifyDBClusterSnapshotAttributeResponse]
readsPrec :: Int -> ReadS ModifyDBClusterSnapshotAttributeResponse
$creadsPrec :: Int -> ReadS ModifyDBClusterSnapshotAttributeResponse
Prelude.Read, Int -> ModifyDBClusterSnapshotAttributeResponse -> ShowS
[ModifyDBClusterSnapshotAttributeResponse] -> ShowS
ModifyDBClusterSnapshotAttributeResponse -> String
(Int -> ModifyDBClusterSnapshotAttributeResponse -> ShowS)
-> (ModifyDBClusterSnapshotAttributeResponse -> String)
-> ([ModifyDBClusterSnapshotAttributeResponse] -> ShowS)
-> Show ModifyDBClusterSnapshotAttributeResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyDBClusterSnapshotAttributeResponse] -> ShowS
$cshowList :: [ModifyDBClusterSnapshotAttributeResponse] -> ShowS
show :: ModifyDBClusterSnapshotAttributeResponse -> String
$cshow :: ModifyDBClusterSnapshotAttributeResponse -> String
showsPrec :: Int -> ModifyDBClusterSnapshotAttributeResponse -> ShowS
$cshowsPrec :: Int -> ModifyDBClusterSnapshotAttributeResponse -> ShowS
Prelude.Show, (forall x.
 ModifyDBClusterSnapshotAttributeResponse
 -> Rep ModifyDBClusterSnapshotAttributeResponse x)
-> (forall x.
    Rep ModifyDBClusterSnapshotAttributeResponse x
    -> ModifyDBClusterSnapshotAttributeResponse)
-> Generic ModifyDBClusterSnapshotAttributeResponse
forall x.
Rep ModifyDBClusterSnapshotAttributeResponse x
-> ModifyDBClusterSnapshotAttributeResponse
forall x.
ModifyDBClusterSnapshotAttributeResponse
-> Rep ModifyDBClusterSnapshotAttributeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyDBClusterSnapshotAttributeResponse x
-> ModifyDBClusterSnapshotAttributeResponse
$cfrom :: forall x.
ModifyDBClusterSnapshotAttributeResponse
-> Rep ModifyDBClusterSnapshotAttributeResponse x
Prelude.Generic)

-- |
-- Create a value of 'ModifyDBClusterSnapshotAttributeResponse' 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:
--
-- 'dbClusterSnapshotAttributesResult', 'modifyDBClusterSnapshotAttributeResponse_dbClusterSnapshotAttributesResult' - Undocumented member.
--
-- 'httpStatus', 'modifyDBClusterSnapshotAttributeResponse_httpStatus' - The response's http status code.
newModifyDBClusterSnapshotAttributeResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ModifyDBClusterSnapshotAttributeResponse
newModifyDBClusterSnapshotAttributeResponse :: Int -> ModifyDBClusterSnapshotAttributeResponse
newModifyDBClusterSnapshotAttributeResponse
  Int
pHttpStatus_ =
    ModifyDBClusterSnapshotAttributeResponse' :: Maybe DBClusterSnapshotAttributesResult
-> Int -> ModifyDBClusterSnapshotAttributeResponse
ModifyDBClusterSnapshotAttributeResponse'
      { $sel:dbClusterSnapshotAttributesResult:ModifyDBClusterSnapshotAttributeResponse' :: Maybe DBClusterSnapshotAttributesResult
dbClusterSnapshotAttributesResult =
          Maybe DBClusterSnapshotAttributesResult
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ModifyDBClusterSnapshotAttributeResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Undocumented member.
modifyDBClusterSnapshotAttributeResponse_dbClusterSnapshotAttributesResult :: Lens.Lens' ModifyDBClusterSnapshotAttributeResponse (Prelude.Maybe DBClusterSnapshotAttributesResult)
modifyDBClusterSnapshotAttributeResponse_dbClusterSnapshotAttributesResult :: (Maybe DBClusterSnapshotAttributesResult
 -> f (Maybe DBClusterSnapshotAttributesResult))
-> ModifyDBClusterSnapshotAttributeResponse
-> f ModifyDBClusterSnapshotAttributeResponse
modifyDBClusterSnapshotAttributeResponse_dbClusterSnapshotAttributesResult = (ModifyDBClusterSnapshotAttributeResponse
 -> Maybe DBClusterSnapshotAttributesResult)
-> (ModifyDBClusterSnapshotAttributeResponse
    -> Maybe DBClusterSnapshotAttributesResult
    -> ModifyDBClusterSnapshotAttributeResponse)
-> Lens
     ModifyDBClusterSnapshotAttributeResponse
     ModifyDBClusterSnapshotAttributeResponse
     (Maybe DBClusterSnapshotAttributesResult)
     (Maybe DBClusterSnapshotAttributesResult)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyDBClusterSnapshotAttributeResponse' {Maybe DBClusterSnapshotAttributesResult
dbClusterSnapshotAttributesResult :: Maybe DBClusterSnapshotAttributesResult
$sel:dbClusterSnapshotAttributesResult:ModifyDBClusterSnapshotAttributeResponse' :: ModifyDBClusterSnapshotAttributeResponse
-> Maybe DBClusterSnapshotAttributesResult
dbClusterSnapshotAttributesResult} -> Maybe DBClusterSnapshotAttributesResult
dbClusterSnapshotAttributesResult) (\s :: ModifyDBClusterSnapshotAttributeResponse
s@ModifyDBClusterSnapshotAttributeResponse' {} Maybe DBClusterSnapshotAttributesResult
a -> ModifyDBClusterSnapshotAttributeResponse
s {$sel:dbClusterSnapshotAttributesResult:ModifyDBClusterSnapshotAttributeResponse' :: Maybe DBClusterSnapshotAttributesResult
dbClusterSnapshotAttributesResult = Maybe DBClusterSnapshotAttributesResult
a} :: ModifyDBClusterSnapshotAttributeResponse)

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

instance
  Prelude.NFData
    ModifyDBClusterSnapshotAttributeResponse