{-# 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.FMS.DisassociateAdminAccount
-- 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 the account that has been set as the Firewall Manager
-- administrator account. To set a different account as the administrator
-- account, you must submit an @AssociateAdminAccount@ request.
module Amazonka.FMS.DisassociateAdminAccount
  ( -- * Creating a Request
    DisassociateAdminAccount (..),
    newDisassociateAdminAccount,

    -- * Destructuring the Response
    DisassociateAdminAccountResponse (..),
    newDisassociateAdminAccountResponse,
  )
where

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

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

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

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

instance Prelude.Hashable DisassociateAdminAccount

instance Prelude.NFData DisassociateAdminAccount

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

instance Core.ToJSON DisassociateAdminAccount where
  toJSON :: DisassociateAdminAccount -> Value
toJSON = Value -> DisassociateAdminAccount -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)

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

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

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

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

instance
  Prelude.NFData
    DisassociateAdminAccountResponse