{-# 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.APIGateway.UpdateDocumentationVersion
(
updateDocumentationVersion
, UpdateDocumentationVersion
, udvPatchOperations
, udvRestAPIId
, udvDocumentationVersion
, documentationVersion
, DocumentationVersion
, dvCreatedDate
, dvVersion
, dvDescription
) where
import Network.AWS.APIGateway.Types
import Network.AWS.APIGateway.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data UpdateDocumentationVersion = UpdateDocumentationVersion'
{ _udvPatchOperations :: !(Maybe [PatchOperation])
, _udvRestAPIId :: !Text
, _udvDocumentationVersion :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateDocumentationVersion
:: Text
-> Text
-> UpdateDocumentationVersion
updateDocumentationVersion pRestAPIId_ pDocumentationVersion_ =
UpdateDocumentationVersion'
{ _udvPatchOperations = Nothing
, _udvRestAPIId = pRestAPIId_
, _udvDocumentationVersion = pDocumentationVersion_
}
udvPatchOperations :: Lens' UpdateDocumentationVersion [PatchOperation]
udvPatchOperations = lens _udvPatchOperations (\ s a -> s{_udvPatchOperations = a}) . _Default . _Coerce
udvRestAPIId :: Lens' UpdateDocumentationVersion Text
udvRestAPIId = lens _udvRestAPIId (\ s a -> s{_udvRestAPIId = a})
udvDocumentationVersion :: Lens' UpdateDocumentationVersion Text
udvDocumentationVersion = lens _udvDocumentationVersion (\ s a -> s{_udvDocumentationVersion = a})
instance AWSRequest UpdateDocumentationVersion where
type Rs UpdateDocumentationVersion =
DocumentationVersion
request = patchJSON apiGateway
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable UpdateDocumentationVersion where
instance NFData UpdateDocumentationVersion where
instance ToHeaders UpdateDocumentationVersion where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToJSON UpdateDocumentationVersion where
toJSON UpdateDocumentationVersion'{..}
= object
(catMaybes
[("patchOperations" .=) <$> _udvPatchOperations])
instance ToPath UpdateDocumentationVersion where
toPath UpdateDocumentationVersion'{..}
= mconcat
["/restapis/", toBS _udvRestAPIId,
"/documentation/versions/",
toBS _udvDocumentationVersion]
instance ToQuery UpdateDocumentationVersion where
toQuery = const mempty