{-# 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.StorageGateway.CreateTapeWithBarcode
(
createTapeWithBarcode
, CreateTapeWithBarcode
, ctwbGatewayARN
, ctwbTapeSizeInBytes
, ctwbTapeBarcode
, createTapeWithBarcodeResponse
, CreateTapeWithBarcodeResponse
, ctwbrsTapeARN
, ctwbrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.StorageGateway.Types
import Network.AWS.StorageGateway.Types.Product
data CreateTapeWithBarcode = CreateTapeWithBarcode'
{ _ctwbGatewayARN :: !Text
, _ctwbTapeSizeInBytes :: !Integer
, _ctwbTapeBarcode :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createTapeWithBarcode
:: Text
-> Integer
-> Text
-> CreateTapeWithBarcode
createTapeWithBarcode pGatewayARN_ pTapeSizeInBytes_ pTapeBarcode_ =
CreateTapeWithBarcode'
{ _ctwbGatewayARN = pGatewayARN_
, _ctwbTapeSizeInBytes = pTapeSizeInBytes_
, _ctwbTapeBarcode = pTapeBarcode_
}
ctwbGatewayARN :: Lens' CreateTapeWithBarcode Text
ctwbGatewayARN = lens _ctwbGatewayARN (\ s a -> s{_ctwbGatewayARN = a})
ctwbTapeSizeInBytes :: Lens' CreateTapeWithBarcode Integer
ctwbTapeSizeInBytes = lens _ctwbTapeSizeInBytes (\ s a -> s{_ctwbTapeSizeInBytes = a})
ctwbTapeBarcode :: Lens' CreateTapeWithBarcode Text
ctwbTapeBarcode = lens _ctwbTapeBarcode (\ s a -> s{_ctwbTapeBarcode = a})
instance AWSRequest CreateTapeWithBarcode where
type Rs CreateTapeWithBarcode =
CreateTapeWithBarcodeResponse
request = postJSON storageGateway
response
= receiveJSON
(\ s h x ->
CreateTapeWithBarcodeResponse' <$>
(x .?> "TapeARN") <*> (pure (fromEnum s)))
instance Hashable CreateTapeWithBarcode where
instance NFData CreateTapeWithBarcode where
instance ToHeaders CreateTapeWithBarcode where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("StorageGateway_20130630.CreateTapeWithBarcode" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateTapeWithBarcode where
toJSON CreateTapeWithBarcode'{..}
= object
(catMaybes
[Just ("GatewayARN" .= _ctwbGatewayARN),
Just ("TapeSizeInBytes" .= _ctwbTapeSizeInBytes),
Just ("TapeBarcode" .= _ctwbTapeBarcode)])
instance ToPath CreateTapeWithBarcode where
toPath = const "/"
instance ToQuery CreateTapeWithBarcode where
toQuery = const mempty
data CreateTapeWithBarcodeResponse = CreateTapeWithBarcodeResponse'
{ _ctwbrsTapeARN :: !(Maybe Text)
, _ctwbrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createTapeWithBarcodeResponse
:: Int
-> CreateTapeWithBarcodeResponse
createTapeWithBarcodeResponse pResponseStatus_ =
CreateTapeWithBarcodeResponse'
{_ctwbrsTapeARN = Nothing, _ctwbrsResponseStatus = pResponseStatus_}
ctwbrsTapeARN :: Lens' CreateTapeWithBarcodeResponse (Maybe Text)
ctwbrsTapeARN = lens _ctwbrsTapeARN (\ s a -> s{_ctwbrsTapeARN = a})
ctwbrsResponseStatus :: Lens' CreateTapeWithBarcodeResponse Int
ctwbrsResponseStatus = lens _ctwbrsResponseStatus (\ s a -> s{_ctwbrsResponseStatus = a})
instance NFData CreateTapeWithBarcodeResponse where