{-# 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.Organizations.RemoveAccountFromOrganization
(
RemoveAccountFromOrganization (..),
newRemoveAccountFromOrganization,
removeAccountFromOrganization_accountId,
RemoveAccountFromOrganizationResponse (..),
newRemoveAccountFromOrganizationResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Organizations.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data RemoveAccountFromOrganization = RemoveAccountFromOrganization'
{
RemoveAccountFromOrganization -> Text
accountId :: Prelude.Text
}
deriving (RemoveAccountFromOrganization
-> RemoveAccountFromOrganization -> Bool
(RemoveAccountFromOrganization
-> RemoveAccountFromOrganization -> Bool)
-> (RemoveAccountFromOrganization
-> RemoveAccountFromOrganization -> Bool)
-> Eq RemoveAccountFromOrganization
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemoveAccountFromOrganization
-> RemoveAccountFromOrganization -> Bool
$c/= :: RemoveAccountFromOrganization
-> RemoveAccountFromOrganization -> Bool
== :: RemoveAccountFromOrganization
-> RemoveAccountFromOrganization -> Bool
$c== :: RemoveAccountFromOrganization
-> RemoveAccountFromOrganization -> Bool
Prelude.Eq, ReadPrec [RemoveAccountFromOrganization]
ReadPrec RemoveAccountFromOrganization
Int -> ReadS RemoveAccountFromOrganization
ReadS [RemoveAccountFromOrganization]
(Int -> ReadS RemoveAccountFromOrganization)
-> ReadS [RemoveAccountFromOrganization]
-> ReadPrec RemoveAccountFromOrganization
-> ReadPrec [RemoveAccountFromOrganization]
-> Read RemoveAccountFromOrganization
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemoveAccountFromOrganization]
$creadListPrec :: ReadPrec [RemoveAccountFromOrganization]
readPrec :: ReadPrec RemoveAccountFromOrganization
$creadPrec :: ReadPrec RemoveAccountFromOrganization
readList :: ReadS [RemoveAccountFromOrganization]
$creadList :: ReadS [RemoveAccountFromOrganization]
readsPrec :: Int -> ReadS RemoveAccountFromOrganization
$creadsPrec :: Int -> ReadS RemoveAccountFromOrganization
Prelude.Read, Int -> RemoveAccountFromOrganization -> ShowS
[RemoveAccountFromOrganization] -> ShowS
RemoveAccountFromOrganization -> String
(Int -> RemoveAccountFromOrganization -> ShowS)
-> (RemoveAccountFromOrganization -> String)
-> ([RemoveAccountFromOrganization] -> ShowS)
-> Show RemoveAccountFromOrganization
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemoveAccountFromOrganization] -> ShowS
$cshowList :: [RemoveAccountFromOrganization] -> ShowS
show :: RemoveAccountFromOrganization -> String
$cshow :: RemoveAccountFromOrganization -> String
showsPrec :: Int -> RemoveAccountFromOrganization -> ShowS
$cshowsPrec :: Int -> RemoveAccountFromOrganization -> ShowS
Prelude.Show, (forall x.
RemoveAccountFromOrganization
-> Rep RemoveAccountFromOrganization x)
-> (forall x.
Rep RemoveAccountFromOrganization x
-> RemoveAccountFromOrganization)
-> Generic RemoveAccountFromOrganization
forall x.
Rep RemoveAccountFromOrganization x
-> RemoveAccountFromOrganization
forall x.
RemoveAccountFromOrganization
-> Rep RemoveAccountFromOrganization x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RemoveAccountFromOrganization x
-> RemoveAccountFromOrganization
$cfrom :: forall x.
RemoveAccountFromOrganization
-> Rep RemoveAccountFromOrganization x
Prelude.Generic)
newRemoveAccountFromOrganization ::
Prelude.Text ->
RemoveAccountFromOrganization
newRemoveAccountFromOrganization :: Text -> RemoveAccountFromOrganization
newRemoveAccountFromOrganization Text
pAccountId_ =
RemoveAccountFromOrganization' :: Text -> RemoveAccountFromOrganization
RemoveAccountFromOrganization'
{ $sel:accountId:RemoveAccountFromOrganization' :: Text
accountId =
Text
pAccountId_
}
removeAccountFromOrganization_accountId :: Lens.Lens' RemoveAccountFromOrganization Prelude.Text
removeAccountFromOrganization_accountId :: (Text -> f Text)
-> RemoveAccountFromOrganization -> f RemoveAccountFromOrganization
removeAccountFromOrganization_accountId = (RemoveAccountFromOrganization -> Text)
-> (RemoveAccountFromOrganization
-> Text -> RemoveAccountFromOrganization)
-> Lens
RemoveAccountFromOrganization
RemoveAccountFromOrganization
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveAccountFromOrganization' {Text
accountId :: Text
$sel:accountId:RemoveAccountFromOrganization' :: RemoveAccountFromOrganization -> Text
accountId} -> Text
accountId) (\s :: RemoveAccountFromOrganization
s@RemoveAccountFromOrganization' {} Text
a -> RemoveAccountFromOrganization
s {$sel:accountId:RemoveAccountFromOrganization' :: Text
accountId = Text
a} :: RemoveAccountFromOrganization)
instance
Core.AWSRequest
RemoveAccountFromOrganization
where
type
AWSResponse RemoveAccountFromOrganization =
RemoveAccountFromOrganizationResponse
request :: RemoveAccountFromOrganization
-> Request RemoveAccountFromOrganization
request = Service
-> RemoveAccountFromOrganization
-> Request RemoveAccountFromOrganization
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RemoveAccountFromOrganization
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RemoveAccountFromOrganization)))
response =
AWSResponse RemoveAccountFromOrganization
-> Logger
-> Service
-> Proxy RemoveAccountFromOrganization
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RemoveAccountFromOrganization)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse RemoveAccountFromOrganization
RemoveAccountFromOrganizationResponse
RemoveAccountFromOrganizationResponse'
instance
Prelude.Hashable
RemoveAccountFromOrganization
instance Prelude.NFData RemoveAccountFromOrganization
instance Core.ToHeaders RemoveAccountFromOrganization where
toHeaders :: RemoveAccountFromOrganization -> [Header]
toHeaders =
[Header] -> RemoveAccountFromOrganization -> [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
"AWSOrganizationsV20161128.RemoveAccountFromOrganization" ::
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 RemoveAccountFromOrganization where
toJSON :: RemoveAccountFromOrganization -> Value
toJSON RemoveAccountFromOrganization' {Text
accountId :: Text
$sel:accountId:RemoveAccountFromOrganization' :: RemoveAccountFromOrganization -> 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
"AccountId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
accountId)]
)
instance Core.ToPath RemoveAccountFromOrganization where
toPath :: RemoveAccountFromOrganization -> ByteString
toPath = ByteString -> RemoveAccountFromOrganization -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery RemoveAccountFromOrganization where
toQuery :: RemoveAccountFromOrganization -> QueryString
toQuery = QueryString -> RemoveAccountFromOrganization -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RemoveAccountFromOrganizationResponse = RemoveAccountFromOrganizationResponse'
{
}
deriving (RemoveAccountFromOrganizationResponse
-> RemoveAccountFromOrganizationResponse -> Bool
(RemoveAccountFromOrganizationResponse
-> RemoveAccountFromOrganizationResponse -> Bool)
-> (RemoveAccountFromOrganizationResponse
-> RemoveAccountFromOrganizationResponse -> Bool)
-> Eq RemoveAccountFromOrganizationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemoveAccountFromOrganizationResponse
-> RemoveAccountFromOrganizationResponse -> Bool
$c/= :: RemoveAccountFromOrganizationResponse
-> RemoveAccountFromOrganizationResponse -> Bool
== :: RemoveAccountFromOrganizationResponse
-> RemoveAccountFromOrganizationResponse -> Bool
$c== :: RemoveAccountFromOrganizationResponse
-> RemoveAccountFromOrganizationResponse -> Bool
Prelude.Eq, ReadPrec [RemoveAccountFromOrganizationResponse]
ReadPrec RemoveAccountFromOrganizationResponse
Int -> ReadS RemoveAccountFromOrganizationResponse
ReadS [RemoveAccountFromOrganizationResponse]
(Int -> ReadS RemoveAccountFromOrganizationResponse)
-> ReadS [RemoveAccountFromOrganizationResponse]
-> ReadPrec RemoveAccountFromOrganizationResponse
-> ReadPrec [RemoveAccountFromOrganizationResponse]
-> Read RemoveAccountFromOrganizationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemoveAccountFromOrganizationResponse]
$creadListPrec :: ReadPrec [RemoveAccountFromOrganizationResponse]
readPrec :: ReadPrec RemoveAccountFromOrganizationResponse
$creadPrec :: ReadPrec RemoveAccountFromOrganizationResponse
readList :: ReadS [RemoveAccountFromOrganizationResponse]
$creadList :: ReadS [RemoveAccountFromOrganizationResponse]
readsPrec :: Int -> ReadS RemoveAccountFromOrganizationResponse
$creadsPrec :: Int -> ReadS RemoveAccountFromOrganizationResponse
Prelude.Read, Int -> RemoveAccountFromOrganizationResponse -> ShowS
[RemoveAccountFromOrganizationResponse] -> ShowS
RemoveAccountFromOrganizationResponse -> String
(Int -> RemoveAccountFromOrganizationResponse -> ShowS)
-> (RemoveAccountFromOrganizationResponse -> String)
-> ([RemoveAccountFromOrganizationResponse] -> ShowS)
-> Show RemoveAccountFromOrganizationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemoveAccountFromOrganizationResponse] -> ShowS
$cshowList :: [RemoveAccountFromOrganizationResponse] -> ShowS
show :: RemoveAccountFromOrganizationResponse -> String
$cshow :: RemoveAccountFromOrganizationResponse -> String
showsPrec :: Int -> RemoveAccountFromOrganizationResponse -> ShowS
$cshowsPrec :: Int -> RemoveAccountFromOrganizationResponse -> ShowS
Prelude.Show, (forall x.
RemoveAccountFromOrganizationResponse
-> Rep RemoveAccountFromOrganizationResponse x)
-> (forall x.
Rep RemoveAccountFromOrganizationResponse x
-> RemoveAccountFromOrganizationResponse)
-> Generic RemoveAccountFromOrganizationResponse
forall x.
Rep RemoveAccountFromOrganizationResponse x
-> RemoveAccountFromOrganizationResponse
forall x.
RemoveAccountFromOrganizationResponse
-> Rep RemoveAccountFromOrganizationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RemoveAccountFromOrganizationResponse x
-> RemoveAccountFromOrganizationResponse
$cfrom :: forall x.
RemoveAccountFromOrganizationResponse
-> Rep RemoveAccountFromOrganizationResponse x
Prelude.Generic)
newRemoveAccountFromOrganizationResponse ::
RemoveAccountFromOrganizationResponse
newRemoveAccountFromOrganizationResponse :: RemoveAccountFromOrganizationResponse
newRemoveAccountFromOrganizationResponse =
RemoveAccountFromOrganizationResponse
RemoveAccountFromOrganizationResponse'
instance
Prelude.NFData
RemoveAccountFromOrganizationResponse