{-# 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.Snowball.UpdateCluster
(
updateCluster
, UpdateCluster
, ucNotification
, ucForwardingAddressId
, ucAddressId
, ucShippingOption
, ucResources
, ucDescription
, ucRoleARN
, ucClusterId
, updateClusterResponse
, UpdateClusterResponse
, ucrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.Snowball.Types
import Network.AWS.Snowball.Types.Product
data UpdateCluster = UpdateCluster'
{ _ucNotification :: !(Maybe Notification)
, _ucForwardingAddressId :: !(Maybe Text)
, _ucAddressId :: !(Maybe Text)
, _ucShippingOption :: !(Maybe ShippingOption)
, _ucResources :: !(Maybe JobResource)
, _ucDescription :: !(Maybe Text)
, _ucRoleARN :: !(Maybe Text)
, _ucClusterId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateCluster
:: Text
-> UpdateCluster
updateCluster pClusterId_ =
UpdateCluster'
{ _ucNotification = Nothing
, _ucForwardingAddressId = Nothing
, _ucAddressId = Nothing
, _ucShippingOption = Nothing
, _ucResources = Nothing
, _ucDescription = Nothing
, _ucRoleARN = Nothing
, _ucClusterId = pClusterId_
}
ucNotification :: Lens' UpdateCluster (Maybe Notification)
ucNotification = lens _ucNotification (\ s a -> s{_ucNotification = a})
ucForwardingAddressId :: Lens' UpdateCluster (Maybe Text)
ucForwardingAddressId = lens _ucForwardingAddressId (\ s a -> s{_ucForwardingAddressId = a})
ucAddressId :: Lens' UpdateCluster (Maybe Text)
ucAddressId = lens _ucAddressId (\ s a -> s{_ucAddressId = a})
ucShippingOption :: Lens' UpdateCluster (Maybe ShippingOption)
ucShippingOption = lens _ucShippingOption (\ s a -> s{_ucShippingOption = a})
ucResources :: Lens' UpdateCluster (Maybe JobResource)
ucResources = lens _ucResources (\ s a -> s{_ucResources = a})
ucDescription :: Lens' UpdateCluster (Maybe Text)
ucDescription = lens _ucDescription (\ s a -> s{_ucDescription = a})
ucRoleARN :: Lens' UpdateCluster (Maybe Text)
ucRoleARN = lens _ucRoleARN (\ s a -> s{_ucRoleARN = a})
ucClusterId :: Lens' UpdateCluster Text
ucClusterId = lens _ucClusterId (\ s a -> s{_ucClusterId = a})
instance AWSRequest UpdateCluster where
type Rs UpdateCluster = UpdateClusterResponse
request = postJSON snowball
response
= receiveEmpty
(\ s h x ->
UpdateClusterResponse' <$> (pure (fromEnum s)))
instance Hashable UpdateCluster where
instance NFData UpdateCluster where
instance ToHeaders UpdateCluster where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSIESnowballJobManagementService.UpdateCluster" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateCluster where
toJSON UpdateCluster'{..}
= object
(catMaybes
[("Notification" .=) <$> _ucNotification,
("ForwardingAddressId" .=) <$>
_ucForwardingAddressId,
("AddressId" .=) <$> _ucAddressId,
("ShippingOption" .=) <$> _ucShippingOption,
("Resources" .=) <$> _ucResources,
("Description" .=) <$> _ucDescription,
("RoleARN" .=) <$> _ucRoleARN,
Just ("ClusterId" .= _ucClusterId)])
instance ToPath UpdateCluster where
toPath = const "/"
instance ToQuery UpdateCluster where
toQuery = const mempty
newtype UpdateClusterResponse = UpdateClusterResponse'
{ _ucrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateClusterResponse
:: Int
-> UpdateClusterResponse
updateClusterResponse pResponseStatus_ =
UpdateClusterResponse' {_ucrsResponseStatus = pResponseStatus_}
ucrsResponseStatus :: Lens' UpdateClusterResponse Int
ucrsResponseStatus = lens _ucrsResponseStatus (\ s a -> s{_ucrsResponseStatus = a})
instance NFData UpdateClusterResponse where