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