{-# 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.ElasticBeanstalk.CreateStorageLocation
(
createStorageLocation
, CreateStorageLocation
, createStorageLocationResponse
, CreateStorageLocationResponse
, cslrsS3Bucket
, cslrsResponseStatus
) where
import Network.AWS.ElasticBeanstalk.Types
import Network.AWS.ElasticBeanstalk.Types.Product
import Network.AWS.Lens
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 Hashable CreateStorageLocation where
instance NFData CreateStorageLocation where
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)
, _cslrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createStorageLocationResponse
:: Int
-> CreateStorageLocationResponse
createStorageLocationResponse pResponseStatus_ =
CreateStorageLocationResponse'
{_cslrsS3Bucket = Nothing, _cslrsResponseStatus = pResponseStatus_}
cslrsS3Bucket :: Lens' CreateStorageLocationResponse (Maybe Text)
cslrsS3Bucket = lens _cslrsS3Bucket (\ s a -> s{_cslrsS3Bucket = a})
cslrsResponseStatus :: Lens' CreateStorageLocationResponse Int
cslrsResponseStatus = lens _cslrsResponseStatus (\ s a -> s{_cslrsResponseStatus = a})
instance NFData CreateStorageLocationResponse where