{-# 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_startSelector,
startStreamProcessor_stopSelector,
startStreamProcessor_name,
StartStreamProcessorResponse (..),
newStartStreamProcessorResponse,
startStreamProcessorResponse_sessionId,
startStreamProcessorResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 -> Maybe StreamProcessingStartSelector
startSelector :: Prelude.Maybe StreamProcessingStartSelector,
StartStreamProcessor -> Maybe StreamProcessingStopSelector
stopSelector :: Prelude.Maybe StreamProcessingStopSelector,
StartStreamProcessor -> Text
name :: Prelude.Text
}
deriving (StartStreamProcessor -> StartStreamProcessor -> Bool
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]
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
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. 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'
{ $sel:startSelector:StartStreamProcessor' :: Maybe StreamProcessingStartSelector
startSelector =
forall a. Maybe a
Prelude.Nothing,
$sel:stopSelector:StartStreamProcessor' :: Maybe StreamProcessingStopSelector
stopSelector = forall a. Maybe a
Prelude.Nothing,
$sel:name:StartStreamProcessor' :: Text
name = Text
pName_
}
startStreamProcessor_startSelector :: Lens.Lens' StartStreamProcessor (Prelude.Maybe StreamProcessingStartSelector)
startStreamProcessor_startSelector :: Lens' StartStreamProcessor (Maybe StreamProcessingStartSelector)
startStreamProcessor_startSelector = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartStreamProcessor' {Maybe StreamProcessingStartSelector
startSelector :: Maybe StreamProcessingStartSelector
$sel:startSelector:StartStreamProcessor' :: StartStreamProcessor -> Maybe StreamProcessingStartSelector
startSelector} -> Maybe StreamProcessingStartSelector
startSelector) (\s :: StartStreamProcessor
s@StartStreamProcessor' {} Maybe StreamProcessingStartSelector
a -> StartStreamProcessor
s {$sel:startSelector:StartStreamProcessor' :: Maybe StreamProcessingStartSelector
startSelector = Maybe StreamProcessingStartSelector
a} :: StartStreamProcessor)
startStreamProcessor_stopSelector :: Lens.Lens' StartStreamProcessor (Prelude.Maybe StreamProcessingStopSelector)
startStreamProcessor_stopSelector :: Lens' StartStreamProcessor (Maybe StreamProcessingStopSelector)
startStreamProcessor_stopSelector = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartStreamProcessor' {Maybe StreamProcessingStopSelector
stopSelector :: Maybe StreamProcessingStopSelector
$sel:stopSelector:StartStreamProcessor' :: StartStreamProcessor -> Maybe StreamProcessingStopSelector
stopSelector} -> Maybe StreamProcessingStopSelector
stopSelector) (\s :: StartStreamProcessor
s@StartStreamProcessor' {} Maybe StreamProcessingStopSelector
a -> StartStreamProcessor
s {$sel:stopSelector:StartStreamProcessor' :: Maybe StreamProcessingStopSelector
stopSelector = Maybe StreamProcessingStopSelector
a} :: StartStreamProcessor)
startStreamProcessor_name :: Lens.Lens' StartStreamProcessor Prelude.Text
startStreamProcessor_name :: Lens' StartStreamProcessor Text
startStreamProcessor_name = 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 :: (Service -> Service)
-> StartStreamProcessor -> Request StartStreamProcessor
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy StartStreamProcessor
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartStreamProcessor)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> StartStreamProcessorResponse
StartStreamProcessorResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"SessionId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable StartStreamProcessor where
hashWithSalt :: Int -> StartStreamProcessor -> Int
hashWithSalt Int
_salt StartStreamProcessor' {Maybe StreamProcessingStartSelector
Maybe StreamProcessingStopSelector
Text
name :: Text
stopSelector :: Maybe StreamProcessingStopSelector
startSelector :: Maybe StreamProcessingStartSelector
$sel:name:StartStreamProcessor' :: StartStreamProcessor -> Text
$sel:stopSelector:StartStreamProcessor' :: StartStreamProcessor -> Maybe StreamProcessingStopSelector
$sel:startSelector:StartStreamProcessor' :: StartStreamProcessor -> Maybe StreamProcessingStartSelector
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StreamProcessingStartSelector
startSelector
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StreamProcessingStopSelector
stopSelector
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
instance Prelude.NFData StartStreamProcessor where
rnf :: StartStreamProcessor -> ()
rnf StartStreamProcessor' {Maybe StreamProcessingStartSelector
Maybe StreamProcessingStopSelector
Text
name :: Text
stopSelector :: Maybe StreamProcessingStopSelector
startSelector :: Maybe StreamProcessingStartSelector
$sel:name:StartStreamProcessor' :: StartStreamProcessor -> Text
$sel:stopSelector:StartStreamProcessor' :: StartStreamProcessor -> Maybe StreamProcessingStopSelector
$sel:startSelector:StartStreamProcessor' :: StartStreamProcessor -> Maybe StreamProcessingStartSelector
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe StreamProcessingStartSelector
startSelector
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StreamProcessingStopSelector
stopSelector
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
instance Data.ToHeaders StartStreamProcessor where
toHeaders :: StartStreamProcessor -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"RekognitionService.StartStreamProcessor" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON StartStreamProcessor where
toJSON :: StartStreamProcessor -> Value
toJSON StartStreamProcessor' {Maybe StreamProcessingStartSelector
Maybe StreamProcessingStopSelector
Text
name :: Text
stopSelector :: Maybe StreamProcessingStopSelector
startSelector :: Maybe StreamProcessingStartSelector
$sel:name:StartStreamProcessor' :: StartStreamProcessor -> Text
$sel:stopSelector:StartStreamProcessor' :: StartStreamProcessor -> Maybe StreamProcessingStopSelector
$sel:startSelector:StartStreamProcessor' :: StartStreamProcessor -> Maybe StreamProcessingStartSelector
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"StartSelector" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StreamProcessingStartSelector
startSelector,
(Key
"StopSelector" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StreamProcessingStopSelector
stopSelector,
forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
]
)
instance Data.ToPath StartStreamProcessor where
toPath :: StartStreamProcessor -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery StartStreamProcessor where
toQuery :: StartStreamProcessor -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data StartStreamProcessorResponse = StartStreamProcessorResponse'
{
StartStreamProcessorResponse -> Maybe Text
sessionId :: Prelude.Maybe Prelude.Text,
StartStreamProcessorResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StartStreamProcessorResponse
-> StartStreamProcessorResponse -> Bool
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]
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
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.
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'
{ $sel:sessionId:StartStreamProcessorResponse' :: Maybe Text
sessionId =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StartStreamProcessorResponse' :: Int
httpStatus = Int
pHttpStatus_
}
startStreamProcessorResponse_sessionId :: Lens.Lens' StartStreamProcessorResponse (Prelude.Maybe Prelude.Text)
startStreamProcessorResponse_sessionId :: Lens' StartStreamProcessorResponse (Maybe Text)
startStreamProcessorResponse_sessionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartStreamProcessorResponse' {Maybe Text
sessionId :: Maybe Text
$sel:sessionId:StartStreamProcessorResponse' :: StartStreamProcessorResponse -> Maybe Text
sessionId} -> Maybe Text
sessionId) (\s :: StartStreamProcessorResponse
s@StartStreamProcessorResponse' {} Maybe Text
a -> StartStreamProcessorResponse
s {$sel:sessionId:StartStreamProcessorResponse' :: Maybe Text
sessionId = Maybe Text
a} :: StartStreamProcessorResponse)
startStreamProcessorResponse_httpStatus :: Lens.Lens' StartStreamProcessorResponse Prelude.Int
startStreamProcessorResponse_httpStatus :: Lens' StartStreamProcessorResponse Int
startStreamProcessorResponse_httpStatus = 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 where
rnf :: StartStreamProcessorResponse -> ()
rnf StartStreamProcessorResponse' {Int
Maybe Text
httpStatus :: Int
sessionId :: Maybe Text
$sel:httpStatus:StartStreamProcessorResponse' :: StartStreamProcessorResponse -> Int
$sel:sessionId:StartStreamProcessorResponse' :: StartStreamProcessorResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sessionId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus