summaryrefslogtreecommitdiff
path: root/gen/Network/Google/Resource/Dataflow/Projects/Locations/Jobs/WorkItems/Lease.hs
blob: 914d41424945bcce4c0ab915c1fbf4ace3bf1181 (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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
{-# 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.Locations.Jobs.WorkItems.Lease
-- 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)
--
-- Leases a dataflow WorkItem to run.
--
-- /See:/ <https://cloud.google.com/dataflow Google Dataflow API Reference> for @dataflow.projects.locations.jobs.workItems.lease@.
module Network.Google.Resource.Dataflow.Projects.Locations.Jobs.WorkItems.Lease
    (
    -- * REST Resource
      ProjectsLocationsJobsWorkItemsLeaseResource

    -- * Creating a Request
    , projectsLocationsJobsWorkItemsLease
    , ProjectsLocationsJobsWorkItemsLease

    -- * Request Lenses
    , pljwilXgafv
    , pljwilJobId
    , pljwilUploadProtocol
    , pljwilLocation
    , pljwilPp
    , pljwilAccessToken
    , pljwilUploadType
    , pljwilPayload
    , pljwilBearerToken
    , pljwilProjectId
    , pljwilCallback
    ) where

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

-- | A resource alias for @dataflow.projects.locations.jobs.workItems.lease@ method which the
-- 'ProjectsLocationsJobsWorkItemsLease' request conforms to.
type ProjectsLocationsJobsWorkItemsLeaseResource =
     "v1b3" :>
       "projects" :>
         Capture "projectId" Text :>
           "locations" :>
             Capture "location" Text :>
               "jobs" :>
                 Capture "jobId" Text :>
                   "workItems:lease" :>
                     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] LeaseWorkItemRequest :>
                                       Post '[JSON] LeaseWorkItemResponse

-- | Leases a dataflow WorkItem to run.
--
-- /See:/ 'projectsLocationsJobsWorkItemsLease' smart constructor.
data ProjectsLocationsJobsWorkItemsLease = ProjectsLocationsJobsWorkItemsLease'
    { _pljwilXgafv          :: !(Maybe Text)
    , _pljwilJobId          :: !Text
    , _pljwilUploadProtocol :: !(Maybe Text)
    , _pljwilLocation       :: !Text
    , _pljwilPp             :: !Bool
    , _pljwilAccessToken    :: !(Maybe Text)
    , _pljwilUploadType     :: !(Maybe Text)
    , _pljwilPayload        :: !LeaseWorkItemRequest
    , _pljwilBearerToken    :: !(Maybe Text)
    , _pljwilProjectId      :: !Text
    , _pljwilCallback       :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'ProjectsLocationsJobsWorkItemsLease' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'pljwilXgafv'
--
-- * 'pljwilJobId'
--
-- * 'pljwilUploadProtocol'
--
-- * 'pljwilLocation'
--
-- * 'pljwilPp'
--
-- * 'pljwilAccessToken'
--
-- * 'pljwilUploadType'
--
-- * 'pljwilPayload'
--
-- * 'pljwilBearerToken'
--
-- * 'pljwilProjectId'
--
-- * 'pljwilCallback'
projectsLocationsJobsWorkItemsLease
    :: Text -- ^ 'pljwilJobId'
    -> Text -- ^ 'pljwilLocation'
    -> LeaseWorkItemRequest -- ^ 'pljwilPayload'
    -> Text -- ^ 'pljwilProjectId'
    -> ProjectsLocationsJobsWorkItemsLease
projectsLocationsJobsWorkItemsLease pPljwilJobId_ pPljwilLocation_ pPljwilPayload_ pPljwilProjectId_ =
    ProjectsLocationsJobsWorkItemsLease'
    { _pljwilXgafv = Nothing
    , _pljwilJobId = pPljwilJobId_
    , _pljwilUploadProtocol = Nothing
    , _pljwilLocation = pPljwilLocation_
    , _pljwilPp = True
    , _pljwilAccessToken = Nothing
    , _pljwilUploadType = Nothing
    , _pljwilPayload = pPljwilPayload_
    , _pljwilBearerToken = Nothing
    , _pljwilProjectId = pPljwilProjectId_
    , _pljwilCallback = Nothing
    }

-- | V1 error format.
pljwilXgafv :: Lens' ProjectsLocationsJobsWorkItemsLease (Maybe Text)
pljwilXgafv
  = lens _pljwilXgafv (\ s a -> s{_pljwilXgafv = a})

-- | Identifies the workflow job this worker belongs to.
pljwilJobId :: Lens' ProjectsLocationsJobsWorkItemsLease Text
pljwilJobId
  = lens _pljwilJobId (\ s a -> s{_pljwilJobId = a})

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

-- | The location which contains the WorkItem\'s job.
pljwilLocation :: Lens' ProjectsLocationsJobsWorkItemsLease Text
pljwilLocation
  = lens _pljwilLocation
      (\ s a -> s{_pljwilLocation = a})

-- | Pretty-print response.
pljwilPp :: Lens' ProjectsLocationsJobsWorkItemsLease Bool
pljwilPp = lens _pljwilPp (\ s a -> s{_pljwilPp = a})

-- | OAuth access token.
pljwilAccessToken :: Lens' ProjectsLocationsJobsWorkItemsLease (Maybe Text)
pljwilAccessToken
  = lens _pljwilAccessToken
      (\ s a -> s{_pljwilAccessToken = a})

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

-- | Multipart request metadata.
pljwilPayload :: Lens' ProjectsLocationsJobsWorkItemsLease LeaseWorkItemRequest
pljwilPayload
  = lens _pljwilPayload
      (\ s a -> s{_pljwilPayload = a})

-- | OAuth bearer token.
pljwilBearerToken :: Lens' ProjectsLocationsJobsWorkItemsLease (Maybe Text)
pljwilBearerToken
  = lens _pljwilBearerToken
      (\ s a -> s{_pljwilBearerToken = a})

-- | Identifies the project this worker belongs to.
pljwilProjectId :: Lens' ProjectsLocationsJobsWorkItemsLease Text
pljwilProjectId
  = lens _pljwilProjectId
      (\ s a -> s{_pljwilProjectId = a})

-- | JSONP
pljwilCallback :: Lens' ProjectsLocationsJobsWorkItemsLease (Maybe Text)
pljwilCallback
  = lens _pljwilCallback
      (\ s a -> s{_pljwilCallback = a})

instance GoogleRequest
         ProjectsLocationsJobsWorkItemsLease where
        type Rs ProjectsLocationsJobsWorkItemsLease =
             LeaseWorkItemResponse
        type Scopes ProjectsLocationsJobsWorkItemsLease =
             '["https://www.googleapis.com/auth/cloud-platform",
               "https://www.googleapis.com/auth/userinfo.email"]
        requestClient
          ProjectsLocationsJobsWorkItemsLease'{..}
          = go _pljwilProjectId _pljwilLocation _pljwilJobId
              _pljwilXgafv
              _pljwilUploadProtocol
              (Just _pljwilPp)
              _pljwilAccessToken
              _pljwilUploadType
              _pljwilBearerToken
              _pljwilCallback
              (Just AltJSON)
              _pljwilPayload
              dataflowService
          where go
                  = buildClient
                      (Proxy ::
                         Proxy ProjectsLocationsJobsWorkItemsLeaseResource)
                      mempty