{-# 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.Spans.CreateSpan
(
ProjectsTracesSpansCreateSpanResource
, projectsTracesSpansCreateSpan
, ProjectsTracesSpansCreateSpan
, ptscsXgafv
, ptscsUploadProtocol
, ptscsAccessToken
, ptscsUploadType
, ptscsPayload
, ptscsName
, ptscsCallback
) where
import Network.Google.CloudTrace.Types
import Network.Google.Prelude
type ProjectsTracesSpansCreateSpanResource =
"v2" :>
Capture "name" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Span :> Post '[JSON] Span
data ProjectsTracesSpansCreateSpan = ProjectsTracesSpansCreateSpan'
{ _ptscsXgafv :: !(Maybe Xgafv)
, _ptscsUploadProtocol :: !(Maybe Text)
, _ptscsAccessToken :: !(Maybe Text)
, _ptscsUploadType :: !(Maybe Text)
, _ptscsPayload :: !Span
, _ptscsName :: !Text
, _ptscsCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsTracesSpansCreateSpan
:: Span
-> Text
-> ProjectsTracesSpansCreateSpan
projectsTracesSpansCreateSpan pPtscsPayload_ pPtscsName_ =
ProjectsTracesSpansCreateSpan'
{ _ptscsXgafv = Nothing
, _ptscsUploadProtocol = Nothing
, _ptscsAccessToken = Nothing
, _ptscsUploadType = Nothing
, _ptscsPayload = pPtscsPayload_
, _ptscsName = pPtscsName_
, _ptscsCallback = Nothing
}
ptscsXgafv :: Lens' ProjectsTracesSpansCreateSpan (Maybe Xgafv)
ptscsXgafv
= lens _ptscsXgafv (\ s a -> s{_ptscsXgafv = a})
ptscsUploadProtocol :: Lens' ProjectsTracesSpansCreateSpan (Maybe Text)
ptscsUploadProtocol
= lens _ptscsUploadProtocol
(\ s a -> s{_ptscsUploadProtocol = a})
ptscsAccessToken :: Lens' ProjectsTracesSpansCreateSpan (Maybe Text)
ptscsAccessToken
= lens _ptscsAccessToken
(\ s a -> s{_ptscsAccessToken = a})
ptscsUploadType :: Lens' ProjectsTracesSpansCreateSpan (Maybe Text)
ptscsUploadType
= lens _ptscsUploadType
(\ s a -> s{_ptscsUploadType = a})
ptscsPayload :: Lens' ProjectsTracesSpansCreateSpan Span
ptscsPayload
= lens _ptscsPayload (\ s a -> s{_ptscsPayload = a})
ptscsName :: Lens' ProjectsTracesSpansCreateSpan Text
ptscsName
= lens _ptscsName (\ s a -> s{_ptscsName = a})
ptscsCallback :: Lens' ProjectsTracesSpansCreateSpan (Maybe Text)
ptscsCallback
= lens _ptscsCallback
(\ s a -> s{_ptscsCallback = a})
instance GoogleRequest ProjectsTracesSpansCreateSpan
where
type Rs ProjectsTracesSpansCreateSpan = Span
type Scopes ProjectsTracesSpansCreateSpan =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/trace.append"]
requestClient ProjectsTracesSpansCreateSpan'{..}
= go _ptscsName _ptscsXgafv _ptscsUploadProtocol
_ptscsAccessToken
_ptscsUploadType
_ptscsCallback
(Just AltJSON)
_ptscsPayload
cloudTraceService
where go
= buildClient
(Proxy ::
Proxy ProjectsTracesSpansCreateSpanResource)
mempty