{-# 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.PhotosLibrary.Albums.Share
(
AlbumsShareResource
, albumsShare
, AlbumsShare
, asXgafv
, asAlbumId
, asUploadProtocol
, asPp
, asAccessToken
, asUploadType
, asPayload
, asBearerToken
, asCallback
) where
import Network.Google.PhotosLibrary.Types
import Network.Google.Prelude
type AlbumsShareResource =
"v1" :>
"albums" :>
CaptureMode "albumId" "share" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "pp" Bool :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "bearer_token" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ShareAlbumRequest :>
Post '[JSON] ShareAlbumResponse
data AlbumsShare = AlbumsShare'
{ _asXgafv :: !(Maybe Xgafv)
, _asAlbumId :: !Text
, _asUploadProtocol :: !(Maybe Text)
, _asPp :: !Bool
, _asAccessToken :: !(Maybe Text)
, _asUploadType :: !(Maybe Text)
, _asPayload :: !ShareAlbumRequest
, _asBearerToken :: !(Maybe Text)
, _asCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
albumsShare
:: Text
-> ShareAlbumRequest
-> AlbumsShare
albumsShare pAsAlbumId_ pAsPayload_ =
AlbumsShare'
{ _asXgafv = Nothing
, _asAlbumId = pAsAlbumId_
, _asUploadProtocol = Nothing
, _asPp = True
, _asAccessToken = Nothing
, _asUploadType = Nothing
, _asPayload = pAsPayload_
, _asBearerToken = Nothing
, _asCallback = Nothing
}
asXgafv :: Lens' AlbumsShare (Maybe Xgafv)
asXgafv = lens _asXgafv (\ s a -> s{_asXgafv = a})
asAlbumId :: Lens' AlbumsShare Text
asAlbumId
= lens _asAlbumId (\ s a -> s{_asAlbumId = a})
asUploadProtocol :: Lens' AlbumsShare (Maybe Text)
asUploadProtocol
= lens _asUploadProtocol
(\ s a -> s{_asUploadProtocol = a})
asPp :: Lens' AlbumsShare Bool
asPp = lens _asPp (\ s a -> s{_asPp = a})
asAccessToken :: Lens' AlbumsShare (Maybe Text)
asAccessToken
= lens _asAccessToken
(\ s a -> s{_asAccessToken = a})
asUploadType :: Lens' AlbumsShare (Maybe Text)
asUploadType
= lens _asUploadType (\ s a -> s{_asUploadType = a})
asPayload :: Lens' AlbumsShare ShareAlbumRequest
asPayload
= lens _asPayload (\ s a -> s{_asPayload = a})
asBearerToken :: Lens' AlbumsShare (Maybe Text)
asBearerToken
= lens _asBearerToken
(\ s a -> s{_asBearerToken = a})
asCallback :: Lens' AlbumsShare (Maybe Text)
asCallback
= lens _asCallback (\ s a -> s{_asCallback = a})
instance GoogleRequest AlbumsShare where
type Rs AlbumsShare = ShareAlbumResponse
type Scopes AlbumsShare =
'["https://www.googleapis.com/auth/photoslibrary.sharing"]
requestClient AlbumsShare'{..}
= go _asAlbumId _asXgafv _asUploadProtocol
(Just _asPp)
_asAccessToken
_asUploadType
_asBearerToken
_asCallback
(Just AltJSON)
_asPayload
photosLibraryService
where go
= buildClient (Proxy :: Proxy AlbumsShareResource)
mempty