{-# 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.DescribeChannel
(
describeChannel
, DescribeChannel
, dChannelId
, describeChannelResponse
, DescribeChannelResponse
, dcrsState
, dcrsARN
, dcrsPipelinesRunningCount
, dcrsInputSpecification
, dcrsInputAttachments
, dcrsDestinations
, dcrsName
, dcrsId
, dcrsEgressEndpoints
, dcrsEncoderSettings
, dcrsRoleARN
, dcrsResponseStatus
) 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 DescribeChannel = DescribeChannel'
{ _dChannelId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeChannel
:: Text
-> DescribeChannel
describeChannel pChannelId_ = DescribeChannel' {_dChannelId = pChannelId_}
dChannelId :: Lens' DescribeChannel Text
dChannelId = lens _dChannelId (\ s a -> s{_dChannelId = a})
instance AWSRequest DescribeChannel where
type Rs DescribeChannel = DescribeChannelResponse
request = get mediaLive
response
= receiveJSON
(\ s h x ->
DescribeChannelResponse' <$>
(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 DescribeChannel where
instance NFData DescribeChannel where
instance ToHeaders DescribeChannel where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath DescribeChannel where
toPath DescribeChannel'{..}
= mconcat ["/prod/channels/", toBS _dChannelId]
instance ToQuery DescribeChannel where
toQuery = const mempty
data DescribeChannelResponse = DescribeChannelResponse'
{ _dcrsState :: !(Maybe ChannelState)
, _dcrsARN :: !(Maybe Text)
, _dcrsPipelinesRunningCount :: !(Maybe Int)
, _dcrsInputSpecification :: !(Maybe InputSpecification)
, _dcrsInputAttachments :: !(Maybe [InputAttachment])
, _dcrsDestinations :: !(Maybe [OutputDestination])
, _dcrsName :: !(Maybe Text)
, _dcrsId :: !(Maybe Text)
, _dcrsEgressEndpoints :: !(Maybe [ChannelEgressEndpoint])
, _dcrsEncoderSettings :: !(Maybe EncoderSettings)
, _dcrsRoleARN :: !(Maybe Text)
, _dcrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeChannelResponse
:: Int
-> DescribeChannelResponse
describeChannelResponse pResponseStatus_ =
DescribeChannelResponse'
{ _dcrsState = Nothing
, _dcrsARN = Nothing
, _dcrsPipelinesRunningCount = Nothing
, _dcrsInputSpecification = Nothing
, _dcrsInputAttachments = Nothing
, _dcrsDestinations = Nothing
, _dcrsName = Nothing
, _dcrsId = Nothing
, _dcrsEgressEndpoints = Nothing
, _dcrsEncoderSettings = Nothing
, _dcrsRoleARN = Nothing
, _dcrsResponseStatus = pResponseStatus_
}
dcrsState :: Lens' DescribeChannelResponse (Maybe ChannelState)
dcrsState = lens _dcrsState (\ s a -> s{_dcrsState = a})
dcrsARN :: Lens' DescribeChannelResponse (Maybe Text)
dcrsARN = lens _dcrsARN (\ s a -> s{_dcrsARN = a})
dcrsPipelinesRunningCount :: Lens' DescribeChannelResponse (Maybe Int)
dcrsPipelinesRunningCount = lens _dcrsPipelinesRunningCount (\ s a -> s{_dcrsPipelinesRunningCount = a})
dcrsInputSpecification :: Lens' DescribeChannelResponse (Maybe InputSpecification)
dcrsInputSpecification = lens _dcrsInputSpecification (\ s a -> s{_dcrsInputSpecification = a})
dcrsInputAttachments :: Lens' DescribeChannelResponse [InputAttachment]
dcrsInputAttachments = lens _dcrsInputAttachments (\ s a -> s{_dcrsInputAttachments = a}) . _Default . _Coerce
dcrsDestinations :: Lens' DescribeChannelResponse [OutputDestination]
dcrsDestinations = lens _dcrsDestinations (\ s a -> s{_dcrsDestinations = a}) . _Default . _Coerce
dcrsName :: Lens' DescribeChannelResponse (Maybe Text)
dcrsName = lens _dcrsName (\ s a -> s{_dcrsName = a})
dcrsId :: Lens' DescribeChannelResponse (Maybe Text)
dcrsId = lens _dcrsId (\ s a -> s{_dcrsId = a})
dcrsEgressEndpoints :: Lens' DescribeChannelResponse [ChannelEgressEndpoint]
dcrsEgressEndpoints = lens _dcrsEgressEndpoints (\ s a -> s{_dcrsEgressEndpoints = a}) . _Default . _Coerce
dcrsEncoderSettings :: Lens' DescribeChannelResponse (Maybe EncoderSettings)
dcrsEncoderSettings = lens _dcrsEncoderSettings (\ s a -> s{_dcrsEncoderSettings = a})
dcrsRoleARN :: Lens' DescribeChannelResponse (Maybe Text)
dcrsRoleARN = lens _dcrsRoleARN (\ s a -> s{_dcrsRoleARN = a})
dcrsResponseStatus :: Lens' DescribeChannelResponse Int
dcrsResponseStatus = lens _dcrsResponseStatus (\ s a -> s{_dcrsResponseStatus = a})
instance NFData DescribeChannelResponse where