{-# 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.ChannelSections.Update
(
ChannelSectionsUpdateResource
, channelSectionsUpdate
, ChannelSectionsUpdate
, csuPart
, csuPayload
, csuOnBehalfOfContentOwner
) where
import Network.Google.Prelude
import Network.Google.YouTube.Types
type ChannelSectionsUpdateResource =
"youtube" :>
"v3" :>
"channelSections" :>
QueryParam "part" Text :>
QueryParam "onBehalfOfContentOwner" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ChannelSection :>
Put '[JSON] ChannelSection
data ChannelSectionsUpdate = ChannelSectionsUpdate'
{ _csuPart :: !Text
, _csuPayload :: !ChannelSection
, _csuOnBehalfOfContentOwner :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
channelSectionsUpdate
:: Text
-> ChannelSection
-> ChannelSectionsUpdate
channelSectionsUpdate pCsuPart_ pCsuPayload_ =
ChannelSectionsUpdate'
{ _csuPart = pCsuPart_
, _csuPayload = pCsuPayload_
, _csuOnBehalfOfContentOwner = Nothing
}
csuPart :: Lens' ChannelSectionsUpdate Text
csuPart = lens _csuPart (\ s a -> s{_csuPart = a})
csuPayload :: Lens' ChannelSectionsUpdate ChannelSection
csuPayload
= lens _csuPayload (\ s a -> s{_csuPayload = a})
csuOnBehalfOfContentOwner :: Lens' ChannelSectionsUpdate (Maybe Text)
csuOnBehalfOfContentOwner
= lens _csuOnBehalfOfContentOwner
(\ s a -> s{_csuOnBehalfOfContentOwner = a})
instance GoogleRequest ChannelSectionsUpdate where
type Rs ChannelSectionsUpdate = ChannelSection
type Scopes ChannelSectionsUpdate =
'["https://www.googleapis.com/auth/youtube",
"https://www.googleapis.com/auth/youtube.force-ssl",
"https://www.googleapis.com/auth/youtubepartner"]
requestClient ChannelSectionsUpdate'{..}
= go (Just _csuPart) _csuOnBehalfOfContentOwner
(Just AltJSON)
_csuPayload
youTubeService
where go
= buildClient
(Proxy :: Proxy ChannelSectionsUpdateResource)
mempty