{-# 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.CodeStar.UpdateProject
(
updateProject
, UpdateProject
, upName
, upDescription
, upId
, updateProjectResponse
, UpdateProjectResponse
, uprsResponseStatus
) where
import Network.AWS.CodeStar.Types
import Network.AWS.CodeStar.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data UpdateProject = UpdateProject'
{ _upName :: !(Maybe (Sensitive Text))
, _upDescription :: !(Maybe (Sensitive Text))
, _upId :: !Text
} deriving (Eq, Show, Data, Typeable, Generic)
updateProject
:: Text
-> UpdateProject
updateProject pId_ =
UpdateProject' {_upName = Nothing, _upDescription = Nothing, _upId = pId_}
upName :: Lens' UpdateProject (Maybe Text)
upName = lens _upName (\ s a -> s{_upName = a}) . mapping _Sensitive
upDescription :: Lens' UpdateProject (Maybe Text)
upDescription = lens _upDescription (\ s a -> s{_upDescription = a}) . mapping _Sensitive
upId :: Lens' UpdateProject Text
upId = lens _upId (\ s a -> s{_upId = a})
instance AWSRequest UpdateProject where
type Rs UpdateProject = UpdateProjectResponse
request = postJSON codeStar
response
= receiveEmpty
(\ s h x ->
UpdateProjectResponse' <$> (pure (fromEnum s)))
instance Hashable UpdateProject where
instance NFData UpdateProject where
instance ToHeaders UpdateProject where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeStar_20170419.UpdateProject" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateProject where
toJSON UpdateProject'{..}
= object
(catMaybes
[("name" .=) <$> _upName,
("description" .=) <$> _upDescription,
Just ("id" .= _upId)])
instance ToPath UpdateProject where
toPath = const "/"
instance ToQuery UpdateProject where
toQuery = const mempty
newtype UpdateProjectResponse = UpdateProjectResponse'
{ _uprsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateProjectResponse
:: Int
-> UpdateProjectResponse
updateProjectResponse pResponseStatus_ =
UpdateProjectResponse' {_uprsResponseStatus = pResponseStatus_}
uprsResponseStatus :: Lens' UpdateProjectResponse Int
uprsResponseStatus = lens _uprsResponseStatus (\ s a -> s{_uprsResponseStatus = a})
instance NFData UpdateProjectResponse where