{-# 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.OpsWorks.StopInstance
(
stopInstance
, StopInstance
, siForce
, siInstanceId
, stopInstanceResponse
, StopInstanceResponse
) where
import Network.AWS.Lens
import Network.AWS.OpsWorks.Types
import Network.AWS.OpsWorks.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data StopInstance = StopInstance'
{ _siForce :: !(Maybe Bool)
, _siInstanceId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
stopInstance
:: Text
-> StopInstance
stopInstance pInstanceId_ =
StopInstance' {_siForce = Nothing, _siInstanceId = pInstanceId_}
siForce :: Lens' StopInstance (Maybe Bool)
siForce = lens _siForce (\ s a -> s{_siForce = a})
siInstanceId :: Lens' StopInstance Text
siInstanceId = lens _siInstanceId (\ s a -> s{_siInstanceId = a})
instance AWSRequest StopInstance where
type Rs StopInstance = StopInstanceResponse
request = postJSON opsWorks
response = receiveNull StopInstanceResponse'
instance Hashable StopInstance where
instance NFData StopInstance where
instance ToHeaders StopInstance where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("OpsWorks_20130218.StopInstance" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON StopInstance where
toJSON StopInstance'{..}
= object
(catMaybes
[("Force" .=) <$> _siForce,
Just ("InstanceId" .= _siInstanceId)])
instance ToPath StopInstance where
toPath = const "/"
instance ToQuery StopInstance where
toQuery = const mempty
data StopInstanceResponse =
StopInstanceResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
stopInstanceResponse
:: StopInstanceResponse
stopInstanceResponse = StopInstanceResponse'
instance NFData StopInstanceResponse where