module Network.AWS.ElasticTranscoder.ReadPipeline
(
readPipeline
, ReadPipeline
, rId
, readPipelineResponse
, ReadPipelineResponse
, rrsWarnings
, rrsPipeline
, rrsResponseStatus
) where
import Network.AWS.ElasticTranscoder.Types
import Network.AWS.ElasticTranscoder.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype ReadPipeline = ReadPipeline'
{ _rId :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
readPipeline
:: Text
-> ReadPipeline
readPipeline pId_ =
ReadPipeline'
{ _rId = pId_
}
rId :: Lens' ReadPipeline Text
rId = lens _rId (\ s a -> s{_rId = a});
instance AWSRequest ReadPipeline where
type Rs ReadPipeline = ReadPipelineResponse
request = get elasticTranscoder
response
= receiveJSON
(\ s h x ->
ReadPipelineResponse' <$>
(x .?> "Warnings" .!@ mempty) <*> (x .?> "Pipeline")
<*> (pure (fromEnum s)))
instance Hashable ReadPipeline
instance NFData ReadPipeline
instance ToHeaders ReadPipeline where
toHeaders = const mempty
instance ToPath ReadPipeline where
toPath ReadPipeline'{..}
= mconcat ["/2012-09-25/pipelines/", toBS _rId]
instance ToQuery ReadPipeline where
toQuery = const mempty
data ReadPipelineResponse = ReadPipelineResponse'
{ _rrsWarnings :: !(Maybe [Warning])
, _rrsPipeline :: !(Maybe Pipeline)
, _rrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
readPipelineResponse
:: Int
-> ReadPipelineResponse
readPipelineResponse pResponseStatus_ =
ReadPipelineResponse'
{ _rrsWarnings = Nothing
, _rrsPipeline = Nothing
, _rrsResponseStatus = pResponseStatus_
}
rrsWarnings :: Lens' ReadPipelineResponse [Warning]
rrsWarnings = lens _rrsWarnings (\ s a -> s{_rrsWarnings = a}) . _Default . _Coerce;
rrsPipeline :: Lens' ReadPipelineResponse (Maybe Pipeline)
rrsPipeline = lens _rrsPipeline (\ s a -> s{_rrsPipeline = a});
rrsResponseStatus :: Lens' ReadPipelineResponse Int
rrsResponseStatus = lens _rrsResponseStatus (\ s a -> s{_rrsResponseStatus = a});
instance NFData ReadPipelineResponse