module Network.AWS.CodeCommit.UpdateDefaultBranch
(
updateDefaultBranch
, UpdateDefaultBranch
, udbRepositoryName
, udbDefaultBranchName
, updateDefaultBranchResponse
, UpdateDefaultBranchResponse
) where
import Network.AWS.CodeCommit.Types
import Network.AWS.CodeCommit.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data UpdateDefaultBranch = UpdateDefaultBranch'
{ _udbRepositoryName :: !Text
, _udbDefaultBranchName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateDefaultBranch
:: Text
-> Text
-> UpdateDefaultBranch
updateDefaultBranch pRepositoryName_ pDefaultBranchName_ =
UpdateDefaultBranch'
{ _udbRepositoryName = pRepositoryName_
, _udbDefaultBranchName = pDefaultBranchName_
}
udbRepositoryName :: Lens' UpdateDefaultBranch Text
udbRepositoryName = lens _udbRepositoryName (\ s a -> s{_udbRepositoryName = a});
udbDefaultBranchName :: Lens' UpdateDefaultBranch Text
udbDefaultBranchName = lens _udbDefaultBranchName (\ s a -> s{_udbDefaultBranchName = a});
instance AWSRequest UpdateDefaultBranch where
type Rs UpdateDefaultBranch =
UpdateDefaultBranchResponse
request = postJSON codeCommit
response = receiveNull UpdateDefaultBranchResponse'
instance ToHeaders UpdateDefaultBranch where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeCommit_20150413.UpdateDefaultBranch" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateDefaultBranch where
toJSON UpdateDefaultBranch'{..}
= object
(catMaybes
[Just ("repositoryName" .= _udbRepositoryName),
Just ("defaultBranchName" .= _udbDefaultBranchName)])
instance ToPath UpdateDefaultBranch where
toPath = const "/"
instance ToQuery UpdateDefaultBranch where
toQuery = const mempty
data UpdateDefaultBranchResponse =
UpdateDefaultBranchResponse'
deriving (Eq,Read,Show,Data,Typeable,Generic)
updateDefaultBranchResponse
:: UpdateDefaultBranchResponse
updateDefaultBranchResponse = UpdateDefaultBranchResponse'