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