{-# 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.CodeBuild.StopBuild
(
stopBuild
, StopBuild
, sbId
, stopBuildResponse
, StopBuildResponse
, sbrsBuild
, sbrsResponseStatus
) where
import Network.AWS.CodeBuild.Types
import Network.AWS.CodeBuild.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype StopBuild = StopBuild'
{ _sbId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
stopBuild
:: Text
-> StopBuild
stopBuild pId_ = StopBuild' {_sbId = pId_}
sbId :: Lens' StopBuild Text
sbId = lens _sbId (\ s a -> s{_sbId = a})
instance AWSRequest StopBuild where
type Rs StopBuild = StopBuildResponse
request = postJSON codeBuild
response
= receiveJSON
(\ s h x ->
StopBuildResponse' <$>
(x .?> "build") <*> (pure (fromEnum s)))
instance Hashable StopBuild where
instance NFData StopBuild where
instance ToHeaders StopBuild where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeBuild_20161006.StopBuild" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON StopBuild where
toJSON StopBuild'{..}
= object (catMaybes [Just ("id" .= _sbId)])
instance ToPath StopBuild where
toPath = const "/"
instance ToQuery StopBuild where
toQuery = const mempty
data StopBuildResponse = StopBuildResponse'
{ _sbrsBuild :: !(Maybe Build)
, _sbrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
stopBuildResponse
:: Int
-> StopBuildResponse
stopBuildResponse pResponseStatus_ =
StopBuildResponse'
{_sbrsBuild = Nothing, _sbrsResponseStatus = pResponseStatus_}
sbrsBuild :: Lens' StopBuildResponse (Maybe Build)
sbrsBuild = lens _sbrsBuild (\ s a -> s{_sbrsBuild = a})
sbrsResponseStatus :: Lens' StopBuildResponse Int
sbrsResponseStatus = lens _sbrsResponseStatus (\ s a -> s{_sbrsResponseStatus = a})
instance NFData StopBuildResponse where