{-# 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.Insert
(
UsersAliasesInsertResource
, usersAliasesInsert
, UsersAliasesInsert
, uaiPayload
, uaiUserKey
) where
import Network.Google.Directory.Types
import Network.Google.Prelude
type UsersAliasesInsertResource =
"admin" :>
"directory" :>
"v1" :>
"users" :>
Capture "userKey" Text :>
"aliases" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Alias :> Post '[JSON] Alias
data UsersAliasesInsert = UsersAliasesInsert'
{ _uaiPayload :: !Alias
, _uaiUserKey :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersAliasesInsert
:: Alias
-> Text
-> UsersAliasesInsert
usersAliasesInsert pUaiPayload_ pUaiUserKey_ =
UsersAliasesInsert'
{ _uaiPayload = pUaiPayload_
, _uaiUserKey = pUaiUserKey_
}
uaiPayload :: Lens' UsersAliasesInsert Alias
uaiPayload
= lens _uaiPayload (\ s a -> s{_uaiPayload = a})
uaiUserKey :: Lens' UsersAliasesInsert Text
uaiUserKey
= lens _uaiUserKey (\ s a -> s{_uaiUserKey = a})
instance GoogleRequest UsersAliasesInsert where
type Rs UsersAliasesInsert = Alias
type Scopes UsersAliasesInsert =
'["https://www.googleapis.com/auth/admin.directory.user",
"https://www.googleapis.com/auth/admin.directory.user.alias"]
requestClient UsersAliasesInsert'{..}
= go _uaiUserKey (Just AltJSON) _uaiPayload
directoryService
where go
= buildClient
(Proxy :: Proxy UsersAliasesInsertResource)
mempty