{-# 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.CodeCommit.UpdateRepositoryName
(
updateRepositoryName
, UpdateRepositoryName
, urnOldName
, urnNewName
, updateRepositoryNameResponse
, UpdateRepositoryNameResponse
) where
import Network.AWS.CodeCommit.Types
import Network.AWS.CodeCommit.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data UpdateRepositoryName = UpdateRepositoryName'
{ _urnOldName :: !Text
, _urnNewName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateRepositoryName
:: Text
-> Text
-> UpdateRepositoryName
updateRepositoryName pOldName_ pNewName_ =
UpdateRepositoryName'
{ _urnOldName = pOldName_
, _urnNewName = pNewName_
}
urnOldName :: Lens' UpdateRepositoryName Text
urnOldName = lens _urnOldName (\ s a -> s{_urnOldName = a});
urnNewName :: Lens' UpdateRepositoryName Text
urnNewName = lens _urnNewName (\ s a -> s{_urnNewName = a});
instance AWSRequest UpdateRepositoryName where
type Rs UpdateRepositoryName =
UpdateRepositoryNameResponse
request = postJSON codeCommit
response = receiveNull UpdateRepositoryNameResponse'
instance Hashable UpdateRepositoryName
instance NFData UpdateRepositoryName
instance ToHeaders UpdateRepositoryName where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeCommit_20150413.UpdateRepositoryName" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateRepositoryName where
toJSON UpdateRepositoryName'{..}
= object
(catMaybes
[Just ("oldName" .= _urnOldName),
Just ("newName" .= _urnNewName)])
instance ToPath UpdateRepositoryName where
toPath = const "/"
instance ToQuery UpdateRepositoryName where
toQuery = const mempty
data UpdateRepositoryNameResponse =
UpdateRepositoryNameResponse'
deriving (Eq,Read,Show,Data,Typeable,Generic)
updateRepositoryNameResponse
:: UpdateRepositoryNameResponse
updateRepositoryNameResponse = UpdateRepositoryNameResponse'
instance NFData UpdateRepositoryNameResponse