{-# 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.Members.Insert
(
MembersInsertResource
, membersInsert
, MembersInsert
, miGroupKey
, miPayload
) where
import Network.Google.Directory.Types
import Network.Google.Prelude
type MembersInsertResource =
"admin" :>
"directory" :>
"v1" :>
"groups" :>
Capture "groupKey" Text :>
"members" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Member :> Post '[JSON] Member
data MembersInsert = MembersInsert'
{ _miGroupKey :: !Text
, _miPayload :: !Member
} deriving (Eq,Show,Data,Typeable,Generic)
membersInsert
:: Text
-> Member
-> MembersInsert
membersInsert pMiGroupKey_ pMiPayload_ =
MembersInsert'
{ _miGroupKey = pMiGroupKey_
, _miPayload = pMiPayload_
}
miGroupKey :: Lens' MembersInsert Text
miGroupKey
= lens _miGroupKey (\ s a -> s{_miGroupKey = a})
miPayload :: Lens' MembersInsert Member
miPayload
= lens _miPayload (\ s a -> s{_miPayload = a})
instance GoogleRequest MembersInsert where
type Rs MembersInsert = Member
type Scopes MembersInsert =
'["https://www.googleapis.com/auth/admin.directory.group",
"https://www.googleapis.com/auth/admin.directory.group.member"]
requestClient MembersInsert'{..}
= go _miGroupKey (Just AltJSON) _miPayload
directoryService
where go
= buildClient (Proxy :: Proxy MembersInsertResource)
mempty