{-# 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.Indexing.URLNotifications.Publish
    (
    
      URLNotificationsPublishResource
    
    , urlNotificationsPublish
    , URLNotificationsPublish
    
    , unpXgafv
    , unpUploadProtocol
    , unpAccessToken
    , unpUploadType
    , unpPayload
    , unpCallback
    ) where
import           Network.Google.Indexing.Types
import           Network.Google.Prelude
type URLNotificationsPublishResource =
     "v3" :>
       "urlNotifications:publish" :>
         QueryParam "$.xgafv" Xgafv :>
           QueryParam "upload_protocol" Text :>
             QueryParam "access_token" Text :>
               QueryParam "uploadType" Text :>
                 QueryParam "callback" Text :>
                   QueryParam "alt" AltJSON :>
                     ReqBody '[JSON] URLNotification :>
                       Post '[JSON] PublishURLNotificationResponse
data URLNotificationsPublish = URLNotificationsPublish'
    { _unpXgafv          :: !(Maybe Xgafv)
    , _unpUploadProtocol :: !(Maybe Text)
    , _unpAccessToken    :: !(Maybe Text)
    , _unpUploadType     :: !(Maybe Text)
    , _unpPayload        :: !URLNotification
    , _unpCallback       :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)
urlNotificationsPublish
    :: URLNotification 
    -> URLNotificationsPublish
urlNotificationsPublish pUnpPayload_ =
    URLNotificationsPublish'
    { _unpXgafv = Nothing
    , _unpUploadProtocol = Nothing
    , _unpAccessToken = Nothing
    , _unpUploadType = Nothing
    , _unpPayload = pUnpPayload_
    , _unpCallback = Nothing
    }
unpXgafv :: Lens' URLNotificationsPublish (Maybe Xgafv)
unpXgafv = lens _unpXgafv (\ s a -> s{_unpXgafv = a})
unpUploadProtocol :: Lens' URLNotificationsPublish (Maybe Text)
unpUploadProtocol
  = lens _unpUploadProtocol
      (\ s a -> s{_unpUploadProtocol = a})
unpAccessToken :: Lens' URLNotificationsPublish (Maybe Text)
unpAccessToken
  = lens _unpAccessToken
      (\ s a -> s{_unpAccessToken = a})
unpUploadType :: Lens' URLNotificationsPublish (Maybe Text)
unpUploadType
  = lens _unpUploadType
      (\ s a -> s{_unpUploadType = a})
unpPayload :: Lens' URLNotificationsPublish URLNotification
unpPayload
  = lens _unpPayload (\ s a -> s{_unpPayload = a})
unpCallback :: Lens' URLNotificationsPublish (Maybe Text)
unpCallback
  = lens _unpCallback (\ s a -> s{_unpCallback = a})
instance GoogleRequest URLNotificationsPublish where
        type Rs URLNotificationsPublish =
             PublishURLNotificationResponse
        type Scopes URLNotificationsPublish =
             '["https://www.googleapis.com/auth/indexing"]
        requestClient URLNotificationsPublish'{..}
          = go _unpXgafv _unpUploadProtocol _unpAccessToken
              _unpUploadType
              _unpCallback
              (Just AltJSON)
              _unpPayload
              indexingService
          where go
                  = buildClient
                      (Proxy :: Proxy URLNotificationsPublishResource)
                      mempty