{-# 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.Method.OAuth2.TokenInfo
(
TokenInfoMethod
, tokenInfo'
, TokenInfo'
, tAccessToken
, tTokenHandle
, tIdToken
) where
import Network.Google.OAuth2.Types
import Network.Google.Prelude
type TokenInfoMethod =
"oauth2" :>
"v2" :>
"tokeninfo" :>
QueryParam "access_token" Text :>
QueryParam "token_handle" Text :>
QueryParam "id_token" Text :>
QueryParam "alt" AltJSON :> Post '[JSON] TokenInfo
data TokenInfo' = TokenInfo''
{ _tAccessToken :: !(Maybe Text)
, _tTokenHandle :: !(Maybe Text)
, _tIdToken :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
tokenInfo'
:: TokenInfo'
tokenInfo' =
TokenInfo''
{ _tAccessToken = Nothing
, _tTokenHandle = Nothing
, _tIdToken = Nothing
}
tAccessToken :: Lens' TokenInfo' (Maybe Text)
tAccessToken
= lens _tAccessToken (\ s a -> s{_tAccessToken = a})
tTokenHandle :: Lens' TokenInfo' (Maybe Text)
tTokenHandle
= lens _tTokenHandle (\ s a -> s{_tTokenHandle = a})
tIdToken :: Lens' TokenInfo' (Maybe Text)
tIdToken = lens _tIdToken (\ s a -> s{_tIdToken = a})
instance GoogleRequest TokenInfo' where
type Rs TokenInfo' = TokenInfo
type Scopes TokenInfo' = '[]
requestClient TokenInfo''{..}
= go _tAccessToken _tTokenHandle _tIdToken
(Just AltJSON)
oAuth2Service
where go
= buildClient (Proxy :: Proxy TokenInfoMethod) mempty