1{-# LANGUAGE DataKinds #-}
2{-# LANGUAGE DeriveDataTypeable #-}
3{-# LANGUAGE DeriveGeneric #-}
4{-# LANGUAGE RecordWildCards #-}
5{-# LANGUAGE TypeFamilies #-}
6{-# LANGUAGE TypeOperators #-}
8{-# OPTIONS_GHC -fno-warn-unused-imports #-}
9{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
12-- Module : Network.Google.API.Taskqueue.Tasks.Patch
13-- Copyright : (c) 2015 Brendan Hay
14-- License : Mozilla Public License, v. 2.0.
15-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
16-- Stability : auto-generated
17-- Portability : non-portable (GHC extensions)
19-- | Update tasks that are leased out of a TaskQueue. This method supports
22-- /See:/ <https://developers.google.com/appengine/docs/python/taskqueue/rest TaskQueue API Reference> for @taskqueue.tasks.patch@.
23module Network.Google.API.Taskqueue.Tasks.Patch
28 -- * Creating a Request
46import Network.Google.AppEngine.TaskQueue.Types
47import Network.Google.Prelude
49-- | A resource alias for taskqueue.tasks.patch which the
50-- 'TasksPatch'' request conforms to.
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" Text :>
61 QueryParam "oauth_token" Text :>
62 QueryParam "newLeaseSeconds" Int32 :>
63 QueryParam "fields" Text :>
64 QueryParam "alt" Alt :> Patch '[JSON] Task
66-- | Update tasks that are leased out of a TaskQueue. This method supports
69-- /See:/ 'tasksPatch'' smart constructor.
70data TasksPatch' = TasksPatch'
71 { _tpTaskqueue :: !Text
72 , _tpQuotaUser :: !(Maybe Text)
73 , _tpPrettyPrint :: !Bool
75 , _tpUserIp :: !(Maybe Text)
76 , _tpKey :: !(Maybe Text)
78 , _tpOauthToken :: !(Maybe Text)
79 , _tpNewLeaseSeconds :: !Int32
80 , _tpFields :: !(Maybe Text)
82 } deriving (Eq,Read,Show,Data,Typeable,Generic)
84-- | Creates a value of 'TasksPatch'' with the minimum fields required to make a request.
86-- Use one of the following lenses to modify other fields as desired:
104-- * 'tpNewLeaseSeconds'
110 :: Text -- ^ 'taskqueue'
111 -> Text -- ^ 'project'
113 -> Int32 -- ^ 'newLeaseSeconds'
115tasksPatch' pTpTaskqueue_ pTpProject_ pTpTask_ pTpNewLeaseSeconds_ =
117 { _tpTaskqueue = pTpTaskqueue_
118 , _tpQuotaUser = Nothing
119 , _tpPrettyPrint = True
120 , _tpProject = pTpProject_
121 , _tpUserIp = Nothing
124 , _tpOauthToken = Nothing
125 , _tpNewLeaseSeconds = pTpNewLeaseSeconds_
126 , _tpFields = Nothing
130tpTaskqueue :: Lens' TasksPatch' Text
132 = lens _tpTaskqueue (\ s a -> s{_tpTaskqueue = a})
134-- | Available to use for quota purposes for server-side applications. Can be
135-- any arbitrary string assigned to a user, but should not exceed 40
136-- characters. Overrides userIp if both are provided.
137tpQuotaUser :: Lens' TasksPatch' (Maybe Text)
139 = lens _tpQuotaUser (\ s a -> s{_tpQuotaUser = a})
141-- | Returns response with indentations and line breaks.
142tpPrettyPrint :: Lens' TasksPatch' Bool
144 = lens _tpPrettyPrint
145 (\ s a -> s{_tpPrettyPrint = a})
147-- | The project under which the queue lies.
148tpProject :: Lens' TasksPatch' Text
150 = lens _tpProject (\ s a -> s{_tpProject = a})
152-- | IP address of the site where the request originates. Use this if you
153-- want to enforce per-user limits.
154tpUserIp :: Lens' TasksPatch' (Maybe Text)
155tpUserIp = lens _tpUserIp (\ s a -> s{_tpUserIp = a})
157-- | API key. Your API key identifies your project and provides you with API
158-- access, quota, and reports. Required unless you provide an OAuth 2.0
160tpKey :: Lens' TasksPatch' (Maybe Text)
161tpKey = lens _tpKey (\ s a -> s{_tpKey = a})
163tpTask :: Lens' TasksPatch' Text
164tpTask = lens _tpTask (\ s a -> s{_tpTask = a})
166-- | OAuth 2.0 token for the current user.
167tpOauthToken :: Lens' TasksPatch' (Maybe Text)
169 = lens _tpOauthToken (\ s a -> s{_tpOauthToken = a})
171-- | The new lease in seconds.
172tpNewLeaseSeconds :: Lens' TasksPatch' Int32
174 = lens _tpNewLeaseSeconds
175 (\ s a -> s{_tpNewLeaseSeconds = a})
177-- | Selector specifying which fields to include in a partial response.
178tpFields :: Lens' TasksPatch' (Maybe Text)
179tpFields = lens _tpFields (\ s a -> s{_tpFields = a})
181-- | Data format for the response.
182tpAlt :: Lens' TasksPatch' Alt
183tpAlt = lens _tpAlt (\ s a -> s{_tpAlt = a})
185instance GoogleRequest TasksPatch' where
186 type Rs TasksPatch' = Task
188 = requestWithRoute defReq appEngineTaskQueueURL
189 requestWithRoute r u TasksPatch'{..}
190 = go _tpTaskqueue _tpQuotaUser (Just _tpPrettyPrint)
196 (Just _tpNewLeaseSeconds)
200 = clientWithRoute (Proxy :: Proxy TasksPatchAPI) r u
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