{-# 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.Schemas.StopDiscoverer
(
StopDiscoverer (..),
newStopDiscoverer,
stopDiscoverer_discovererId,
StopDiscovererResponse (..),
newStopDiscovererResponse,
stopDiscovererResponse_state,
stopDiscovererResponse_discovererId,
stopDiscovererResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Schemas.Types
data StopDiscoverer = StopDiscoverer'
{
StopDiscoverer -> Text
discovererId :: Prelude.Text
}
deriving (StopDiscoverer -> StopDiscoverer -> Bool
(StopDiscoverer -> StopDiscoverer -> Bool)
-> (StopDiscoverer -> StopDiscoverer -> Bool) -> Eq StopDiscoverer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopDiscoverer -> StopDiscoverer -> Bool
$c/= :: StopDiscoverer -> StopDiscoverer -> Bool
== :: StopDiscoverer -> StopDiscoverer -> Bool
$c== :: StopDiscoverer -> StopDiscoverer -> Bool
Prelude.Eq, ReadPrec [StopDiscoverer]
ReadPrec StopDiscoverer
Int -> ReadS StopDiscoverer
ReadS [StopDiscoverer]
(Int -> ReadS StopDiscoverer)
-> ReadS [StopDiscoverer]
-> ReadPrec StopDiscoverer
-> ReadPrec [StopDiscoverer]
-> Read StopDiscoverer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopDiscoverer]
$creadListPrec :: ReadPrec [StopDiscoverer]
readPrec :: ReadPrec StopDiscoverer
$creadPrec :: ReadPrec StopDiscoverer
readList :: ReadS [StopDiscoverer]
$creadList :: ReadS [StopDiscoverer]
readsPrec :: Int -> ReadS StopDiscoverer
$creadsPrec :: Int -> ReadS StopDiscoverer
Prelude.Read, Int -> StopDiscoverer -> ShowS
[StopDiscoverer] -> ShowS
StopDiscoverer -> String
(Int -> StopDiscoverer -> ShowS)
-> (StopDiscoverer -> String)
-> ([StopDiscoverer] -> ShowS)
-> Show StopDiscoverer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopDiscoverer] -> ShowS
$cshowList :: [StopDiscoverer] -> ShowS
show :: StopDiscoverer -> String
$cshow :: StopDiscoverer -> String
showsPrec :: Int -> StopDiscoverer -> ShowS
$cshowsPrec :: Int -> StopDiscoverer -> ShowS
Prelude.Show, (forall x. StopDiscoverer -> Rep StopDiscoverer x)
-> (forall x. Rep StopDiscoverer x -> StopDiscoverer)
-> Generic StopDiscoverer
forall x. Rep StopDiscoverer x -> StopDiscoverer
forall x. StopDiscoverer -> Rep StopDiscoverer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopDiscoverer x -> StopDiscoverer
$cfrom :: forall x. StopDiscoverer -> Rep StopDiscoverer x
Prelude.Generic)
newStopDiscoverer ::
Prelude.Text ->
StopDiscoverer
newStopDiscoverer :: Text -> StopDiscoverer
newStopDiscoverer Text
pDiscovererId_ =
StopDiscoverer' :: Text -> StopDiscoverer
StopDiscoverer' {$sel:discovererId:StopDiscoverer' :: Text
discovererId = Text
pDiscovererId_}
stopDiscoverer_discovererId :: Lens.Lens' StopDiscoverer Prelude.Text
stopDiscoverer_discovererId :: (Text -> f Text) -> StopDiscoverer -> f StopDiscoverer
stopDiscoverer_discovererId = (StopDiscoverer -> Text)
-> (StopDiscoverer -> Text -> StopDiscoverer)
-> Lens StopDiscoverer StopDiscoverer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopDiscoverer' {Text
discovererId :: Text
$sel:discovererId:StopDiscoverer' :: StopDiscoverer -> Text
discovererId} -> Text
discovererId) (\s :: StopDiscoverer
s@StopDiscoverer' {} Text
a -> StopDiscoverer
s {$sel:discovererId:StopDiscoverer' :: Text
discovererId = Text
a} :: StopDiscoverer)
instance Core.AWSRequest StopDiscoverer where
type
AWSResponse StopDiscoverer =
StopDiscovererResponse
request :: StopDiscoverer -> Request StopDiscoverer
request = Service -> StopDiscoverer -> Request StopDiscoverer
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StopDiscoverer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopDiscoverer)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse StopDiscoverer))
-> Logger
-> Service
-> Proxy StopDiscoverer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopDiscoverer)))
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 DiscovererState
-> Maybe Text -> Int -> StopDiscovererResponse
StopDiscovererResponse'
(Maybe DiscovererState
-> Maybe Text -> Int -> StopDiscovererResponse)
-> Either String (Maybe DiscovererState)
-> Either String (Maybe Text -> Int -> StopDiscovererResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe DiscovererState)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"State")
Either String (Maybe Text -> Int -> StopDiscovererResponse)
-> Either String (Maybe Text)
-> Either String (Int -> StopDiscovererResponse)
forall (f :: * -> *) a b. Applicative f => 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
"DiscovererId")
Either String (Int -> StopDiscovererResponse)
-> Either String Int -> Either String StopDiscovererResponse
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 StopDiscoverer
instance Prelude.NFData StopDiscoverer
instance Core.ToHeaders StopDiscoverer where
toHeaders :: StopDiscoverer -> ResponseHeaders
toHeaders =
ResponseHeaders -> StopDiscoverer -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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 StopDiscoverer where
toJSON :: StopDiscoverer -> Value
toJSON = Value -> StopDiscoverer -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance Core.ToPath StopDiscoverer where
toPath :: StopDiscoverer -> ByteString
toPath StopDiscoverer' {Text
discovererId :: Text
$sel:discovererId:StopDiscoverer' :: StopDiscoverer -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v1/discoverers/id/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
discovererId,
ByteString
"/stop"
]
instance Core.ToQuery StopDiscoverer where
toQuery :: StopDiscoverer -> QueryString
toQuery = QueryString -> StopDiscoverer -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StopDiscovererResponse = StopDiscovererResponse'
{
StopDiscovererResponse -> Maybe DiscovererState
state :: Prelude.Maybe DiscovererState,
StopDiscovererResponse -> Maybe Text
discovererId :: Prelude.Maybe Prelude.Text,
StopDiscovererResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopDiscovererResponse -> StopDiscovererResponse -> Bool
(StopDiscovererResponse -> StopDiscovererResponse -> Bool)
-> (StopDiscovererResponse -> StopDiscovererResponse -> Bool)
-> Eq StopDiscovererResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopDiscovererResponse -> StopDiscovererResponse -> Bool
$c/= :: StopDiscovererResponse -> StopDiscovererResponse -> Bool
== :: StopDiscovererResponse -> StopDiscovererResponse -> Bool
$c== :: StopDiscovererResponse -> StopDiscovererResponse -> Bool
Prelude.Eq, ReadPrec [StopDiscovererResponse]
ReadPrec StopDiscovererResponse
Int -> ReadS StopDiscovererResponse
ReadS [StopDiscovererResponse]
(Int -> ReadS StopDiscovererResponse)
-> ReadS [StopDiscovererResponse]
-> ReadPrec StopDiscovererResponse
-> ReadPrec [StopDiscovererResponse]
-> Read StopDiscovererResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopDiscovererResponse]
$creadListPrec :: ReadPrec [StopDiscovererResponse]
readPrec :: ReadPrec StopDiscovererResponse
$creadPrec :: ReadPrec StopDiscovererResponse
readList :: ReadS [StopDiscovererResponse]
$creadList :: ReadS [StopDiscovererResponse]
readsPrec :: Int -> ReadS StopDiscovererResponse
$creadsPrec :: Int -> ReadS StopDiscovererResponse
Prelude.Read, Int -> StopDiscovererResponse -> ShowS
[StopDiscovererResponse] -> ShowS
StopDiscovererResponse -> String
(Int -> StopDiscovererResponse -> ShowS)
-> (StopDiscovererResponse -> String)
-> ([StopDiscovererResponse] -> ShowS)
-> Show StopDiscovererResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopDiscovererResponse] -> ShowS
$cshowList :: [StopDiscovererResponse] -> ShowS
show :: StopDiscovererResponse -> String
$cshow :: StopDiscovererResponse -> String
showsPrec :: Int -> StopDiscovererResponse -> ShowS
$cshowsPrec :: Int -> StopDiscovererResponse -> ShowS
Prelude.Show, (forall x. StopDiscovererResponse -> Rep StopDiscovererResponse x)
-> (forall x.
Rep StopDiscovererResponse x -> StopDiscovererResponse)
-> Generic StopDiscovererResponse
forall x. Rep StopDiscovererResponse x -> StopDiscovererResponse
forall x. StopDiscovererResponse -> Rep StopDiscovererResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopDiscovererResponse x -> StopDiscovererResponse
$cfrom :: forall x. StopDiscovererResponse -> Rep StopDiscovererResponse x
Prelude.Generic)
newStopDiscovererResponse ::
Prelude.Int ->
StopDiscovererResponse
newStopDiscovererResponse :: Int -> StopDiscovererResponse
newStopDiscovererResponse Int
pHttpStatus_ =
StopDiscovererResponse' :: Maybe DiscovererState
-> Maybe Text -> Int -> StopDiscovererResponse
StopDiscovererResponse'
{ $sel:state:StopDiscovererResponse' :: Maybe DiscovererState
state = Maybe DiscovererState
forall a. Maybe a
Prelude.Nothing,
$sel:discovererId:StopDiscovererResponse' :: Maybe Text
discovererId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StopDiscovererResponse' :: Int
httpStatus = Int
pHttpStatus_
}
stopDiscovererResponse_state :: Lens.Lens' StopDiscovererResponse (Prelude.Maybe DiscovererState)
stopDiscovererResponse_state :: (Maybe DiscovererState -> f (Maybe DiscovererState))
-> StopDiscovererResponse -> f StopDiscovererResponse
stopDiscovererResponse_state = (StopDiscovererResponse -> Maybe DiscovererState)
-> (StopDiscovererResponse
-> Maybe DiscovererState -> StopDiscovererResponse)
-> Lens
StopDiscovererResponse
StopDiscovererResponse
(Maybe DiscovererState)
(Maybe DiscovererState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopDiscovererResponse' {Maybe DiscovererState
state :: Maybe DiscovererState
$sel:state:StopDiscovererResponse' :: StopDiscovererResponse -> Maybe DiscovererState
state} -> Maybe DiscovererState
state) (\s :: StopDiscovererResponse
s@StopDiscovererResponse' {} Maybe DiscovererState
a -> StopDiscovererResponse
s {$sel:state:StopDiscovererResponse' :: Maybe DiscovererState
state = Maybe DiscovererState
a} :: StopDiscovererResponse)
stopDiscovererResponse_discovererId :: Lens.Lens' StopDiscovererResponse (Prelude.Maybe Prelude.Text)
stopDiscovererResponse_discovererId :: (Maybe Text -> f (Maybe Text))
-> StopDiscovererResponse -> f StopDiscovererResponse
stopDiscovererResponse_discovererId = (StopDiscovererResponse -> Maybe Text)
-> (StopDiscovererResponse -> Maybe Text -> StopDiscovererResponse)
-> Lens
StopDiscovererResponse
StopDiscovererResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopDiscovererResponse' {Maybe Text
discovererId :: Maybe Text
$sel:discovererId:StopDiscovererResponse' :: StopDiscovererResponse -> Maybe Text
discovererId} -> Maybe Text
discovererId) (\s :: StopDiscovererResponse
s@StopDiscovererResponse' {} Maybe Text
a -> StopDiscovererResponse
s {$sel:discovererId:StopDiscovererResponse' :: Maybe Text
discovererId = Maybe Text
a} :: StopDiscovererResponse)
stopDiscovererResponse_httpStatus :: Lens.Lens' StopDiscovererResponse Prelude.Int
stopDiscovererResponse_httpStatus :: (Int -> f Int)
-> StopDiscovererResponse -> f StopDiscovererResponse
stopDiscovererResponse_httpStatus = (StopDiscovererResponse -> Int)
-> (StopDiscovererResponse -> Int -> StopDiscovererResponse)
-> Lens StopDiscovererResponse StopDiscovererResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopDiscovererResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopDiscovererResponse' :: StopDiscovererResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopDiscovererResponse
s@StopDiscovererResponse' {} Int
a -> StopDiscovererResponse
s {$sel:httpStatus:StopDiscovererResponse' :: Int
httpStatus = Int
a} :: StopDiscovererResponse)
instance Prelude.NFData StopDiscovererResponse