{-# 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.MediaItems.Search
(
MediaItemsSearchResource
, mediaItemsSearch
, MediaItemsSearch
, misXgafv
, misUploadProtocol
, misPp
, misAccessToken
, misUploadType
, misPayload
, misBearerToken
, misCallback
) where
import Network.Google.PhotosLibrary.Types
import Network.Google.Prelude
type MediaItemsSearchResource =
"v1" :>
"mediaItems:search" :>
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] SearchMediaItemsRequest :>
Post '[JSON] SearchMediaItemsResponse
data MediaItemsSearch = MediaItemsSearch'
{ _misXgafv :: !(Maybe Xgafv)
, _misUploadProtocol :: !(Maybe Text)
, _misPp :: !Bool
, _misAccessToken :: !(Maybe Text)
, _misUploadType :: !(Maybe Text)
, _misPayload :: !SearchMediaItemsRequest
, _misBearerToken :: !(Maybe Text)
, _misCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
mediaItemsSearch
:: SearchMediaItemsRequest
-> MediaItemsSearch
mediaItemsSearch pMisPayload_ =
MediaItemsSearch'
{ _misXgafv = Nothing
, _misUploadProtocol = Nothing
, _misPp = True
, _misAccessToken = Nothing
, _misUploadType = Nothing
, _misPayload = pMisPayload_
, _misBearerToken = Nothing
, _misCallback = Nothing
}
misXgafv :: Lens' MediaItemsSearch (Maybe Xgafv)
misXgafv = lens _misXgafv (\ s a -> s{_misXgafv = a})
misUploadProtocol :: Lens' MediaItemsSearch (Maybe Text)
misUploadProtocol
= lens _misUploadProtocol
(\ s a -> s{_misUploadProtocol = a})
misPp :: Lens' MediaItemsSearch Bool
misPp = lens _misPp (\ s a -> s{_misPp = a})
misAccessToken :: Lens' MediaItemsSearch (Maybe Text)
misAccessToken
= lens _misAccessToken
(\ s a -> s{_misAccessToken = a})
misUploadType :: Lens' MediaItemsSearch (Maybe Text)
misUploadType
= lens _misUploadType
(\ s a -> s{_misUploadType = a})
misPayload :: Lens' MediaItemsSearch SearchMediaItemsRequest
misPayload
= lens _misPayload (\ s a -> s{_misPayload = a})
misBearerToken :: Lens' MediaItemsSearch (Maybe Text)
misBearerToken
= lens _misBearerToken
(\ s a -> s{_misBearerToken = a})
misCallback :: Lens' MediaItemsSearch (Maybe Text)
misCallback
= lens _misCallback (\ s a -> s{_misCallback = a})
instance GoogleRequest MediaItemsSearch where
type Rs MediaItemsSearch = SearchMediaItemsResponse
type Scopes MediaItemsSearch =
'["https://www.googleapis.com/auth/drive.photos.readonly",
"https://www.googleapis.com/auth/photoslibrary",
"https://www.googleapis.com/auth/photoslibrary.readonly",
"https://www.googleapis.com/auth/photoslibrary.readonly.appcreateddata"]
requestClient MediaItemsSearch'{..}
= go _misXgafv _misUploadProtocol (Just _misPp)
_misAccessToken
_misUploadType
_misBearerToken
_misCallback
(Just AltJSON)
_misPayload
photosLibraryService
where go
= buildClient
(Proxy :: Proxy MediaItemsSearchResource)
mempty