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