amazonka-gamelift-1.4.0: gen/Network/AWS/GameLift/DeleteScalingPolicy.hs
{-# 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 #-}
-- Derived from AWS service descriptions, licensed under Apache 2.0.
-- |
-- Module : Network.AWS.GameLift.DeleteScalingPolicy
-- Copyright : (c) 2013-2016 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes a fleet scaling policy. This action means that the policy is no
-- longer in force and removes all record of it. To delete a scaling
-- policy, specify both the scaling policy name and the fleet ID it is
-- associated with.
module Network.AWS.GameLift.DeleteScalingPolicy
(
-- * Creating a Request
deleteScalingPolicy
, DeleteScalingPolicy
-- * Request Lenses
, dspName
, dspFleetId
-- * Destructuring the Response
, deleteScalingPolicyResponse
, DeleteScalingPolicyResponse
) where
import Network.AWS.GameLift.Types
import Network.AWS.GameLift.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
-- | Represents the input for a request action.
--
-- /See:/ 'deleteScalingPolicy' smart constructor.
data DeleteScalingPolicy = DeleteScalingPolicy'
{ _dspName :: !Text
, _dspFleetId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
-- | Creates a value of 'DeleteScalingPolicy' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'dspName'
--
-- * 'dspFleetId'
deleteScalingPolicy
:: Text -- ^ 'dspName'
-> Text -- ^ 'dspFleetId'
-> DeleteScalingPolicy
deleteScalingPolicy pName_ pFleetId_ =
DeleteScalingPolicy'
{ _dspName = pName_
, _dspFleetId = pFleetId_
}
-- | Descriptive label associated with this scaling policy. Policy names do
-- not need to be unique.
dspName :: Lens' DeleteScalingPolicy Text
dspName = lens _dspName (\ s a -> s{_dspName = a});
-- | Unique identifier for a fleet.
dspFleetId :: Lens' DeleteScalingPolicy Text
dspFleetId = lens _dspFleetId (\ s a -> s{_dspFleetId = a});
instance AWSRequest DeleteScalingPolicy where
type Rs DeleteScalingPolicy =
DeleteScalingPolicyResponse
request = postJSON gameLift
response = receiveNull DeleteScalingPolicyResponse'
instance Hashable DeleteScalingPolicy
instance ToHeaders DeleteScalingPolicy where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("GameLift.DeleteScalingPolicy" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteScalingPolicy where
toJSON DeleteScalingPolicy'{..}
= object
(catMaybes
[Just ("Name" .= _dspName),
Just ("FleetId" .= _dspFleetId)])
instance ToPath DeleteScalingPolicy where
toPath = const "/"
instance ToQuery DeleteScalingPolicy where
toQuery = const mempty
-- | /See:/ 'deleteScalingPolicyResponse' smart constructor.
data DeleteScalingPolicyResponse =
DeleteScalingPolicyResponse'
deriving (Eq,Read,Show,Data,Typeable,Generic)
-- | Creates a value of 'DeleteScalingPolicyResponse' with the minimum fields required to make a request.
--
deleteScalingPolicyResponse
:: DeleteScalingPolicyResponse
deleteScalingPolicyResponse = DeleteScalingPolicyResponse'