{-# 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.StopTrigger
(
StopTrigger (..),
newStopTrigger,
stopTrigger_name,
StopTriggerResponse (..),
newStopTriggerResponse,
stopTriggerResponse_name,
stopTriggerResponse_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 StopTrigger = StopTrigger'
{
StopTrigger -> Text
name :: Prelude.Text
}
deriving (StopTrigger -> StopTrigger -> Bool
(StopTrigger -> StopTrigger -> Bool)
-> (StopTrigger -> StopTrigger -> Bool) -> Eq StopTrigger
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopTrigger -> StopTrigger -> Bool
$c/= :: StopTrigger -> StopTrigger -> Bool
== :: StopTrigger -> StopTrigger -> Bool
$c== :: StopTrigger -> StopTrigger -> Bool
Prelude.Eq, ReadPrec [StopTrigger]
ReadPrec StopTrigger
Int -> ReadS StopTrigger
ReadS [StopTrigger]
(Int -> ReadS StopTrigger)
-> ReadS [StopTrigger]
-> ReadPrec StopTrigger
-> ReadPrec [StopTrigger]
-> Read StopTrigger
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopTrigger]
$creadListPrec :: ReadPrec [StopTrigger]
readPrec :: ReadPrec StopTrigger
$creadPrec :: ReadPrec StopTrigger
readList :: ReadS [StopTrigger]
$creadList :: ReadS [StopTrigger]
readsPrec :: Int -> ReadS StopTrigger
$creadsPrec :: Int -> ReadS StopTrigger
Prelude.Read, Int -> StopTrigger -> ShowS
[StopTrigger] -> ShowS
StopTrigger -> String
(Int -> StopTrigger -> ShowS)
-> (StopTrigger -> String)
-> ([StopTrigger] -> ShowS)
-> Show StopTrigger
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopTrigger] -> ShowS
$cshowList :: [StopTrigger] -> ShowS
show :: StopTrigger -> String
$cshow :: StopTrigger -> String
showsPrec :: Int -> StopTrigger -> ShowS
$cshowsPrec :: Int -> StopTrigger -> ShowS
Prelude.Show, (forall x. StopTrigger -> Rep StopTrigger x)
-> (forall x. Rep StopTrigger x -> StopTrigger)
-> Generic StopTrigger
forall x. Rep StopTrigger x -> StopTrigger
forall x. StopTrigger -> Rep StopTrigger x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopTrigger x -> StopTrigger
$cfrom :: forall x. StopTrigger -> Rep StopTrigger x
Prelude.Generic)
newStopTrigger ::
Prelude.Text ->
StopTrigger
newStopTrigger :: Text -> StopTrigger
newStopTrigger Text
pName_ = StopTrigger' :: Text -> StopTrigger
StopTrigger' {$sel:name:StopTrigger' :: Text
name = Text
pName_}
stopTrigger_name :: Lens.Lens' StopTrigger Prelude.Text
stopTrigger_name :: (Text -> f Text) -> StopTrigger -> f StopTrigger
stopTrigger_name = (StopTrigger -> Text)
-> (StopTrigger -> Text -> StopTrigger)
-> Lens StopTrigger StopTrigger Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopTrigger' {Text
name :: Text
$sel:name:StopTrigger' :: StopTrigger -> Text
name} -> Text
name) (\s :: StopTrigger
s@StopTrigger' {} Text
a -> StopTrigger
s {$sel:name:StopTrigger' :: Text
name = Text
a} :: StopTrigger)
instance Core.AWSRequest StopTrigger where
type AWSResponse StopTrigger = StopTriggerResponse
request :: StopTrigger -> Request StopTrigger
request = Service -> StopTrigger -> Request StopTrigger
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StopTrigger
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopTrigger)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse StopTrigger))
-> Logger
-> Service
-> Proxy StopTrigger
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopTrigger)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> StopTriggerResponse
StopTriggerResponse'
(Maybe Text -> Int -> StopTriggerResponse)
-> Either String (Maybe Text)
-> Either String (Int -> StopTriggerResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Name")
Either String (Int -> StopTriggerResponse)
-> Either String Int -> Either String StopTriggerResponse
forall (f :: * -> *) a b. Applicative f => 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 StopTrigger
instance Prelude.NFData StopTrigger
instance Core.ToHeaders StopTrigger where
toHeaders :: StopTrigger -> ResponseHeaders
toHeaders =
ResponseHeaders -> StopTrigger -> 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.StopTrigger" :: 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 StopTrigger where
toJSON :: StopTrigger -> Value
toJSON StopTrigger' {Text
name :: Text
$sel:name:StopTrigger' :: StopTrigger -> 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 StopTrigger where
toPath :: StopTrigger -> ByteString
toPath = ByteString -> StopTrigger -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StopTrigger where
toQuery :: StopTrigger -> QueryString
toQuery = QueryString -> StopTrigger -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StopTriggerResponse = StopTriggerResponse'
{
StopTriggerResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
StopTriggerResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopTriggerResponse -> StopTriggerResponse -> Bool
(StopTriggerResponse -> StopTriggerResponse -> Bool)
-> (StopTriggerResponse -> StopTriggerResponse -> Bool)
-> Eq StopTriggerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopTriggerResponse -> StopTriggerResponse -> Bool
$c/= :: StopTriggerResponse -> StopTriggerResponse -> Bool
== :: StopTriggerResponse -> StopTriggerResponse -> Bool
$c== :: StopTriggerResponse -> StopTriggerResponse -> Bool
Prelude.Eq, ReadPrec [StopTriggerResponse]
ReadPrec StopTriggerResponse
Int -> ReadS StopTriggerResponse
ReadS [StopTriggerResponse]
(Int -> ReadS StopTriggerResponse)
-> ReadS [StopTriggerResponse]
-> ReadPrec StopTriggerResponse
-> ReadPrec [StopTriggerResponse]
-> Read StopTriggerResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopTriggerResponse]
$creadListPrec :: ReadPrec [StopTriggerResponse]
readPrec :: ReadPrec StopTriggerResponse
$creadPrec :: ReadPrec StopTriggerResponse
readList :: ReadS [StopTriggerResponse]
$creadList :: ReadS [StopTriggerResponse]
readsPrec :: Int -> ReadS StopTriggerResponse
$creadsPrec :: Int -> ReadS StopTriggerResponse
Prelude.Read, Int -> StopTriggerResponse -> ShowS
[StopTriggerResponse] -> ShowS
StopTriggerResponse -> String
(Int -> StopTriggerResponse -> ShowS)
-> (StopTriggerResponse -> String)
-> ([StopTriggerResponse] -> ShowS)
-> Show StopTriggerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopTriggerResponse] -> ShowS
$cshowList :: [StopTriggerResponse] -> ShowS
show :: StopTriggerResponse -> String
$cshow :: StopTriggerResponse -> String
showsPrec :: Int -> StopTriggerResponse -> ShowS
$cshowsPrec :: Int -> StopTriggerResponse -> ShowS
Prelude.Show, (forall x. StopTriggerResponse -> Rep StopTriggerResponse x)
-> (forall x. Rep StopTriggerResponse x -> StopTriggerResponse)
-> Generic StopTriggerResponse
forall x. Rep StopTriggerResponse x -> StopTriggerResponse
forall x. StopTriggerResponse -> Rep StopTriggerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopTriggerResponse x -> StopTriggerResponse
$cfrom :: forall x. StopTriggerResponse -> Rep StopTriggerResponse x
Prelude.Generic)
newStopTriggerResponse ::
Prelude.Int ->
StopTriggerResponse
newStopTriggerResponse :: Int -> StopTriggerResponse
newStopTriggerResponse Int
pHttpStatus_ =
StopTriggerResponse' :: Maybe Text -> Int -> StopTriggerResponse
StopTriggerResponse'
{ $sel:name:StopTriggerResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StopTriggerResponse' :: Int
httpStatus = Int
pHttpStatus_
}
stopTriggerResponse_name :: Lens.Lens' StopTriggerResponse (Prelude.Maybe Prelude.Text)
stopTriggerResponse_name :: (Maybe Text -> f (Maybe Text))
-> StopTriggerResponse -> f StopTriggerResponse
stopTriggerResponse_name = (StopTriggerResponse -> Maybe Text)
-> (StopTriggerResponse -> Maybe Text -> StopTriggerResponse)
-> Lens
StopTriggerResponse StopTriggerResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopTriggerResponse' {Maybe Text
name :: Maybe Text
$sel:name:StopTriggerResponse' :: StopTriggerResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: StopTriggerResponse
s@StopTriggerResponse' {} Maybe Text
a -> StopTriggerResponse
s {$sel:name:StopTriggerResponse' :: Maybe Text
name = Maybe Text
a} :: StopTriggerResponse)
stopTriggerResponse_httpStatus :: Lens.Lens' StopTriggerResponse Prelude.Int
stopTriggerResponse_httpStatus :: (Int -> f Int) -> StopTriggerResponse -> f StopTriggerResponse
stopTriggerResponse_httpStatus = (StopTriggerResponse -> Int)
-> (StopTriggerResponse -> Int -> StopTriggerResponse)
-> Lens StopTriggerResponse StopTriggerResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopTriggerResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopTriggerResponse' :: StopTriggerResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopTriggerResponse
s@StopTriggerResponse' {} Int
a -> StopTriggerResponse
s {$sel:httpStatus:StopTriggerResponse' :: Int
httpStatus = Int
a} :: StopTriggerResponse)
instance Prelude.NFData StopTriggerResponse