{-# 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.Insert
(
URLInsertResource
, urlInsert
, URLInsert
, uiPayload
) where
import Network.Google.Prelude
import Network.Google.URLShortener.Types
type URLInsertResource =
"urlshortener" :>
"v1" :>
"url" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] URL :> Post '[JSON] URL
newtype URLInsert = URLInsert'
{ _uiPayload :: URL
} deriving (Eq,Show,Data,Typeable,Generic)
urlInsert
:: URL
-> URLInsert
urlInsert pUiPayload_ =
URLInsert'
{ _uiPayload = pUiPayload_
}
uiPayload :: Lens' URLInsert URL
uiPayload
= lens _uiPayload (\ s a -> s{_uiPayload = a})
instance GoogleRequest URLInsert where
type Rs URLInsert = URL
type Scopes URLInsert =
'["https://www.googleapis.com/auth/urlshortener"]
requestClient URLInsert'{..}
= go (Just AltJSON) _uiPayload uRLShortenerService
where go
= buildClient (Proxy :: Proxy URLInsertResource)
mempty