summaryrefslogtreecommitdiff
path: root/gen/Network/Google/Resource/Dataflow/Projects/Jobs/Messages/List.hs
blob: af5d54a5f6229c141e83977c8d1ea50947aac477 (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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
{-# 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.Messages.List
-- 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)
--
-- Request the job status.
--
-- /See:/ <https://cloud.google.com/dataflow Dataflow API Reference> for @dataflow.projects.jobs.messages.list@.
module Network.Google.Resource.Dataflow.Projects.Jobs.Messages.List
    (
    -- * REST Resource
      ProjectsJobsMessagesListResource

    -- * Creating a Request
    , projectsJobsMessagesList
    , ProjectsJobsMessagesList

    -- * Request Lenses
    , pjmlXgafv
    , pjmlJobId
    , pjmlUploadProtocol
    , pjmlLocation
    , pjmlStartTime
    , pjmlAccessToken
    , pjmlUploadType
    , pjmlEndTime
    , pjmlMinimumImportance
    , pjmlPageToken
    , pjmlProjectId
    , pjmlPageSize
    , pjmlCallback
    ) where

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

-- | A resource alias for @dataflow.projects.jobs.messages.list@ method which the
-- 'ProjectsJobsMessagesList' request conforms to.
type ProjectsJobsMessagesListResource =
     "v1b3" :>
       "projects" :>
         Capture "projectId" Text :>
           "jobs" :>
             Capture "jobId" Text :>
               "messages" :>
                 QueryParam "$.xgafv" Xgafv :>
                   QueryParam "upload_protocol" Text :>
                     QueryParam "location" Text :>
                       QueryParam "startTime" DateTime' :>
                         QueryParam "access_token" Text :>
                           QueryParam "uploadType" Text :>
                             QueryParam "endTime" DateTime' :>
                               QueryParam "minimumImportance" Text :>
                                 QueryParam "pageToken" Text :>
                                   QueryParam "pageSize" (Textual Int32) :>
                                     QueryParam "callback" Text :>
                                       QueryParam "alt" AltJSON :>
                                         Get '[JSON] ListJobMessagesResponse

-- | Request the job status.
--
-- /See:/ 'projectsJobsMessagesList' smart constructor.
data ProjectsJobsMessagesList = ProjectsJobsMessagesList'
    { _pjmlXgafv             :: !(Maybe Xgafv)
    , _pjmlJobId             :: !Text
    , _pjmlUploadProtocol    :: !(Maybe Text)
    , _pjmlLocation          :: !(Maybe Text)
    , _pjmlStartTime         :: !(Maybe DateTime')
    , _pjmlAccessToken       :: !(Maybe Text)
    , _pjmlUploadType        :: !(Maybe Text)
    , _pjmlEndTime           :: !(Maybe DateTime')
    , _pjmlMinimumImportance :: !(Maybe Text)
    , _pjmlPageToken         :: !(Maybe Text)
    , _pjmlProjectId         :: !Text
    , _pjmlPageSize          :: !(Maybe (Textual Int32))
    , _pjmlCallback          :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'ProjectsJobsMessagesList' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'pjmlXgafv'
--
-- * 'pjmlJobId'
--
-- * 'pjmlUploadProtocol'
--
-- * 'pjmlLocation'
--
-- * 'pjmlStartTime'
--
-- * 'pjmlAccessToken'
--
-- * 'pjmlUploadType'
--
-- * 'pjmlEndTime'
--
-- * 'pjmlMinimumImportance'
--
-- * 'pjmlPageToken'
--
-- * 'pjmlProjectId'
--
-- * 'pjmlPageSize'
--
-- * 'pjmlCallback'
projectsJobsMessagesList
    :: Text -- ^ 'pjmlJobId'
    -> Text -- ^ 'pjmlProjectId'
    -> ProjectsJobsMessagesList
projectsJobsMessagesList pPjmlJobId_ pPjmlProjectId_ =
    ProjectsJobsMessagesList'
    { _pjmlXgafv = Nothing
    , _pjmlJobId = pPjmlJobId_
    , _pjmlUploadProtocol = Nothing
    , _pjmlLocation = Nothing
    , _pjmlStartTime = Nothing
    , _pjmlAccessToken = Nothing
    , _pjmlUploadType = Nothing
    , _pjmlEndTime = Nothing
    , _pjmlMinimumImportance = Nothing
    , _pjmlPageToken = Nothing
    , _pjmlProjectId = pPjmlProjectId_
    , _pjmlPageSize = Nothing
    , _pjmlCallback = Nothing
    }

-- | V1 error format.
pjmlXgafv :: Lens' ProjectsJobsMessagesList (Maybe Xgafv)
pjmlXgafv
  = lens _pjmlXgafv (\ s a -> s{_pjmlXgafv = a})

-- | The job to get messages about.
pjmlJobId :: Lens' ProjectsJobsMessagesList Text
pjmlJobId
  = lens _pjmlJobId (\ s a -> s{_pjmlJobId = a})

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

-- | The location which contains the job specified by job_id.
pjmlLocation :: Lens' ProjectsJobsMessagesList (Maybe Text)
pjmlLocation
  = lens _pjmlLocation (\ s a -> s{_pjmlLocation = a})

-- | If specified, return only messages with timestamps >= start_time. The
-- default is the job creation time (i.e. beginning of messages).
pjmlStartTime :: Lens' ProjectsJobsMessagesList (Maybe UTCTime)
pjmlStartTime
  = lens _pjmlStartTime
      (\ s a -> s{_pjmlStartTime = a})
      . mapping _DateTime

-- | OAuth access token.
pjmlAccessToken :: Lens' ProjectsJobsMessagesList (Maybe Text)
pjmlAccessToken
  = lens _pjmlAccessToken
      (\ s a -> s{_pjmlAccessToken = a})

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

-- | Return only messages with timestamps \< end_time. The default is now
-- (i.e. return up to the latest messages available).
pjmlEndTime :: Lens' ProjectsJobsMessagesList (Maybe UTCTime)
pjmlEndTime
  = lens _pjmlEndTime (\ s a -> s{_pjmlEndTime = a}) .
      mapping _DateTime

-- | Filter to only get messages with importance >= level
pjmlMinimumImportance :: Lens' ProjectsJobsMessagesList (Maybe Text)
pjmlMinimumImportance
  = lens _pjmlMinimumImportance
      (\ s a -> s{_pjmlMinimumImportance = a})

-- | If supplied, this should be the value of next_page_token returned by an
-- earlier call. This will cause the next page of results to be returned.
pjmlPageToken :: Lens' ProjectsJobsMessagesList (Maybe Text)
pjmlPageToken
  = lens _pjmlPageToken
      (\ s a -> s{_pjmlPageToken = a})

-- | A project id.
pjmlProjectId :: Lens' ProjectsJobsMessagesList Text
pjmlProjectId
  = lens _pjmlProjectId
      (\ s a -> s{_pjmlProjectId = a})

-- | If specified, determines the maximum number of messages to return. If
-- unspecified, the service may choose an appropriate default, or may
-- return an arbitrarily large number of results.
pjmlPageSize :: Lens' ProjectsJobsMessagesList (Maybe Int32)
pjmlPageSize
  = lens _pjmlPageSize (\ s a -> s{_pjmlPageSize = a})
      . mapping _Coerce

-- | JSONP
pjmlCallback :: Lens' ProjectsJobsMessagesList (Maybe Text)
pjmlCallback
  = lens _pjmlCallback (\ s a -> s{_pjmlCallback = a})

instance GoogleRequest ProjectsJobsMessagesList where
        type Rs ProjectsJobsMessagesList =
             ListJobMessagesResponse
        type Scopes ProjectsJobsMessagesList =
             '["https://www.googleapis.com/auth/cloud-platform",
               "https://www.googleapis.com/auth/compute",
               "https://www.googleapis.com/auth/compute.readonly",
               "https://www.googleapis.com/auth/userinfo.email"]
        requestClient ProjectsJobsMessagesList'{..}
          = go _pjmlProjectId _pjmlJobId _pjmlXgafv
              _pjmlUploadProtocol
              _pjmlLocation
              _pjmlStartTime
              _pjmlAccessToken
              _pjmlUploadType
              _pjmlEndTime
              _pjmlMinimumImportance
              _pjmlPageToken
              _pjmlPageSize
              _pjmlCallback
              (Just AltJSON)
              dataflowService
          where go
                  = buildClient
                      (Proxy :: Proxy ProjectsJobsMessagesListResource)
                      mempty