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