summaryrefslogtreecommitdiff
path: root/gen/Network/Google/Resource/Dataflow/Projects/Jobs/Debug/SendCapture.hs
blob: ddc7a894f85312f04bd45aaa5e76ae74e6a8b770 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
{-# 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.Dataflow.Projects.Jobs.Debug.SendCapture
-- Copyright   : (c) 2015-2016 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Send encoded debug capture data for component.
--
-- /See:/ <https://cloud.google.com/dataflow Google Dataflow API Reference> for @dataflow.projects.jobs.debug.sendCapture@.
module Network.Google.Resource.Dataflow.Projects.Jobs.Debug.SendCapture
    (
    -- * REST Resource
      ProjectsJobsDebugSendCaptureResource

    -- * Creating a Request
    , projectsJobsDebugSendCapture
    , ProjectsJobsDebugSendCapture

    -- * Request Lenses
    , pjdscXgafv
    , pjdscJobId
    , pjdscUploadProtocol
    , pjdscPp
    , pjdscAccessToken
    , pjdscUploadType
    , pjdscPayload
    , pjdscBearerToken
    , pjdscProjectId
    , pjdscCallback
    ) where

import           Network.Google.Dataflow.Types
import           Network.Google.Prelude

-- | A resource alias for @dataflow.projects.jobs.debug.sendCapture@ method which the
-- 'ProjectsJobsDebugSendCapture' request conforms to.
type ProjectsJobsDebugSendCaptureResource =
     "v1b3" :>
       "projects" :>
         Capture "projectId" Text :>
           "jobs" :>
             Capture "jobId" Text :>
               "debug" :>
                 "sendCapture" :>
                   QueryParam "$.xgafv" Text :>
                     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] SendDebugCaptureRequest :>
                                     Post '[JSON] SendDebugCaptureResponse

-- | Send encoded debug capture data for component.
--
-- /See:/ 'projectsJobsDebugSendCapture' smart constructor.
data ProjectsJobsDebugSendCapture = ProjectsJobsDebugSendCapture'
    { _pjdscXgafv          :: !(Maybe Text)
    , _pjdscJobId          :: !Text
    , _pjdscUploadProtocol :: !(Maybe Text)
    , _pjdscPp             :: !Bool
    , _pjdscAccessToken    :: !(Maybe Text)
    , _pjdscUploadType     :: !(Maybe Text)
    , _pjdscPayload        :: !SendDebugCaptureRequest
    , _pjdscBearerToken    :: !(Maybe Text)
    , _pjdscProjectId      :: !Text
    , _pjdscCallback       :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'ProjectsJobsDebugSendCapture' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'pjdscXgafv'
--
-- * 'pjdscJobId'
--
-- * 'pjdscUploadProtocol'
--
-- * 'pjdscPp'
--
-- * 'pjdscAccessToken'
--
-- * 'pjdscUploadType'
--
-- * 'pjdscPayload'
--
-- * 'pjdscBearerToken'
--
-- * 'pjdscProjectId'
--
-- * 'pjdscCallback'
projectsJobsDebugSendCapture
    :: Text -- ^ 'pjdscJobId'
    -> SendDebugCaptureRequest -- ^ 'pjdscPayload'
    -> Text -- ^ 'pjdscProjectId'
    -> ProjectsJobsDebugSendCapture
projectsJobsDebugSendCapture pPjdscJobId_ pPjdscPayload_ pPjdscProjectId_ =
    ProjectsJobsDebugSendCapture'
    { _pjdscXgafv = Nothing
    , _pjdscJobId = pPjdscJobId_
    , _pjdscUploadProtocol = Nothing
    , _pjdscPp = True
    , _pjdscAccessToken = Nothing
    , _pjdscUploadType = Nothing
    , _pjdscPayload = pPjdscPayload_
    , _pjdscBearerToken = Nothing
    , _pjdscProjectId = pPjdscProjectId_
    , _pjdscCallback = Nothing
    }

-- | V1 error format.
pjdscXgafv :: Lens' ProjectsJobsDebugSendCapture (Maybe Text)
pjdscXgafv
  = lens _pjdscXgafv (\ s a -> s{_pjdscXgafv = a})

-- | The job id.
pjdscJobId :: Lens' ProjectsJobsDebugSendCapture Text
pjdscJobId
  = lens _pjdscJobId (\ s a -> s{_pjdscJobId = a})

-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
pjdscUploadProtocol :: Lens' ProjectsJobsDebugSendCapture (Maybe Text)
pjdscUploadProtocol
  = lens _pjdscUploadProtocol
      (\ s a -> s{_pjdscUploadProtocol = a})

-- | Pretty-print response.
pjdscPp :: Lens' ProjectsJobsDebugSendCapture Bool
pjdscPp = lens _pjdscPp (\ s a -> s{_pjdscPp = a})

-- | OAuth access token.
pjdscAccessToken :: Lens' ProjectsJobsDebugSendCapture (Maybe Text)
pjdscAccessToken
  = lens _pjdscAccessToken
      (\ s a -> s{_pjdscAccessToken = a})

-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
pjdscUploadType :: Lens' ProjectsJobsDebugSendCapture (Maybe Text)
pjdscUploadType
  = lens _pjdscUploadType
      (\ s a -> s{_pjdscUploadType = a})

-- | Multipart request metadata.
pjdscPayload :: Lens' ProjectsJobsDebugSendCapture SendDebugCaptureRequest
pjdscPayload
  = lens _pjdscPayload (\ s a -> s{_pjdscPayload = a})

-- | OAuth bearer token.
pjdscBearerToken :: Lens' ProjectsJobsDebugSendCapture (Maybe Text)
pjdscBearerToken
  = lens _pjdscBearerToken
      (\ s a -> s{_pjdscBearerToken = a})

-- | The project id.
pjdscProjectId :: Lens' ProjectsJobsDebugSendCapture Text
pjdscProjectId
  = lens _pjdscProjectId
      (\ s a -> s{_pjdscProjectId = a})

-- | JSONP
pjdscCallback :: Lens' ProjectsJobsDebugSendCapture (Maybe Text)
pjdscCallback
  = lens _pjdscCallback
      (\ s a -> s{_pjdscCallback = a})

instance GoogleRequest ProjectsJobsDebugSendCapture
         where
        type Rs ProjectsJobsDebugSendCapture =
             SendDebugCaptureResponse
        type Scopes ProjectsJobsDebugSendCapture =
             '["https://www.googleapis.com/auth/cloud-platform",
               "https://www.googleapis.com/auth/userinfo.email"]
        requestClient ProjectsJobsDebugSendCapture'{..}
          = go _pjdscProjectId _pjdscJobId _pjdscXgafv
              _pjdscUploadProtocol
              (Just _pjdscPp)
              _pjdscAccessToken
              _pjdscUploadType
              _pjdscBearerToken
              _pjdscCallback
              (Just AltJSON)
              _pjdscPayload
              dataflowService
          where go
                  = buildClient
                      (Proxy :: Proxy ProjectsJobsDebugSendCaptureResource)
                      mempty