{-# 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.DialogFlow.Projects.Agent.Train
(
ProjectsAgentTrainResource
, projectsAgentTrain
, ProjectsAgentTrain
, patParent
, patXgafv
, patUploadProtocol
, patAccessToken
, patUploadType
, patPayload
, patCallback
) where
import Network.Google.DialogFlow.Types
import Network.Google.Prelude
type ProjectsAgentTrainResource =
"v2" :>
Capture "parent" Text :>
"agent:train" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON]
GoogleCloudDialogflowV2TrainAgentRequest
:> Post '[JSON] GoogleLongrunningOperation
data ProjectsAgentTrain = ProjectsAgentTrain'
{ _patParent :: !Text
, _patXgafv :: !(Maybe Xgafv)
, _patUploadProtocol :: !(Maybe Text)
, _patAccessToken :: !(Maybe Text)
, _patUploadType :: !(Maybe Text)
, _patPayload :: !GoogleCloudDialogflowV2TrainAgentRequest
, _patCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsAgentTrain
:: Text
-> GoogleCloudDialogflowV2TrainAgentRequest
-> ProjectsAgentTrain
projectsAgentTrain pPatParent_ pPatPayload_ =
ProjectsAgentTrain'
{ _patParent = pPatParent_
, _patXgafv = Nothing
, _patUploadProtocol = Nothing
, _patAccessToken = Nothing
, _patUploadType = Nothing
, _patPayload = pPatPayload_
, _patCallback = Nothing
}
patParent :: Lens' ProjectsAgentTrain Text
patParent
= lens _patParent (\ s a -> s{_patParent = a})
patXgafv :: Lens' ProjectsAgentTrain (Maybe Xgafv)
patXgafv = lens _patXgafv (\ s a -> s{_patXgafv = a})
patUploadProtocol :: Lens' ProjectsAgentTrain (Maybe Text)
patUploadProtocol
= lens _patUploadProtocol
(\ s a -> s{_patUploadProtocol = a})
patAccessToken :: Lens' ProjectsAgentTrain (Maybe Text)
patAccessToken
= lens _patAccessToken
(\ s a -> s{_patAccessToken = a})
patUploadType :: Lens' ProjectsAgentTrain (Maybe Text)
patUploadType
= lens _patUploadType
(\ s a -> s{_patUploadType = a})
patPayload :: Lens' ProjectsAgentTrain GoogleCloudDialogflowV2TrainAgentRequest
patPayload
= lens _patPayload (\ s a -> s{_patPayload = a})
patCallback :: Lens' ProjectsAgentTrain (Maybe Text)
patCallback
= lens _patCallback (\ s a -> s{_patCallback = a})
instance GoogleRequest ProjectsAgentTrain where
type Rs ProjectsAgentTrain =
GoogleLongrunningOperation
type Scopes ProjectsAgentTrain =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/dialogflow"]
requestClient ProjectsAgentTrain'{..}
= go _patParent _patXgafv _patUploadProtocol
_patAccessToken
_patUploadType
_patCallback
(Just AltJSON)
_patPayload
dialogFlowService
where go
= buildClient
(Proxy :: Proxy ProjectsAgentTrainResource)
mempty