{-# 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.Neptune.RemoveRoleFromDBCluster
-- 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)
--
-- Disassociates an Identity and Access Management (IAM) role from a DB
-- cluster.
module Amazonka.Neptune.RemoveRoleFromDBCluster
  ( -- * Creating a Request
    RemoveRoleFromDBCluster (..),
    newRemoveRoleFromDBCluster,

    -- * Request Lenses
    removeRoleFromDBCluster_featureName,
    removeRoleFromDBCluster_dbClusterIdentifier,
    removeRoleFromDBCluster_roleArn,

    -- * Destructuring the Response
    RemoveRoleFromDBClusterResponse (..),
    newRemoveRoleFromDBClusterResponse,
  )
where

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

-- | /See:/ 'newRemoveRoleFromDBCluster' smart constructor.
data RemoveRoleFromDBCluster = RemoveRoleFromDBCluster'
  { -- | The name of the feature for the DB cluster that the IAM role is to be
    -- disassociated from. For the list of supported feature names, see
    -- DBEngineVersion.
    RemoveRoleFromDBCluster -> Maybe Text
featureName :: Prelude.Maybe Prelude.Text,
    -- | The name of the DB cluster to disassociate the IAM role from.
    RemoveRoleFromDBCluster -> Text
dbClusterIdentifier :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the IAM role to disassociate from the
    -- DB cluster, for example
    -- @arn:aws:iam::123456789012:role\/NeptuneAccessRole@.
    RemoveRoleFromDBCluster -> Text
roleArn :: Prelude.Text
  }
  deriving (RemoveRoleFromDBCluster -> RemoveRoleFromDBCluster -> Bool
(RemoveRoleFromDBCluster -> RemoveRoleFromDBCluster -> Bool)
-> (RemoveRoleFromDBCluster -> RemoveRoleFromDBCluster -> Bool)
-> Eq RemoveRoleFromDBCluster
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemoveRoleFromDBCluster -> RemoveRoleFromDBCluster -> Bool
$c/= :: RemoveRoleFromDBCluster -> RemoveRoleFromDBCluster -> Bool
== :: RemoveRoleFromDBCluster -> RemoveRoleFromDBCluster -> Bool
$c== :: RemoveRoleFromDBCluster -> RemoveRoleFromDBCluster -> Bool
Prelude.Eq, ReadPrec [RemoveRoleFromDBCluster]
ReadPrec RemoveRoleFromDBCluster
Int -> ReadS RemoveRoleFromDBCluster
ReadS [RemoveRoleFromDBCluster]
(Int -> ReadS RemoveRoleFromDBCluster)
-> ReadS [RemoveRoleFromDBCluster]
-> ReadPrec RemoveRoleFromDBCluster
-> ReadPrec [RemoveRoleFromDBCluster]
-> Read RemoveRoleFromDBCluster
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemoveRoleFromDBCluster]
$creadListPrec :: ReadPrec [RemoveRoleFromDBCluster]
readPrec :: ReadPrec RemoveRoleFromDBCluster
$creadPrec :: ReadPrec RemoveRoleFromDBCluster
readList :: ReadS [RemoveRoleFromDBCluster]
$creadList :: ReadS [RemoveRoleFromDBCluster]
readsPrec :: Int -> ReadS RemoveRoleFromDBCluster
$creadsPrec :: Int -> ReadS RemoveRoleFromDBCluster
Prelude.Read, Int -> RemoveRoleFromDBCluster -> ShowS
[RemoveRoleFromDBCluster] -> ShowS
RemoveRoleFromDBCluster -> String
(Int -> RemoveRoleFromDBCluster -> ShowS)
-> (RemoveRoleFromDBCluster -> String)
-> ([RemoveRoleFromDBCluster] -> ShowS)
-> Show RemoveRoleFromDBCluster
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemoveRoleFromDBCluster] -> ShowS
$cshowList :: [RemoveRoleFromDBCluster] -> ShowS
show :: RemoveRoleFromDBCluster -> String
$cshow :: RemoveRoleFromDBCluster -> String
showsPrec :: Int -> RemoveRoleFromDBCluster -> ShowS
$cshowsPrec :: Int -> RemoveRoleFromDBCluster -> ShowS
Prelude.Show, (forall x.
 RemoveRoleFromDBCluster -> Rep RemoveRoleFromDBCluster x)
-> (forall x.
    Rep RemoveRoleFromDBCluster x -> RemoveRoleFromDBCluster)
-> Generic RemoveRoleFromDBCluster
forall x. Rep RemoveRoleFromDBCluster x -> RemoveRoleFromDBCluster
forall x. RemoveRoleFromDBCluster -> Rep RemoveRoleFromDBCluster x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RemoveRoleFromDBCluster x -> RemoveRoleFromDBCluster
$cfrom :: forall x. RemoveRoleFromDBCluster -> Rep RemoveRoleFromDBCluster x
Prelude.Generic)

-- |
-- Create a value of 'RemoveRoleFromDBCluster' 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:
--
-- 'featureName', 'removeRoleFromDBCluster_featureName' - The name of the feature for the DB cluster that the IAM role is to be
-- disassociated from. For the list of supported feature names, see
-- DBEngineVersion.
--
-- 'dbClusterIdentifier', 'removeRoleFromDBCluster_dbClusterIdentifier' - The name of the DB cluster to disassociate the IAM role from.
--
-- 'roleArn', 'removeRoleFromDBCluster_roleArn' - The Amazon Resource Name (ARN) of the IAM role to disassociate from the
-- DB cluster, for example
-- @arn:aws:iam::123456789012:role\/NeptuneAccessRole@.
newRemoveRoleFromDBCluster ::
  -- | 'dbClusterIdentifier'
  Prelude.Text ->
  -- | 'roleArn'
  Prelude.Text ->
  RemoveRoleFromDBCluster
newRemoveRoleFromDBCluster :: Text -> Text -> RemoveRoleFromDBCluster
newRemoveRoleFromDBCluster
  Text
pDBClusterIdentifier_
  Text
pRoleArn_ =
    RemoveRoleFromDBCluster' :: Maybe Text -> Text -> Text -> RemoveRoleFromDBCluster
RemoveRoleFromDBCluster'
      { $sel:featureName:RemoveRoleFromDBCluster' :: Maybe Text
featureName =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:dbClusterIdentifier:RemoveRoleFromDBCluster' :: Text
dbClusterIdentifier = Text
pDBClusterIdentifier_,
        $sel:roleArn:RemoveRoleFromDBCluster' :: Text
roleArn = Text
pRoleArn_
      }

-- | The name of the feature for the DB cluster that the IAM role is to be
-- disassociated from. For the list of supported feature names, see
-- DBEngineVersion.
removeRoleFromDBCluster_featureName :: Lens.Lens' RemoveRoleFromDBCluster (Prelude.Maybe Prelude.Text)
removeRoleFromDBCluster_featureName :: (Maybe Text -> f (Maybe Text))
-> RemoveRoleFromDBCluster -> f RemoveRoleFromDBCluster
removeRoleFromDBCluster_featureName = (RemoveRoleFromDBCluster -> Maybe Text)
-> (RemoveRoleFromDBCluster
    -> Maybe Text -> RemoveRoleFromDBCluster)
-> Lens
     RemoveRoleFromDBCluster
     RemoveRoleFromDBCluster
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveRoleFromDBCluster' {Maybe Text
featureName :: Maybe Text
$sel:featureName:RemoveRoleFromDBCluster' :: RemoveRoleFromDBCluster -> Maybe Text
featureName} -> Maybe Text
featureName) (\s :: RemoveRoleFromDBCluster
s@RemoveRoleFromDBCluster' {} Maybe Text
a -> RemoveRoleFromDBCluster
s {$sel:featureName:RemoveRoleFromDBCluster' :: Maybe Text
featureName = Maybe Text
a} :: RemoveRoleFromDBCluster)

-- | The name of the DB cluster to disassociate the IAM role from.
removeRoleFromDBCluster_dbClusterIdentifier :: Lens.Lens' RemoveRoleFromDBCluster Prelude.Text
removeRoleFromDBCluster_dbClusterIdentifier :: (Text -> f Text)
-> RemoveRoleFromDBCluster -> f RemoveRoleFromDBCluster
removeRoleFromDBCluster_dbClusterIdentifier = (RemoveRoleFromDBCluster -> Text)
-> (RemoveRoleFromDBCluster -> Text -> RemoveRoleFromDBCluster)
-> Lens RemoveRoleFromDBCluster RemoveRoleFromDBCluster Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveRoleFromDBCluster' {Text
dbClusterIdentifier :: Text
$sel:dbClusterIdentifier:RemoveRoleFromDBCluster' :: RemoveRoleFromDBCluster -> Text
dbClusterIdentifier} -> Text
dbClusterIdentifier) (\s :: RemoveRoleFromDBCluster
s@RemoveRoleFromDBCluster' {} Text
a -> RemoveRoleFromDBCluster
s {$sel:dbClusterIdentifier:RemoveRoleFromDBCluster' :: Text
dbClusterIdentifier = Text
a} :: RemoveRoleFromDBCluster)

-- | The Amazon Resource Name (ARN) of the IAM role to disassociate from the
-- DB cluster, for example
-- @arn:aws:iam::123456789012:role\/NeptuneAccessRole@.
removeRoleFromDBCluster_roleArn :: Lens.Lens' RemoveRoleFromDBCluster Prelude.Text
removeRoleFromDBCluster_roleArn :: (Text -> f Text)
-> RemoveRoleFromDBCluster -> f RemoveRoleFromDBCluster
removeRoleFromDBCluster_roleArn = (RemoveRoleFromDBCluster -> Text)
-> (RemoveRoleFromDBCluster -> Text -> RemoveRoleFromDBCluster)
-> Lens RemoveRoleFromDBCluster RemoveRoleFromDBCluster Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveRoleFromDBCluster' {Text
roleArn :: Text
$sel:roleArn:RemoveRoleFromDBCluster' :: RemoveRoleFromDBCluster -> Text
roleArn} -> Text
roleArn) (\s :: RemoveRoleFromDBCluster
s@RemoveRoleFromDBCluster' {} Text
a -> RemoveRoleFromDBCluster
s {$sel:roleArn:RemoveRoleFromDBCluster' :: Text
roleArn = Text
a} :: RemoveRoleFromDBCluster)

instance Core.AWSRequest RemoveRoleFromDBCluster where
  type
    AWSResponse RemoveRoleFromDBCluster =
      RemoveRoleFromDBClusterResponse
  request :: RemoveRoleFromDBCluster -> Request RemoveRoleFromDBCluster
request = Service
-> RemoveRoleFromDBCluster -> Request RemoveRoleFromDBCluster
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy RemoveRoleFromDBCluster
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse RemoveRoleFromDBCluster)))
response =
    AWSResponse RemoveRoleFromDBCluster
-> Logger
-> Service
-> Proxy RemoveRoleFromDBCluster
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse RemoveRoleFromDBCluster)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse RemoveRoleFromDBCluster
RemoveRoleFromDBClusterResponse
RemoveRoleFromDBClusterResponse'

instance Prelude.Hashable RemoveRoleFromDBCluster

instance Prelude.NFData RemoveRoleFromDBCluster

instance Core.ToHeaders RemoveRoleFromDBCluster where
  toHeaders :: RemoveRoleFromDBCluster -> [Header]
toHeaders = [Header] -> RemoveRoleFromDBCluster -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery RemoveRoleFromDBCluster where
  toQuery :: RemoveRoleFromDBCluster -> QueryString
toQuery RemoveRoleFromDBCluster' {Maybe Text
Text
roleArn :: Text
dbClusterIdentifier :: Text
featureName :: Maybe Text
$sel:roleArn:RemoveRoleFromDBCluster' :: RemoveRoleFromDBCluster -> Text
$sel:dbClusterIdentifier:RemoveRoleFromDBCluster' :: RemoveRoleFromDBCluster -> Text
$sel:featureName:RemoveRoleFromDBCluster' :: RemoveRoleFromDBCluster -> 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
"RemoveRoleFromDBCluster" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
        ByteString
"FeatureName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
featureName,
        ByteString
"DBClusterIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
dbClusterIdentifier,
        ByteString
"RoleArn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
roleArn
      ]

-- | /See:/ 'newRemoveRoleFromDBClusterResponse' smart constructor.
data RemoveRoleFromDBClusterResponse = RemoveRoleFromDBClusterResponse'
  {
  }
  deriving (RemoveRoleFromDBClusterResponse
-> RemoveRoleFromDBClusterResponse -> Bool
(RemoveRoleFromDBClusterResponse
 -> RemoveRoleFromDBClusterResponse -> Bool)
-> (RemoveRoleFromDBClusterResponse
    -> RemoveRoleFromDBClusterResponse -> Bool)
-> Eq RemoveRoleFromDBClusterResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemoveRoleFromDBClusterResponse
-> RemoveRoleFromDBClusterResponse -> Bool
$c/= :: RemoveRoleFromDBClusterResponse
-> RemoveRoleFromDBClusterResponse -> Bool
== :: RemoveRoleFromDBClusterResponse
-> RemoveRoleFromDBClusterResponse -> Bool
$c== :: RemoveRoleFromDBClusterResponse
-> RemoveRoleFromDBClusterResponse -> Bool
Prelude.Eq, ReadPrec [RemoveRoleFromDBClusterResponse]
ReadPrec RemoveRoleFromDBClusterResponse
Int -> ReadS RemoveRoleFromDBClusterResponse
ReadS [RemoveRoleFromDBClusterResponse]
(Int -> ReadS RemoveRoleFromDBClusterResponse)
-> ReadS [RemoveRoleFromDBClusterResponse]
-> ReadPrec RemoveRoleFromDBClusterResponse
-> ReadPrec [RemoveRoleFromDBClusterResponse]
-> Read RemoveRoleFromDBClusterResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemoveRoleFromDBClusterResponse]
$creadListPrec :: ReadPrec [RemoveRoleFromDBClusterResponse]
readPrec :: ReadPrec RemoveRoleFromDBClusterResponse
$creadPrec :: ReadPrec RemoveRoleFromDBClusterResponse
readList :: ReadS [RemoveRoleFromDBClusterResponse]
$creadList :: ReadS [RemoveRoleFromDBClusterResponse]
readsPrec :: Int -> ReadS RemoveRoleFromDBClusterResponse
$creadsPrec :: Int -> ReadS RemoveRoleFromDBClusterResponse
Prelude.Read, Int -> RemoveRoleFromDBClusterResponse -> ShowS
[RemoveRoleFromDBClusterResponse] -> ShowS
RemoveRoleFromDBClusterResponse -> String
(Int -> RemoveRoleFromDBClusterResponse -> ShowS)
-> (RemoveRoleFromDBClusterResponse -> String)
-> ([RemoveRoleFromDBClusterResponse] -> ShowS)
-> Show RemoveRoleFromDBClusterResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemoveRoleFromDBClusterResponse] -> ShowS
$cshowList :: [RemoveRoleFromDBClusterResponse] -> ShowS
show :: RemoveRoleFromDBClusterResponse -> String
$cshow :: RemoveRoleFromDBClusterResponse -> String
showsPrec :: Int -> RemoveRoleFromDBClusterResponse -> ShowS
$cshowsPrec :: Int -> RemoveRoleFromDBClusterResponse -> ShowS
Prelude.Show, (forall x.
 RemoveRoleFromDBClusterResponse
 -> Rep RemoveRoleFromDBClusterResponse x)
-> (forall x.
    Rep RemoveRoleFromDBClusterResponse x
    -> RemoveRoleFromDBClusterResponse)
-> Generic RemoveRoleFromDBClusterResponse
forall x.
Rep RemoveRoleFromDBClusterResponse x
-> RemoveRoleFromDBClusterResponse
forall x.
RemoveRoleFromDBClusterResponse
-> Rep RemoveRoleFromDBClusterResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RemoveRoleFromDBClusterResponse x
-> RemoveRoleFromDBClusterResponse
$cfrom :: forall x.
RemoveRoleFromDBClusterResponse
-> Rep RemoveRoleFromDBClusterResponse x
Prelude.Generic)

-- |
-- Create a value of 'RemoveRoleFromDBClusterResponse' 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.
newRemoveRoleFromDBClusterResponse ::
  RemoveRoleFromDBClusterResponse
newRemoveRoleFromDBClusterResponse :: RemoveRoleFromDBClusterResponse
newRemoveRoleFromDBClusterResponse =
  RemoveRoleFromDBClusterResponse
RemoveRoleFromDBClusterResponse'

instance
  Prelude.NFData
    RemoveRoleFromDBClusterResponse