{-# 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.UpdateProject
(
updateProject
, UpdateProject
, upArtifacts
, upEnvironment
, upBadgeEnabled
, upCache
, upVpcConfig
, upSource
, upEncryptionKey
, upDescription
, upServiceRole
, upTags
, upTimeoutInMinutes
, upName
, updateProjectResponse
, UpdateProjectResponse
, uprsProject
, uprsResponseStatus
) 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
data UpdateProject = UpdateProject'
{ _upArtifacts :: !(Maybe ProjectArtifacts)
, _upEnvironment :: !(Maybe ProjectEnvironment)
, _upBadgeEnabled :: !(Maybe Bool)
, _upCache :: !(Maybe ProjectCache)
, _upVpcConfig :: !(Maybe VPCConfig)
, _upSource :: !(Maybe ProjectSource)
, _upEncryptionKey :: !(Maybe Text)
, _upDescription :: !(Maybe Text)
, _upServiceRole :: !(Maybe Text)
, _upTags :: !(Maybe [Tag])
, _upTimeoutInMinutes :: !(Maybe Nat)
, _upName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateProject
:: Text
-> UpdateProject
updateProject pName_ =
UpdateProject'
{ _upArtifacts = Nothing
, _upEnvironment = Nothing
, _upBadgeEnabled = Nothing
, _upCache = Nothing
, _upVpcConfig = Nothing
, _upSource = Nothing
, _upEncryptionKey = Nothing
, _upDescription = Nothing
, _upServiceRole = Nothing
, _upTags = Nothing
, _upTimeoutInMinutes = Nothing
, _upName = pName_
}
upArtifacts :: Lens' UpdateProject (Maybe ProjectArtifacts)
upArtifacts = lens _upArtifacts (\ s a -> s{_upArtifacts = a})
upEnvironment :: Lens' UpdateProject (Maybe ProjectEnvironment)
upEnvironment = lens _upEnvironment (\ s a -> s{_upEnvironment = a})
upBadgeEnabled :: Lens' UpdateProject (Maybe Bool)
upBadgeEnabled = lens _upBadgeEnabled (\ s a -> s{_upBadgeEnabled = a})
upCache :: Lens' UpdateProject (Maybe ProjectCache)
upCache = lens _upCache (\ s a -> s{_upCache = a})
upVpcConfig :: Lens' UpdateProject (Maybe VPCConfig)
upVpcConfig = lens _upVpcConfig (\ s a -> s{_upVpcConfig = a})
upSource :: Lens' UpdateProject (Maybe ProjectSource)
upSource = lens _upSource (\ s a -> s{_upSource = a})
upEncryptionKey :: Lens' UpdateProject (Maybe Text)
upEncryptionKey = lens _upEncryptionKey (\ s a -> s{_upEncryptionKey = a})
upDescription :: Lens' UpdateProject (Maybe Text)
upDescription = lens _upDescription (\ s a -> s{_upDescription = a})
upServiceRole :: Lens' UpdateProject (Maybe Text)
upServiceRole = lens _upServiceRole (\ s a -> s{_upServiceRole = a})
upTags :: Lens' UpdateProject [Tag]
upTags = lens _upTags (\ s a -> s{_upTags = a}) . _Default . _Coerce
upTimeoutInMinutes :: Lens' UpdateProject (Maybe Natural)
upTimeoutInMinutes = lens _upTimeoutInMinutes (\ s a -> s{_upTimeoutInMinutes = a}) . mapping _Nat
upName :: Lens' UpdateProject Text
upName = lens _upName (\ s a -> s{_upName = a})
instance AWSRequest UpdateProject where
type Rs UpdateProject = UpdateProjectResponse
request = postJSON codeBuild
response
= receiveJSON
(\ s h x ->
UpdateProjectResponse' <$>
(x .?> "project") <*> (pure (fromEnum s)))
instance Hashable UpdateProject where
instance NFData UpdateProject where
instance ToHeaders UpdateProject where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeBuild_20161006.UpdateProject" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateProject where
toJSON UpdateProject'{..}
= object
(catMaybes
[("artifacts" .=) <$> _upArtifacts,
("environment" .=) <$> _upEnvironment,
("badgeEnabled" .=) <$> _upBadgeEnabled,
("cache" .=) <$> _upCache,
("vpcConfig" .=) <$> _upVpcConfig,
("source" .=) <$> _upSource,
("encryptionKey" .=) <$> _upEncryptionKey,
("description" .=) <$> _upDescription,
("serviceRole" .=) <$> _upServiceRole,
("tags" .=) <$> _upTags,
("timeoutInMinutes" .=) <$> _upTimeoutInMinutes,
Just ("name" .= _upName)])
instance ToPath UpdateProject where
toPath = const "/"
instance ToQuery UpdateProject where
toQuery = const mempty
data UpdateProjectResponse = UpdateProjectResponse'
{ _uprsProject :: !(Maybe Project)
, _uprsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateProjectResponse
:: Int
-> UpdateProjectResponse
updateProjectResponse pResponseStatus_ =
UpdateProjectResponse'
{_uprsProject = Nothing, _uprsResponseStatus = pResponseStatus_}
uprsProject :: Lens' UpdateProjectResponse (Maybe Project)
uprsProject = lens _uprsProject (\ s a -> s{_uprsProject = a})
uprsResponseStatus :: Lens' UpdateProjectResponse Int
uprsResponseStatus = lens _uprsResponseStatus (\ s a -> s{_uprsResponseStatus = a})
instance NFData UpdateProjectResponse where