{-# 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.SendAs.SmimeInfo.Insert
(
UsersSettingsSendAsSmimeInfoInsertResource
, usersSettingsSendAsSmimeInfoInsert
, UsersSettingsSendAsSmimeInfoInsert
, ussasiiPayload
, ussasiiUserId
, ussasiiSendAsEmail
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
type UsersSettingsSendAsSmimeInfoInsertResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"settings" :>
"sendAs" :>
Capture "sendAsEmail" Text :>
"smimeInfo" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] SmimeInfo :> Post '[JSON] SmimeInfo
data UsersSettingsSendAsSmimeInfoInsert = UsersSettingsSendAsSmimeInfoInsert'
{ _ussasiiPayload :: !SmimeInfo
, _ussasiiUserId :: !Text
, _ussasiiSendAsEmail :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersSettingsSendAsSmimeInfoInsert
:: SmimeInfo
-> Text
-> UsersSettingsSendAsSmimeInfoInsert
usersSettingsSendAsSmimeInfoInsert pUssasiiPayload_ pUssasiiSendAsEmail_ =
UsersSettingsSendAsSmimeInfoInsert'
{ _ussasiiPayload = pUssasiiPayload_
, _ussasiiUserId = "me"
, _ussasiiSendAsEmail = pUssasiiSendAsEmail_
}
ussasiiPayload :: Lens' UsersSettingsSendAsSmimeInfoInsert SmimeInfo
ussasiiPayload
= lens _ussasiiPayload
(\ s a -> s{_ussasiiPayload = a})
ussasiiUserId :: Lens' UsersSettingsSendAsSmimeInfoInsert Text
ussasiiUserId
= lens _ussasiiUserId
(\ s a -> s{_ussasiiUserId = a})
ussasiiSendAsEmail :: Lens' UsersSettingsSendAsSmimeInfoInsert Text
ussasiiSendAsEmail
= lens _ussasiiSendAsEmail
(\ s a -> s{_ussasiiSendAsEmail = a})
instance GoogleRequest
UsersSettingsSendAsSmimeInfoInsert where
type Rs UsersSettingsSendAsSmimeInfoInsert =
SmimeInfo
type Scopes UsersSettingsSendAsSmimeInfoInsert =
'["https://www.googleapis.com/auth/gmail.settings.basic",
"https://www.googleapis.com/auth/gmail.settings.sharing"]
requestClient UsersSettingsSendAsSmimeInfoInsert'{..}
= go _ussasiiUserId _ussasiiSendAsEmail
(Just AltJSON)
_ussasiiPayload
gmailService
where go
= buildClient
(Proxy ::
Proxy UsersSettingsSendAsSmimeInfoInsertResource)
mempty