{-# 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.DFAReporting.PlacementGroups.Insert
    (
    
      PlacementGroupsInsertResource
    
    , placementGroupsInsert
    , PlacementGroupsInsert
    
    , pgiProFileId
    , pgiPayload
    ) where
import           Network.Google.DFAReporting.Types
import           Network.Google.Prelude
type PlacementGroupsInsertResource =
     "dfareporting" :>
       "v3.2" :>
         "userprofiles" :>
           Capture "profileId" (Textual Int64) :>
             "placementGroups" :>
               QueryParam "alt" AltJSON :>
                 ReqBody '[JSON] PlacementGroup :>
                   Post '[JSON] PlacementGroup
data PlacementGroupsInsert = PlacementGroupsInsert'
    { _pgiProFileId :: !(Textual Int64)
    , _pgiPayload   :: !PlacementGroup
    } deriving (Eq,Show,Data,Typeable,Generic)
placementGroupsInsert
    :: Int64 
    -> PlacementGroup 
    -> PlacementGroupsInsert
placementGroupsInsert pPgiProFileId_ pPgiPayload_ =
    PlacementGroupsInsert'
    { _pgiProFileId = _Coerce # pPgiProFileId_
    , _pgiPayload = pPgiPayload_
    }
pgiProFileId :: Lens' PlacementGroupsInsert Int64
pgiProFileId
  = lens _pgiProFileId (\ s a -> s{_pgiProFileId = a})
      . _Coerce
pgiPayload :: Lens' PlacementGroupsInsert PlacementGroup
pgiPayload
  = lens _pgiPayload (\ s a -> s{_pgiPayload = a})
instance GoogleRequest PlacementGroupsInsert where
        type Rs PlacementGroupsInsert = PlacementGroup
        type Scopes PlacementGroupsInsert =
             '["https://www.googleapis.com/auth/dfatrafficking"]
        requestClient PlacementGroupsInsert'{..}
          = go _pgiProFileId (Just AltJSON) _pgiPayload
              dFAReportingService
          where go
                  = buildClient
                      (Proxy :: Proxy PlacementGroupsInsertResource)
                      mempty