{-# 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.Thumbnails.Set
(
ThumbnailsSetResource
, thumbnailsSet
, ThumbnailsSet
, tsOnBehalfOfContentOwner
, tsVideoId
) where
import Network.Google.Prelude
import Network.Google.YouTube.Types
type ThumbnailsSetResource =
"youtube" :>
"v3" :>
"thumbnails" :>
"set" :>
QueryParam "videoId" Text :>
QueryParam "onBehalfOfContentOwner" Text :>
QueryParam "alt" AltJSON :>
Post '[JSON] ThumbnailSetResponse
:<|>
"upload" :>
"youtube" :>
"v3" :>
"thumbnails" :>
"set" :>
QueryParam "videoId" Text :>
QueryParam "onBehalfOfContentOwner" Text :>
QueryParam "alt" AltJSON :>
QueryParam "uploadType" AltMedia :>
AltMedia :> Post '[JSON] ThumbnailSetResponse
data ThumbnailsSet = ThumbnailsSet'
{ _tsOnBehalfOfContentOwner :: !(Maybe Text)
, _tsVideoId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
thumbnailsSet
:: Text
-> ThumbnailsSet
thumbnailsSet pTsVideoId_ =
ThumbnailsSet'
{ _tsOnBehalfOfContentOwner = Nothing
, _tsVideoId = pTsVideoId_
}
tsOnBehalfOfContentOwner :: Lens' ThumbnailsSet (Maybe Text)
tsOnBehalfOfContentOwner
= lens _tsOnBehalfOfContentOwner
(\ s a -> s{_tsOnBehalfOfContentOwner = a})
tsVideoId :: Lens' ThumbnailsSet Text
tsVideoId
= lens _tsVideoId (\ s a -> s{_tsVideoId = a})
instance GoogleRequest ThumbnailsSet where
type Rs ThumbnailsSet = ThumbnailSetResponse
type Scopes ThumbnailsSet =
'["https://www.googleapis.com/auth/youtube",
"https://www.googleapis.com/auth/youtube.force-ssl",
"https://www.googleapis.com/auth/youtube.upload",
"https://www.googleapis.com/auth/youtubepartner"]
requestClient ThumbnailsSet'{..}
= go (Just _tsVideoId) _tsOnBehalfOfContentOwner
(Just AltJSON)
youTubeService
where go :<|> _
= buildClient (Proxy :: Proxy ThumbnailsSetResource)
mempty
instance GoogleRequest (MediaUpload ThumbnailsSet)
where
type Rs (MediaUpload ThumbnailsSet) =
ThumbnailSetResponse
type Scopes (MediaUpload ThumbnailsSet) =
Scopes ThumbnailsSet
requestClient (MediaUpload ThumbnailsSet'{..} body)
= go (Just _tsVideoId) _tsOnBehalfOfContentOwner
(Just AltJSON)
(Just AltMedia)
body
youTubeService
where _ :<|> go
= buildClient (Proxy :: Proxy ThumbnailsSetResource)
mempty