{-# 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.IoTAnalytics.UpdateChannel
(
updateChannel
, UpdateChannel
, ucRetentionPeriod
, ucChannelName
, updateChannelResponse
, UpdateChannelResponse
) where
import Network.AWS.IoTAnalytics.Types
import Network.AWS.IoTAnalytics.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data UpdateChannel = UpdateChannel'
{ _ucRetentionPeriod :: !(Maybe RetentionPeriod)
, _ucChannelName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateChannel
:: Text
-> UpdateChannel
updateChannel pChannelName_ =
UpdateChannel' {_ucRetentionPeriod = Nothing, _ucChannelName = pChannelName_}
ucRetentionPeriod :: Lens' UpdateChannel (Maybe RetentionPeriod)
ucRetentionPeriod = lens _ucRetentionPeriod (\ s a -> s{_ucRetentionPeriod = a})
ucChannelName :: Lens' UpdateChannel Text
ucChannelName = lens _ucChannelName (\ s a -> s{_ucChannelName = a})
instance AWSRequest UpdateChannel where
type Rs UpdateChannel = UpdateChannelResponse
request = putJSON ioTAnalytics
response = receiveNull UpdateChannelResponse'
instance Hashable UpdateChannel where
instance NFData UpdateChannel where
instance ToHeaders UpdateChannel where
toHeaders = const mempty
instance ToJSON UpdateChannel where
toJSON UpdateChannel'{..}
= object
(catMaybes
[("retentionPeriod" .=) <$> _ucRetentionPeriod])
instance ToPath UpdateChannel where
toPath UpdateChannel'{..}
= mconcat ["/channels/", toBS _ucChannelName]
instance ToQuery UpdateChannel where
toQuery = const mempty
data UpdateChannelResponse =
UpdateChannelResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
updateChannelResponse
:: UpdateChannelResponse
updateChannelResponse = UpdateChannelResponse'
instance NFData UpdateChannelResponse where