{-# 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.MyConfig.RequestAccess
(
MyConfigRequestAccessResource
, myConfigRequestAccess
, MyConfigRequestAccess
, mcraCpksver
, mcraLocale
, mcraLicenseTypes
, mcraVolumeId
, mcraSource
, mcraNonce
) where
import Network.Google.Books.Types
import Network.Google.Prelude
type MyConfigRequestAccessResource =
"books" :>
"v1" :>
"myconfig" :>
"requestAccess" :>
QueryParam "source" Text :>
QueryParam "volumeId" Text :>
QueryParam "nonce" Text :>
QueryParam "cpksver" Text :>
QueryParam "locale" Text :>
QueryParam "licenseTypes"
MyConfigRequestAccessLicenseTypes
:>
QueryParam "alt" AltJSON :>
Post '[JSON] RequestAccess
data MyConfigRequestAccess = MyConfigRequestAccess'
{ _mcraCpksver :: !Text
, _mcraLocale :: !(Maybe Text)
, _mcraLicenseTypes :: !(Maybe MyConfigRequestAccessLicenseTypes)
, _mcraVolumeId :: !Text
, _mcraSource :: !Text
, _mcraNonce :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
myConfigRequestAccess
:: Text
-> Text
-> Text
-> Text
-> MyConfigRequestAccess
myConfigRequestAccess pMcraCpksver_ pMcraVolumeId_ pMcraSource_ pMcraNonce_ =
MyConfigRequestAccess'
{ _mcraCpksver = pMcraCpksver_
, _mcraLocale = Nothing
, _mcraLicenseTypes = Nothing
, _mcraVolumeId = pMcraVolumeId_
, _mcraSource = pMcraSource_
, _mcraNonce = pMcraNonce_
}
mcraCpksver :: Lens' MyConfigRequestAccess Text
mcraCpksver
= lens _mcraCpksver (\ s a -> s{_mcraCpksver = a})
mcraLocale :: Lens' MyConfigRequestAccess (Maybe Text)
mcraLocale
= lens _mcraLocale (\ s a -> s{_mcraLocale = a})
mcraLicenseTypes :: Lens' MyConfigRequestAccess (Maybe MyConfigRequestAccessLicenseTypes)
mcraLicenseTypes
= lens _mcraLicenseTypes
(\ s a -> s{_mcraLicenseTypes = a})
mcraVolumeId :: Lens' MyConfigRequestAccess Text
mcraVolumeId
= lens _mcraVolumeId (\ s a -> s{_mcraVolumeId = a})
mcraSource :: Lens' MyConfigRequestAccess Text
mcraSource
= lens _mcraSource (\ s a -> s{_mcraSource = a})
mcraNonce :: Lens' MyConfigRequestAccess Text
mcraNonce
= lens _mcraNonce (\ s a -> s{_mcraNonce = a})
instance GoogleRequest MyConfigRequestAccess where
type Rs MyConfigRequestAccess = RequestAccess
type Scopes MyConfigRequestAccess =
'["https://www.googleapis.com/auth/books"]
requestClient MyConfigRequestAccess'{..}
= go (Just _mcraSource) (Just _mcraVolumeId)
(Just _mcraNonce)
(Just _mcraCpksver)
_mcraLocale
_mcraLicenseTypes
(Just AltJSON)
booksService
where go
= buildClient
(Proxy :: Proxy MyConfigRequestAccessResource)
mempty