{-# 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.GamesConfiguration.AchievementConfigurations.Patch
    (
    
      AchievementConfigurationsPatchResource
    
    , achievementConfigurationsPatch
    , AchievementConfigurationsPatch
    
    , acpAchievementId
    , acpPayload
    ) where
import           Network.Google.GamesConfiguration.Types
import           Network.Google.Prelude
type AchievementConfigurationsPatchResource =
     "games" :>
       "v1configuration" :>
         "achievements" :>
           Capture "achievementId" Text :>
             QueryParam "alt" AltJSON :>
               ReqBody '[JSON] AchievementConfiguration :>
                 Patch '[JSON] AchievementConfiguration
data AchievementConfigurationsPatch = AchievementConfigurationsPatch'
    { _acpAchievementId :: !Text
    , _acpPayload       :: !AchievementConfiguration
    } deriving (Eq,Show,Data,Typeable,Generic)
achievementConfigurationsPatch
    :: Text 
    -> AchievementConfiguration 
    -> AchievementConfigurationsPatch
achievementConfigurationsPatch pAcpAchievementId_ pAcpPayload_ =
    AchievementConfigurationsPatch'
    { _acpAchievementId = pAcpAchievementId_
    , _acpPayload = pAcpPayload_
    }
acpAchievementId :: Lens' AchievementConfigurationsPatch Text
acpAchievementId
  = lens _acpAchievementId
      (\ s a -> s{_acpAchievementId = a})
acpPayload :: Lens' AchievementConfigurationsPatch AchievementConfiguration
acpPayload
  = lens _acpPayload (\ s a -> s{_acpPayload = a})
instance GoogleRequest AchievementConfigurationsPatch
         where
        type Rs AchievementConfigurationsPatch =
             AchievementConfiguration
        type Scopes AchievementConfigurationsPatch =
             '["https://www.googleapis.com/auth/androidpublisher"]
        requestClient AchievementConfigurationsPatch'{..}
          = go _acpAchievementId (Just AltJSON) _acpPayload
              gamesConfigurationService
          where go
                  = buildClient
                      (Proxy ::
                         Proxy AchievementConfigurationsPatchResource)
                      mempty