module Network.AWS.ElasticBeanstalk.CreateStorageLocation
    (
    
      createStorageLocation
    , CreateStorageLocation
    
    , createStorageLocationResponse
    , CreateStorageLocationResponse
    
    , cslrsS3Bucket
    , cslrsStatus
    ) where
import           Network.AWS.ElasticBeanstalk.Types
import           Network.AWS.ElasticBeanstalk.Types.Product
import           Network.AWS.Prelude
import           Network.AWS.Request
import           Network.AWS.Response
data CreateStorageLocation =
    CreateStorageLocation'
    deriving (Eq,Read,Show,Data,Typeable,Generic)
createStorageLocation
    :: CreateStorageLocation
createStorageLocation = CreateStorageLocation'
instance AWSRequest CreateStorageLocation where
        type Rs CreateStorageLocation =
             CreateStorageLocationResponse
        request = postQuery elasticBeanstalk
        response
          = receiveXMLWrapper "CreateStorageLocationResult"
              (\ s h x ->
                 CreateStorageLocationResponse' <$>
                   (x .@? "S3Bucket") <*> (pure (fromEnum s)))
instance ToHeaders CreateStorageLocation where
        toHeaders = const mempty
instance ToPath CreateStorageLocation where
        toPath = const "/"
instance ToQuery CreateStorageLocation where
        toQuery
          = const
              (mconcat
                 ["Action" =: ("CreateStorageLocation" :: ByteString),
                  "Version" =: ("2010-12-01" :: ByteString)])
data CreateStorageLocationResponse = CreateStorageLocationResponse'
    { _cslrsS3Bucket :: !(Maybe Text)
    , _cslrsStatus   :: !Int
    } deriving (Eq,Read,Show,Data,Typeable,Generic)
createStorageLocationResponse
    :: Int 
    -> CreateStorageLocationResponse
createStorageLocationResponse pStatus_ =
    CreateStorageLocationResponse'
    { _cslrsS3Bucket = Nothing
    , _cslrsStatus = pStatus_
    }
cslrsS3Bucket :: Lens' CreateStorageLocationResponse (Maybe Text)
cslrsS3Bucket = lens _cslrsS3Bucket (\ s a -> s{_cslrsS3Bucket = a});
cslrsStatus :: Lens' CreateStorageLocationResponse Int
cslrsStatus = lens _cslrsStatus (\ s a -> s{_cslrsStatus = a});