{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.Rekognition.StartStreamProcessor
(
startStreamProcessor
, StartStreamProcessor
, sName
, startStreamProcessorResponse
, StartStreamProcessorResponse
, srsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Rekognition.Types
import Network.AWS.Rekognition.Types.Product
import Network.AWS.Request
import Network.AWS.Response
newtype StartStreamProcessor = StartStreamProcessor'
{ _sName :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
startStreamProcessor
:: Text
-> StartStreamProcessor
startStreamProcessor pName_ = StartStreamProcessor' {_sName = pName_}
sName :: Lens' StartStreamProcessor Text
sName = lens _sName (\ s a -> s{_sName = a})
instance AWSRequest StartStreamProcessor where
type Rs StartStreamProcessor =
StartStreamProcessorResponse
request = postJSON rekognition
response
= receiveEmpty
(\ s h x ->
StartStreamProcessorResponse' <$>
(pure (fromEnum s)))
instance Hashable StartStreamProcessor where
instance NFData StartStreamProcessor where
instance ToHeaders StartStreamProcessor where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("RekognitionService.StartStreamProcessor" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON StartStreamProcessor where
toJSON StartStreamProcessor'{..}
= object (catMaybes [Just ("Name" .= _sName)])
instance ToPath StartStreamProcessor where
toPath = const "/"
instance ToQuery StartStreamProcessor where
toQuery = const mempty
newtype StartStreamProcessorResponse = StartStreamProcessorResponse'
{ _srsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
startStreamProcessorResponse
:: Int
-> StartStreamProcessorResponse
startStreamProcessorResponse pResponseStatus_ =
StartStreamProcessorResponse' {_srsResponseStatus = pResponseStatus_}
srsResponseStatus :: Lens' StartStreamProcessorResponse Int
srsResponseStatus = lens _srsResponseStatus (\ s a -> s{_srsResponseStatus = a})
instance NFData StartStreamProcessorResponse where