{-# 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.DisableAWSServiceAccess
(
DisableAWSServiceAccess (..),
newDisableAWSServiceAccess,
disableAWSServiceAccess_servicePrincipal,
DisableAWSServiceAccessResponse (..),
newDisableAWSServiceAccessResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Organizations.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DisableAWSServiceAccess = DisableAWSServiceAccess'
{
DisableAWSServiceAccess -> Text
servicePrincipal :: Prelude.Text
}
deriving (DisableAWSServiceAccess -> DisableAWSServiceAccess -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisableAWSServiceAccess -> DisableAWSServiceAccess -> Bool
$c/= :: DisableAWSServiceAccess -> DisableAWSServiceAccess -> Bool
== :: DisableAWSServiceAccess -> DisableAWSServiceAccess -> Bool
$c== :: DisableAWSServiceAccess -> DisableAWSServiceAccess -> Bool
Prelude.Eq, ReadPrec [DisableAWSServiceAccess]
ReadPrec DisableAWSServiceAccess
Int -> ReadS DisableAWSServiceAccess
ReadS [DisableAWSServiceAccess]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisableAWSServiceAccess]
$creadListPrec :: ReadPrec [DisableAWSServiceAccess]
readPrec :: ReadPrec DisableAWSServiceAccess
$creadPrec :: ReadPrec DisableAWSServiceAccess
readList :: ReadS [DisableAWSServiceAccess]
$creadList :: ReadS [DisableAWSServiceAccess]
readsPrec :: Int -> ReadS DisableAWSServiceAccess
$creadsPrec :: Int -> ReadS DisableAWSServiceAccess
Prelude.Read, Int -> DisableAWSServiceAccess -> ShowS
[DisableAWSServiceAccess] -> ShowS
DisableAWSServiceAccess -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisableAWSServiceAccess] -> ShowS
$cshowList :: [DisableAWSServiceAccess] -> ShowS
show :: DisableAWSServiceAccess -> String
$cshow :: DisableAWSServiceAccess -> String
showsPrec :: Int -> DisableAWSServiceAccess -> ShowS
$cshowsPrec :: Int -> DisableAWSServiceAccess -> ShowS
Prelude.Show, forall x. Rep DisableAWSServiceAccess x -> DisableAWSServiceAccess
forall x. DisableAWSServiceAccess -> Rep DisableAWSServiceAccess x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisableAWSServiceAccess x -> DisableAWSServiceAccess
$cfrom :: forall x. DisableAWSServiceAccess -> Rep DisableAWSServiceAccess x
Prelude.Generic)
newDisableAWSServiceAccess ::
Prelude.Text ->
DisableAWSServiceAccess
newDisableAWSServiceAccess :: Text -> DisableAWSServiceAccess
newDisableAWSServiceAccess Text
pServicePrincipal_ =
DisableAWSServiceAccess'
{ $sel:servicePrincipal:DisableAWSServiceAccess' :: Text
servicePrincipal =
Text
pServicePrincipal_
}
disableAWSServiceAccess_servicePrincipal :: Lens.Lens' DisableAWSServiceAccess Prelude.Text
disableAWSServiceAccess_servicePrincipal :: Lens' DisableAWSServiceAccess Text
disableAWSServiceAccess_servicePrincipal = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisableAWSServiceAccess' {Text
servicePrincipal :: Text
$sel:servicePrincipal:DisableAWSServiceAccess' :: DisableAWSServiceAccess -> Text
servicePrincipal} -> Text
servicePrincipal) (\s :: DisableAWSServiceAccess
s@DisableAWSServiceAccess' {} Text
a -> DisableAWSServiceAccess
s {$sel:servicePrincipal:DisableAWSServiceAccess' :: Text
servicePrincipal = Text
a} :: DisableAWSServiceAccess)
instance Core.AWSRequest DisableAWSServiceAccess where
type
AWSResponse DisableAWSServiceAccess =
DisableAWSServiceAccessResponse
request :: (Service -> Service)
-> DisableAWSServiceAccess -> Request DisableAWSServiceAccess
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DisableAWSServiceAccess
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisableAWSServiceAccess)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
DisableAWSServiceAccessResponse
DisableAWSServiceAccessResponse'
instance Prelude.Hashable DisableAWSServiceAccess where
hashWithSalt :: Int -> DisableAWSServiceAccess -> Int
hashWithSalt Int
_salt DisableAWSServiceAccess' {Text
servicePrincipal :: Text
$sel:servicePrincipal:DisableAWSServiceAccess' :: DisableAWSServiceAccess -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
servicePrincipal
instance Prelude.NFData DisableAWSServiceAccess where
rnf :: DisableAWSServiceAccess -> ()
rnf DisableAWSServiceAccess' {Text
servicePrincipal :: Text
$sel:servicePrincipal:DisableAWSServiceAccess' :: DisableAWSServiceAccess -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
servicePrincipal
instance Data.ToHeaders DisableAWSServiceAccess where
toHeaders :: DisableAWSServiceAccess -> [Header]
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"AWSOrganizationsV20161128.DisableAWSServiceAccess" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON DisableAWSServiceAccess where
toJSON :: DisableAWSServiceAccess -> Value
toJSON DisableAWSServiceAccess' {Text
servicePrincipal :: Text
$sel:servicePrincipal:DisableAWSServiceAccess' :: DisableAWSServiceAccess -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"ServicePrincipal" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
servicePrincipal)
]
)
instance Data.ToPath DisableAWSServiceAccess where
toPath :: DisableAWSServiceAccess -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DisableAWSServiceAccess where
toQuery :: DisableAWSServiceAccess -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DisableAWSServiceAccessResponse = DisableAWSServiceAccessResponse'
{
}
deriving (DisableAWSServiceAccessResponse
-> DisableAWSServiceAccessResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisableAWSServiceAccessResponse
-> DisableAWSServiceAccessResponse -> Bool
$c/= :: DisableAWSServiceAccessResponse
-> DisableAWSServiceAccessResponse -> Bool
== :: DisableAWSServiceAccessResponse
-> DisableAWSServiceAccessResponse -> Bool
$c== :: DisableAWSServiceAccessResponse
-> DisableAWSServiceAccessResponse -> Bool
Prelude.Eq, ReadPrec [DisableAWSServiceAccessResponse]
ReadPrec DisableAWSServiceAccessResponse
Int -> ReadS DisableAWSServiceAccessResponse
ReadS [DisableAWSServiceAccessResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisableAWSServiceAccessResponse]
$creadListPrec :: ReadPrec [DisableAWSServiceAccessResponse]
readPrec :: ReadPrec DisableAWSServiceAccessResponse
$creadPrec :: ReadPrec DisableAWSServiceAccessResponse
readList :: ReadS [DisableAWSServiceAccessResponse]
$creadList :: ReadS [DisableAWSServiceAccessResponse]
readsPrec :: Int -> ReadS DisableAWSServiceAccessResponse
$creadsPrec :: Int -> ReadS DisableAWSServiceAccessResponse
Prelude.Read, Int -> DisableAWSServiceAccessResponse -> ShowS
[DisableAWSServiceAccessResponse] -> ShowS
DisableAWSServiceAccessResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisableAWSServiceAccessResponse] -> ShowS
$cshowList :: [DisableAWSServiceAccessResponse] -> ShowS
show :: DisableAWSServiceAccessResponse -> String
$cshow :: DisableAWSServiceAccessResponse -> String
showsPrec :: Int -> DisableAWSServiceAccessResponse -> ShowS
$cshowsPrec :: Int -> DisableAWSServiceAccessResponse -> ShowS
Prelude.Show, forall x.
Rep DisableAWSServiceAccessResponse x
-> DisableAWSServiceAccessResponse
forall x.
DisableAWSServiceAccessResponse
-> Rep DisableAWSServiceAccessResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisableAWSServiceAccessResponse x
-> DisableAWSServiceAccessResponse
$cfrom :: forall x.
DisableAWSServiceAccessResponse
-> Rep DisableAWSServiceAccessResponse x
Prelude.Generic)
newDisableAWSServiceAccessResponse ::
DisableAWSServiceAccessResponse
newDisableAWSServiceAccessResponse :: DisableAWSServiceAccessResponse
newDisableAWSServiceAccessResponse =
DisableAWSServiceAccessResponse
DisableAWSServiceAccessResponse'
instance
Prelude.NFData
DisableAWSServiceAccessResponse
where
rnf :: DisableAWSServiceAccessResponse -> ()
rnf DisableAWSServiceAccessResponse
_ = ()