{-# 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.Glue.StopCrawler
(
StopCrawler (..),
newStopCrawler,
stopCrawler_name,
StopCrawlerResponse (..),
newStopCrawlerResponse,
stopCrawlerResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Glue.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 StopCrawler = StopCrawler'
{
StopCrawler -> Text
name :: Prelude.Text
}
deriving (StopCrawler -> StopCrawler -> Bool
(StopCrawler -> StopCrawler -> Bool)
-> (StopCrawler -> StopCrawler -> Bool) -> Eq StopCrawler
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopCrawler -> StopCrawler -> Bool
$c/= :: StopCrawler -> StopCrawler -> Bool
== :: StopCrawler -> StopCrawler -> Bool
$c== :: StopCrawler -> StopCrawler -> Bool
Prelude.Eq, ReadPrec [StopCrawler]
ReadPrec StopCrawler
Int -> ReadS StopCrawler
ReadS [StopCrawler]
(Int -> ReadS StopCrawler)
-> ReadS [StopCrawler]
-> ReadPrec StopCrawler
-> ReadPrec [StopCrawler]
-> Read StopCrawler
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopCrawler]
$creadListPrec :: ReadPrec [StopCrawler]
readPrec :: ReadPrec StopCrawler
$creadPrec :: ReadPrec StopCrawler
readList :: ReadS [StopCrawler]
$creadList :: ReadS [StopCrawler]
readsPrec :: Int -> ReadS StopCrawler
$creadsPrec :: Int -> ReadS StopCrawler
Prelude.Read, Int -> StopCrawler -> ShowS
[StopCrawler] -> ShowS
StopCrawler -> String
(Int -> StopCrawler -> ShowS)
-> (StopCrawler -> String)
-> ([StopCrawler] -> ShowS)
-> Show StopCrawler
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopCrawler] -> ShowS
$cshowList :: [StopCrawler] -> ShowS
show :: StopCrawler -> String
$cshow :: StopCrawler -> String
showsPrec :: Int -> StopCrawler -> ShowS
$cshowsPrec :: Int -> StopCrawler -> ShowS
Prelude.Show, (forall x. StopCrawler -> Rep StopCrawler x)
-> (forall x. Rep StopCrawler x -> StopCrawler)
-> Generic StopCrawler
forall x. Rep StopCrawler x -> StopCrawler
forall x. StopCrawler -> Rep StopCrawler x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopCrawler x -> StopCrawler
$cfrom :: forall x. StopCrawler -> Rep StopCrawler x
Prelude.Generic)
newStopCrawler ::
Prelude.Text ->
StopCrawler
newStopCrawler :: Text -> StopCrawler
newStopCrawler Text
pName_ = StopCrawler' :: Text -> StopCrawler
StopCrawler' {$sel:name:StopCrawler' :: Text
name = Text
pName_}
stopCrawler_name :: Lens.Lens' StopCrawler Prelude.Text
stopCrawler_name :: (Text -> f Text) -> StopCrawler -> f StopCrawler
stopCrawler_name = (StopCrawler -> Text)
-> (StopCrawler -> Text -> StopCrawler)
-> Lens StopCrawler StopCrawler Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopCrawler' {Text
name :: Text
$sel:name:StopCrawler' :: StopCrawler -> Text
name} -> Text
name) (\s :: StopCrawler
s@StopCrawler' {} Text
a -> StopCrawler
s {$sel:name:StopCrawler' :: Text
name = Text
a} :: StopCrawler)
instance Core.AWSRequest StopCrawler where
type AWSResponse StopCrawler = StopCrawlerResponse
request :: StopCrawler -> Request StopCrawler
request = Service -> StopCrawler -> Request StopCrawler
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StopCrawler
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopCrawler)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse StopCrawler))
-> Logger
-> Service
-> Proxy StopCrawler
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopCrawler)))
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 -> StopCrawlerResponse
StopCrawlerResponse'
(Int -> StopCrawlerResponse)
-> Either String Int -> Either String StopCrawlerResponse
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 StopCrawler
instance Prelude.NFData StopCrawler
instance Core.ToHeaders StopCrawler where
toHeaders :: StopCrawler -> ResponseHeaders
toHeaders =
ResponseHeaders -> StopCrawler -> 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
"AWSGlue.StopCrawler" :: 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 StopCrawler where
toJSON :: StopCrawler -> Value
toJSON StopCrawler' {Text
name :: Text
$sel:name:StopCrawler' :: StopCrawler -> 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
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)]
)
instance Core.ToPath StopCrawler where
toPath :: StopCrawler -> ByteString
toPath = ByteString -> StopCrawler -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StopCrawler where
toQuery :: StopCrawler -> QueryString
toQuery = QueryString -> StopCrawler -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StopCrawlerResponse = StopCrawlerResponse'
{
StopCrawlerResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopCrawlerResponse -> StopCrawlerResponse -> Bool
(StopCrawlerResponse -> StopCrawlerResponse -> Bool)
-> (StopCrawlerResponse -> StopCrawlerResponse -> Bool)
-> Eq StopCrawlerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopCrawlerResponse -> StopCrawlerResponse -> Bool
$c/= :: StopCrawlerResponse -> StopCrawlerResponse -> Bool
== :: StopCrawlerResponse -> StopCrawlerResponse -> Bool
$c== :: StopCrawlerResponse -> StopCrawlerResponse -> Bool
Prelude.Eq, ReadPrec [StopCrawlerResponse]
ReadPrec StopCrawlerResponse
Int -> ReadS StopCrawlerResponse
ReadS [StopCrawlerResponse]
(Int -> ReadS StopCrawlerResponse)
-> ReadS [StopCrawlerResponse]
-> ReadPrec StopCrawlerResponse
-> ReadPrec [StopCrawlerResponse]
-> Read StopCrawlerResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopCrawlerResponse]
$creadListPrec :: ReadPrec [StopCrawlerResponse]
readPrec :: ReadPrec StopCrawlerResponse
$creadPrec :: ReadPrec StopCrawlerResponse
readList :: ReadS [StopCrawlerResponse]
$creadList :: ReadS [StopCrawlerResponse]
readsPrec :: Int -> ReadS StopCrawlerResponse
$creadsPrec :: Int -> ReadS StopCrawlerResponse
Prelude.Read, Int -> StopCrawlerResponse -> ShowS
[StopCrawlerResponse] -> ShowS
StopCrawlerResponse -> String
(Int -> StopCrawlerResponse -> ShowS)
-> (StopCrawlerResponse -> String)
-> ([StopCrawlerResponse] -> ShowS)
-> Show StopCrawlerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopCrawlerResponse] -> ShowS
$cshowList :: [StopCrawlerResponse] -> ShowS
show :: StopCrawlerResponse -> String
$cshow :: StopCrawlerResponse -> String
showsPrec :: Int -> StopCrawlerResponse -> ShowS
$cshowsPrec :: Int -> StopCrawlerResponse -> ShowS
Prelude.Show, (forall x. StopCrawlerResponse -> Rep StopCrawlerResponse x)
-> (forall x. Rep StopCrawlerResponse x -> StopCrawlerResponse)
-> Generic StopCrawlerResponse
forall x. Rep StopCrawlerResponse x -> StopCrawlerResponse
forall x. StopCrawlerResponse -> Rep StopCrawlerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopCrawlerResponse x -> StopCrawlerResponse
$cfrom :: forall x. StopCrawlerResponse -> Rep StopCrawlerResponse x
Prelude.Generic)
newStopCrawlerResponse ::
Prelude.Int ->
StopCrawlerResponse
newStopCrawlerResponse :: Int -> StopCrawlerResponse
newStopCrawlerResponse Int
pHttpStatus_ =
StopCrawlerResponse' :: Int -> StopCrawlerResponse
StopCrawlerResponse' {$sel:httpStatus:StopCrawlerResponse' :: Int
httpStatus = Int
pHttpStatus_}
stopCrawlerResponse_httpStatus :: Lens.Lens' StopCrawlerResponse Prelude.Int
stopCrawlerResponse_httpStatus :: (Int -> f Int) -> StopCrawlerResponse -> f StopCrawlerResponse
stopCrawlerResponse_httpStatus = (StopCrawlerResponse -> Int)
-> (StopCrawlerResponse -> Int -> StopCrawlerResponse)
-> Lens StopCrawlerResponse StopCrawlerResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopCrawlerResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopCrawlerResponse' :: StopCrawlerResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopCrawlerResponse
s@StopCrawlerResponse' {} Int
a -> StopCrawlerResponse
s {$sel:httpStatus:StopCrawlerResponse' :: Int
httpStatus = Int
a} :: StopCrawlerResponse)
instance Prelude.NFData StopCrawlerResponse