{-# 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.ServiceControl.Services.AllocateQuota
(
ServicesAllocateQuotaResource
, servicesAllocateQuota
, ServicesAllocateQuota
, saqXgafv
, saqUploadProtocol
, saqAccessToken
, saqUploadType
, saqPayload
, saqServiceName
, saqCallback
) where
import Network.Google.Prelude
import Network.Google.ServiceControl.Types
type ServicesAllocateQuotaResource =
"v1" :>
"services" :>
CaptureMode "serviceName" "allocateQuota" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] AllocateQuotaRequest :>
Post '[JSON] AllocateQuotaResponse
data ServicesAllocateQuota = ServicesAllocateQuota'
{ _saqXgafv :: !(Maybe Xgafv)
, _saqUploadProtocol :: !(Maybe Text)
, _saqAccessToken :: !(Maybe Text)
, _saqUploadType :: !(Maybe Text)
, _saqPayload :: !AllocateQuotaRequest
, _saqServiceName :: !Text
, _saqCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
servicesAllocateQuota
:: AllocateQuotaRequest
-> Text
-> ServicesAllocateQuota
servicesAllocateQuota pSaqPayload_ pSaqServiceName_ =
ServicesAllocateQuota'
{ _saqXgafv = Nothing
, _saqUploadProtocol = Nothing
, _saqAccessToken = Nothing
, _saqUploadType = Nothing
, _saqPayload = pSaqPayload_
, _saqServiceName = pSaqServiceName_
, _saqCallback = Nothing
}
saqXgafv :: Lens' ServicesAllocateQuota (Maybe Xgafv)
saqXgafv = lens _saqXgafv (\ s a -> s{_saqXgafv = a})
saqUploadProtocol :: Lens' ServicesAllocateQuota (Maybe Text)
saqUploadProtocol
= lens _saqUploadProtocol
(\ s a -> s{_saqUploadProtocol = a})
saqAccessToken :: Lens' ServicesAllocateQuota (Maybe Text)
saqAccessToken
= lens _saqAccessToken
(\ s a -> s{_saqAccessToken = a})
saqUploadType :: Lens' ServicesAllocateQuota (Maybe Text)
saqUploadType
= lens _saqUploadType
(\ s a -> s{_saqUploadType = a})
saqPayload :: Lens' ServicesAllocateQuota AllocateQuotaRequest
saqPayload
= lens _saqPayload (\ s a -> s{_saqPayload = a})
saqServiceName :: Lens' ServicesAllocateQuota Text
saqServiceName
= lens _saqServiceName
(\ s a -> s{_saqServiceName = a})
saqCallback :: Lens' ServicesAllocateQuota (Maybe Text)
saqCallback
= lens _saqCallback (\ s a -> s{_saqCallback = a})
instance GoogleRequest ServicesAllocateQuota where
type Rs ServicesAllocateQuota = AllocateQuotaResponse
type Scopes ServicesAllocateQuota =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/servicecontrol"]
requestClient ServicesAllocateQuota'{..}
= go _saqServiceName _saqXgafv _saqUploadProtocol
_saqAccessToken
_saqUploadType
_saqCallback
(Just AltJSON)
_saqPayload
serviceControlService
where go
= buildClient
(Proxy :: Proxy ServicesAllocateQuotaResource)
mempty