{-# 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.PlayListItems.Insert
(
PlayListItemsInsertResource
, playListItemsInsert
, PlayListItemsInsert
, pliiPart
, pliiPayload
, pliiOnBehalfOfContentOwner
) where
import Network.Google.Prelude
import Network.Google.YouTube.Types
type PlayListItemsInsertResource =
"youtube" :>
"v3" :>
"playlistItems" :>
QueryParam "part" Text :>
QueryParam "onBehalfOfContentOwner" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] PlayListItem :>
Post '[JSON] PlayListItem
data PlayListItemsInsert = PlayListItemsInsert'
{ _pliiPart :: !Text
, _pliiPayload :: !PlayListItem
, _pliiOnBehalfOfContentOwner :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
playListItemsInsert
:: Text
-> PlayListItem
-> PlayListItemsInsert
playListItemsInsert pPliiPart_ pPliiPayload_ =
PlayListItemsInsert'
{ _pliiPart = pPliiPart_
, _pliiPayload = pPliiPayload_
, _pliiOnBehalfOfContentOwner = Nothing
}
pliiPart :: Lens' PlayListItemsInsert Text
pliiPart = lens _pliiPart (\ s a -> s{_pliiPart = a})
pliiPayload :: Lens' PlayListItemsInsert PlayListItem
pliiPayload
= lens _pliiPayload (\ s a -> s{_pliiPayload = a})
pliiOnBehalfOfContentOwner :: Lens' PlayListItemsInsert (Maybe Text)
pliiOnBehalfOfContentOwner
= lens _pliiOnBehalfOfContentOwner
(\ s a -> s{_pliiOnBehalfOfContentOwner = a})
instance GoogleRequest PlayListItemsInsert where
type Rs PlayListItemsInsert = PlayListItem
type Scopes PlayListItemsInsert =
'["https://www.googleapis.com/auth/youtube",
"https://www.googleapis.com/auth/youtube.force-ssl",
"https://www.googleapis.com/auth/youtubepartner"]
requestClient PlayListItemsInsert'{..}
= go (Just _pliiPart) _pliiOnBehalfOfContentOwner
(Just AltJSON)
_pliiPayload
youTubeService
where go
= buildClient
(Proxy :: Proxy PlayListItemsInsertResource)
mempty