{-# 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.Tokens.Delete
(
TokensDeleteResource
, tokensDelete
, TokensDelete
, tdClientId
, tdUserKey
) where
import Network.Google.Directory.Types
import Network.Google.Prelude
type TokensDeleteResource =
"admin" :>
"directory" :>
"v1" :>
"users" :>
Capture "userKey" Text :>
"tokens" :>
Capture "clientId" Text :>
QueryParam "alt" AltJSON :> Delete '[JSON] ()
-- | Delete all access tokens issued by a user for an application.
--
-- /See:/ 'tokensDelete' smart constructor.
data TokensDelete = TokensDelete'
{ _tdClientId :: !Text
, _tdUserKey :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'TokensDelete' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'tdClientId'
--
-- * 'tdUserKey'
tokensDelete
:: Text -- ^ 'tdClientId'
-> Text -- ^ 'tdUserKey'
-> TokensDelete
tokensDelete pTdClientId_ pTdUserKey_ =
TokensDelete'
{ _tdClientId = pTdClientId_
, _tdUserKey = pTdUserKey_
}
-- | The Client ID of the application the token is issued to.
tdClientId :: Lens' TokensDelete Text
tdClientId
= lens _tdClientId (\ s a -> s{_tdClientId = a})
-- | Identifies the user in the API request. The value can be the user\'s
-- primary email address, alias email address, or unique user ID.
tdUserKey :: Lens' TokensDelete Text
tdUserKey
= lens _tdUserKey (\ s a -> s{_tdUserKey = a})
instance GoogleRequest TokensDelete where
type Rs TokensDelete = ()
type Scopes TokensDelete =
'["https://www.googleapis.com/auth/admin.directory.user.security"]
requestClient TokensDelete'{..}
= go _tdUserKey _tdClientId (Just AltJSON)
directoryService
where go
= buildClient (Proxy :: Proxy TokensDeleteResource)
mempty