{-# 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.MediaPackage.UpdateChannel
(
updateChannel
, UpdateChannel
, ucDescription
, ucId
, updateChannelResponse
, UpdateChannelResponse
, ucrsHlsIngest
, ucrsARN
, ucrsId
, ucrsDescription
, ucrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.MediaPackage.Types
import Network.AWS.MediaPackage.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data UpdateChannel = UpdateChannel'
{ _ucDescription :: !(Maybe Text)
, _ucId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateChannel
:: Text
-> UpdateChannel
updateChannel pId_ = UpdateChannel' {_ucDescription = Nothing, _ucId = pId_}
ucDescription :: Lens' UpdateChannel (Maybe Text)
ucDescription = lens _ucDescription (\ s a -> s{_ucDescription = a})
ucId :: Lens' UpdateChannel Text
ucId = lens _ucId (\ s a -> s{_ucId = a})
instance AWSRequest UpdateChannel where
type Rs UpdateChannel = UpdateChannelResponse
request = putJSON mediaPackage
response
= receiveJSON
(\ s h x ->
UpdateChannelResponse' <$>
(x .?> "hlsIngest") <*> (x .?> "arn") <*>
(x .?> "id")
<*> (x .?> "description")
<*> (pure (fromEnum s)))
instance Hashable UpdateChannel where
instance NFData UpdateChannel where
instance ToHeaders UpdateChannel where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateChannel where
toJSON UpdateChannel'{..}
= object
(catMaybes [("description" .=) <$> _ucDescription])
instance ToPath UpdateChannel where
toPath UpdateChannel'{..}
= mconcat ["/channels/", toBS _ucId]
instance ToQuery UpdateChannel where
toQuery = const mempty
data UpdateChannelResponse = UpdateChannelResponse'
{ _ucrsHlsIngest :: !(Maybe HlsIngest)
, _ucrsARN :: !(Maybe Text)
, _ucrsId :: !(Maybe Text)
, _ucrsDescription :: !(Maybe Text)
, _ucrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateChannelResponse
:: Int
-> UpdateChannelResponse
updateChannelResponse pResponseStatus_ =
UpdateChannelResponse'
{ _ucrsHlsIngest = Nothing
, _ucrsARN = Nothing
, _ucrsId = Nothing
, _ucrsDescription = Nothing
, _ucrsResponseStatus = pResponseStatus_
}
ucrsHlsIngest :: Lens' UpdateChannelResponse (Maybe HlsIngest)
ucrsHlsIngest = lens _ucrsHlsIngest (\ s a -> s{_ucrsHlsIngest = a})
ucrsARN :: Lens' UpdateChannelResponse (Maybe Text)
ucrsARN = lens _ucrsARN (\ s a -> s{_ucrsARN = a})
ucrsId :: Lens' UpdateChannelResponse (Maybe Text)
ucrsId = lens _ucrsId (\ s a -> s{_ucrsId = a})
ucrsDescription :: Lens' UpdateChannelResponse (Maybe Text)
ucrsDescription = lens _ucrsDescription (\ s a -> s{_ucrsDescription = a})
ucrsResponseStatus :: Lens' UpdateChannelResponse Int
ucrsResponseStatus = lens _ucrsResponseStatus (\ s a -> s{_ucrsResponseStatus = a})
instance NFData UpdateChannelResponse where