{-# 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.Directory.Notifications.Patch
(
NotificationsPatchResource
, notificationsPatch
, NotificationsPatch
, npPayload
, npCustomer
, npNotificationId
) where
import Network.Google.Directory.Types
import Network.Google.Prelude
type NotificationsPatchResource =
"admin" :>
"directory" :>
"v1" :>
"customer" :>
Capture "customer" Text :>
"notifications" :>
Capture "notificationId" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Notification :>
Patch '[JSON] Notification
-- | Updates a notification. This method supports patch semantics.
--
-- /See:/ 'notificationsPatch' smart constructor.
data NotificationsPatch = NotificationsPatch'
{ _npPayload :: !Notification
, _npCustomer :: !Text
, _npNotificationId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'NotificationsPatch' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'npPayload'
--
-- * 'npCustomer'
--
-- * 'npNotificationId'
notificationsPatch
:: Notification -- ^ 'npPayload'
-> Text -- ^ 'npCustomer'
-> Text -- ^ 'npNotificationId'
-> NotificationsPatch
notificationsPatch pNpPayload_ pNpCustomer_ pNpNotificationId_ =
NotificationsPatch'
{ _npPayload = pNpPayload_
, _npCustomer = pNpCustomer_
, _npNotificationId = pNpNotificationId_
}
-- | Multipart request metadata.
npPayload :: Lens' NotificationsPatch Notification
npPayload
= lens _npPayload (\ s a -> s{_npPayload = a})
-- | The unique ID for the customer\'s Google account.
npCustomer :: Lens' NotificationsPatch Text
npCustomer
= lens _npCustomer (\ s a -> s{_npCustomer = a})
-- | The unique ID of the notification.
npNotificationId :: Lens' NotificationsPatch Text
npNotificationId
= lens _npNotificationId
(\ s a -> s{_npNotificationId = a})
instance GoogleRequest NotificationsPatch where
type Rs NotificationsPatch = Notification
type Scopes NotificationsPatch =
'["https://www.googleapis.com/auth/admin.directory.notifications"]
requestClient NotificationsPatch'{..}
= go _npCustomer _npNotificationId (Just AltJSON)
_npPayload
directoryService
where go
= buildClient
(Proxy :: Proxy NotificationsPatchResource)
mempty