{-# 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.StartChannel
(
startChannel
, StartChannel
, scChannelId
, startChannelResponse
, StartChannelResponse
, scrsState
, scrsARN
, scrsPipelinesRunningCount
, scrsInputSpecification
, scrsInputAttachments
, scrsDestinations
, scrsName
, scrsId
, scrsEgressEndpoints
, scrsEncoderSettings
, scrsRoleARN
, scrsResponseStatus
) 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 StartChannel = StartChannel'
{ _scChannelId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
startChannel
:: Text
-> StartChannel
startChannel pChannelId_ = StartChannel' {_scChannelId = pChannelId_}
scChannelId :: Lens' StartChannel Text
scChannelId = lens _scChannelId (\ s a -> s{_scChannelId = a})
instance AWSRequest StartChannel where
type Rs StartChannel = StartChannelResponse
request = postJSON mediaLive
response
= receiveJSON
(\ s h x ->
StartChannelResponse' <$>
(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 StartChannel where
instance NFData StartChannel where
instance ToHeaders StartChannel where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON StartChannel where
toJSON = const (Object mempty)
instance ToPath StartChannel where
toPath StartChannel'{..}
= mconcat
["/prod/channels/", toBS _scChannelId, "/start"]
instance ToQuery StartChannel where
toQuery = const mempty
data StartChannelResponse = StartChannelResponse'
{ _scrsState :: !(Maybe ChannelState)
, _scrsARN :: !(Maybe Text)
, _scrsPipelinesRunningCount :: !(Maybe Int)
, _scrsInputSpecification :: !(Maybe InputSpecification)
, _scrsInputAttachments :: !(Maybe [InputAttachment])
, _scrsDestinations :: !(Maybe [OutputDestination])
, _scrsName :: !(Maybe Text)
, _scrsId :: !(Maybe Text)
, _scrsEgressEndpoints :: !(Maybe [ChannelEgressEndpoint])
, _scrsEncoderSettings :: !(Maybe EncoderSettings)
, _scrsRoleARN :: !(Maybe Text)
, _scrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
startChannelResponse
:: Int
-> StartChannelResponse
startChannelResponse pResponseStatus_ =
StartChannelResponse'
{ _scrsState = Nothing
, _scrsARN = Nothing
, _scrsPipelinesRunningCount = Nothing
, _scrsInputSpecification = Nothing
, _scrsInputAttachments = Nothing
, _scrsDestinations = Nothing
, _scrsName = Nothing
, _scrsId = Nothing
, _scrsEgressEndpoints = Nothing
, _scrsEncoderSettings = Nothing
, _scrsRoleARN = Nothing
, _scrsResponseStatus = pResponseStatus_
}
scrsState :: Lens' StartChannelResponse (Maybe ChannelState)
scrsState = lens _scrsState (\ s a -> s{_scrsState = a})
scrsARN :: Lens' StartChannelResponse (Maybe Text)
scrsARN = lens _scrsARN (\ s a -> s{_scrsARN = a})
scrsPipelinesRunningCount :: Lens' StartChannelResponse (Maybe Int)
scrsPipelinesRunningCount = lens _scrsPipelinesRunningCount (\ s a -> s{_scrsPipelinesRunningCount = a})
scrsInputSpecification :: Lens' StartChannelResponse (Maybe InputSpecification)
scrsInputSpecification = lens _scrsInputSpecification (\ s a -> s{_scrsInputSpecification = a})
scrsInputAttachments :: Lens' StartChannelResponse [InputAttachment]
scrsInputAttachments = lens _scrsInputAttachments (\ s a -> s{_scrsInputAttachments = a}) . _Default . _Coerce
scrsDestinations :: Lens' StartChannelResponse [OutputDestination]
scrsDestinations = lens _scrsDestinations (\ s a -> s{_scrsDestinations = a}) . _Default . _Coerce
scrsName :: Lens' StartChannelResponse (Maybe Text)
scrsName = lens _scrsName (\ s a -> s{_scrsName = a})
scrsId :: Lens' StartChannelResponse (Maybe Text)
scrsId = lens _scrsId (\ s a -> s{_scrsId = a})
scrsEgressEndpoints :: Lens' StartChannelResponse [ChannelEgressEndpoint]
scrsEgressEndpoints = lens _scrsEgressEndpoints (\ s a -> s{_scrsEgressEndpoints = a}) . _Default . _Coerce
scrsEncoderSettings :: Lens' StartChannelResponse (Maybe EncoderSettings)
scrsEncoderSettings = lens _scrsEncoderSettings (\ s a -> s{_scrsEncoderSettings = a})
scrsRoleARN :: Lens' StartChannelResponse (Maybe Text)
scrsRoleARN = lens _scrsRoleARN (\ s a -> s{_scrsRoleARN = a})
scrsResponseStatus :: Lens' StartChannelResponse Int
scrsResponseStatus = lens _scrsResponseStatus (\ s a -> s{_scrsResponseStatus = a})
instance NFData StartChannelResponse where