module Network.AWS.APIGateway.UpdateDocumentationPart
(
updateDocumentationPart
, UpdateDocumentationPart
, udpPatchOperations
, udpRestAPIId
, udpDocumentationPartId
, documentationPart
, DocumentationPart
, dpLocation
, dpId
, dpProperties
) 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 UpdateDocumentationPart = UpdateDocumentationPart'
{ _udpPatchOperations :: !(Maybe [PatchOperation])
, _udpRestAPIId :: !Text
, _udpDocumentationPartId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateDocumentationPart
:: Text
-> Text
-> UpdateDocumentationPart
updateDocumentationPart pRestAPIId_ pDocumentationPartId_ =
UpdateDocumentationPart'
{ _udpPatchOperations = Nothing
, _udpRestAPIId = pRestAPIId_
, _udpDocumentationPartId = pDocumentationPartId_
}
udpPatchOperations :: Lens' UpdateDocumentationPart [PatchOperation]
udpPatchOperations = lens _udpPatchOperations (\ s a -> s{_udpPatchOperations = a}) . _Default . _Coerce;
udpRestAPIId :: Lens' UpdateDocumentationPart Text
udpRestAPIId = lens _udpRestAPIId (\ s a -> s{_udpRestAPIId = a});
udpDocumentationPartId :: Lens' UpdateDocumentationPart Text
udpDocumentationPartId = lens _udpDocumentationPartId (\ s a -> s{_udpDocumentationPartId = a});
instance AWSRequest UpdateDocumentationPart where
type Rs UpdateDocumentationPart = DocumentationPart
request = patchJSON apiGateway
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable UpdateDocumentationPart where
instance NFData UpdateDocumentationPart where
instance ToHeaders UpdateDocumentationPart where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToJSON UpdateDocumentationPart where
toJSON UpdateDocumentationPart'{..}
= object
(catMaybes
[("patchOperations" .=) <$> _udpPatchOperations])
instance ToPath UpdateDocumentationPart where
toPath UpdateDocumentationPart'{..}
= mconcat
["/restapis/", toBS _udpRestAPIId,
"/documentation/parts/",
toBS _udpDocumentationPartId]
instance ToQuery UpdateDocumentationPart where
toQuery = const mempty