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