module Network.AWS.EC2.CreateVPCEndpoint
(
createVPCEndpoint
, CreateVPCEndpoint
, cvePolicyDocument
, cveClientToken
, cveDryRun
, cveRouteTableIds
, cveVPCId
, cveServiceName
, createVPCEndpointResponse
, CreateVPCEndpointResponse
, cversClientToken
, cversVPCEndpoint
, cversResponseStatus
) where
import Network.AWS.EC2.Types
import Network.AWS.EC2.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data CreateVPCEndpoint = CreateVPCEndpoint'
{ _cvePolicyDocument :: !(Maybe Text)
, _cveClientToken :: !(Maybe Text)
, _cveDryRun :: !(Maybe Bool)
, _cveRouteTableIds :: !(Maybe [Text])
, _cveVPCId :: !Text
, _cveServiceName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createVPCEndpoint
:: Text
-> Text
-> CreateVPCEndpoint
createVPCEndpoint pVPCId_ pServiceName_ =
CreateVPCEndpoint'
{ _cvePolicyDocument = Nothing
, _cveClientToken = Nothing
, _cveDryRun = Nothing
, _cveRouteTableIds = Nothing
, _cveVPCId = pVPCId_
, _cveServiceName = pServiceName_
}
cvePolicyDocument :: Lens' CreateVPCEndpoint (Maybe Text)
cvePolicyDocument = lens _cvePolicyDocument (\ s a -> s{_cvePolicyDocument = a});
cveClientToken :: Lens' CreateVPCEndpoint (Maybe Text)
cveClientToken = lens _cveClientToken (\ s a -> s{_cveClientToken = a});
cveDryRun :: Lens' CreateVPCEndpoint (Maybe Bool)
cveDryRun = lens _cveDryRun (\ s a -> s{_cveDryRun = a});
cveRouteTableIds :: Lens' CreateVPCEndpoint [Text]
cveRouteTableIds = lens _cveRouteTableIds (\ s a -> s{_cveRouteTableIds = a}) . _Default . _Coerce;
cveVPCId :: Lens' CreateVPCEndpoint Text
cveVPCId = lens _cveVPCId (\ s a -> s{_cveVPCId = a});
cveServiceName :: Lens' CreateVPCEndpoint Text
cveServiceName = lens _cveServiceName (\ s a -> s{_cveServiceName = a});
instance AWSRequest CreateVPCEndpoint where
type Rs CreateVPCEndpoint = CreateVPCEndpointResponse
request = postQuery eC2
response
= receiveXML
(\ s h x ->
CreateVPCEndpointResponse' <$>
(x .@? "clientToken") <*> (x .@? "vpcEndpoint") <*>
(pure (fromEnum s)))
instance ToHeaders CreateVPCEndpoint where
toHeaders = const mempty
instance ToPath CreateVPCEndpoint where
toPath = const "/"
instance ToQuery CreateVPCEndpoint where
toQuery CreateVPCEndpoint'{..}
= mconcat
["Action" =: ("CreateVpcEndpoint" :: ByteString),
"Version" =: ("2015-04-15" :: ByteString),
"PolicyDocument" =: _cvePolicyDocument,
"ClientToken" =: _cveClientToken,
"DryRun" =: _cveDryRun,
toQuery
(toQueryList "RouteTableId" <$> _cveRouteTableIds),
"VpcId" =: _cveVPCId,
"ServiceName" =: _cveServiceName]
data CreateVPCEndpointResponse = CreateVPCEndpointResponse'
{ _cversClientToken :: !(Maybe Text)
, _cversVPCEndpoint :: !(Maybe VPCEndpoint)
, _cversResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createVPCEndpointResponse
:: Int
-> CreateVPCEndpointResponse
createVPCEndpointResponse pResponseStatus_ =
CreateVPCEndpointResponse'
{ _cversClientToken = Nothing
, _cversVPCEndpoint = Nothing
, _cversResponseStatus = pResponseStatus_
}
cversClientToken :: Lens' CreateVPCEndpointResponse (Maybe Text)
cversClientToken = lens _cversClientToken (\ s a -> s{_cversClientToken = a});
cversVPCEndpoint :: Lens' CreateVPCEndpointResponse (Maybe VPCEndpoint)
cversVPCEndpoint = lens _cversVPCEndpoint (\ s a -> s{_cversVPCEndpoint = a});
cversResponseStatus :: Lens' CreateVPCEndpointResponse Int
cversResponseStatus = lens _cversResponseStatus (\ s a -> s{_cversResponseStatus = a});