{-# 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.DeleteEnvironment
(
deleteEnvironment
, DeleteEnvironment
, deEnvironmentId
, deleteEnvironmentResponse
, DeleteEnvironmentResponse
, dersResponseStatus
) 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
newtype DeleteEnvironment = DeleteEnvironment'
{ _deEnvironmentId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteEnvironment
:: Text
-> DeleteEnvironment
deleteEnvironment pEnvironmentId_ =
DeleteEnvironment' {_deEnvironmentId = pEnvironmentId_}
deEnvironmentId :: Lens' DeleteEnvironment Text
deEnvironmentId = lens _deEnvironmentId (\ s a -> s{_deEnvironmentId = a})
instance AWSRequest DeleteEnvironment where
type Rs DeleteEnvironment = DeleteEnvironmentResponse
request = postJSON cloud9
response
= receiveEmpty
(\ s h x ->
DeleteEnvironmentResponse' <$> (pure (fromEnum s)))
instance Hashable DeleteEnvironment where
instance NFData DeleteEnvironment where
instance ToHeaders DeleteEnvironment where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSCloud9WorkspaceManagementService.DeleteEnvironment"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteEnvironment where
toJSON DeleteEnvironment'{..}
= object
(catMaybes
[Just ("environmentId" .= _deEnvironmentId)])
instance ToPath DeleteEnvironment where
toPath = const "/"
instance ToQuery DeleteEnvironment where
toQuery = const mempty
newtype DeleteEnvironmentResponse = DeleteEnvironmentResponse'
{ _dersResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteEnvironmentResponse
:: Int
-> DeleteEnvironmentResponse
deleteEnvironmentResponse pResponseStatus_ =
DeleteEnvironmentResponse' {_dersResponseStatus = pResponseStatus_}
dersResponseStatus :: Lens' DeleteEnvironmentResponse Int
dersResponseStatus = lens _dersResponseStatus (\ s a -> s{_dersResponseStatus = a})
instance NFData DeleteEnvironmentResponse where