{-# 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.Tracing.Projects.Traces.Spans.Create
(
ProjectsTracesSpansCreateResource
, projectsTracesSpansCreate
, ProjectsTracesSpansCreate
, ptscXgafv
, ptscUploadProtocol
, ptscPp
, ptscAccessToken
, ptscUploadType
, ptscPayload
, ptscBearerToken
, ptscName
, ptscCallback
) where
import Network.Google.Prelude
import Network.Google.Tracing.Types
type ProjectsTracesSpansCreateResource =
"v2" :>
Capture "name" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "pp" Bool :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "bearer_token" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Span :> Put '[JSON] Span
data ProjectsTracesSpansCreate = ProjectsTracesSpansCreate'
{ _ptscXgafv :: !(Maybe Xgafv)
, _ptscUploadProtocol :: !(Maybe Text)
, _ptscPp :: !Bool
, _ptscAccessToken :: !(Maybe Text)
, _ptscUploadType :: !(Maybe Text)
, _ptscPayload :: !Span
, _ptscBearerToken :: !(Maybe Text)
, _ptscName :: !Text
, _ptscCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsTracesSpansCreate
:: Span
-> Text
-> ProjectsTracesSpansCreate
projectsTracesSpansCreate pPtscPayload_ pPtscName_ =
ProjectsTracesSpansCreate'
{ _ptscXgafv = Nothing
, _ptscUploadProtocol = Nothing
, _ptscPp = True
, _ptscAccessToken = Nothing
, _ptscUploadType = Nothing
, _ptscPayload = pPtscPayload_
, _ptscBearerToken = Nothing
, _ptscName = pPtscName_
, _ptscCallback = Nothing
}
ptscXgafv :: Lens' ProjectsTracesSpansCreate (Maybe Xgafv)
ptscXgafv
= lens _ptscXgafv (\ s a -> s{_ptscXgafv = a})
ptscUploadProtocol :: Lens' ProjectsTracesSpansCreate (Maybe Text)
ptscUploadProtocol
= lens _ptscUploadProtocol
(\ s a -> s{_ptscUploadProtocol = a})
ptscPp :: Lens' ProjectsTracesSpansCreate Bool
ptscPp = lens _ptscPp (\ s a -> s{_ptscPp = a})
ptscAccessToken :: Lens' ProjectsTracesSpansCreate (Maybe Text)
ptscAccessToken
= lens _ptscAccessToken
(\ s a -> s{_ptscAccessToken = a})
ptscUploadType :: Lens' ProjectsTracesSpansCreate (Maybe Text)
ptscUploadType
= lens _ptscUploadType
(\ s a -> s{_ptscUploadType = a})
ptscPayload :: Lens' ProjectsTracesSpansCreate Span
ptscPayload
= lens _ptscPayload (\ s a -> s{_ptscPayload = a})
ptscBearerToken :: Lens' ProjectsTracesSpansCreate (Maybe Text)
ptscBearerToken
= lens _ptscBearerToken
(\ s a -> s{_ptscBearerToken = a})
ptscName :: Lens' ProjectsTracesSpansCreate Text
ptscName = lens _ptscName (\ s a -> s{_ptscName = a})
ptscCallback :: Lens' ProjectsTracesSpansCreate (Maybe Text)
ptscCallback
= lens _ptscCallback (\ s a -> s{_ptscCallback = a})
instance GoogleRequest ProjectsTracesSpansCreate
where
type Rs ProjectsTracesSpansCreate = Span
type Scopes ProjectsTracesSpansCreate =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/trace.append"]
requestClient ProjectsTracesSpansCreate'{..}
= go _ptscName _ptscXgafv _ptscUploadProtocol
(Just _ptscPp)
_ptscAccessToken
_ptscUploadType
_ptscBearerToken
_ptscCallback
(Just AltJSON)
_ptscPayload
tracingService
where go
= buildClient
(Proxy :: Proxy ProjectsTracesSpansCreateResource)
mempty