1{-# LANGUAGE DataKinds #-}
2{-# LANGUAGE DeriveDataTypeable #-}
3{-# LANGUAGE DeriveGeneric #-}
4{-# LANGUAGE FlexibleInstances #-}
5{-# LANGUAGE NoImplicitPrelude #-}
6{-# LANGUAGE OverloadedStrings #-}
7{-# LANGUAGE RecordWildCards #-}
8{-# LANGUAGE TypeFamilies #-}
9{-# LANGUAGE TypeOperators #-}
11{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
12{-# OPTIONS_GHC -fno-warn-unused-binds #-}
13{-# OPTIONS_GHC -fno-warn-unused-imports #-}
16-- Module : Network.Google.Resource.TaskQueue.Tasks.Update
17-- Copyright : (c) 2015 Brendan Hay
18-- License : Mozilla Public License, v. 2.0.
19-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
20-- Stability : auto-generated
21-- Portability : non-portable (GHC extensions)
23-- | Update tasks that are leased out of a TaskQueue.
25-- /See:/ <https://developers.google.com/appengine/docs/python/taskqueue/rest TaskQueue API Reference> for @TaskqueueTasksUpdate@.
26module Network.Google.Resource.TaskQueue.Tasks.Update
31 -- * Creating a Request
49import Network.Google.Prelude
50import Network.Google.TaskQueue.Types
52-- | A resource alias for @TaskqueueTasksUpdate@ method which the
53-- 'TasksUpdate'' request conforms to.
54type TasksUpdateResource =
55 Capture "project" Text :>
57 Capture "taskqueue" Text :>
59 Capture "task" Text :>
60 QueryParam "newLeaseSeconds" Int32 :>
61 QueryParam "quotaUser" Text :>
62 QueryParam "prettyPrint" Bool :>
63 QueryParam "userIp" Text :>
64 QueryParam "fields" Text :>
65 QueryParam "key" AuthKey :>
66 QueryParam "oauth_token" OAuthToken :>
67 QueryParam "alt" AltJSON :>
68 ReqBody '[JSON] Task :> Post '[JSON] Task
70-- | Update tasks that are leased out of a TaskQueue.
72-- /See:/ 'tasksUpdate'' smart constructor.
73data TasksUpdate' = TasksUpdate'
74 { _tuTaskqueue :: !Text
75 , _tuQuotaUser :: !(Maybe Text)
76 , _tuPrettyPrint :: !Bool
78 , _tuUserIP :: !(Maybe Text)
80 , _tuKey :: !(Maybe AuthKey)
82 , _tuOAuthToken :: !(Maybe OAuthToken)
83 , _tuNewLeaseSeconds :: !Int32
84 , _tuFields :: !(Maybe Text)
85 } deriving (Eq,Show,Data,Typeable,Generic)
87-- | Creates a value of 'TasksUpdate'' with the minimum fields required to make a request.
89-- Use one of the following lenses to modify other fields as desired:
109-- * 'tuNewLeaseSeconds'
113 :: Text -- ^ 'taskqueue'
114 -> Text -- ^ 'project'
115 -> Task -- ^ 'payload'
117 -> Int32 -- ^ 'newLeaseSeconds'
119tasksUpdate' pTuTaskqueue_ pTuProject_ pTuPayload_ pTuTask_ pTuNewLeaseSeconds_ =
121 { _tuTaskqueue = pTuTaskqueue_
122 , _tuQuotaUser = Nothing
123 , _tuPrettyPrint = True
124 , _tuProject = pTuProject_
125 , _tuUserIP = Nothing
126 , _tuPayload = pTuPayload_
129 , _tuOAuthToken = Nothing
130 , _tuNewLeaseSeconds = pTuNewLeaseSeconds_
131 , _tuFields = Nothing
134tuTaskqueue :: Lens' TasksUpdate' Text
136 = lens _tuTaskqueue (\ s a -> s{_tuTaskqueue = a})
138-- | Available to use for quota purposes for server-side applications. Can be
139-- any arbitrary string assigned to a user, but should not exceed 40
140-- characters. Overrides userIp if both are provided.
141tuQuotaUser :: Lens' TasksUpdate' (Maybe Text)
143 = lens _tuQuotaUser (\ s a -> s{_tuQuotaUser = a})
145-- | Returns response with indentations and line breaks.
146tuPrettyPrint :: Lens' TasksUpdate' Bool
148 = lens _tuPrettyPrint
149 (\ s a -> s{_tuPrettyPrint = a})
151-- | The project under which the queue lies.
152tuProject :: Lens' TasksUpdate' Text
154 = lens _tuProject (\ s a -> s{_tuProject = a})
156-- | IP address of the site where the request originates. Use this if you
157-- want to enforce per-user limits.
158tuUserIP :: Lens' TasksUpdate' (Maybe Text)
159tuUserIP = lens _tuUserIP (\ s a -> s{_tuUserIP = a})
161-- | Multipart request metadata.
162tuPayload :: Lens' TasksUpdate' Task
164 = lens _tuPayload (\ s a -> s{_tuPayload = a})
166-- | API key. Your API key identifies your project and provides you with API
167-- access, quota, and reports. Required unless you provide an OAuth 2.0
169tuKey :: Lens' TasksUpdate' (Maybe AuthKey)
170tuKey = lens _tuKey (\ s a -> s{_tuKey = a})
172tuTask :: Lens' TasksUpdate' Text
173tuTask = lens _tuTask (\ s a -> s{_tuTask = a})
175-- | OAuth 2.0 token for the current user.
176tuOAuthToken :: Lens' TasksUpdate' (Maybe OAuthToken)
178 = lens _tuOAuthToken (\ s a -> s{_tuOAuthToken = a})
180-- | The new lease in seconds.
181tuNewLeaseSeconds :: Lens' TasksUpdate' Int32
183 = lens _tuNewLeaseSeconds
184 (\ s a -> s{_tuNewLeaseSeconds = a})
186-- | Selector specifying which fields to include in a partial response.
187tuFields :: Lens' TasksUpdate' (Maybe Text)
188tuFields = lens _tuFields (\ s a -> s{_tuFields = a})
190instance GoogleAuth TasksUpdate' where
191 _AuthKey = tuKey . _Just
192 _AuthToken = tuOAuthToken . _Just
194instance GoogleRequest TasksUpdate' where
195 type Rs TasksUpdate' = Task
196 request = requestWith taskQueueRequest
197 requestWith rq TasksUpdate'{..}
198 = go _tuProject _tuTaskqueue _tuTask
199 (Just _tuNewLeaseSeconds)
201 (Just _tuPrettyPrint)
209 = clientBuild (Proxy :: Proxy TasksUpdateResource) rq
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