{-# 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.CancelCluster
(
cancelCluster
, CancelCluster
, ccClusterId
, cancelClusterResponse
, CancelClusterResponse
, ccrsResponseStatus
) 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
newtype CancelCluster = CancelCluster'
{ _ccClusterId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
cancelCluster
:: Text
-> CancelCluster
cancelCluster pClusterId_ = CancelCluster' {_ccClusterId = pClusterId_}
ccClusterId :: Lens' CancelCluster Text
ccClusterId = lens _ccClusterId (\ s a -> s{_ccClusterId = a})
instance AWSRequest CancelCluster where
type Rs CancelCluster = CancelClusterResponse
request = postJSON snowball
response
= receiveEmpty
(\ s h x ->
CancelClusterResponse' <$> (pure (fromEnum s)))
instance Hashable CancelCluster where
instance NFData CancelCluster where
instance ToHeaders CancelCluster where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSIESnowballJobManagementService.CancelCluster" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CancelCluster where
toJSON CancelCluster'{..}
= object
(catMaybes [Just ("ClusterId" .= _ccClusterId)])
instance ToPath CancelCluster where
toPath = const "/"
instance ToQuery CancelCluster where
toQuery = const mempty
newtype CancelClusterResponse = CancelClusterResponse'
{ _ccrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
cancelClusterResponse
:: Int
-> CancelClusterResponse
cancelClusterResponse pResponseStatus_ =
CancelClusterResponse' {_ccrsResponseStatus = pResponseStatus_}
ccrsResponseStatus :: Lens' CancelClusterResponse Int
ccrsResponseStatus = lens _ccrsResponseStatus (\ s a -> s{_ccrsResponseStatus = a})
instance NFData CancelClusterResponse where