{-# 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.Storage.Notifications.Insert
(
NotificationsInsertResource
, notificationsInsert
, NotificationsInsert
, niBucket
, niPayload
, niUserProject
) where
import Network.Google.Prelude
import Network.Google.Storage.Types
type NotificationsInsertResource =
"storage" :>
"v1" :>
"b" :>
Capture "bucket" Text :>
"notificationConfigs" :>
QueryParam "userProject" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Notification :>
Post '[JSON] Notification
data NotificationsInsert = NotificationsInsert'
{ _niBucket :: !Text
, _niPayload :: !Notification
, _niUserProject :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
notificationsInsert
:: Text
-> Notification
-> NotificationsInsert
notificationsInsert pNiBucket_ pNiPayload_ =
NotificationsInsert'
{ _niBucket = pNiBucket_
, _niPayload = pNiPayload_
, _niUserProject = Nothing
}
niBucket :: Lens' NotificationsInsert Text
niBucket = lens _niBucket (\ s a -> s{_niBucket = a})
niPayload :: Lens' NotificationsInsert Notification
niPayload
= lens _niPayload (\ s a -> s{_niPayload = a})
niUserProject :: Lens' NotificationsInsert (Maybe Text)
niUserProject
= lens _niUserProject
(\ s a -> s{_niUserProject = a})
instance GoogleRequest NotificationsInsert where
type Rs NotificationsInsert = Notification
type Scopes NotificationsInsert =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/devstorage.full_control",
"https://www.googleapis.com/auth/devstorage.read_write"]
requestClient NotificationsInsert'{..}
= go _niBucket _niUserProject (Just AltJSON)
_niPayload
storageService
where go
= buildClient
(Proxy :: Proxy NotificationsInsertResource)
mempty