{-# 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.Patch
(
TransferJobsPatchResource
, transferJobsPatch
, TransferJobsPatch
, tjpXgafv
, tjpUploadProtocol
, tjpPp
, tjpAccessToken
, tjpJobName
, tjpUploadType
, tjpPayload
, tjpBearerToken
, tjpCallback
) where
import Network.Google.Prelude
import Network.Google.StorageTransfer.Types
type TransferJobsPatchResource =
"v1" :>
Capture "jobName" Text :>
QueryParam "$.xgafv" Text :>
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] UpdateTransferJobRequest :>
Patch '[JSON] TransferJob
-- | Updates a transfer job. Updating a job\'s transfer spec does not affect
-- transfer operations that are running already. Updating the scheduling of
-- a job is not allowed.
--
-- /See:/ 'transferJobsPatch' smart constructor.
data TransferJobsPatch = TransferJobsPatch'
{ _tjpXgafv :: !(Maybe Text)
, _tjpUploadProtocol :: !(Maybe Text)
, _tjpPp :: !Bool
, _tjpAccessToken :: !(Maybe Text)
, _tjpJobName :: !Text
, _tjpUploadType :: !(Maybe Text)
, _tjpPayload :: !UpdateTransferJobRequest
, _tjpBearerToken :: !(Maybe Text)
, _tjpCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'TransferJobsPatch' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'tjpXgafv'
--
-- * 'tjpUploadProtocol'
--
-- * 'tjpPp'
--
-- * 'tjpAccessToken'
--
-- * 'tjpJobName'
--
-- * 'tjpUploadType'
--
-- * 'tjpPayload'
--
-- * 'tjpBearerToken'
--
-- * 'tjpCallback'
transferJobsPatch
:: Text -- ^ 'tjpJobName'
-> UpdateTransferJobRequest -- ^ 'tjpPayload'
-> TransferJobsPatch
transferJobsPatch pTjpJobName_ pTjpPayload_ =
TransferJobsPatch'
{ _tjpXgafv = Nothing
, _tjpUploadProtocol = Nothing
, _tjpPp = True
, _tjpAccessToken = Nothing
, _tjpJobName = pTjpJobName_
, _tjpUploadType = Nothing
, _tjpPayload = pTjpPayload_
, _tjpBearerToken = Nothing
, _tjpCallback = Nothing
}
-- | V1 error format.
tjpXgafv :: Lens' TransferJobsPatch (Maybe Text)
tjpXgafv = lens _tjpXgafv (\ s a -> s{_tjpXgafv = a})
-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
tjpUploadProtocol :: Lens' TransferJobsPatch (Maybe Text)
tjpUploadProtocol
= lens _tjpUploadProtocol
(\ s a -> s{_tjpUploadProtocol = a})
-- | Pretty-print response.
tjpPp :: Lens' TransferJobsPatch Bool
tjpPp = lens _tjpPp (\ s a -> s{_tjpPp = a})
-- | OAuth access token.
tjpAccessToken :: Lens' TransferJobsPatch (Maybe Text)
tjpAccessToken
= lens _tjpAccessToken
(\ s a -> s{_tjpAccessToken = a})
-- | The name of job to update. Required.
tjpJobName :: Lens' TransferJobsPatch Text
tjpJobName
= lens _tjpJobName (\ s a -> s{_tjpJobName = a})
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
tjpUploadType :: Lens' TransferJobsPatch (Maybe Text)
tjpUploadType
= lens _tjpUploadType
(\ s a -> s{_tjpUploadType = a})
-- | Multipart request metadata.
tjpPayload :: Lens' TransferJobsPatch UpdateTransferJobRequest
tjpPayload
= lens _tjpPayload (\ s a -> s{_tjpPayload = a})
-- | OAuth bearer token.
tjpBearerToken :: Lens' TransferJobsPatch (Maybe Text)
tjpBearerToken
= lens _tjpBearerToken
(\ s a -> s{_tjpBearerToken = a})
-- | JSONP
tjpCallback :: Lens' TransferJobsPatch (Maybe Text)
tjpCallback
= lens _tjpCallback (\ s a -> s{_tjpCallback = a})
instance GoogleRequest TransferJobsPatch where
type Rs TransferJobsPatch = TransferJob
type Scopes TransferJobsPatch =
'["https://www.googleapis.com/auth/cloud-platform"]
requestClient TransferJobsPatch'{..}
= go _tjpJobName _tjpXgafv _tjpUploadProtocol
(Just _tjpPp)
_tjpAccessToken
_tjpUploadType
_tjpBearerToken
_tjpCallback
(Just AltJSON)
_tjpPayload
storageTransferService
where go
= buildClient
(Proxy :: Proxy TransferJobsPatchResource)
mempty