{-# 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.Labels.Patch
(
UsersLabelsPatchResource
, usersLabelsPatch
, UsersLabelsPatch
, ulpPayload
, ulpUserId
, ulpId
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
type UsersLabelsPatchResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"labels" :>
Capture "id" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Label :> Patch '[JSON] Label
data UsersLabelsPatch = UsersLabelsPatch'
{ _ulpPayload :: !Label
, _ulpUserId :: !Text
, _ulpId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersLabelsPatch
:: Label
-> Text
-> UsersLabelsPatch
usersLabelsPatch pUlpPayload_ pUlpId_ =
UsersLabelsPatch'
{ _ulpPayload = pUlpPayload_
, _ulpUserId = "me"
, _ulpId = pUlpId_
}
ulpPayload :: Lens' UsersLabelsPatch Label
ulpPayload
= lens _ulpPayload (\ s a -> s{_ulpPayload = a})
ulpUserId :: Lens' UsersLabelsPatch Text
ulpUserId
= lens _ulpUserId (\ s a -> s{_ulpUserId = a})
ulpId :: Lens' UsersLabelsPatch Text
ulpId = lens _ulpId (\ s a -> s{_ulpId = a})
instance GoogleRequest UsersLabelsPatch where
type Rs UsersLabelsPatch = Label
type Scopes UsersLabelsPatch =
'["https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.labels",
"https://www.googleapis.com/auth/gmail.modify"]
requestClient UsersLabelsPatch'{..}
= go _ulpUserId _ulpId (Just AltJSON) _ulpPayload
gmailService
where go
= buildClient
(Proxy :: Proxy UsersLabelsPatchResource)
mempty