{-# 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.Datastore.Projects.Import
(
ProjectsImportResource
, projectsImport
, ProjectsImport
, pXgafv
, pUploadProtocol
, pAccessToken
, pUploadType
, pPayload
, pProjectId
, pCallback
) where
import Network.Google.Datastore.Types
import Network.Google.Prelude
type ProjectsImportResource =
"v1" :>
"projects" :>
CaptureMode "projectId" "import" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON]
GoogleDatastoreAdminV1ImportEntitiesRequest
:> Post '[JSON] GoogleLongrunningOperation
data ProjectsImport = ProjectsImport'
{ _pXgafv :: !(Maybe Xgafv)
, _pUploadProtocol :: !(Maybe Text)
, _pAccessToken :: !(Maybe Text)
, _pUploadType :: !(Maybe Text)
, _pPayload :: !GoogleDatastoreAdminV1ImportEntitiesRequest
, _pProjectId :: !Text
, _pCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsImport
:: GoogleDatastoreAdminV1ImportEntitiesRequest
-> Text
-> ProjectsImport
projectsImport pPPayload_ pPProjectId_ =
ProjectsImport'
{ _pXgafv = Nothing
, _pUploadProtocol = Nothing
, _pAccessToken = Nothing
, _pUploadType = Nothing
, _pPayload = pPPayload_
, _pProjectId = pPProjectId_
, _pCallback = Nothing
}
pXgafv :: Lens' ProjectsImport (Maybe Xgafv)
pXgafv = lens _pXgafv (\ s a -> s{_pXgafv = a})
pUploadProtocol :: Lens' ProjectsImport (Maybe Text)
pUploadProtocol
= lens _pUploadProtocol
(\ s a -> s{_pUploadProtocol = a})
pAccessToken :: Lens' ProjectsImport (Maybe Text)
pAccessToken
= lens _pAccessToken (\ s a -> s{_pAccessToken = a})
pUploadType :: Lens' ProjectsImport (Maybe Text)
pUploadType
= lens _pUploadType (\ s a -> s{_pUploadType = a})
pPayload :: Lens' ProjectsImport GoogleDatastoreAdminV1ImportEntitiesRequest
pPayload = lens _pPayload (\ s a -> s{_pPayload = a})
pProjectId :: Lens' ProjectsImport Text
pProjectId
= lens _pProjectId (\ s a -> s{_pProjectId = a})
pCallback :: Lens' ProjectsImport (Maybe Text)
pCallback
= lens _pCallback (\ s a -> s{_pCallback = a})
instance GoogleRequest ProjectsImport where
type Rs ProjectsImport = GoogleLongrunningOperation
type Scopes ProjectsImport =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/datastore"]
requestClient ProjectsImport'{..}
= go _pProjectId _pXgafv _pUploadProtocol
_pAccessToken
_pUploadType
_pCallback
(Just AltJSON)
_pPayload
datastoreService
where go
= buildClient (Proxy :: Proxy ProjectsImportResource)
mempty