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.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 Sv UpdateRepositoryName = CodeCommit
type Rs UpdateRepositoryName =
UpdateRepositoryNameResponse
request = postJSON
response = receiveNull UpdateRepositoryNameResponse'
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
["oldName" .= _urnOldName, "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'