{-# 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.CcOffers.List
(
CcOffersListResource
, ccOffersList
, CcOffersList
, colAdvertiser
, colProjection
, colPublisher
) where
import Network.Google.Affiliates.Types
import Network.Google.Prelude
type CcOffersListResource =
"gan" :>
"v1beta1" :>
"publishers" :>
Capture "publisher" Text :>
"ccOffers" :>
QueryParams "advertiser" Text :>
QueryParam "projection" CcOffersListProjection :>
QueryParam "alt" AltJSON :> Get '[JSON] CcOffers
-- | Retrieves credit card offers for the given publisher.
--
-- /See:/ 'ccOffersList' smart constructor.
data CcOffersList = CcOffersList'
{ _colAdvertiser :: !(Maybe [Text])
, _colProjection :: !(Maybe CcOffersListProjection)
, _colPublisher :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'CcOffersList' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'colAdvertiser'
--
-- * 'colProjection'
--
-- * 'colPublisher'
ccOffersList
:: Text -- ^ 'colPublisher'
-> CcOffersList
ccOffersList pColPublisher_ =
CcOffersList'
{ _colAdvertiser = Nothing
, _colProjection = Nothing
, _colPublisher = pColPublisher_
}
-- | The advertiser ID of a card issuer whose offers to include. Optional,
-- may be repeated.
colAdvertiser :: Lens' CcOffersList [Text]
colAdvertiser
= lens _colAdvertiser
(\ s a -> s{_colAdvertiser = a})
. _Default
. _Coerce
-- | The set of fields to return.
colProjection :: Lens' CcOffersList (Maybe CcOffersListProjection)
colProjection
= lens _colProjection
(\ s a -> s{_colProjection = a})
-- | The ID of the publisher in question.
colPublisher :: Lens' CcOffersList Text
colPublisher
= lens _colPublisher (\ s a -> s{_colPublisher = a})
instance GoogleRequest CcOffersList where
type Rs CcOffersList = CcOffers
type Scopes CcOffersList = '[]
requestClient CcOffersList'{..}
= go _colPublisher (_colAdvertiser ^. _Default)
_colProjection
(Just AltJSON)
affiliatesService
where go
= buildClient (Proxy :: Proxy CcOffersListResource)
mempty