{-# 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.YouTubeReporting.Jobs.Create
(
JobsCreateResource
, jobsCreate
, JobsCreate
, jcXgafv
, jcUploadProtocol
, jcAccessToken
, jcUploadType
, jcPayload
, jcOnBehalfOfContentOwner
, jcCallback
) where
import Network.Google.Prelude
import Network.Google.YouTubeReporting.Types
type JobsCreateResource =
"v1" :>
"jobs" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "onBehalfOfContentOwner" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Job :> Post '[JSON] Job
data JobsCreate = JobsCreate'
{ _jcXgafv :: !(Maybe Xgafv)
, _jcUploadProtocol :: !(Maybe Text)
, _jcAccessToken :: !(Maybe Text)
, _jcUploadType :: !(Maybe Text)
, _jcPayload :: !Job
, _jcOnBehalfOfContentOwner :: !(Maybe Text)
, _jcCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
jobsCreate
:: Job
-> JobsCreate
jobsCreate pJcPayload_ =
JobsCreate'
{ _jcXgafv = Nothing
, _jcUploadProtocol = Nothing
, _jcAccessToken = Nothing
, _jcUploadType = Nothing
, _jcPayload = pJcPayload_
, _jcOnBehalfOfContentOwner = Nothing
, _jcCallback = Nothing
}
jcXgafv :: Lens' JobsCreate (Maybe Xgafv)
jcXgafv = lens _jcXgafv (\ s a -> s{_jcXgafv = a})
jcUploadProtocol :: Lens' JobsCreate (Maybe Text)
jcUploadProtocol
= lens _jcUploadProtocol
(\ s a -> s{_jcUploadProtocol = a})
jcAccessToken :: Lens' JobsCreate (Maybe Text)
jcAccessToken
= lens _jcAccessToken
(\ s a -> s{_jcAccessToken = a})
jcUploadType :: Lens' JobsCreate (Maybe Text)
jcUploadType
= lens _jcUploadType (\ s a -> s{_jcUploadType = a})
jcPayload :: Lens' JobsCreate Job
jcPayload
= lens _jcPayload (\ s a -> s{_jcPayload = a})
jcOnBehalfOfContentOwner :: Lens' JobsCreate (Maybe Text)
jcOnBehalfOfContentOwner
= lens _jcOnBehalfOfContentOwner
(\ s a -> s{_jcOnBehalfOfContentOwner = a})
jcCallback :: Lens' JobsCreate (Maybe Text)
jcCallback
= lens _jcCallback (\ s a -> s{_jcCallback = a})
instance GoogleRequest JobsCreate where
type Rs JobsCreate = Job
type Scopes JobsCreate =
'["https://www.googleapis.com/auth/yt-analytics-monetary.readonly",
"https://www.googleapis.com/auth/yt-analytics.readonly"]
requestClient JobsCreate'{..}
= go _jcXgafv _jcUploadProtocol _jcAccessToken
_jcUploadType
_jcOnBehalfOfContentOwner
_jcCallback
(Just AltJSON)
_jcPayload
youTubeReportingService
where go
= buildClient (Proxy :: Proxy JobsCreateResource)
mempty