{-# 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.GAN.Links.Insert
(
LinksInsertResource
, linksInsert
, LinksInsert
, liPayload
, liRoleId
, liRole
) where
import Network.Google.Affiliates.Types
import Network.Google.Prelude
type LinksInsertResource =
"gan" :>
"v1beta1" :>
Capture "role" LinksInsertRole :>
Capture "roleId" Text :>
"link" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Link :> Post '[JSON] Link
-- | Inserts a new link.
--
-- /See:/ 'linksInsert' smart constructor.
data LinksInsert = LinksInsert'
{ _liPayload :: !Link
, _liRoleId :: !Text
, _liRole :: !LinksInsertRole
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'LinksInsert' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'liPayload'
--
-- * 'liRoleId'
--
-- * 'liRole'
linksInsert
:: Link -- ^ 'liPayload'
-> Text -- ^ 'liRoleId'
-> LinksInsertRole -- ^ 'liRole'
-> LinksInsert
linksInsert pLiPayload_ pLiRoleId_ pLiRole_ =
LinksInsert'
{ _liPayload = pLiPayload_
, _liRoleId = pLiRoleId_
, _liRole = pLiRole_
}
-- | Multipart request metadata.
liPayload :: Lens' LinksInsert Link
liPayload
= lens _liPayload (\ s a -> s{_liPayload = a})
-- | The ID of the requesting advertiser or publisher.
liRoleId :: Lens' LinksInsert Text
liRoleId = lens _liRoleId (\ s a -> s{_liRoleId = a})
-- | The role of the requester. Valid values: \'advertisers\' or
-- \'publishers\'.
liRole :: Lens' LinksInsert LinksInsertRole
liRole = lens _liRole (\ s a -> s{_liRole = a})
instance GoogleRequest LinksInsert where
type Rs LinksInsert = Link
type Scopes LinksInsert = '[]
requestClient LinksInsert'{..}
= go _liRole _liRoleId (Just AltJSON) _liPayload
affiliatesService
where go
= buildClient (Proxy :: Proxy LinksInsertResource)
mempty