{-# 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
, 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
newtype StopInstance = StopInstance'
{ _siInstanceId :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
stopInstance
:: Text
-> StopInstance
stopInstance pInstanceId_ =
StopInstance'
{ _siInstanceId = pInstanceId_
}
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
instance NFData StopInstance
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 [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