{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE ImportQualifiedPost #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Gogol.URLShortener.Url.Get
(
URLShortenerUrlGetResource,
URLShortenerUrlGet (..),
newURLShortenerUrlGet,
)
where
import Gogol.Prelude qualified as Core
import Gogol.URLShortener.Types
type URLShortenerUrlGetResource =
"urlshortener"
Core.:> "v1"
Core.:> "url"
Core.:> Core.QueryParam "shortUrl" Core.Text
Core.:> Core.QueryParam "projection" UrlGetProjection
Core.:> Core.QueryParam "alt" Core.AltJSON
Core.:> Core.Get '[Core.JSON] Url
data URLShortenerUrlGet = URLShortenerUrlGet
{
URLShortenerUrlGet -> Maybe UrlGetProjection
projection :: (Core.Maybe UrlGetProjection),
URLShortenerUrlGet -> Text
shortUrl :: Core.Text
}
deriving (URLShortenerUrlGet -> URLShortenerUrlGet -> Bool
(URLShortenerUrlGet -> URLShortenerUrlGet -> Bool)
-> (URLShortenerUrlGet -> URLShortenerUrlGet -> Bool)
-> Eq URLShortenerUrlGet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: URLShortenerUrlGet -> URLShortenerUrlGet -> Bool
== :: URLShortenerUrlGet -> URLShortenerUrlGet -> Bool
$c/= :: URLShortenerUrlGet -> URLShortenerUrlGet -> Bool
/= :: URLShortenerUrlGet -> URLShortenerUrlGet -> Bool
Core.Eq, Int -> URLShortenerUrlGet -> ShowS
[URLShortenerUrlGet] -> ShowS
URLShortenerUrlGet -> String
(Int -> URLShortenerUrlGet -> ShowS)
-> (URLShortenerUrlGet -> String)
-> ([URLShortenerUrlGet] -> ShowS)
-> Show URLShortenerUrlGet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> URLShortenerUrlGet -> ShowS
showsPrec :: Int -> URLShortenerUrlGet -> ShowS
$cshow :: URLShortenerUrlGet -> String
show :: URLShortenerUrlGet -> String
$cshowList :: [URLShortenerUrlGet] -> ShowS
showList :: [URLShortenerUrlGet] -> ShowS
Core.Show, (forall x. URLShortenerUrlGet -> Rep URLShortenerUrlGet x)
-> (forall x. Rep URLShortenerUrlGet x -> URLShortenerUrlGet)
-> Generic URLShortenerUrlGet
forall x. Rep URLShortenerUrlGet x -> URLShortenerUrlGet
forall x. URLShortenerUrlGet -> Rep URLShortenerUrlGet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. URLShortenerUrlGet -> Rep URLShortenerUrlGet x
from :: forall x. URLShortenerUrlGet -> Rep URLShortenerUrlGet x
$cto :: forall x. Rep URLShortenerUrlGet x -> URLShortenerUrlGet
to :: forall x. Rep URLShortenerUrlGet x -> URLShortenerUrlGet
Core.Generic)
newURLShortenerUrlGet ::
Core.Text ->
URLShortenerUrlGet
newURLShortenerUrlGet :: Text -> URLShortenerUrlGet
newURLShortenerUrlGet Text
shortUrl =
URLShortenerUrlGet
{ projection :: Maybe UrlGetProjection
projection = Maybe UrlGetProjection
forall a. Maybe a
Core.Nothing,
shortUrl :: Text
shortUrl = Text
shortUrl
}
instance Core.GoogleRequest URLShortenerUrlGet where
type Rs URLShortenerUrlGet = Url
type Scopes URLShortenerUrlGet = '[Urlshortener'FullControl]
requestClient :: URLShortenerUrlGet -> GClient (Rs URLShortenerUrlGet)
requestClient URLShortenerUrlGet {Maybe UrlGetProjection
Text
projection :: URLShortenerUrlGet -> Maybe UrlGetProjection
shortUrl :: URLShortenerUrlGet -> Text
projection :: Maybe UrlGetProjection
shortUrl :: Text
..} =
Maybe Text
-> Maybe UrlGetProjection
-> Maybe AltJSON
-> ServiceConfig
-> GClient Url
go
(Text -> Maybe Text
forall a. a -> Maybe a
Core.Just Text
shortUrl)
Maybe UrlGetProjection
projection
(AltJSON -> Maybe AltJSON
forall a. a -> Maybe a
Core.Just AltJSON
Core.AltJSON)
ServiceConfig
uRLShortenerService
where
go :: Fn URLShortenerUrlGetResource
go =
Proxy URLShortenerUrlGetResource
-> Request -> Fn URLShortenerUrlGetResource
forall {k} (fn :: k).
GoogleClient fn =>
Proxy fn -> Request -> Fn fn
Core.buildClient
(Proxy URLShortenerUrlGetResource
forall {k} (t :: k). Proxy t
Core.Proxy :: Core.Proxy URLShortenerUrlGetResource)
Request
forall a. Monoid a => a
Core.mempty