{-# 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.Update
(
UsersLabelsUpdateResource
, usersLabelsUpdate
, UsersLabelsUpdate
, uluPayload
, uluUserId
, uluId
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
type UsersLabelsUpdateResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"labels" :>
Capture "id" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Label :> Put '[JSON] Label
data UsersLabelsUpdate = UsersLabelsUpdate'
{ _uluPayload :: !Label
, _uluUserId :: !Text
, _uluId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersLabelsUpdate
:: Label
-> Text
-> UsersLabelsUpdate
usersLabelsUpdate pUluPayload_ pUluId_ =
UsersLabelsUpdate'
{ _uluPayload = pUluPayload_
, _uluUserId = "me"
, _uluId = pUluId_
}
uluPayload :: Lens' UsersLabelsUpdate Label
uluPayload
= lens _uluPayload (\ s a -> s{_uluPayload = a})
uluUserId :: Lens' UsersLabelsUpdate Text
uluUserId
= lens _uluUserId (\ s a -> s{_uluUserId = a})
uluId :: Lens' UsersLabelsUpdate Text
uluId = lens _uluId (\ s a -> s{_uluId = a})
instance GoogleRequest UsersLabelsUpdate where
type Rs UsersLabelsUpdate = Label
type Scopes UsersLabelsUpdate =
'["https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.labels",
"https://www.googleapis.com/auth/gmail.modify"]
requestClient UsersLabelsUpdate'{..}
= go _uluUserId _uluId (Just AltJSON) _uluPayload
gmailService
where go
= buildClient
(Proxy :: Proxy UsersLabelsUpdateResource)
mempty