{-# 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.DisassociateDRTRole
-- 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 your Amazon Web
-- Services account.
--
-- To make a @DisassociateDRTRole@ 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 @DisassociateDRTRole@ request to remove this access.
module Amazonka.Shield.DisassociateDRTRole
  ( -- * Creating a Request
    DisassociateDRTRole (..),
    newDisassociateDRTRole,

    -- * Destructuring the Response
    DisassociateDRTRoleResponse (..),
    newDisassociateDRTRoleResponse,

    -- * Response Lenses
    disassociateDRTRoleResponse_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:/ 'newDisassociateDRTRole' smart constructor.
data DisassociateDRTRole = DisassociateDRTRole'
  {
  }
  deriving (DisassociateDRTRole -> DisassociateDRTRole -> Bool
(DisassociateDRTRole -> DisassociateDRTRole -> Bool)
-> (DisassociateDRTRole -> DisassociateDRTRole -> Bool)
-> Eq DisassociateDRTRole
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateDRTRole -> DisassociateDRTRole -> Bool
$c/= :: DisassociateDRTRole -> DisassociateDRTRole -> Bool
== :: DisassociateDRTRole -> DisassociateDRTRole -> Bool
$c== :: DisassociateDRTRole -> DisassociateDRTRole -> Bool
Prelude.Eq, ReadPrec [DisassociateDRTRole]
ReadPrec DisassociateDRTRole
Int -> ReadS DisassociateDRTRole
ReadS [DisassociateDRTRole]
(Int -> ReadS DisassociateDRTRole)
-> ReadS [DisassociateDRTRole]
-> ReadPrec DisassociateDRTRole
-> ReadPrec [DisassociateDRTRole]
-> Read DisassociateDRTRole
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateDRTRole]
$creadListPrec :: ReadPrec [DisassociateDRTRole]
readPrec :: ReadPrec DisassociateDRTRole
$creadPrec :: ReadPrec DisassociateDRTRole
readList :: ReadS [DisassociateDRTRole]
$creadList :: ReadS [DisassociateDRTRole]
readsPrec :: Int -> ReadS DisassociateDRTRole
$creadsPrec :: Int -> ReadS DisassociateDRTRole
Prelude.Read, Int -> DisassociateDRTRole -> ShowS
[DisassociateDRTRole] -> ShowS
DisassociateDRTRole -> String
(Int -> DisassociateDRTRole -> ShowS)
-> (DisassociateDRTRole -> String)
-> ([DisassociateDRTRole] -> ShowS)
-> Show DisassociateDRTRole
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateDRTRole] -> ShowS
$cshowList :: [DisassociateDRTRole] -> ShowS
show :: DisassociateDRTRole -> String
$cshow :: DisassociateDRTRole -> String
showsPrec :: Int -> DisassociateDRTRole -> ShowS
$cshowsPrec :: Int -> DisassociateDRTRole -> ShowS
Prelude.Show, (forall x. DisassociateDRTRole -> Rep DisassociateDRTRole x)
-> (forall x. Rep DisassociateDRTRole x -> DisassociateDRTRole)
-> Generic DisassociateDRTRole
forall x. Rep DisassociateDRTRole x -> DisassociateDRTRole
forall x. DisassociateDRTRole -> Rep DisassociateDRTRole x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisassociateDRTRole x -> DisassociateDRTRole
$cfrom :: forall x. DisassociateDRTRole -> Rep DisassociateDRTRole x
Prelude.Generic)

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

instance Core.AWSRequest DisassociateDRTRole where
  type
    AWSResponse DisassociateDRTRole =
      DisassociateDRTRoleResponse
  request :: DisassociateDRTRole -> Request DisassociateDRTRole
request = Service -> DisassociateDRTRole -> Request DisassociateDRTRole
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DisassociateDRTRole
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DisassociateDRTRole)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DisassociateDRTRole))
-> Logger
-> Service
-> Proxy DisassociateDRTRole
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DisassociateDRTRole)))
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 -> DisassociateDRTRoleResponse
DisassociateDRTRoleResponse'
            (Int -> DisassociateDRTRoleResponse)
-> Either String Int -> Either String DisassociateDRTRoleResponse
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 DisassociateDRTRole

instance Prelude.NFData DisassociateDRTRole

instance Core.ToHeaders DisassociateDRTRole where
  toHeaders :: DisassociateDRTRole -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DisassociateDRTRole -> 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.DisassociateDRTRole" ::
                          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 DisassociateDRTRole where
  toJSON :: DisassociateDRTRole -> Value
toJSON = Value -> DisassociateDRTRole -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)

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

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

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

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

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

instance Prelude.NFData DisassociateDRTRoleResponse