{-# 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 #-}
module Amazonka.AuditManager.DeregisterOrganizationAdminAccount
(
DeregisterOrganizationAdminAccount (..),
newDeregisterOrganizationAdminAccount,
deregisterOrganizationAdminAccount_adminAccountId,
DeregisterOrganizationAdminAccountResponse (..),
newDeregisterOrganizationAdminAccountResponse,
deregisterOrganizationAdminAccountResponse_httpStatus,
)
where
import Amazonka.AuditManager.Types
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
data DeregisterOrganizationAdminAccount = DeregisterOrganizationAdminAccount'
{
DeregisterOrganizationAdminAccount -> Maybe Text
adminAccountId :: Prelude.Maybe Prelude.Text
}
deriving (DeregisterOrganizationAdminAccount
-> DeregisterOrganizationAdminAccount -> Bool
(DeregisterOrganizationAdminAccount
-> DeregisterOrganizationAdminAccount -> Bool)
-> (DeregisterOrganizationAdminAccount
-> DeregisterOrganizationAdminAccount -> Bool)
-> Eq DeregisterOrganizationAdminAccount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeregisterOrganizationAdminAccount
-> DeregisterOrganizationAdminAccount -> Bool
$c/= :: DeregisterOrganizationAdminAccount
-> DeregisterOrganizationAdminAccount -> Bool
== :: DeregisterOrganizationAdminAccount
-> DeregisterOrganizationAdminAccount -> Bool
$c== :: DeregisterOrganizationAdminAccount
-> DeregisterOrganizationAdminAccount -> Bool
Prelude.Eq, ReadPrec [DeregisterOrganizationAdminAccount]
ReadPrec DeregisterOrganizationAdminAccount
Int -> ReadS DeregisterOrganizationAdminAccount
ReadS [DeregisterOrganizationAdminAccount]
(Int -> ReadS DeregisterOrganizationAdminAccount)
-> ReadS [DeregisterOrganizationAdminAccount]
-> ReadPrec DeregisterOrganizationAdminAccount
-> ReadPrec [DeregisterOrganizationAdminAccount]
-> Read DeregisterOrganizationAdminAccount
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeregisterOrganizationAdminAccount]
$creadListPrec :: ReadPrec [DeregisterOrganizationAdminAccount]
readPrec :: ReadPrec DeregisterOrganizationAdminAccount
$creadPrec :: ReadPrec DeregisterOrganizationAdminAccount
readList :: ReadS [DeregisterOrganizationAdminAccount]
$creadList :: ReadS [DeregisterOrganizationAdminAccount]
readsPrec :: Int -> ReadS DeregisterOrganizationAdminAccount
$creadsPrec :: Int -> ReadS DeregisterOrganizationAdminAccount
Prelude.Read, Int -> DeregisterOrganizationAdminAccount -> ShowS
[DeregisterOrganizationAdminAccount] -> ShowS
DeregisterOrganizationAdminAccount -> String
(Int -> DeregisterOrganizationAdminAccount -> ShowS)
-> (DeregisterOrganizationAdminAccount -> String)
-> ([DeregisterOrganizationAdminAccount] -> ShowS)
-> Show DeregisterOrganizationAdminAccount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeregisterOrganizationAdminAccount] -> ShowS
$cshowList :: [DeregisterOrganizationAdminAccount] -> ShowS
show :: DeregisterOrganizationAdminAccount -> String
$cshow :: DeregisterOrganizationAdminAccount -> String
showsPrec :: Int -> DeregisterOrganizationAdminAccount -> ShowS
$cshowsPrec :: Int -> DeregisterOrganizationAdminAccount -> ShowS
Prelude.Show, (forall x.
DeregisterOrganizationAdminAccount
-> Rep DeregisterOrganizationAdminAccount x)
-> (forall x.
Rep DeregisterOrganizationAdminAccount x
-> DeregisterOrganizationAdminAccount)
-> Generic DeregisterOrganizationAdminAccount
forall x.
Rep DeregisterOrganizationAdminAccount x
-> DeregisterOrganizationAdminAccount
forall x.
DeregisterOrganizationAdminAccount
-> Rep DeregisterOrganizationAdminAccount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeregisterOrganizationAdminAccount x
-> DeregisterOrganizationAdminAccount
$cfrom :: forall x.
DeregisterOrganizationAdminAccount
-> Rep DeregisterOrganizationAdminAccount x
Prelude.Generic)
newDeregisterOrganizationAdminAccount ::
DeregisterOrganizationAdminAccount
newDeregisterOrganizationAdminAccount :: DeregisterOrganizationAdminAccount
newDeregisterOrganizationAdminAccount =
DeregisterOrganizationAdminAccount' :: Maybe Text -> DeregisterOrganizationAdminAccount
DeregisterOrganizationAdminAccount'
{ $sel:adminAccountId:DeregisterOrganizationAdminAccount' :: Maybe Text
adminAccountId =
Maybe Text
forall a. Maybe a
Prelude.Nothing
}
deregisterOrganizationAdminAccount_adminAccountId :: Lens.Lens' DeregisterOrganizationAdminAccount (Prelude.Maybe Prelude.Text)
deregisterOrganizationAdminAccount_adminAccountId :: (Maybe Text -> f (Maybe Text))
-> DeregisterOrganizationAdminAccount
-> f DeregisterOrganizationAdminAccount
deregisterOrganizationAdminAccount_adminAccountId = (DeregisterOrganizationAdminAccount -> Maybe Text)
-> (DeregisterOrganizationAdminAccount
-> Maybe Text -> DeregisterOrganizationAdminAccount)
-> Lens
DeregisterOrganizationAdminAccount
DeregisterOrganizationAdminAccount
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterOrganizationAdminAccount' {Maybe Text
adminAccountId :: Maybe Text
$sel:adminAccountId:DeregisterOrganizationAdminAccount' :: DeregisterOrganizationAdminAccount -> Maybe Text
adminAccountId} -> Maybe Text
adminAccountId) (\s :: DeregisterOrganizationAdminAccount
s@DeregisterOrganizationAdminAccount' {} Maybe Text
a -> DeregisterOrganizationAdminAccount
s {$sel:adminAccountId:DeregisterOrganizationAdminAccount' :: Maybe Text
adminAccountId = Maybe Text
a} :: DeregisterOrganizationAdminAccount)
instance
Core.AWSRequest
DeregisterOrganizationAdminAccount
where
type
AWSResponse DeregisterOrganizationAdminAccount =
DeregisterOrganizationAdminAccountResponse
request :: DeregisterOrganizationAdminAccount
-> Request DeregisterOrganizationAdminAccount
request = Service
-> DeregisterOrganizationAdminAccount
-> Request DeregisterOrganizationAdminAccount
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeregisterOrganizationAdminAccount
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DeregisterOrganizationAdminAccount)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeregisterOrganizationAdminAccount))
-> Logger
-> Service
-> Proxy DeregisterOrganizationAdminAccount
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DeregisterOrganizationAdminAccount)))
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 -> DeregisterOrganizationAdminAccountResponse
DeregisterOrganizationAdminAccountResponse'
(Int -> DeregisterOrganizationAdminAccountResponse)
-> Either String Int
-> Either String DeregisterOrganizationAdminAccountResponse
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
DeregisterOrganizationAdminAccount
instance
Prelude.NFData
DeregisterOrganizationAdminAccount
instance
Core.ToHeaders
DeregisterOrganizationAdminAccount
where
toHeaders :: DeregisterOrganizationAdminAccount -> ResponseHeaders
toHeaders =
ResponseHeaders
-> DeregisterOrganizationAdminAccount -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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
DeregisterOrganizationAdminAccount
where
toJSON :: DeregisterOrganizationAdminAccount -> Value
toJSON DeregisterOrganizationAdminAccount' {Maybe Text
adminAccountId :: Maybe Text
$sel:adminAccountId:DeregisterOrganizationAdminAccount' :: DeregisterOrganizationAdminAccount -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"adminAccountId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
adminAccountId
]
)
instance
Core.ToPath
DeregisterOrganizationAdminAccount
where
toPath :: DeregisterOrganizationAdminAccount -> ByteString
toPath =
ByteString -> DeregisterOrganizationAdminAccount -> ByteString
forall a b. a -> b -> a
Prelude.const
ByteString
"/account/deregisterOrganizationAdminAccount"
instance
Core.ToQuery
DeregisterOrganizationAdminAccount
where
toQuery :: DeregisterOrganizationAdminAccount -> QueryString
toQuery = QueryString -> DeregisterOrganizationAdminAccount -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeregisterOrganizationAdminAccountResponse = DeregisterOrganizationAdminAccountResponse'
{
DeregisterOrganizationAdminAccountResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeregisterOrganizationAdminAccountResponse
-> DeregisterOrganizationAdminAccountResponse -> Bool
(DeregisterOrganizationAdminAccountResponse
-> DeregisterOrganizationAdminAccountResponse -> Bool)
-> (DeregisterOrganizationAdminAccountResponse
-> DeregisterOrganizationAdminAccountResponse -> Bool)
-> Eq DeregisterOrganizationAdminAccountResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeregisterOrganizationAdminAccountResponse
-> DeregisterOrganizationAdminAccountResponse -> Bool
$c/= :: DeregisterOrganizationAdminAccountResponse
-> DeregisterOrganizationAdminAccountResponse -> Bool
== :: DeregisterOrganizationAdminAccountResponse
-> DeregisterOrganizationAdminAccountResponse -> Bool
$c== :: DeregisterOrganizationAdminAccountResponse
-> DeregisterOrganizationAdminAccountResponse -> Bool
Prelude.Eq, ReadPrec [DeregisterOrganizationAdminAccountResponse]
ReadPrec DeregisterOrganizationAdminAccountResponse
Int -> ReadS DeregisterOrganizationAdminAccountResponse
ReadS [DeregisterOrganizationAdminAccountResponse]
(Int -> ReadS DeregisterOrganizationAdminAccountResponse)
-> ReadS [DeregisterOrganizationAdminAccountResponse]
-> ReadPrec DeregisterOrganizationAdminAccountResponse
-> ReadPrec [DeregisterOrganizationAdminAccountResponse]
-> Read DeregisterOrganizationAdminAccountResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeregisterOrganizationAdminAccountResponse]
$creadListPrec :: ReadPrec [DeregisterOrganizationAdminAccountResponse]
readPrec :: ReadPrec DeregisterOrganizationAdminAccountResponse
$creadPrec :: ReadPrec DeregisterOrganizationAdminAccountResponse
readList :: ReadS [DeregisterOrganizationAdminAccountResponse]
$creadList :: ReadS [DeregisterOrganizationAdminAccountResponse]
readsPrec :: Int -> ReadS DeregisterOrganizationAdminAccountResponse
$creadsPrec :: Int -> ReadS DeregisterOrganizationAdminAccountResponse
Prelude.Read, Int -> DeregisterOrganizationAdminAccountResponse -> ShowS
[DeregisterOrganizationAdminAccountResponse] -> ShowS
DeregisterOrganizationAdminAccountResponse -> String
(Int -> DeregisterOrganizationAdminAccountResponse -> ShowS)
-> (DeregisterOrganizationAdminAccountResponse -> String)
-> ([DeregisterOrganizationAdminAccountResponse] -> ShowS)
-> Show DeregisterOrganizationAdminAccountResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeregisterOrganizationAdminAccountResponse] -> ShowS
$cshowList :: [DeregisterOrganizationAdminAccountResponse] -> ShowS
show :: DeregisterOrganizationAdminAccountResponse -> String
$cshow :: DeregisterOrganizationAdminAccountResponse -> String
showsPrec :: Int -> DeregisterOrganizationAdminAccountResponse -> ShowS
$cshowsPrec :: Int -> DeregisterOrganizationAdminAccountResponse -> ShowS
Prelude.Show, (forall x.
DeregisterOrganizationAdminAccountResponse
-> Rep DeregisterOrganizationAdminAccountResponse x)
-> (forall x.
Rep DeregisterOrganizationAdminAccountResponse x
-> DeregisterOrganizationAdminAccountResponse)
-> Generic DeregisterOrganizationAdminAccountResponse
forall x.
Rep DeregisterOrganizationAdminAccountResponse x
-> DeregisterOrganizationAdminAccountResponse
forall x.
DeregisterOrganizationAdminAccountResponse
-> Rep DeregisterOrganizationAdminAccountResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeregisterOrganizationAdminAccountResponse x
-> DeregisterOrganizationAdminAccountResponse
$cfrom :: forall x.
DeregisterOrganizationAdminAccountResponse
-> Rep DeregisterOrganizationAdminAccountResponse x
Prelude.Generic)
newDeregisterOrganizationAdminAccountResponse ::
Prelude.Int ->
DeregisterOrganizationAdminAccountResponse
newDeregisterOrganizationAdminAccountResponse :: Int -> DeregisterOrganizationAdminAccountResponse
newDeregisterOrganizationAdminAccountResponse
Int
pHttpStatus_ =
DeregisterOrganizationAdminAccountResponse' :: Int -> DeregisterOrganizationAdminAccountResponse
DeregisterOrganizationAdminAccountResponse'
{ $sel:httpStatus:DeregisterOrganizationAdminAccountResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deregisterOrganizationAdminAccountResponse_httpStatus :: Lens.Lens' DeregisterOrganizationAdminAccountResponse Prelude.Int
deregisterOrganizationAdminAccountResponse_httpStatus :: (Int -> f Int)
-> DeregisterOrganizationAdminAccountResponse
-> f DeregisterOrganizationAdminAccountResponse
deregisterOrganizationAdminAccountResponse_httpStatus = (DeregisterOrganizationAdminAccountResponse -> Int)
-> (DeregisterOrganizationAdminAccountResponse
-> Int -> DeregisterOrganizationAdminAccountResponse)
-> Lens
DeregisterOrganizationAdminAccountResponse
DeregisterOrganizationAdminAccountResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterOrganizationAdminAccountResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeregisterOrganizationAdminAccountResponse' :: DeregisterOrganizationAdminAccountResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeregisterOrganizationAdminAccountResponse
s@DeregisterOrganizationAdminAccountResponse' {} Int
a -> DeregisterOrganizationAdminAccountResponse
s {$sel:httpStatus:DeregisterOrganizationAdminAccountResponse' :: Int
httpStatus = Int
a} :: DeregisterOrganizationAdminAccountResponse)
instance
Prelude.NFData
DeregisterOrganizationAdminAccountResponse