{-# 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.Cloud9.CreateEnvironmentEC
(
createEnvironmentEC
, CreateEnvironmentEC
, ceecAutomaticStopTimeMinutes
, ceecSubnetId
, ceecOwnerARN
, ceecClientRequestToken
, ceecDescription
, ceecName
, ceecInstanceType
, createEnvironmentECResponse
, CreateEnvironmentECResponse
, ceecrsEnvironmentId
, ceecrsResponseStatus
) where
import Network.AWS.Cloud9.Types
import Network.AWS.Cloud9.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data CreateEnvironmentEC = CreateEnvironmentEC'
{ _ceecAutomaticStopTimeMinutes :: !(Maybe Int)
, _ceecSubnetId :: !(Maybe Text)
, _ceecOwnerARN :: !(Maybe Text)
, _ceecClientRequestToken :: !(Maybe Text)
, _ceecDescription :: !(Maybe Text)
, _ceecName :: !Text
, _ceecInstanceType :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createEnvironmentEC
:: Text
-> Text
-> CreateEnvironmentEC
createEnvironmentEC pName_ pInstanceType_ =
CreateEnvironmentEC'
{ _ceecAutomaticStopTimeMinutes = Nothing
, _ceecSubnetId = Nothing
, _ceecOwnerARN = Nothing
, _ceecClientRequestToken = Nothing
, _ceecDescription = Nothing
, _ceecName = pName_
, _ceecInstanceType = pInstanceType_
}
ceecAutomaticStopTimeMinutes :: Lens' CreateEnvironmentEC (Maybe Int)
ceecAutomaticStopTimeMinutes = lens _ceecAutomaticStopTimeMinutes (\ s a -> s{_ceecAutomaticStopTimeMinutes = a})
ceecSubnetId :: Lens' CreateEnvironmentEC (Maybe Text)
ceecSubnetId = lens _ceecSubnetId (\ s a -> s{_ceecSubnetId = a})
ceecOwnerARN :: Lens' CreateEnvironmentEC (Maybe Text)
ceecOwnerARN = lens _ceecOwnerARN (\ s a -> s{_ceecOwnerARN = a})
ceecClientRequestToken :: Lens' CreateEnvironmentEC (Maybe Text)
ceecClientRequestToken = lens _ceecClientRequestToken (\ s a -> s{_ceecClientRequestToken = a})
ceecDescription :: Lens' CreateEnvironmentEC (Maybe Text)
ceecDescription = lens _ceecDescription (\ s a -> s{_ceecDescription = a})
ceecName :: Lens' CreateEnvironmentEC Text
ceecName = lens _ceecName (\ s a -> s{_ceecName = a})
ceecInstanceType :: Lens' CreateEnvironmentEC Text
ceecInstanceType = lens _ceecInstanceType (\ s a -> s{_ceecInstanceType = a})
instance AWSRequest CreateEnvironmentEC where
type Rs CreateEnvironmentEC =
CreateEnvironmentECResponse
request = postJSON cloud9
response
= receiveJSON
(\ s h x ->
CreateEnvironmentECResponse' <$>
(x .?> "environmentId") <*> (pure (fromEnum s)))
instance Hashable CreateEnvironmentEC where
instance NFData CreateEnvironmentEC where
instance ToHeaders CreateEnvironmentEC where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSCloud9WorkspaceManagementService.CreateEnvironmentEC"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateEnvironmentEC where
toJSON CreateEnvironmentEC'{..}
= object
(catMaybes
[("automaticStopTimeMinutes" .=) <$>
_ceecAutomaticStopTimeMinutes,
("subnetId" .=) <$> _ceecSubnetId,
("ownerArn" .=) <$> _ceecOwnerARN,
("clientRequestToken" .=) <$>
_ceecClientRequestToken,
("description" .=) <$> _ceecDescription,
Just ("name" .= _ceecName),
Just ("instanceType" .= _ceecInstanceType)])
instance ToPath CreateEnvironmentEC where
toPath = const "/"
instance ToQuery CreateEnvironmentEC where
toQuery = const mempty
data CreateEnvironmentECResponse = CreateEnvironmentECResponse'
{ _ceecrsEnvironmentId :: !(Maybe Text)
, _ceecrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createEnvironmentECResponse
:: Int
-> CreateEnvironmentECResponse
createEnvironmentECResponse pResponseStatus_ =
CreateEnvironmentECResponse'
{_ceecrsEnvironmentId = Nothing, _ceecrsResponseStatus = pResponseStatus_}
ceecrsEnvironmentId :: Lens' CreateEnvironmentECResponse (Maybe Text)
ceecrsEnvironmentId = lens _ceecrsEnvironmentId (\ s a -> s{_ceecrsEnvironmentId = a})
ceecrsResponseStatus :: Lens' CreateEnvironmentECResponse Int
ceecrsResponseStatus = lens _ceecrsResponseStatus (\ s a -> s{_ceecrsResponseStatus = a})
instance NFData CreateEnvironmentECResponse where