{-# 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.AutoScalingPlans.DeleteScalingPlan
(
deleteScalingPlan
, DeleteScalingPlan
, dspScalingPlanName
, dspScalingPlanVersion
, deleteScalingPlanResponse
, DeleteScalingPlanResponse
, dsprsResponseStatus
) where
import Network.AWS.AutoScalingPlans.Types
import Network.AWS.AutoScalingPlans.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DeleteScalingPlan = DeleteScalingPlan'
{ _dspScalingPlanName :: !Text
, _dspScalingPlanVersion :: !Integer
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteScalingPlan
:: Text
-> Integer
-> DeleteScalingPlan
deleteScalingPlan pScalingPlanName_ pScalingPlanVersion_ =
DeleteScalingPlan'
{ _dspScalingPlanName = pScalingPlanName_
, _dspScalingPlanVersion = pScalingPlanVersion_
}
dspScalingPlanName :: Lens' DeleteScalingPlan Text
dspScalingPlanName = lens _dspScalingPlanName (\ s a -> s{_dspScalingPlanName = a})
dspScalingPlanVersion :: Lens' DeleteScalingPlan Integer
dspScalingPlanVersion = lens _dspScalingPlanVersion (\ s a -> s{_dspScalingPlanVersion = a})
instance AWSRequest DeleteScalingPlan where
type Rs DeleteScalingPlan = DeleteScalingPlanResponse
request = postJSON autoScalingPlans
response
= receiveEmpty
(\ s h x ->
DeleteScalingPlanResponse' <$> (pure (fromEnum s)))
instance Hashable DeleteScalingPlan where
instance NFData DeleteScalingPlan where
instance ToHeaders DeleteScalingPlan where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AnyScaleScalingPlannerFrontendService.DeleteScalingPlan"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteScalingPlan where
toJSON DeleteScalingPlan'{..}
= object
(catMaybes
[Just ("ScalingPlanName" .= _dspScalingPlanName),
Just
("ScalingPlanVersion" .= _dspScalingPlanVersion)])
instance ToPath DeleteScalingPlan where
toPath = const "/"
instance ToQuery DeleteScalingPlan where
toQuery = const mempty
newtype DeleteScalingPlanResponse = DeleteScalingPlanResponse'
{ _dsprsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteScalingPlanResponse
:: Int
-> DeleteScalingPlanResponse
deleteScalingPlanResponse pResponseStatus_ =
DeleteScalingPlanResponse' {_dsprsResponseStatus = pResponseStatus_}
dsprsResponseStatus :: Lens' DeleteScalingPlanResponse Int
dsprsResponseStatus = lens _dsprsResponseStatus (\ s a -> s{_dsprsResponseStatus = a})
instance NFData DeleteScalingPlanResponse where