{-# 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.Gmail.Users.Settings.UpdateVacation
(
UsersSettingsUpdateVacationResource
, usersSettingsUpdateVacation
, UsersSettingsUpdateVacation
, usuvPayload
, usuvUserId
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
type UsersSettingsUpdateVacationResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"settings" :>
"vacation" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] VacationSettings :>
Put '[JSON] VacationSettings
data UsersSettingsUpdateVacation = UsersSettingsUpdateVacation'
{ _usuvPayload :: !VacationSettings
, _usuvUserId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersSettingsUpdateVacation
:: VacationSettings
-> UsersSettingsUpdateVacation
usersSettingsUpdateVacation pUsuvPayload_ =
UsersSettingsUpdateVacation'
{ _usuvPayload = pUsuvPayload_
, _usuvUserId = "me"
}
usuvPayload :: Lens' UsersSettingsUpdateVacation VacationSettings
usuvPayload
= lens _usuvPayload (\ s a -> s{_usuvPayload = a})
usuvUserId :: Lens' UsersSettingsUpdateVacation Text
usuvUserId
= lens _usuvUserId (\ s a -> s{_usuvUserId = a})
instance GoogleRequest UsersSettingsUpdateVacation
where
type Rs UsersSettingsUpdateVacation =
VacationSettings
type Scopes UsersSettingsUpdateVacation =
'["https://www.googleapis.com/auth/gmail.settings.basic"]
requestClient UsersSettingsUpdateVacation'{..}
= go _usuvUserId (Just AltJSON) _usuvPayload
gmailService
where go
= buildClient
(Proxy :: Proxy UsersSettingsUpdateVacationResource)
mempty