{-# 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.StorageTransfer.TransferJobs.Create
(
TransferJobsCreateResource
, transferJobsCreate
, TransferJobsCreate
, tjcXgafv
, tjcUploadProtocol
, tjcAccessToken
, tjcUploadType
, tjcPayload
, tjcCallback
) where
import Network.Google.Prelude
import Network.Google.StorageTransfer.Types
type TransferJobsCreateResource =
"v1" :>
"transferJobs" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] TransferJob :>
Post '[JSON] TransferJob
data TransferJobsCreate = TransferJobsCreate'
{ _tjcXgafv :: !(Maybe Xgafv)
, _tjcUploadProtocol :: !(Maybe Text)
, _tjcAccessToken :: !(Maybe Text)
, _tjcUploadType :: !(Maybe Text)
, _tjcPayload :: !TransferJob
, _tjcCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
transferJobsCreate
:: TransferJob
-> TransferJobsCreate
transferJobsCreate pTjcPayload_ =
TransferJobsCreate'
{ _tjcXgafv = Nothing
, _tjcUploadProtocol = Nothing
, _tjcAccessToken = Nothing
, _tjcUploadType = Nothing
, _tjcPayload = pTjcPayload_
, _tjcCallback = Nothing
}
tjcXgafv :: Lens' TransferJobsCreate (Maybe Xgafv)
tjcXgafv = lens _tjcXgafv (\ s a -> s{_tjcXgafv = a})
tjcUploadProtocol :: Lens' TransferJobsCreate (Maybe Text)
tjcUploadProtocol
= lens _tjcUploadProtocol
(\ s a -> s{_tjcUploadProtocol = a})
tjcAccessToken :: Lens' TransferJobsCreate (Maybe Text)
tjcAccessToken
= lens _tjcAccessToken
(\ s a -> s{_tjcAccessToken = a})
tjcUploadType :: Lens' TransferJobsCreate (Maybe Text)
tjcUploadType
= lens _tjcUploadType
(\ s a -> s{_tjcUploadType = a})
tjcPayload :: Lens' TransferJobsCreate TransferJob
tjcPayload
= lens _tjcPayload (\ s a -> s{_tjcPayload = a})
tjcCallback :: Lens' TransferJobsCreate (Maybe Text)
tjcCallback
= lens _tjcCallback (\ s a -> s{_tjcCallback = a})
instance GoogleRequest TransferJobsCreate where
type Rs TransferJobsCreate = TransferJob
type Scopes TransferJobsCreate =
'["https://www.googleapis.com/auth/cloud-platform"]
requestClient TransferJobsCreate'{..}
= go _tjcXgafv _tjcUploadProtocol _tjcAccessToken
_tjcUploadType
_tjcCallback
(Just AltJSON)
_tjcPayload
storageTransferService
where go
= buildClient
(Proxy :: Proxy TransferJobsCreateResource)
mempty