{-# 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.CancelSchemaExtension
(
CancelSchemaExtension (..),
newCancelSchemaExtension,
cancelSchemaExtension_directoryId,
cancelSchemaExtension_schemaExtensionId,
CancelSchemaExtensionResponse (..),
newCancelSchemaExtensionResponse,
cancelSchemaExtensionResponse_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 CancelSchemaExtension = CancelSchemaExtension'
{
CancelSchemaExtension -> Text
directoryId :: Prelude.Text,
CancelSchemaExtension -> Text
schemaExtensionId :: Prelude.Text
}
deriving (CancelSchemaExtension -> CancelSchemaExtension -> Bool
(CancelSchemaExtension -> CancelSchemaExtension -> Bool)
-> (CancelSchemaExtension -> CancelSchemaExtension -> Bool)
-> Eq CancelSchemaExtension
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelSchemaExtension -> CancelSchemaExtension -> Bool
$c/= :: CancelSchemaExtension -> CancelSchemaExtension -> Bool
== :: CancelSchemaExtension -> CancelSchemaExtension -> Bool
$c== :: CancelSchemaExtension -> CancelSchemaExtension -> Bool
Prelude.Eq, ReadPrec [CancelSchemaExtension]
ReadPrec CancelSchemaExtension
Int -> ReadS CancelSchemaExtension
ReadS [CancelSchemaExtension]
(Int -> ReadS CancelSchemaExtension)
-> ReadS [CancelSchemaExtension]
-> ReadPrec CancelSchemaExtension
-> ReadPrec [CancelSchemaExtension]
-> Read CancelSchemaExtension
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CancelSchemaExtension]
$creadListPrec :: ReadPrec [CancelSchemaExtension]
readPrec :: ReadPrec CancelSchemaExtension
$creadPrec :: ReadPrec CancelSchemaExtension
readList :: ReadS [CancelSchemaExtension]
$creadList :: ReadS [CancelSchemaExtension]
readsPrec :: Int -> ReadS CancelSchemaExtension
$creadsPrec :: Int -> ReadS CancelSchemaExtension
Prelude.Read, Int -> CancelSchemaExtension -> ShowS
[CancelSchemaExtension] -> ShowS
CancelSchemaExtension -> String
(Int -> CancelSchemaExtension -> ShowS)
-> (CancelSchemaExtension -> String)
-> ([CancelSchemaExtension] -> ShowS)
-> Show CancelSchemaExtension
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelSchemaExtension] -> ShowS
$cshowList :: [CancelSchemaExtension] -> ShowS
show :: CancelSchemaExtension -> String
$cshow :: CancelSchemaExtension -> String
showsPrec :: Int -> CancelSchemaExtension -> ShowS
$cshowsPrec :: Int -> CancelSchemaExtension -> ShowS
Prelude.Show, (forall x. CancelSchemaExtension -> Rep CancelSchemaExtension x)
-> (forall x. Rep CancelSchemaExtension x -> CancelSchemaExtension)
-> Generic CancelSchemaExtension
forall x. Rep CancelSchemaExtension x -> CancelSchemaExtension
forall x. CancelSchemaExtension -> Rep CancelSchemaExtension x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CancelSchemaExtension x -> CancelSchemaExtension
$cfrom :: forall x. CancelSchemaExtension -> Rep CancelSchemaExtension x
Prelude.Generic)
newCancelSchemaExtension ::
Prelude.Text ->
Prelude.Text ->
CancelSchemaExtension
newCancelSchemaExtension :: Text -> Text -> CancelSchemaExtension
newCancelSchemaExtension
Text
pDirectoryId_
Text
pSchemaExtensionId_ =
CancelSchemaExtension' :: Text -> Text -> CancelSchemaExtension
CancelSchemaExtension'
{ $sel:directoryId:CancelSchemaExtension' :: Text
directoryId = Text
pDirectoryId_,
$sel:schemaExtensionId:CancelSchemaExtension' :: Text
schemaExtensionId = Text
pSchemaExtensionId_
}
cancelSchemaExtension_directoryId :: Lens.Lens' CancelSchemaExtension Prelude.Text
cancelSchemaExtension_directoryId :: (Text -> f Text)
-> CancelSchemaExtension -> f CancelSchemaExtension
cancelSchemaExtension_directoryId = (CancelSchemaExtension -> Text)
-> (CancelSchemaExtension -> Text -> CancelSchemaExtension)
-> Lens CancelSchemaExtension CancelSchemaExtension Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelSchemaExtension' {Text
directoryId :: Text
$sel:directoryId:CancelSchemaExtension' :: CancelSchemaExtension -> Text
directoryId} -> Text
directoryId) (\s :: CancelSchemaExtension
s@CancelSchemaExtension' {} Text
a -> CancelSchemaExtension
s {$sel:directoryId:CancelSchemaExtension' :: Text
directoryId = Text
a} :: CancelSchemaExtension)
cancelSchemaExtension_schemaExtensionId :: Lens.Lens' CancelSchemaExtension Prelude.Text
cancelSchemaExtension_schemaExtensionId :: (Text -> f Text)
-> CancelSchemaExtension -> f CancelSchemaExtension
cancelSchemaExtension_schemaExtensionId = (CancelSchemaExtension -> Text)
-> (CancelSchemaExtension -> Text -> CancelSchemaExtension)
-> Lens CancelSchemaExtension CancelSchemaExtension Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelSchemaExtension' {Text
schemaExtensionId :: Text
$sel:schemaExtensionId:CancelSchemaExtension' :: CancelSchemaExtension -> Text
schemaExtensionId} -> Text
schemaExtensionId) (\s :: CancelSchemaExtension
s@CancelSchemaExtension' {} Text
a -> CancelSchemaExtension
s {$sel:schemaExtensionId:CancelSchemaExtension' :: Text
schemaExtensionId = Text
a} :: CancelSchemaExtension)
instance Core.AWSRequest CancelSchemaExtension where
type
AWSResponse CancelSchemaExtension =
CancelSchemaExtensionResponse
request :: CancelSchemaExtension -> Request CancelSchemaExtension
request = Service -> CancelSchemaExtension -> Request CancelSchemaExtension
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CancelSchemaExtension
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CancelSchemaExtension)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse CancelSchemaExtension))
-> Logger
-> Service
-> Proxy CancelSchemaExtension
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CancelSchemaExtension)))
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 -> CancelSchemaExtensionResponse
CancelSchemaExtensionResponse'
(Int -> CancelSchemaExtensionResponse)
-> Either String Int -> Either String CancelSchemaExtensionResponse
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 CancelSchemaExtension
instance Prelude.NFData CancelSchemaExtension
instance Core.ToHeaders CancelSchemaExtension where
toHeaders :: CancelSchemaExtension -> ResponseHeaders
toHeaders =
ResponseHeaders -> CancelSchemaExtension -> 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.CancelSchemaExtension" ::
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 CancelSchemaExtension where
toJSON :: CancelSchemaExtension -> Value
toJSON CancelSchemaExtension' {Text
schemaExtensionId :: Text
directoryId :: Text
$sel:schemaExtensionId:CancelSchemaExtension' :: CancelSchemaExtension -> Text
$sel:directoryId:CancelSchemaExtension' :: CancelSchemaExtension -> 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
"SchemaExtensionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
schemaExtensionId)
]
)
instance Core.ToPath CancelSchemaExtension where
toPath :: CancelSchemaExtension -> ByteString
toPath = ByteString -> CancelSchemaExtension -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CancelSchemaExtension where
toQuery :: CancelSchemaExtension -> QueryString
toQuery = QueryString -> CancelSchemaExtension -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CancelSchemaExtensionResponse = CancelSchemaExtensionResponse'
{
CancelSchemaExtensionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CancelSchemaExtensionResponse
-> CancelSchemaExtensionResponse -> Bool
(CancelSchemaExtensionResponse
-> CancelSchemaExtensionResponse -> Bool)
-> (CancelSchemaExtensionResponse
-> CancelSchemaExtensionResponse -> Bool)
-> Eq CancelSchemaExtensionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelSchemaExtensionResponse
-> CancelSchemaExtensionResponse -> Bool
$c/= :: CancelSchemaExtensionResponse
-> CancelSchemaExtensionResponse -> Bool
== :: CancelSchemaExtensionResponse
-> CancelSchemaExtensionResponse -> Bool
$c== :: CancelSchemaExtensionResponse
-> CancelSchemaExtensionResponse -> Bool
Prelude.Eq, ReadPrec [CancelSchemaExtensionResponse]
ReadPrec CancelSchemaExtensionResponse
Int -> ReadS CancelSchemaExtensionResponse
ReadS [CancelSchemaExtensionResponse]
(Int -> ReadS CancelSchemaExtensionResponse)
-> ReadS [CancelSchemaExtensionResponse]
-> ReadPrec CancelSchemaExtensionResponse
-> ReadPrec [CancelSchemaExtensionResponse]
-> Read CancelSchemaExtensionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CancelSchemaExtensionResponse]
$creadListPrec :: ReadPrec [CancelSchemaExtensionResponse]
readPrec :: ReadPrec CancelSchemaExtensionResponse
$creadPrec :: ReadPrec CancelSchemaExtensionResponse
readList :: ReadS [CancelSchemaExtensionResponse]
$creadList :: ReadS [CancelSchemaExtensionResponse]
readsPrec :: Int -> ReadS CancelSchemaExtensionResponse
$creadsPrec :: Int -> ReadS CancelSchemaExtensionResponse
Prelude.Read, Int -> CancelSchemaExtensionResponse -> ShowS
[CancelSchemaExtensionResponse] -> ShowS
CancelSchemaExtensionResponse -> String
(Int -> CancelSchemaExtensionResponse -> ShowS)
-> (CancelSchemaExtensionResponse -> String)
-> ([CancelSchemaExtensionResponse] -> ShowS)
-> Show CancelSchemaExtensionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelSchemaExtensionResponse] -> ShowS
$cshowList :: [CancelSchemaExtensionResponse] -> ShowS
show :: CancelSchemaExtensionResponse -> String
$cshow :: CancelSchemaExtensionResponse -> String
showsPrec :: Int -> CancelSchemaExtensionResponse -> ShowS
$cshowsPrec :: Int -> CancelSchemaExtensionResponse -> ShowS
Prelude.Show, (forall x.
CancelSchemaExtensionResponse
-> Rep CancelSchemaExtensionResponse x)
-> (forall x.
Rep CancelSchemaExtensionResponse x
-> CancelSchemaExtensionResponse)
-> Generic CancelSchemaExtensionResponse
forall x.
Rep CancelSchemaExtensionResponse x
-> CancelSchemaExtensionResponse
forall x.
CancelSchemaExtensionResponse
-> Rep CancelSchemaExtensionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CancelSchemaExtensionResponse x
-> CancelSchemaExtensionResponse
$cfrom :: forall x.
CancelSchemaExtensionResponse
-> Rep CancelSchemaExtensionResponse x
Prelude.Generic)
newCancelSchemaExtensionResponse ::
Prelude.Int ->
CancelSchemaExtensionResponse
newCancelSchemaExtensionResponse :: Int -> CancelSchemaExtensionResponse
newCancelSchemaExtensionResponse Int
pHttpStatus_ =
CancelSchemaExtensionResponse' :: Int -> CancelSchemaExtensionResponse
CancelSchemaExtensionResponse'
{ $sel:httpStatus:CancelSchemaExtensionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
cancelSchemaExtensionResponse_httpStatus :: Lens.Lens' CancelSchemaExtensionResponse Prelude.Int
cancelSchemaExtensionResponse_httpStatus :: (Int -> f Int)
-> CancelSchemaExtensionResponse -> f CancelSchemaExtensionResponse
cancelSchemaExtensionResponse_httpStatus = (CancelSchemaExtensionResponse -> Int)
-> (CancelSchemaExtensionResponse
-> Int -> CancelSchemaExtensionResponse)
-> Lens
CancelSchemaExtensionResponse CancelSchemaExtensionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelSchemaExtensionResponse' {Int
httpStatus :: Int
$sel:httpStatus:CancelSchemaExtensionResponse' :: CancelSchemaExtensionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CancelSchemaExtensionResponse
s@CancelSchemaExtensionResponse' {} Int
a -> CancelSchemaExtensionResponse
s {$sel:httpStatus:CancelSchemaExtensionResponse' :: Int
httpStatus = Int
a} :: CancelSchemaExtensionResponse)
instance Prelude.NFData CancelSchemaExtensionResponse