{-# 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.UserRoles.Insert
(
UserRolesInsertResource
, userRolesInsert
, UserRolesInsert
, uriProFileId
, uriPayload
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type UserRolesInsertResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"userRoles" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] UserRole :> Post '[JSON] UserRole
data UserRolesInsert = UserRolesInsert'
{ _uriProFileId :: !(Textual Int64)
, _uriPayload :: !UserRole
} deriving (Eq,Show,Data,Typeable,Generic)
userRolesInsert
:: Int64
-> UserRole
-> UserRolesInsert
userRolesInsert pUriProFileId_ pUriPayload_ =
UserRolesInsert'
{ _uriProFileId = _Coerce # pUriProFileId_
, _uriPayload = pUriPayload_
}
uriProFileId :: Lens' UserRolesInsert Int64
uriProFileId
= lens _uriProFileId (\ s a -> s{_uriProFileId = a})
. _Coerce
uriPayload :: Lens' UserRolesInsert UserRole
uriPayload
= lens _uriPayload (\ s a -> s{_uriPayload = a})
instance GoogleRequest UserRolesInsert where
type Rs UserRolesInsert = UserRole
type Scopes UserRolesInsert =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient UserRolesInsert'{..}
= go _uriProFileId (Just AltJSON) _uriPayload
dFAReportingService
where go
= buildClient
(Proxy :: Proxy UserRolesInsertResource)
mempty