{-# 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.Insert
(
MyLibraryAnnotationsInsertResource
, myLibraryAnnotationsInsert
, MyLibraryAnnotationsInsert
, mlaiCountry
, mlaiPayload
, mlaiShowOnlySummaryInResponse
, mlaiAnnotationId
, mlaiSource
) where
import Network.Google.Books.Types
import Network.Google.Prelude
type MyLibraryAnnotationsInsertResource =
"books" :>
"v1" :>
"mylibrary" :>
"annotations" :>
QueryParam "country" Text :>
QueryParam "showOnlySummaryInResponse" Bool :>
QueryParam "annotationId" Text :>
QueryParam "source" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Annotation :> Post '[JSON] Annotation
data MyLibraryAnnotationsInsert = MyLibraryAnnotationsInsert'
{ _mlaiCountry :: !(Maybe Text)
, _mlaiPayload :: !Annotation
, _mlaiShowOnlySummaryInResponse :: !(Maybe Bool)
, _mlaiAnnotationId :: !(Maybe Text)
, _mlaiSource :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
myLibraryAnnotationsInsert
:: Annotation
-> MyLibraryAnnotationsInsert
myLibraryAnnotationsInsert pMlaiPayload_ =
MyLibraryAnnotationsInsert'
{ _mlaiCountry = Nothing
, _mlaiPayload = pMlaiPayload_
, _mlaiShowOnlySummaryInResponse = Nothing
, _mlaiAnnotationId = Nothing
, _mlaiSource = Nothing
}
mlaiCountry :: Lens' MyLibraryAnnotationsInsert (Maybe Text)
mlaiCountry
= lens _mlaiCountry (\ s a -> s{_mlaiCountry = a})
mlaiPayload :: Lens' MyLibraryAnnotationsInsert Annotation
mlaiPayload
= lens _mlaiPayload (\ s a -> s{_mlaiPayload = a})
mlaiShowOnlySummaryInResponse :: Lens' MyLibraryAnnotationsInsert (Maybe Bool)
mlaiShowOnlySummaryInResponse
= lens _mlaiShowOnlySummaryInResponse
(\ s a -> s{_mlaiShowOnlySummaryInResponse = a})
mlaiAnnotationId :: Lens' MyLibraryAnnotationsInsert (Maybe Text)
mlaiAnnotationId
= lens _mlaiAnnotationId
(\ s a -> s{_mlaiAnnotationId = a})
mlaiSource :: Lens' MyLibraryAnnotationsInsert (Maybe Text)
mlaiSource
= lens _mlaiSource (\ s a -> s{_mlaiSource = a})
instance GoogleRequest MyLibraryAnnotationsInsert
where
type Rs MyLibraryAnnotationsInsert = Annotation
type Scopes MyLibraryAnnotationsInsert =
'["https://www.googleapis.com/auth/books"]
requestClient MyLibraryAnnotationsInsert'{..}
= go _mlaiCountry _mlaiShowOnlySummaryInResponse
_mlaiAnnotationId
_mlaiSource
(Just AltJSON)
_mlaiPayload
booksService
where go
= buildClient
(Proxy :: Proxy MyLibraryAnnotationsInsertResource)
mempty