{-# 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.Subscriptions.Insert
(
SubscriptionsInsertResource
, subscriptionsInsert
, SubscriptionsInsert
, siPart
, siPayload
) where
import Network.Google.Prelude
import Network.Google.YouTube.Types
type SubscriptionsInsertResource =
"youtube" :>
"v3" :>
"subscriptions" :>
QueryParam "part" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Subscription :>
Post '[JSON] Subscription
data SubscriptionsInsert = SubscriptionsInsert'
{ _siPart :: !Text
, _siPayload :: !Subscription
} deriving (Eq,Show,Data,Typeable,Generic)
subscriptionsInsert
:: Text
-> Subscription
-> SubscriptionsInsert
subscriptionsInsert pSiPart_ pSiPayload_ =
SubscriptionsInsert'
{ _siPart = pSiPart_
, _siPayload = pSiPayload_
}
siPart :: Lens' SubscriptionsInsert Text
siPart = lens _siPart (\ s a -> s{_siPart = a})
siPayload :: Lens' SubscriptionsInsert Subscription
siPayload
= lens _siPayload (\ s a -> s{_siPayload = a})
instance GoogleRequest SubscriptionsInsert where
type Rs SubscriptionsInsert = Subscription
type Scopes SubscriptionsInsert =
'["https://www.googleapis.com/auth/youtube",
"https://www.googleapis.com/auth/youtube.force-ssl",
"https://www.googleapis.com/auth/youtubepartner"]
requestClient SubscriptionsInsert'{..}
= go (Just _siPart) (Just AltJSON) _siPayload
youTubeService
where go
= buildClient
(Proxy :: Proxy SubscriptionsInsertResource)
mempty