{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.Resource.Books.MyLibrary.Annotations.Update
(
MyLibraryAnnotationsUpdateResource
, myLibraryAnnotationsUpdate
, MyLibraryAnnotationsUpdate
, mlauPayload
, mlauAnnotationId
, mlauSource
) where
import Network.Google.Books.Types
import Network.Google.Prelude
type MyLibraryAnnotationsUpdateResource =
"books" :>
"v1" :>
"mylibrary" :>
"annotations" :>
Capture "annotationId" Text :>
QueryParam "source" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Annotation :> Put '[JSON] Annotation
data MyLibraryAnnotationsUpdate = MyLibraryAnnotationsUpdate'
{ _mlauPayload :: !Annotation
, _mlauAnnotationId :: !Text
, _mlauSource :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
myLibraryAnnotationsUpdate
:: Annotation
-> Text
-> MyLibraryAnnotationsUpdate
myLibraryAnnotationsUpdate pMlauPayload_ pMlauAnnotationId_ =
MyLibraryAnnotationsUpdate'
{ _mlauPayload = pMlauPayload_
, _mlauAnnotationId = pMlauAnnotationId_
, _mlauSource = Nothing
}
mlauPayload :: Lens' MyLibraryAnnotationsUpdate Annotation
mlauPayload
= lens _mlauPayload (\ s a -> s{_mlauPayload = a})
mlauAnnotationId :: Lens' MyLibraryAnnotationsUpdate Text
mlauAnnotationId
= lens _mlauAnnotationId
(\ s a -> s{_mlauAnnotationId = a})
mlauSource :: Lens' MyLibraryAnnotationsUpdate (Maybe Text)
mlauSource
= lens _mlauSource (\ s a -> s{_mlauSource = a})
instance GoogleRequest MyLibraryAnnotationsUpdate
where
type Rs MyLibraryAnnotationsUpdate = Annotation
type Scopes MyLibraryAnnotationsUpdate =
'["https://www.googleapis.com/auth/books"]
requestClient MyLibraryAnnotationsUpdate'{..}
= go _mlauAnnotationId _mlauSource (Just AltJSON)
_mlauPayload
booksService
where go
= buildClient
(Proxy :: Proxy MyLibraryAnnotationsUpdateResource)
mempty