summaryrefslogtreecommitdiff
path: root/gen/Network/Google/Resource/Dataflow/Projects/Jobs/Debug/GetConfig.hs
blob: 61dd5370a68c9ba40aa6fc61e74322b2bc8b0f0f (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.GetConfig
-- 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)
--
-- Get encoded debug configuration for component. Not cacheable.
--
-- /See:/ <https://cloud.google.com/dataflow Google Dataflow API Reference> for @dataflow.projects.jobs.debug.getConfig@.
module Network.Google.Resource.Dataflow.Projects.Jobs.Debug.GetConfig
    (
    -- * REST Resource
      ProjectsJobsDebugGetConfigResource

    -- * Creating a Request
    , projectsJobsDebugGetConfig
    , ProjectsJobsDebugGetConfig

    -- * Request Lenses
    , pjdgcXgafv
    , pjdgcJobId
    , pjdgcUploadProtocol
    , pjdgcPp
    , pjdgcAccessToken
    , pjdgcUploadType
    , pjdgcPayload
    , pjdgcBearerToken
    , pjdgcProjectId
    , pjdgcCallback
    ) where

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

-- | A resource alias for @dataflow.projects.jobs.debug.getConfig@ method which the
-- 'ProjectsJobsDebugGetConfig' request conforms to.
type ProjectsJobsDebugGetConfigResource =
     "v1b3" :>
       "projects" :>
         Capture "projectId" Text :>
           "jobs" :>
             Capture "jobId" Text :>
               "debug" :>
                 "getConfig" :>
                   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] GetDebugConfigRequest :>
                                     Post '[JSON] GetDebugConfigResponse

-- | Get encoded debug configuration for component. Not cacheable.
--
-- /See:/ 'projectsJobsDebugGetConfig' smart constructor.
data ProjectsJobsDebugGetConfig = ProjectsJobsDebugGetConfig'
    { _pjdgcXgafv          :: !(Maybe Text)
    , _pjdgcJobId          :: !Text
    , _pjdgcUploadProtocol :: !(Maybe Text)
    , _pjdgcPp             :: !Bool
    , _pjdgcAccessToken    :: !(Maybe Text)
    , _pjdgcUploadType     :: !(Maybe Text)
    , _pjdgcPayload        :: !GetDebugConfigRequest
    , _pjdgcBearerToken    :: !(Maybe Text)
    , _pjdgcProjectId      :: !Text
    , _pjdgcCallback       :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'ProjectsJobsDebugGetConfig' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'pjdgcXgafv'
--
-- * 'pjdgcJobId'
--
-- * 'pjdgcUploadProtocol'
--
-- * 'pjdgcPp'
--
-- * 'pjdgcAccessToken'
--
-- * 'pjdgcUploadType'
--
-- * 'pjdgcPayload'
--
-- * 'pjdgcBearerToken'
--
-- * 'pjdgcProjectId'
--
-- * 'pjdgcCallback'
projectsJobsDebugGetConfig
    :: Text -- ^ 'pjdgcJobId'
    -> GetDebugConfigRequest -- ^ 'pjdgcPayload'
    -> Text -- ^ 'pjdgcProjectId'
    -> ProjectsJobsDebugGetConfig
projectsJobsDebugGetConfig pPjdgcJobId_ pPjdgcPayload_ pPjdgcProjectId_ =
    ProjectsJobsDebugGetConfig'
    { _pjdgcXgafv = Nothing
    , _pjdgcJobId = pPjdgcJobId_
    , _pjdgcUploadProtocol = Nothing
    , _pjdgcPp = True
    , _pjdgcAccessToken = Nothing
    , _pjdgcUploadType = Nothing
    , _pjdgcPayload = pPjdgcPayload_
    , _pjdgcBearerToken = Nothing
    , _pjdgcProjectId = pPjdgcProjectId_
    , _pjdgcCallback = Nothing
    }

-- | V1 error format.
pjdgcXgafv :: Lens' ProjectsJobsDebugGetConfig (Maybe Text)
pjdgcXgafv
  = lens _pjdgcXgafv (\ s a -> s{_pjdgcXgafv = a})

-- | The job id.
pjdgcJobId :: Lens' ProjectsJobsDebugGetConfig Text
pjdgcJobId
  = lens _pjdgcJobId (\ s a -> s{_pjdgcJobId = a})

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

-- | Pretty-print response.
pjdgcPp :: Lens' ProjectsJobsDebugGetConfig Bool
pjdgcPp = lens _pjdgcPp (\ s a -> s{_pjdgcPp = a})

-- | OAuth access token.
pjdgcAccessToken :: Lens' ProjectsJobsDebugGetConfig (Maybe Text)
pjdgcAccessToken
  = lens _pjdgcAccessToken
      (\ s a -> s{_pjdgcAccessToken = a})

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

-- | Multipart request metadata.
pjdgcPayload :: Lens' ProjectsJobsDebugGetConfig GetDebugConfigRequest
pjdgcPayload
  = lens _pjdgcPayload (\ s a -> s{_pjdgcPayload = a})

-- | OAuth bearer token.
pjdgcBearerToken :: Lens' ProjectsJobsDebugGetConfig (Maybe Text)
pjdgcBearerToken
  = lens _pjdgcBearerToken
      (\ s a -> s{_pjdgcBearerToken = a})

-- | The project id.
pjdgcProjectId :: Lens' ProjectsJobsDebugGetConfig Text
pjdgcProjectId
  = lens _pjdgcProjectId
      (\ s a -> s{_pjdgcProjectId = a})

-- | JSONP
pjdgcCallback :: Lens' ProjectsJobsDebugGetConfig (Maybe Text)
pjdgcCallback
  = lens _pjdgcCallback
      (\ s a -> s{_pjdgcCallback = a})

instance GoogleRequest ProjectsJobsDebugGetConfig
         where
        type Rs ProjectsJobsDebugGetConfig =
             GetDebugConfigResponse
        type Scopes ProjectsJobsDebugGetConfig =
             '["https://www.googleapis.com/auth/cloud-platform",
               "https://www.googleapis.com/auth/userinfo.email"]
        requestClient ProjectsJobsDebugGetConfig'{..}
          = go _pjdgcProjectId _pjdgcJobId _pjdgcXgafv
              _pjdgcUploadProtocol
              (Just _pjdgcPp)
              _pjdgcAccessToken
              _pjdgcUploadType
              _pjdgcBearerToken
              _pjdgcCallback
              (Just AltJSON)
              _pjdgcPayload
              dataflowService
          where go
                  = buildClient
                      (Proxy :: Proxy ProjectsJobsDebugGetConfigResource)
                      mempty