{-# 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.DirectoryService.DeleteConditionalForwarder
(
DeleteConditionalForwarder (..),
newDeleteConditionalForwarder,
deleteConditionalForwarder_directoryId,
deleteConditionalForwarder_remoteDomainName,
DeleteConditionalForwarderResponse (..),
newDeleteConditionalForwarderResponse,
deleteConditionalForwarderResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DirectoryService.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteConditionalForwarder = DeleteConditionalForwarder'
{
DeleteConditionalForwarder -> Text
directoryId :: Prelude.Text,
DeleteConditionalForwarder -> Text
remoteDomainName :: Prelude.Text
}
deriving (DeleteConditionalForwarder -> DeleteConditionalForwarder -> Bool
(DeleteConditionalForwarder -> DeleteConditionalForwarder -> Bool)
-> (DeleteConditionalForwarder
-> DeleteConditionalForwarder -> Bool)
-> Eq DeleteConditionalForwarder
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteConditionalForwarder -> DeleteConditionalForwarder -> Bool
$c/= :: DeleteConditionalForwarder -> DeleteConditionalForwarder -> Bool
== :: DeleteConditionalForwarder -> DeleteConditionalForwarder -> Bool
$c== :: DeleteConditionalForwarder -> DeleteConditionalForwarder -> Bool
Prelude.Eq, ReadPrec [DeleteConditionalForwarder]
ReadPrec DeleteConditionalForwarder
Int -> ReadS DeleteConditionalForwarder
ReadS [DeleteConditionalForwarder]
(Int -> ReadS DeleteConditionalForwarder)
-> ReadS [DeleteConditionalForwarder]
-> ReadPrec DeleteConditionalForwarder
-> ReadPrec [DeleteConditionalForwarder]
-> Read DeleteConditionalForwarder
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteConditionalForwarder]
$creadListPrec :: ReadPrec [DeleteConditionalForwarder]
readPrec :: ReadPrec DeleteConditionalForwarder
$creadPrec :: ReadPrec DeleteConditionalForwarder
readList :: ReadS [DeleteConditionalForwarder]
$creadList :: ReadS [DeleteConditionalForwarder]
readsPrec :: Int -> ReadS DeleteConditionalForwarder
$creadsPrec :: Int -> ReadS DeleteConditionalForwarder
Prelude.Read, Int -> DeleteConditionalForwarder -> ShowS
[DeleteConditionalForwarder] -> ShowS
DeleteConditionalForwarder -> String
(Int -> DeleteConditionalForwarder -> ShowS)
-> (DeleteConditionalForwarder -> String)
-> ([DeleteConditionalForwarder] -> ShowS)
-> Show DeleteConditionalForwarder
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteConditionalForwarder] -> ShowS
$cshowList :: [DeleteConditionalForwarder] -> ShowS
show :: DeleteConditionalForwarder -> String
$cshow :: DeleteConditionalForwarder -> String
showsPrec :: Int -> DeleteConditionalForwarder -> ShowS
$cshowsPrec :: Int -> DeleteConditionalForwarder -> ShowS
Prelude.Show, (forall x.
DeleteConditionalForwarder -> Rep DeleteConditionalForwarder x)
-> (forall x.
Rep DeleteConditionalForwarder x -> DeleteConditionalForwarder)
-> Generic DeleteConditionalForwarder
forall x.
Rep DeleteConditionalForwarder x -> DeleteConditionalForwarder
forall x.
DeleteConditionalForwarder -> Rep DeleteConditionalForwarder x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteConditionalForwarder x -> DeleteConditionalForwarder
$cfrom :: forall x.
DeleteConditionalForwarder -> Rep DeleteConditionalForwarder x
Prelude.Generic)
newDeleteConditionalForwarder ::
Prelude.Text ->
Prelude.Text ->
DeleteConditionalForwarder
newDeleteConditionalForwarder :: Text -> Text -> DeleteConditionalForwarder
newDeleteConditionalForwarder
Text
pDirectoryId_
Text
pRemoteDomainName_ =
DeleteConditionalForwarder' :: Text -> Text -> DeleteConditionalForwarder
DeleteConditionalForwarder'
{ $sel:directoryId:DeleteConditionalForwarder' :: Text
directoryId =
Text
pDirectoryId_,
$sel:remoteDomainName:DeleteConditionalForwarder' :: Text
remoteDomainName = Text
pRemoteDomainName_
}
deleteConditionalForwarder_directoryId :: Lens.Lens' DeleteConditionalForwarder Prelude.Text
deleteConditionalForwarder_directoryId :: (Text -> f Text)
-> DeleteConditionalForwarder -> f DeleteConditionalForwarder
deleteConditionalForwarder_directoryId = (DeleteConditionalForwarder -> Text)
-> (DeleteConditionalForwarder
-> Text -> DeleteConditionalForwarder)
-> Lens
DeleteConditionalForwarder DeleteConditionalForwarder Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConditionalForwarder' {Text
directoryId :: Text
$sel:directoryId:DeleteConditionalForwarder' :: DeleteConditionalForwarder -> Text
directoryId} -> Text
directoryId) (\s :: DeleteConditionalForwarder
s@DeleteConditionalForwarder' {} Text
a -> DeleteConditionalForwarder
s {$sel:directoryId:DeleteConditionalForwarder' :: Text
directoryId = Text
a} :: DeleteConditionalForwarder)
deleteConditionalForwarder_remoteDomainName :: Lens.Lens' DeleteConditionalForwarder Prelude.Text
deleteConditionalForwarder_remoteDomainName :: (Text -> f Text)
-> DeleteConditionalForwarder -> f DeleteConditionalForwarder
deleteConditionalForwarder_remoteDomainName = (DeleteConditionalForwarder -> Text)
-> (DeleteConditionalForwarder
-> Text -> DeleteConditionalForwarder)
-> Lens
DeleteConditionalForwarder DeleteConditionalForwarder Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConditionalForwarder' {Text
remoteDomainName :: Text
$sel:remoteDomainName:DeleteConditionalForwarder' :: DeleteConditionalForwarder -> Text
remoteDomainName} -> Text
remoteDomainName) (\s :: DeleteConditionalForwarder
s@DeleteConditionalForwarder' {} Text
a -> DeleteConditionalForwarder
s {$sel:remoteDomainName:DeleteConditionalForwarder' :: Text
remoteDomainName = Text
a} :: DeleteConditionalForwarder)
instance Core.AWSRequest DeleteConditionalForwarder where
type
AWSResponse DeleteConditionalForwarder =
DeleteConditionalForwarderResponse
request :: DeleteConditionalForwarder -> Request DeleteConditionalForwarder
request = Service
-> DeleteConditionalForwarder -> Request DeleteConditionalForwarder
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteConditionalForwarder
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteConditionalForwarder)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteConditionalForwarder))
-> Logger
-> Service
-> Proxy DeleteConditionalForwarder
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteConditionalForwarder)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeleteConditionalForwarderResponse
DeleteConditionalForwarderResponse'
(Int -> DeleteConditionalForwarderResponse)
-> Either String Int
-> Either String DeleteConditionalForwarderResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DeleteConditionalForwarder
instance Prelude.NFData DeleteConditionalForwarder
instance Core.ToHeaders DeleteConditionalForwarder where
toHeaders :: DeleteConditionalForwarder -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteConditionalForwarder -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"DirectoryService_20150416.DeleteConditionalForwarder" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DeleteConditionalForwarder where
toJSON :: DeleteConditionalForwarder -> Value
toJSON DeleteConditionalForwarder' {Text
remoteDomainName :: Text
directoryId :: Text
$sel:remoteDomainName:DeleteConditionalForwarder' :: DeleteConditionalForwarder -> Text
$sel:directoryId:DeleteConditionalForwarder' :: DeleteConditionalForwarder -> 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
"DirectoryId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
directoryId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"RemoteDomainName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
remoteDomainName)
]
)
instance Core.ToPath DeleteConditionalForwarder where
toPath :: DeleteConditionalForwarder -> ByteString
toPath = ByteString -> DeleteConditionalForwarder -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteConditionalForwarder where
toQuery :: DeleteConditionalForwarder -> QueryString
toQuery = QueryString -> DeleteConditionalForwarder -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteConditionalForwarderResponse = DeleteConditionalForwarderResponse'
{
DeleteConditionalForwarderResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteConditionalForwarderResponse
-> DeleteConditionalForwarderResponse -> Bool
(DeleteConditionalForwarderResponse
-> DeleteConditionalForwarderResponse -> Bool)
-> (DeleteConditionalForwarderResponse
-> DeleteConditionalForwarderResponse -> Bool)
-> Eq DeleteConditionalForwarderResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteConditionalForwarderResponse
-> DeleteConditionalForwarderResponse -> Bool
$c/= :: DeleteConditionalForwarderResponse
-> DeleteConditionalForwarderResponse -> Bool
== :: DeleteConditionalForwarderResponse
-> DeleteConditionalForwarderResponse -> Bool
$c== :: DeleteConditionalForwarderResponse
-> DeleteConditionalForwarderResponse -> Bool
Prelude.Eq, ReadPrec [DeleteConditionalForwarderResponse]
ReadPrec DeleteConditionalForwarderResponse
Int -> ReadS DeleteConditionalForwarderResponse
ReadS [DeleteConditionalForwarderResponse]
(Int -> ReadS DeleteConditionalForwarderResponse)
-> ReadS [DeleteConditionalForwarderResponse]
-> ReadPrec DeleteConditionalForwarderResponse
-> ReadPrec [DeleteConditionalForwarderResponse]
-> Read DeleteConditionalForwarderResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteConditionalForwarderResponse]
$creadListPrec :: ReadPrec [DeleteConditionalForwarderResponse]
readPrec :: ReadPrec DeleteConditionalForwarderResponse
$creadPrec :: ReadPrec DeleteConditionalForwarderResponse
readList :: ReadS [DeleteConditionalForwarderResponse]
$creadList :: ReadS [DeleteConditionalForwarderResponse]
readsPrec :: Int -> ReadS DeleteConditionalForwarderResponse
$creadsPrec :: Int -> ReadS DeleteConditionalForwarderResponse
Prelude.Read, Int -> DeleteConditionalForwarderResponse -> ShowS
[DeleteConditionalForwarderResponse] -> ShowS
DeleteConditionalForwarderResponse -> String
(Int -> DeleteConditionalForwarderResponse -> ShowS)
-> (DeleteConditionalForwarderResponse -> String)
-> ([DeleteConditionalForwarderResponse] -> ShowS)
-> Show DeleteConditionalForwarderResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteConditionalForwarderResponse] -> ShowS
$cshowList :: [DeleteConditionalForwarderResponse] -> ShowS
show :: DeleteConditionalForwarderResponse -> String
$cshow :: DeleteConditionalForwarderResponse -> String
showsPrec :: Int -> DeleteConditionalForwarderResponse -> ShowS
$cshowsPrec :: Int -> DeleteConditionalForwarderResponse -> ShowS
Prelude.Show, (forall x.
DeleteConditionalForwarderResponse
-> Rep DeleteConditionalForwarderResponse x)
-> (forall x.
Rep DeleteConditionalForwarderResponse x
-> DeleteConditionalForwarderResponse)
-> Generic DeleteConditionalForwarderResponse
forall x.
Rep DeleteConditionalForwarderResponse x
-> DeleteConditionalForwarderResponse
forall x.
DeleteConditionalForwarderResponse
-> Rep DeleteConditionalForwarderResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteConditionalForwarderResponse x
-> DeleteConditionalForwarderResponse
$cfrom :: forall x.
DeleteConditionalForwarderResponse
-> Rep DeleteConditionalForwarderResponse x
Prelude.Generic)
newDeleteConditionalForwarderResponse ::
Prelude.Int ->
DeleteConditionalForwarderResponse
newDeleteConditionalForwarderResponse :: Int -> DeleteConditionalForwarderResponse
newDeleteConditionalForwarderResponse Int
pHttpStatus_ =
DeleteConditionalForwarderResponse' :: Int -> DeleteConditionalForwarderResponse
DeleteConditionalForwarderResponse'
{ $sel:httpStatus:DeleteConditionalForwarderResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteConditionalForwarderResponse_httpStatus :: Lens.Lens' DeleteConditionalForwarderResponse Prelude.Int
deleteConditionalForwarderResponse_httpStatus :: (Int -> f Int)
-> DeleteConditionalForwarderResponse
-> f DeleteConditionalForwarderResponse
deleteConditionalForwarderResponse_httpStatus = (DeleteConditionalForwarderResponse -> Int)
-> (DeleteConditionalForwarderResponse
-> Int -> DeleteConditionalForwarderResponse)
-> Lens
DeleteConditionalForwarderResponse
DeleteConditionalForwarderResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConditionalForwarderResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteConditionalForwarderResponse' :: DeleteConditionalForwarderResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteConditionalForwarderResponse
s@DeleteConditionalForwarderResponse' {} Int
a -> DeleteConditionalForwarderResponse
s {$sel:httpStatus:DeleteConditionalForwarderResponse' :: Int
httpStatus = Int
a} :: DeleteConditionalForwarderResponse)
instance
Prelude.NFData
DeleteConditionalForwarderResponse