{-# 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.URLShortener.URL.Get
(
URLGetResource
, urlGet
, URLGet
, ugProjection
, ugShortURL
) where
import Network.Google.Prelude
import Network.Google.URLShortener.Types
type URLGetResource =
"urlshortener" :>
"v1" :>
"url" :>
QueryParam "shortUrl" Text :>
QueryParam "projection" URLGetProjection :>
QueryParam "alt" AltJSON :> Get '[JSON] URL
data URLGet = URLGet'
{ _ugProjection :: !(Maybe URLGetProjection)
, _ugShortURL :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
urlGet
:: Text
-> URLGet
urlGet pUgShortURL_ =
URLGet'
{ _ugProjection = Nothing
, _ugShortURL = pUgShortURL_
}
ugProjection :: Lens' URLGet (Maybe URLGetProjection)
ugProjection
= lens _ugProjection (\ s a -> s{_ugProjection = a})
ugShortURL :: Lens' URLGet Text
ugShortURL
= lens _ugShortURL (\ s a -> s{_ugShortURL = a})
instance GoogleRequest URLGet where
type Rs URLGet = URL
type Scopes URLGet =
'["https://www.googleapis.com/auth/urlshortener"]
requestClient URLGet'{..}
= go (Just _ugShortURL) _ugProjection (Just AltJSON)
uRLShortenerService
where go
= buildClient (Proxy :: Proxy URLGetResource) mempty