{-# 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.CloudTrace.Projects.Traces.BatchWrite
(
ProjectsTracesBatchWriteResource
, projectsTracesBatchWrite
, ProjectsTracesBatchWrite
, ptbwXgafv
, ptbwUploadProtocol
, ptbwAccessToken
, ptbwUploadType
, ptbwPayload
, ptbwName
, ptbwCallback
) where
import Network.Google.CloudTrace.Types
import Network.Google.Prelude
type ProjectsTracesBatchWriteResource =
"v2" :>
Capture "name" Text :>
"traces:batchWrite" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] BatchWriteSpansRequest :>
Post '[JSON] Empty
data ProjectsTracesBatchWrite = ProjectsTracesBatchWrite'
{ _ptbwXgafv :: !(Maybe Xgafv)
, _ptbwUploadProtocol :: !(Maybe Text)
, _ptbwAccessToken :: !(Maybe Text)
, _ptbwUploadType :: !(Maybe Text)
, _ptbwPayload :: !BatchWriteSpansRequest
, _ptbwName :: !Text
, _ptbwCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsTracesBatchWrite
:: BatchWriteSpansRequest
-> Text
-> ProjectsTracesBatchWrite
projectsTracesBatchWrite pPtbwPayload_ pPtbwName_ =
ProjectsTracesBatchWrite'
{ _ptbwXgafv = Nothing
, _ptbwUploadProtocol = Nothing
, _ptbwAccessToken = Nothing
, _ptbwUploadType = Nothing
, _ptbwPayload = pPtbwPayload_
, _ptbwName = pPtbwName_
, _ptbwCallback = Nothing
}
ptbwXgafv :: Lens' ProjectsTracesBatchWrite (Maybe Xgafv)
ptbwXgafv
= lens _ptbwXgafv (\ s a -> s{_ptbwXgafv = a})
ptbwUploadProtocol :: Lens' ProjectsTracesBatchWrite (Maybe Text)
ptbwUploadProtocol
= lens _ptbwUploadProtocol
(\ s a -> s{_ptbwUploadProtocol = a})
ptbwAccessToken :: Lens' ProjectsTracesBatchWrite (Maybe Text)
ptbwAccessToken
= lens _ptbwAccessToken
(\ s a -> s{_ptbwAccessToken = a})
ptbwUploadType :: Lens' ProjectsTracesBatchWrite (Maybe Text)
ptbwUploadType
= lens _ptbwUploadType
(\ s a -> s{_ptbwUploadType = a})
ptbwPayload :: Lens' ProjectsTracesBatchWrite BatchWriteSpansRequest
ptbwPayload
= lens _ptbwPayload (\ s a -> s{_ptbwPayload = a})
ptbwName :: Lens' ProjectsTracesBatchWrite Text
ptbwName = lens _ptbwName (\ s a -> s{_ptbwName = a})
ptbwCallback :: Lens' ProjectsTracesBatchWrite (Maybe Text)
ptbwCallback
= lens _ptbwCallback (\ s a -> s{_ptbwCallback = a})
instance GoogleRequest ProjectsTracesBatchWrite where
type Rs ProjectsTracesBatchWrite = Empty
type Scopes ProjectsTracesBatchWrite =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/trace.append"]
requestClient ProjectsTracesBatchWrite'{..}
= go _ptbwName _ptbwXgafv _ptbwUploadProtocol
_ptbwAccessToken
_ptbwUploadType
_ptbwCallback
(Just AltJSON)
_ptbwPayload
cloudTraceService
where go
= buildClient
(Proxy :: Proxy ProjectsTracesBatchWriteResource)
mempty