{-# 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.Download
(
CaptionsDownloadResource
, captionsDownload
, CaptionsDownload
, capaOnBehalfOf
, capaTlang
, capaOnBehalfOfContentOwner
, capaId
, capaTfmt
) where
import Network.Google.Prelude
import Network.Google.YouTube.Types
type CaptionsDownloadResource =
"youtube" :>
"v3" :>
"captions" :>
Capture "id" Text :>
QueryParam "onBehalfOf" Text :>
QueryParam "tlang" Text :>
QueryParam "onBehalfOfContentOwner" Text :>
QueryParam "tfmt" CaptionsDownloadTfmt :>
QueryParam "alt" AltJSON :> Get '[JSON] ()
:<|>
"youtube" :>
"v3" :>
"captions" :>
Capture "id" Text :>
QueryParam "onBehalfOf" Text :>
QueryParam "tlang" Text :>
QueryParam "onBehalfOfContentOwner" Text :>
QueryParam "tfmt" CaptionsDownloadTfmt :>
QueryParam "alt" AltMedia :>
Get '[OctetStream] Stream
data CaptionsDownload = CaptionsDownload'
{ _capaOnBehalfOf :: !(Maybe Text)
, _capaTlang :: !(Maybe Text)
, _capaOnBehalfOfContentOwner :: !(Maybe Text)
, _capaId :: !Text
, _capaTfmt :: !(Maybe CaptionsDownloadTfmt)
} deriving (Eq,Show,Data,Typeable,Generic)
captionsDownload
:: Text
-> CaptionsDownload
captionsDownload pCapaId_ =
CaptionsDownload'
{ _capaOnBehalfOf = Nothing
, _capaTlang = Nothing
, _capaOnBehalfOfContentOwner = Nothing
, _capaId = pCapaId_
, _capaTfmt = Nothing
}
capaOnBehalfOf :: Lens' CaptionsDownload (Maybe Text)
capaOnBehalfOf
= lens _capaOnBehalfOf
(\ s a -> s{_capaOnBehalfOf = a})
capaTlang :: Lens' CaptionsDownload (Maybe Text)
capaTlang
= lens _capaTlang (\ s a -> s{_capaTlang = a})
capaOnBehalfOfContentOwner :: Lens' CaptionsDownload (Maybe Text)
capaOnBehalfOfContentOwner
= lens _capaOnBehalfOfContentOwner
(\ s a -> s{_capaOnBehalfOfContentOwner = a})
capaId :: Lens' CaptionsDownload Text
capaId = lens _capaId (\ s a -> s{_capaId = a})
capaTfmt :: Lens' CaptionsDownload (Maybe CaptionsDownloadTfmt)
capaTfmt = lens _capaTfmt (\ s a -> s{_capaTfmt = a})
instance GoogleRequest CaptionsDownload where
type Rs CaptionsDownload = ()
type Scopes CaptionsDownload =
'["https://www.googleapis.com/auth/youtube.force-ssl",
"https://www.googleapis.com/auth/youtubepartner"]
requestClient CaptionsDownload'{..}
= go _capaId _capaOnBehalfOf _capaTlang
_capaOnBehalfOfContentOwner
_capaTfmt
(Just AltJSON)
youTubeService
where go :<|> _
= buildClient
(Proxy :: Proxy CaptionsDownloadResource)
mempty
instance GoogleRequest
(MediaDownload CaptionsDownload) where
type Rs (MediaDownload CaptionsDownload) = Stream
type Scopes (MediaDownload CaptionsDownload) =
Scopes CaptionsDownload
requestClient (MediaDownload CaptionsDownload'{..})
= go _capaId _capaOnBehalfOf _capaTlang
_capaOnBehalfOfContentOwner
_capaTfmt
(Just AltMedia)
youTubeService
where _ :<|> go
= buildClient
(Proxy :: Proxy CaptionsDownloadResource)
mempty