{-# 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.Shield.DisassociateDRTLogBucket
-- 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)
--
-- Removes the Shield Response Team\'s (SRT) access to the specified Amazon
-- S3 bucket containing the logs that you shared previously.
--
-- To make a @DisassociateDRTLogBucket@ request, you must be subscribed to
-- the
-- <https://aws.amazon.com/premiumsupport/business-support/ Business Support plan>
-- or the
-- <https://aws.amazon.com/premiumsupport/enterprise-support/ Enterprise Support plan>.
-- However, if you are not subscribed to one of these support plans, but
-- had been previously and had granted the SRT access to your account, you
-- can submit a @DisassociateDRTLogBucket@ request to remove this access.
module Amazonka.Shield.DisassociateDRTLogBucket
  ( -- * Creating a Request
    DisassociateDRTLogBucket (..),
    newDisassociateDRTLogBucket,

    -- * Request Lenses
    disassociateDRTLogBucket_logBucket,

    -- * Destructuring the Response
    DisassociateDRTLogBucketResponse (..),
    newDisassociateDRTLogBucketResponse,

    -- * Response Lenses
    disassociateDRTLogBucketResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDisassociateDRTLogBucket' smart constructor.
data DisassociateDRTLogBucket = DisassociateDRTLogBucket'
  { -- | The Amazon S3 bucket that contains the logs that you want to share.
    DisassociateDRTLogBucket -> Text
logBucket :: Prelude.Text
  }
  deriving (DisassociateDRTLogBucket -> DisassociateDRTLogBucket -> Bool
(DisassociateDRTLogBucket -> DisassociateDRTLogBucket -> Bool)
-> (DisassociateDRTLogBucket -> DisassociateDRTLogBucket -> Bool)
-> Eq DisassociateDRTLogBucket
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateDRTLogBucket -> DisassociateDRTLogBucket -> Bool
$c/= :: DisassociateDRTLogBucket -> DisassociateDRTLogBucket -> Bool
== :: DisassociateDRTLogBucket -> DisassociateDRTLogBucket -> Bool
$c== :: DisassociateDRTLogBucket -> DisassociateDRTLogBucket -> Bool
Prelude.Eq, ReadPrec [DisassociateDRTLogBucket]
ReadPrec DisassociateDRTLogBucket
Int -> ReadS DisassociateDRTLogBucket
ReadS [DisassociateDRTLogBucket]
(Int -> ReadS DisassociateDRTLogBucket)
-> ReadS [DisassociateDRTLogBucket]
-> ReadPrec DisassociateDRTLogBucket
-> ReadPrec [DisassociateDRTLogBucket]
-> Read DisassociateDRTLogBucket
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateDRTLogBucket]
$creadListPrec :: ReadPrec [DisassociateDRTLogBucket]
readPrec :: ReadPrec DisassociateDRTLogBucket
$creadPrec :: ReadPrec DisassociateDRTLogBucket
readList :: ReadS [DisassociateDRTLogBucket]
$creadList :: ReadS [DisassociateDRTLogBucket]
readsPrec :: Int -> ReadS DisassociateDRTLogBucket
$creadsPrec :: Int -> ReadS DisassociateDRTLogBucket
Prelude.Read, Int -> DisassociateDRTLogBucket -> ShowS
[DisassociateDRTLogBucket] -> ShowS
DisassociateDRTLogBucket -> String
(Int -> DisassociateDRTLogBucket -> ShowS)
-> (DisassociateDRTLogBucket -> String)
-> ([DisassociateDRTLogBucket] -> ShowS)
-> Show DisassociateDRTLogBucket
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateDRTLogBucket] -> ShowS
$cshowList :: [DisassociateDRTLogBucket] -> ShowS
show :: DisassociateDRTLogBucket -> String
$cshow :: DisassociateDRTLogBucket -> String
showsPrec :: Int -> DisassociateDRTLogBucket -> ShowS
$cshowsPrec :: Int -> DisassociateDRTLogBucket -> ShowS
Prelude.Show, (forall x.
 DisassociateDRTLogBucket -> Rep DisassociateDRTLogBucket x)
-> (forall x.
    Rep DisassociateDRTLogBucket x -> DisassociateDRTLogBucket)
-> Generic DisassociateDRTLogBucket
forall x.
Rep DisassociateDRTLogBucket x -> DisassociateDRTLogBucket
forall x.
DisassociateDRTLogBucket -> Rep DisassociateDRTLogBucket x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateDRTLogBucket x -> DisassociateDRTLogBucket
$cfrom :: forall x.
DisassociateDRTLogBucket -> Rep DisassociateDRTLogBucket x
Prelude.Generic)

-- |
-- Create a value of 'DisassociateDRTLogBucket' 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:
--
-- 'logBucket', 'disassociateDRTLogBucket_logBucket' - The Amazon S3 bucket that contains the logs that you want to share.
newDisassociateDRTLogBucket ::
  -- | 'logBucket'
  Prelude.Text ->
  DisassociateDRTLogBucket
newDisassociateDRTLogBucket :: Text -> DisassociateDRTLogBucket
newDisassociateDRTLogBucket Text
pLogBucket_ =
  DisassociateDRTLogBucket' :: Text -> DisassociateDRTLogBucket
DisassociateDRTLogBucket' {$sel:logBucket:DisassociateDRTLogBucket' :: Text
logBucket = Text
pLogBucket_}

-- | The Amazon S3 bucket that contains the logs that you want to share.
disassociateDRTLogBucket_logBucket :: Lens.Lens' DisassociateDRTLogBucket Prelude.Text
disassociateDRTLogBucket_logBucket :: (Text -> f Text)
-> DisassociateDRTLogBucket -> f DisassociateDRTLogBucket
disassociateDRTLogBucket_logBucket = (DisassociateDRTLogBucket -> Text)
-> (DisassociateDRTLogBucket -> Text -> DisassociateDRTLogBucket)
-> Lens DisassociateDRTLogBucket DisassociateDRTLogBucket Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateDRTLogBucket' {Text
logBucket :: Text
$sel:logBucket:DisassociateDRTLogBucket' :: DisassociateDRTLogBucket -> Text
logBucket} -> Text
logBucket) (\s :: DisassociateDRTLogBucket
s@DisassociateDRTLogBucket' {} Text
a -> DisassociateDRTLogBucket
s {$sel:logBucket:DisassociateDRTLogBucket' :: Text
logBucket = Text
a} :: DisassociateDRTLogBucket)

instance Core.AWSRequest DisassociateDRTLogBucket where
  type
    AWSResponse DisassociateDRTLogBucket =
      DisassociateDRTLogBucketResponse
  request :: DisassociateDRTLogBucket -> Request DisassociateDRTLogBucket
request = Service
-> DisassociateDRTLogBucket -> Request DisassociateDRTLogBucket
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DisassociateDRTLogBucket
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DisassociateDRTLogBucket)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DisassociateDRTLogBucket))
-> Logger
-> Service
-> Proxy DisassociateDRTLogBucket
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DisassociateDRTLogBucket)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DisassociateDRTLogBucketResponse
DisassociateDRTLogBucketResponse'
            (Int -> DisassociateDRTLogBucketResponse)
-> Either String Int
-> Either String DisassociateDRTLogBucketResponse
forall (f :: * -> *) a b. Functor 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 DisassociateDRTLogBucket

instance Prelude.NFData DisassociateDRTLogBucket

instance Core.ToHeaders DisassociateDRTLogBucket where
  toHeaders :: DisassociateDRTLogBucket -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DisassociateDRTLogBucket -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSShield_20160616.DisassociateDRTLogBucket" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DisassociateDRTLogBucket where
  toJSON :: DisassociateDRTLogBucket -> Value
toJSON DisassociateDRTLogBucket' {Text
logBucket :: Text
$sel:logBucket:DisassociateDRTLogBucket' :: DisassociateDRTLogBucket -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"LogBucket" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
logBucket)]
      )

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

instance Core.ToQuery DisassociateDRTLogBucket where
  toQuery :: DisassociateDRTLogBucket -> QueryString
toQuery = QueryString -> DisassociateDRTLogBucket -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

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

-- |
-- Create a value of 'DisassociateDRTLogBucketResponse' 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:
--
-- 'httpStatus', 'disassociateDRTLogBucketResponse_httpStatus' - The response's http status code.
newDisassociateDRTLogBucketResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DisassociateDRTLogBucketResponse
newDisassociateDRTLogBucketResponse :: Int -> DisassociateDRTLogBucketResponse
newDisassociateDRTLogBucketResponse Int
pHttpStatus_ =
  DisassociateDRTLogBucketResponse' :: Int -> DisassociateDRTLogBucketResponse
DisassociateDRTLogBucketResponse'
    { $sel:httpStatus:DisassociateDRTLogBucketResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance
  Prelude.NFData
    DisassociateDRTLogBucketResponse