{-# 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.DeleteChannel
(
deleteChannel
, DeleteChannel
, dcChannelId
, deleteChannelResponse
, DeleteChannelResponse
, drsState
, drsARN
, drsPipelinesRunningCount
, drsInputSpecification
, drsInputAttachments
, drsDestinations
, drsName
, drsId
, drsEgressEndpoints
, drsEncoderSettings
, drsRoleARN
, drsResponseStatus
) 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 DeleteChannel = DeleteChannel'
{ _dcChannelId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteChannel
:: Text
-> DeleteChannel
deleteChannel pChannelId_ = DeleteChannel' {_dcChannelId = pChannelId_}
dcChannelId :: Lens' DeleteChannel Text
dcChannelId = lens _dcChannelId (\ s a -> s{_dcChannelId = a})
instance AWSRequest DeleteChannel where
type Rs DeleteChannel = DeleteChannelResponse
request = delete mediaLive
response
= receiveJSON
(\ s h x ->
DeleteChannelResponse' <$>
(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 DeleteChannel where
instance NFData DeleteChannel where
instance ToHeaders DeleteChannel where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath DeleteChannel where
toPath DeleteChannel'{..}
= mconcat ["/prod/channels/", toBS _dcChannelId]
instance ToQuery DeleteChannel where
toQuery = const mempty
data DeleteChannelResponse = DeleteChannelResponse'
{ _drsState :: !(Maybe ChannelState)
, _drsARN :: !(Maybe Text)
, _drsPipelinesRunningCount :: !(Maybe Int)
, _drsInputSpecification :: !(Maybe InputSpecification)
, _drsInputAttachments :: !(Maybe [InputAttachment])
, _drsDestinations :: !(Maybe [OutputDestination])
, _drsName :: !(Maybe Text)
, _drsId :: !(Maybe Text)
, _drsEgressEndpoints :: !(Maybe [ChannelEgressEndpoint])
, _drsEncoderSettings :: !(Maybe EncoderSettings)
, _drsRoleARN :: !(Maybe Text)
, _drsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteChannelResponse
:: Int
-> DeleteChannelResponse
deleteChannelResponse pResponseStatus_ =
DeleteChannelResponse'
{ _drsState = Nothing
, _drsARN = Nothing
, _drsPipelinesRunningCount = Nothing
, _drsInputSpecification = Nothing
, _drsInputAttachments = Nothing
, _drsDestinations = Nothing
, _drsName = Nothing
, _drsId = Nothing
, _drsEgressEndpoints = Nothing
, _drsEncoderSettings = Nothing
, _drsRoleARN = Nothing
, _drsResponseStatus = pResponseStatus_
}
drsState :: Lens' DeleteChannelResponse (Maybe ChannelState)
drsState = lens _drsState (\ s a -> s{_drsState = a})
drsARN :: Lens' DeleteChannelResponse (Maybe Text)
drsARN = lens _drsARN (\ s a -> s{_drsARN = a})
drsPipelinesRunningCount :: Lens' DeleteChannelResponse (Maybe Int)
drsPipelinesRunningCount = lens _drsPipelinesRunningCount (\ s a -> s{_drsPipelinesRunningCount = a})
drsInputSpecification :: Lens' DeleteChannelResponse (Maybe InputSpecification)
drsInputSpecification = lens _drsInputSpecification (\ s a -> s{_drsInputSpecification = a})
drsInputAttachments :: Lens' DeleteChannelResponse [InputAttachment]
drsInputAttachments = lens _drsInputAttachments (\ s a -> s{_drsInputAttachments = a}) . _Default . _Coerce
drsDestinations :: Lens' DeleteChannelResponse [OutputDestination]
drsDestinations = lens _drsDestinations (\ s a -> s{_drsDestinations = a}) . _Default . _Coerce
drsName :: Lens' DeleteChannelResponse (Maybe Text)
drsName = lens _drsName (\ s a -> s{_drsName = a})
drsId :: Lens' DeleteChannelResponse (Maybe Text)
drsId = lens _drsId (\ s a -> s{_drsId = a})
drsEgressEndpoints :: Lens' DeleteChannelResponse [ChannelEgressEndpoint]
drsEgressEndpoints = lens _drsEgressEndpoints (\ s a -> s{_drsEgressEndpoints = a}) . _Default . _Coerce
drsEncoderSettings :: Lens' DeleteChannelResponse (Maybe EncoderSettings)
drsEncoderSettings = lens _drsEncoderSettings (\ s a -> s{_drsEncoderSettings = a})
drsRoleARN :: Lens' DeleteChannelResponse (Maybe Text)
drsRoleARN = lens _drsRoleARN (\ s a -> s{_drsRoleARN = a})
drsResponseStatus :: Lens' DeleteChannelResponse Int
drsResponseStatus = lens _drsResponseStatus (\ s a -> s{_drsResponseStatus = a})
instance NFData DeleteChannelResponse where