{-# 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.MediaLive.StopChannel
(
stopChannel
, StopChannel
, sChannelId
, stopChannelResponse
, StopChannelResponse
, srsState
, srsARN
, srsPipelinesRunningCount
, srsInputSpecification
, srsInputAttachments
, srsDestinations
, srsName
, srsId
, srsEgressEndpoints
, srsEncoderSettings
, srsRoleARN
, srsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.MediaLive.Types
import Network.AWS.MediaLive.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype StopChannel = StopChannel'
{ _sChannelId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
stopChannel
:: Text
-> StopChannel
stopChannel pChannelId_ = StopChannel' {_sChannelId = pChannelId_}
sChannelId :: Lens' StopChannel Text
sChannelId = lens _sChannelId (\ s a -> s{_sChannelId = a})
instance AWSRequest StopChannel where
type Rs StopChannel = StopChannelResponse
request = postJSON mediaLive
response
= receiveJSON
(\ s h x ->
StopChannelResponse' <$>
(x .?> "state") <*> (x .?> "arn") <*>
(x .?> "pipelinesRunningCount")
<*> (x .?> "inputSpecification")
<*> (x .?> "inputAttachments" .!@ mempty)
<*> (x .?> "destinations" .!@ mempty)
<*> (x .?> "name")
<*> (x .?> "id")
<*> (x .?> "egressEndpoints" .!@ mempty)
<*> (x .?> "encoderSettings")
<*> (x .?> "roleArn")
<*> (pure (fromEnum s)))
instance Hashable StopChannel where
instance NFData StopChannel where
instance ToHeaders StopChannel where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON StopChannel where
toJSON = const (Object mempty)
instance ToPath StopChannel where
toPath StopChannel'{..}
= mconcat
["/prod/channels/", toBS _sChannelId, "/stop"]
instance ToQuery StopChannel where
toQuery = const mempty
data StopChannelResponse = StopChannelResponse'
{ _srsState :: !(Maybe ChannelState)
, _srsARN :: !(Maybe Text)
, _srsPipelinesRunningCount :: !(Maybe Int)
, _srsInputSpecification :: !(Maybe InputSpecification)
, _srsInputAttachments :: !(Maybe [InputAttachment])
, _srsDestinations :: !(Maybe [OutputDestination])
, _srsName :: !(Maybe Text)
, _srsId :: !(Maybe Text)
, _srsEgressEndpoints :: !(Maybe [ChannelEgressEndpoint])
, _srsEncoderSettings :: !(Maybe EncoderSettings)
, _srsRoleARN :: !(Maybe Text)
, _srsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
stopChannelResponse
:: Int
-> StopChannelResponse
stopChannelResponse pResponseStatus_ =
StopChannelResponse'
{ _srsState = Nothing
, _srsARN = Nothing
, _srsPipelinesRunningCount = Nothing
, _srsInputSpecification = Nothing
, _srsInputAttachments = Nothing
, _srsDestinations = Nothing
, _srsName = Nothing
, _srsId = Nothing
, _srsEgressEndpoints = Nothing
, _srsEncoderSettings = Nothing
, _srsRoleARN = Nothing
, _srsResponseStatus = pResponseStatus_
}
srsState :: Lens' StopChannelResponse (Maybe ChannelState)
srsState = lens _srsState (\ s a -> s{_srsState = a})
srsARN :: Lens' StopChannelResponse (Maybe Text)
srsARN = lens _srsARN (\ s a -> s{_srsARN = a})
srsPipelinesRunningCount :: Lens' StopChannelResponse (Maybe Int)
srsPipelinesRunningCount = lens _srsPipelinesRunningCount (\ s a -> s{_srsPipelinesRunningCount = a})
srsInputSpecification :: Lens' StopChannelResponse (Maybe InputSpecification)
srsInputSpecification = lens _srsInputSpecification (\ s a -> s{_srsInputSpecification = a})
srsInputAttachments :: Lens' StopChannelResponse [InputAttachment]
srsInputAttachments = lens _srsInputAttachments (\ s a -> s{_srsInputAttachments = a}) . _Default . _Coerce
srsDestinations :: Lens' StopChannelResponse [OutputDestination]
srsDestinations = lens _srsDestinations (\ s a -> s{_srsDestinations = a}) . _Default . _Coerce
srsName :: Lens' StopChannelResponse (Maybe Text)
srsName = lens _srsName (\ s a -> s{_srsName = a})
srsId :: Lens' StopChannelResponse (Maybe Text)
srsId = lens _srsId (\ s a -> s{_srsId = a})
srsEgressEndpoints :: Lens' StopChannelResponse [ChannelEgressEndpoint]
srsEgressEndpoints = lens _srsEgressEndpoints (\ s a -> s{_srsEgressEndpoints = a}) . _Default . _Coerce
srsEncoderSettings :: Lens' StopChannelResponse (Maybe EncoderSettings)
srsEncoderSettings = lens _srsEncoderSettings (\ s a -> s{_srsEncoderSettings = a})
srsRoleARN :: Lens' StopChannelResponse (Maybe Text)
srsRoleARN = lens _srsRoleARN (\ s a -> s{_srsRoleARN = a})
srsResponseStatus :: Lens' StopChannelResponse Int
srsResponseStatus = lens _srsResponseStatus (\ s a -> s{_srsResponseStatus = a})
instance NFData StopChannelResponse where