{-# 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.FirebaseRules.Projects.Rulesets.Create
(
ProjectsRulesetsCreateResource
, projectsRulesetsCreate
, ProjectsRulesetsCreate
, prcXgafv
, prcUploadProtocol
, prcAccessToken
, prcUploadType
, prcPayload
, prcName
, prcCallback
) where
import Network.Google.FirebaseRules.Types
import Network.Google.Prelude
type ProjectsRulesetsCreateResource =
"v1" :>
Capture "name" Text :>
"rulesets" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Ruleset :> Post '[JSON] Ruleset
data ProjectsRulesetsCreate = ProjectsRulesetsCreate'
{ _prcXgafv :: !(Maybe Xgafv)
, _prcUploadProtocol :: !(Maybe Text)
, _prcAccessToken :: !(Maybe Text)
, _prcUploadType :: !(Maybe Text)
, _prcPayload :: !Ruleset
, _prcName :: !Text
, _prcCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsRulesetsCreate
:: Ruleset
-> Text
-> ProjectsRulesetsCreate
projectsRulesetsCreate pPrcPayload_ pPrcName_ =
ProjectsRulesetsCreate'
{ _prcXgafv = Nothing
, _prcUploadProtocol = Nothing
, _prcAccessToken = Nothing
, _prcUploadType = Nothing
, _prcPayload = pPrcPayload_
, _prcName = pPrcName_
, _prcCallback = Nothing
}
prcXgafv :: Lens' ProjectsRulesetsCreate (Maybe Xgafv)
prcXgafv = lens _prcXgafv (\ s a -> s{_prcXgafv = a})
prcUploadProtocol :: Lens' ProjectsRulesetsCreate (Maybe Text)
prcUploadProtocol
= lens _prcUploadProtocol
(\ s a -> s{_prcUploadProtocol = a})
prcAccessToken :: Lens' ProjectsRulesetsCreate (Maybe Text)
prcAccessToken
= lens _prcAccessToken
(\ s a -> s{_prcAccessToken = a})
prcUploadType :: Lens' ProjectsRulesetsCreate (Maybe Text)
prcUploadType
= lens _prcUploadType
(\ s a -> s{_prcUploadType = a})
prcPayload :: Lens' ProjectsRulesetsCreate Ruleset
prcPayload
= lens _prcPayload (\ s a -> s{_prcPayload = a})
prcName :: Lens' ProjectsRulesetsCreate Text
prcName = lens _prcName (\ s a -> s{_prcName = a})
prcCallback :: Lens' ProjectsRulesetsCreate (Maybe Text)
prcCallback
= lens _prcCallback (\ s a -> s{_prcCallback = a})
instance GoogleRequest ProjectsRulesetsCreate where
type Rs ProjectsRulesetsCreate = Ruleset
type Scopes ProjectsRulesetsCreate =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/firebase"]
requestClient ProjectsRulesetsCreate'{..}
= go _prcName _prcXgafv _prcUploadProtocol
_prcAccessToken
_prcUploadType
_prcCallback
(Just AltJSON)
_prcPayload
firebaseRulesService
where go
= buildClient
(Proxy :: Proxy ProjectsRulesetsCreateResource)
mempty