{-# 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.YouTube.Captions.Update
(
CaptionsUpdateResource
, captionsUpdate
, CaptionsUpdate
, capOnBehalfOf
, capPart
, capPayload
, capOnBehalfOfContentOwner
, capSync
) where
import Network.Google.Prelude
import Network.Google.YouTube.Types
type CaptionsUpdateResource =
"youtube" :>
"v3" :>
"captions" :>
QueryParam "part" Text :>
QueryParam "onBehalfOf" Text :>
QueryParam "onBehalfOfContentOwner" Text :>
QueryParam "sync" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Caption :> Put '[JSON] Caption
:<|>
"upload" :>
"youtube" :>
"v3" :>
"captions" :>
QueryParam "part" Text :>
QueryParam "onBehalfOf" Text :>
QueryParam "onBehalfOfContentOwner" Text :>
QueryParam "sync" Bool :>
QueryParam "alt" AltJSON :>
QueryParam "uploadType" Multipart :>
MultipartRelated '[JSON] Caption :>
Put '[JSON] Caption
data CaptionsUpdate = CaptionsUpdate'
{ _capOnBehalfOf :: !(Maybe Text)
, _capPart :: !Text
, _capPayload :: !Caption
, _capOnBehalfOfContentOwner :: !(Maybe Text)
, _capSync :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
captionsUpdate
:: Text
-> Caption
-> CaptionsUpdate
captionsUpdate pCapPart_ pCapPayload_ =
CaptionsUpdate'
{ _capOnBehalfOf = Nothing
, _capPart = pCapPart_
, _capPayload = pCapPayload_
, _capOnBehalfOfContentOwner = Nothing
, _capSync = Nothing
}
capOnBehalfOf :: Lens' CaptionsUpdate (Maybe Text)
capOnBehalfOf
= lens _capOnBehalfOf
(\ s a -> s{_capOnBehalfOf = a})
capPart :: Lens' CaptionsUpdate Text
capPart = lens _capPart (\ s a -> s{_capPart = a})
capPayload :: Lens' CaptionsUpdate Caption
capPayload
= lens _capPayload (\ s a -> s{_capPayload = a})
capOnBehalfOfContentOwner :: Lens' CaptionsUpdate (Maybe Text)
capOnBehalfOfContentOwner
= lens _capOnBehalfOfContentOwner
(\ s a -> s{_capOnBehalfOfContentOwner = a})
capSync :: Lens' CaptionsUpdate (Maybe Bool)
capSync = lens _capSync (\ s a -> s{_capSync = a})
instance GoogleRequest CaptionsUpdate where
type Rs CaptionsUpdate = Caption
type Scopes CaptionsUpdate =
'["https://www.googleapis.com/auth/youtube.force-ssl",
"https://www.googleapis.com/auth/youtubepartner"]
requestClient CaptionsUpdate'{..}
= go (Just _capPart) _capOnBehalfOf
_capOnBehalfOfContentOwner
_capSync
(Just AltJSON)
_capPayload
youTubeService
where go :<|> _
= buildClient (Proxy :: Proxy CaptionsUpdateResource)
mempty
instance GoogleRequest (MediaUpload CaptionsUpdate)
where
type Rs (MediaUpload CaptionsUpdate) = Caption
type Scopes (MediaUpload CaptionsUpdate) =
Scopes CaptionsUpdate
requestClient (MediaUpload CaptionsUpdate'{..} body)
= go (Just _capPart) _capOnBehalfOf
_capOnBehalfOfContentOwner
_capSync
(Just AltJSON)
(Just Multipart)
_capPayload
body
youTubeService
where _ :<|> go
= buildClient (Proxy :: Proxy CaptionsUpdateResource)
mempty