1{-# LANGUAGE DataKinds #-}
2{-# LANGUAGE DeriveDataTypeable #-}
3{-# LANGUAGE DeriveGeneric #-}
4{-# LANGUAGE OverloadedStrings #-}
5{-# LANGUAGE RecordWildCards #-}
6{-# LANGUAGE TypeFamilies #-}
7{-# LANGUAGE TypeOperators #-}
9{-# OPTIONS_GHC -fno-warn-unused-imports #-}
10{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
13-- Module : Network.Google.Resource.Taskqueue.Tasks.Update
14-- Copyright : (c) 2015 Brendan Hay
15-- License : Mozilla Public License, v. 2.0.
16-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
17-- Stability : auto-generated
18-- Portability : non-portable (GHC extensions)
20-- | Update tasks that are leased out of a TaskQueue.
22-- /See:/ <https://developers.google.com/appengine/docs/python/taskqueue/rest TaskQueue API Reference> for @TaskqueueTasksUpdate@.
23module Network.Google.Resource.Taskqueue.Tasks.Update
28 -- * Creating a Request
46import Network.Google.AppEngineTaskQueue.Types
47import Network.Google.Prelude
49-- | A resource alias for @TaskqueueTasksUpdate@ which the
50-- 'TasksUpdate'' request conforms to.
51type TasksUpdateResource =
52 Capture "project" Text :>
54 Capture "taskqueue" Text :>
56 Capture "task" Text :>
57 QueryParam "quotaUser" Text :>
58 QueryParam "prettyPrint" Bool :>
59 QueryParam "userIp" Text :>
60 QueryParam "key" Key :>
61 QueryParam "oauth_token" OAuthToken :>
62 QueryParam "newLeaseSeconds" Int32 :>
63 QueryParam "fields" Text :>
64 QueryParam "alt" AltJSON :>
65 ReqBody '[JSON] Task :> Post '[JSON] Task
67-- | Update tasks that are leased out of a TaskQueue.
69-- /See:/ 'tasksUpdate'' smart constructor.
70data TasksUpdate' = TasksUpdate'
71 { _tuTaskqueue :: !Text
72 , _tuQuotaUser :: !(Maybe Text)
73 , _tuPrettyPrint :: !Bool
75 , _tuUserIP :: !(Maybe Text)
76 , _tuKey :: !(Maybe Key)
79 , _tuOAuthToken :: !(Maybe OAuthToken)
80 , _tuNewLeaseSeconds :: !Int32
81 , _tuFields :: !(Maybe Text)
82 } deriving (Eq,Read,Show,Data,Typeable,Generic)
84-- | Creates a value of 'TasksUpdate'' with the minimum fields required to make a request.
86-- Use one of the following lenses to modify other fields as desired:
106-- * 'tuNewLeaseSeconds'
110 :: Text -- ^ 'taskqueue'
111 -> Text -- ^ 'project'
114 -> Int32 -- ^ 'newLeaseSeconds'
116tasksUpdate' pTuTaskqueue_ pTuProject_ pTuTask_ pTuTask_ pTuNewLeaseSeconds_ =
118 { _tuTaskqueue = pTuTaskqueue_
119 , _tuQuotaUser = Nothing
120 , _tuPrettyPrint = True
121 , _tuProject = pTuProject_
122 , _tuUserIP = Nothing
126 , _tuOAuthToken = Nothing
127 , _tuNewLeaseSeconds = pTuNewLeaseSeconds_
128 , _tuFields = Nothing
131tuTaskqueue :: Lens' TasksUpdate' Text
133 = lens _tuTaskqueue (\ s a -> s{_tuTaskqueue = a})
135-- | Available to use for quota purposes for server-side applications. Can be
136-- any arbitrary string assigned to a user, but should not exceed 40
137-- characters. Overrides userIp if both are provided.
138tuQuotaUser :: Lens' TasksUpdate' (Maybe Text)
140 = lens _tuQuotaUser (\ s a -> s{_tuQuotaUser = a})
142-- | Returns response with indentations and line breaks.
143tuPrettyPrint :: Lens' TasksUpdate' Bool
145 = lens _tuPrettyPrint
146 (\ s a -> s{_tuPrettyPrint = a})
148-- | The project under which the queue lies.
149tuProject :: Lens' TasksUpdate' Text
151 = lens _tuProject (\ s a -> s{_tuProject = a})
153-- | IP address of the site where the request originates. Use this if you
154-- want to enforce per-user limits.
155tuUserIP :: Lens' TasksUpdate' (Maybe Text)
156tuUserIP = lens _tuUserIP (\ s a -> s{_tuUserIP = a})
158-- | API key. Your API key identifies your project and provides you with API
159-- access, quota, and reports. Required unless you provide an OAuth 2.0
161tuKey :: Lens' TasksUpdate' (Maybe Key)
162tuKey = lens _tuKey (\ s a -> s{_tuKey = a})
164-- | Multipart request metadata.
165tuTask :: Lens' TasksUpdate' Task
166tuTask = lens _tuTask (\ s a -> s{_tuTask = a})
168tuTask :: Lens' TasksUpdate' Text
169tuTask = lens _tuTask (\ s a -> s{_tuTask = a})
171-- | OAuth 2.0 token for the current user.
172tuOAuthToken :: Lens' TasksUpdate' (Maybe OAuthToken)
174 = lens _tuOAuthToken (\ s a -> s{_tuOAuthToken = a})
176-- | The new lease in seconds.
177tuNewLeaseSeconds :: Lens' TasksUpdate' Int32
179 = lens _tuNewLeaseSeconds
180 (\ s a -> s{_tuNewLeaseSeconds = a})
182-- | Selector specifying which fields to include in a partial response.
183tuFields :: Lens' TasksUpdate' (Maybe Text)
184tuFields = lens _tuFields (\ s a -> s{_tuFields = a})
186instance GoogleAuth TasksUpdate' where
187 authKey = tuKey . _Just
188 authToken = tuOAuthToken . _Just
190instance GoogleRequest TasksUpdate' where
191 type Rs TasksUpdate' = Task
193 = requestWithRoute defReq appEngineTaskQueueURL
194 requestWithRoute r u TasksUpdate'{..}
195 = go _tuTaskqueue _tuQuotaUser (Just _tuPrettyPrint)
201 (Just _tuNewLeaseSeconds)
207 (Proxy :: Proxy TasksUpdateResource)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list