{-# 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.Directory.Users.Aliases.Watch
(
UsersAliasesWatchResource
, usersAliasesWatch
, UsersAliasesWatch
, uawEvent
, uawPayload
, uawUserKey
) where
import Network.Google.Directory.Types
import Network.Google.Prelude
type UsersAliasesWatchResource =
"admin" :>
"directory" :>
"v1" :>
"users" :>
Capture "userKey" Text :>
"aliases" :>
"watch" :>
QueryParam "event" UsersAliasesWatchEvent :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Channel :> Post '[JSON] Channel
data UsersAliasesWatch = UsersAliasesWatch'
{ _uawEvent :: !(Maybe UsersAliasesWatchEvent)
, _uawPayload :: !Channel
, _uawUserKey :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersAliasesWatch
:: Channel
-> Text
-> UsersAliasesWatch
usersAliasesWatch pUawPayload_ pUawUserKey_ =
UsersAliasesWatch'
{ _uawEvent = Nothing
, _uawPayload = pUawPayload_
, _uawUserKey = pUawUserKey_
}
uawEvent :: Lens' UsersAliasesWatch (Maybe UsersAliasesWatchEvent)
uawEvent = lens _uawEvent (\ s a -> s{_uawEvent = a})
uawPayload :: Lens' UsersAliasesWatch Channel
uawPayload
= lens _uawPayload (\ s a -> s{_uawPayload = a})
uawUserKey :: Lens' UsersAliasesWatch Text
uawUserKey
= lens _uawUserKey (\ s a -> s{_uawUserKey = a})
instance GoogleRequest UsersAliasesWatch where
type Rs UsersAliasesWatch = Channel
type Scopes UsersAliasesWatch =
'["https://www.googleapis.com/auth/admin.directory.user",
"https://www.googleapis.com/auth/admin.directory.user.alias",
"https://www.googleapis.com/auth/admin.directory.user.alias.readonly",
"https://www.googleapis.com/auth/admin.directory.user.readonly"]
requestClient UsersAliasesWatch'{..}
= go _uawUserKey _uawEvent (Just AltJSON) _uawPayload
directoryService
where go
= buildClient
(Proxy :: Proxy UsersAliasesWatchResource)
mempty