summaryrefslogtreecommitdiff
path: root/gen/Network/Google/Resource/Dataflow/Projects/Locations/Jobs/Create.hs
blob: def1b41253dcf13074780a77f88b2b7d27831da8 (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
{-# 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.Create
-- 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)
--
-- Creates a Cloud Dataflow job.
--
-- /See:/ <https://cloud.google.com/dataflow Dataflow API Reference> for @dataflow.projects.locations.jobs.create@.
module Network.Google.Resource.Dataflow.Projects.Locations.Jobs.Create
    (
    -- * REST Resource
      ProjectsLocationsJobsCreateResource

    -- * Creating a Request
    , projectsLocationsJobsCreate
    , ProjectsLocationsJobsCreate

    -- * Request Lenses
    , pljcXgafv
    , pljcUploadProtocol
    , pljcLocation
    , pljcAccessToken
    , pljcUploadType
    , pljcPayload
    , pljcView
    , pljcProjectId
    , pljcReplaceJobId
    , pljcCallback
    ) where

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

-- | A resource alias for @dataflow.projects.locations.jobs.create@ method which the
-- 'ProjectsLocationsJobsCreate' request conforms to.
type ProjectsLocationsJobsCreateResource =
     "v1b3" :>
       "projects" :>
         Capture "projectId" Text :>
           "locations" :>
             Capture "location" Text :>
               "jobs" :>
                 QueryParam "$.xgafv" Xgafv :>
                   QueryParam "upload_protocol" Text :>
                     QueryParam "access_token" Text :>
                       QueryParam "uploadType" Text :>
                         QueryParam "view" Text :>
                           QueryParam "replaceJobId" Text :>
                             QueryParam "callback" Text :>
                               QueryParam "alt" AltJSON :>
                                 ReqBody '[JSON] Job :> Post '[JSON] Job

-- | Creates a Cloud Dataflow job.
--
-- /See:/ 'projectsLocationsJobsCreate' smart constructor.
data ProjectsLocationsJobsCreate = ProjectsLocationsJobsCreate'
    { _pljcXgafv          :: !(Maybe Xgafv)
    , _pljcUploadProtocol :: !(Maybe Text)
    , _pljcLocation       :: !Text
    , _pljcAccessToken    :: !(Maybe Text)
    , _pljcUploadType     :: !(Maybe Text)
    , _pljcPayload        :: !Job
    , _pljcView           :: !(Maybe Text)
    , _pljcProjectId      :: !Text
    , _pljcReplaceJobId   :: !(Maybe Text)
    , _pljcCallback       :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'ProjectsLocationsJobsCreate' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'pljcXgafv'
--
-- * 'pljcUploadProtocol'
--
-- * 'pljcLocation'
--
-- * 'pljcAccessToken'
--
-- * 'pljcUploadType'
--
-- * 'pljcPayload'
--
-- * 'pljcView'
--
-- * 'pljcProjectId'
--
-- * 'pljcReplaceJobId'
--
-- * 'pljcCallback'
projectsLocationsJobsCreate
    :: Text -- ^ 'pljcLocation'
    -> Job -- ^ 'pljcPayload'
    -> Text -- ^ 'pljcProjectId'
    -> ProjectsLocationsJobsCreate
projectsLocationsJobsCreate pPljcLocation_ pPljcPayload_ pPljcProjectId_ =
    ProjectsLocationsJobsCreate'
    { _pljcXgafv = Nothing
    , _pljcUploadProtocol = Nothing
    , _pljcLocation = pPljcLocation_
    , _pljcAccessToken = Nothing
    , _pljcUploadType = Nothing
    , _pljcPayload = pPljcPayload_
    , _pljcView = Nothing
    , _pljcProjectId = pPljcProjectId_
    , _pljcReplaceJobId = Nothing
    , _pljcCallback = Nothing
    }

-- | V1 error format.
pljcXgafv :: Lens' ProjectsLocationsJobsCreate (Maybe Xgafv)
pljcXgafv
  = lens _pljcXgafv (\ s a -> s{_pljcXgafv = a})

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

-- | The location that contains this job.
pljcLocation :: Lens' ProjectsLocationsJobsCreate Text
pljcLocation
  = lens _pljcLocation (\ s a -> s{_pljcLocation = a})

-- | OAuth access token.
pljcAccessToken :: Lens' ProjectsLocationsJobsCreate (Maybe Text)
pljcAccessToken
  = lens _pljcAccessToken
      (\ s a -> s{_pljcAccessToken = a})

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

-- | Multipart request metadata.
pljcPayload :: Lens' ProjectsLocationsJobsCreate Job
pljcPayload
  = lens _pljcPayload (\ s a -> s{_pljcPayload = a})

-- | The level of information requested in response.
pljcView :: Lens' ProjectsLocationsJobsCreate (Maybe Text)
pljcView = lens _pljcView (\ s a -> s{_pljcView = a})

-- | The ID of the Cloud Platform project that the job belongs to.
pljcProjectId :: Lens' ProjectsLocationsJobsCreate Text
pljcProjectId
  = lens _pljcProjectId
      (\ s a -> s{_pljcProjectId = a})

-- | Deprecated. This field is now in the Job message.
pljcReplaceJobId :: Lens' ProjectsLocationsJobsCreate (Maybe Text)
pljcReplaceJobId
  = lens _pljcReplaceJobId
      (\ s a -> s{_pljcReplaceJobId = a})

-- | JSONP
pljcCallback :: Lens' ProjectsLocationsJobsCreate (Maybe Text)
pljcCallback
  = lens _pljcCallback (\ s a -> s{_pljcCallback = a})

instance GoogleRequest ProjectsLocationsJobsCreate
         where
        type Rs ProjectsLocationsJobsCreate = Job
        type Scopes ProjectsLocationsJobsCreate =
             '["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 ProjectsLocationsJobsCreate'{..}
          = go _pljcProjectId _pljcLocation _pljcXgafv
              _pljcUploadProtocol
              _pljcAccessToken
              _pljcUploadType
              _pljcView
              _pljcReplaceJobId
              _pljcCallback
              (Just AltJSON)
              _pljcPayload
              dataflowService
          where go
                  = buildClient
                      (Proxy :: Proxy ProjectsLocationsJobsCreateResource)
                      mempty