{-# 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.ForwardingAddresses.Create
(
UsersSettingsForwardingAddressesCreateResource
, usersSettingsForwardingAddressesCreate
, UsersSettingsForwardingAddressesCreate
, usfacPayload
, usfacUserId
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
type UsersSettingsForwardingAddressesCreateResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"settings" :>
"forwardingAddresses" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ForwardingAddress :>
Post '[JSON] ForwardingAddress
data UsersSettingsForwardingAddressesCreate = UsersSettingsForwardingAddressesCreate'
{ _usfacPayload :: !ForwardingAddress
, _usfacUserId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersSettingsForwardingAddressesCreate
:: ForwardingAddress
-> UsersSettingsForwardingAddressesCreate
usersSettingsForwardingAddressesCreate pUsfacPayload_ =
UsersSettingsForwardingAddressesCreate'
{ _usfacPayload = pUsfacPayload_
, _usfacUserId = "me"
}
usfacPayload :: Lens' UsersSettingsForwardingAddressesCreate ForwardingAddress
usfacPayload
= lens _usfacPayload (\ s a -> s{_usfacPayload = a})
usfacUserId :: Lens' UsersSettingsForwardingAddressesCreate Text
usfacUserId
= lens _usfacUserId (\ s a -> s{_usfacUserId = a})
instance GoogleRequest
UsersSettingsForwardingAddressesCreate where
type Rs UsersSettingsForwardingAddressesCreate =
ForwardingAddress
type Scopes UsersSettingsForwardingAddressesCreate =
'["https://www.googleapis.com/auth/gmail.settings.sharing"]
requestClient
UsersSettingsForwardingAddressesCreate'{..}
= go _usfacUserId (Just AltJSON) _usfacPayload
gmailService
where go
= buildClient
(Proxy ::
Proxy UsersSettingsForwardingAddressesCreateResource)
mempty