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