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.Patch
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. This method supports
23-- /See:/ <https://developers.google.com/appengine/docs/python/taskqueue/rest TaskQueue API Reference> for @TaskqueueTasksPatch@.
24module Network.Google.Resource.Taskqueue.Tasks.Patch
29 -- * Creating a Request
47import Network.Google.AppEngineTaskQueue.Types
48import Network.Google.Prelude
50-- | A resource alias for @TaskqueueTasksPatch@ which the
51-- 'TasksPatch'' request conforms to.
52type TasksPatchResource =
53 Capture "project" Text :>
55 Capture "taskqueue" Text :>
57 Capture "task" Text :>
58 QueryParam "quotaUser" Text :>
59 QueryParam "prettyPrint" Bool :>
60 QueryParam "userIp" Text :>
61 QueryParam "key" Key :>
62 QueryParam "oauth_token" OAuthToken :>
63 QueryParam "newLeaseSeconds" Int32 :>
64 QueryParam "fields" Text :>
65 QueryParam "alt" AltJSON :>
66 ReqBody '[JSON] Task :> Patch '[JSON] Task
68-- | Update tasks that are leased out of a TaskQueue. This method supports
71-- /See:/ 'tasksPatch'' smart constructor.
72data TasksPatch' = TasksPatch'
73 { _tpTaskqueue :: !Text
74 , _tpQuotaUser :: !(Maybe Text)
75 , _tpPrettyPrint :: !Bool
77 , _tpUserIP :: !(Maybe Text)
78 , _tpKey :: !(Maybe Key)
81 , _tpOAuthToken :: !(Maybe OAuthToken)
82 , _tpNewLeaseSeconds :: !Int32
83 , _tpFields :: !(Maybe Text)
84 } deriving (Eq,Read,Show,Data,Typeable,Generic)
86-- | Creates a value of 'TasksPatch'' with the minimum fields required to make a request.
88-- Use one of the following lenses to modify other fields as desired:
108-- * 'tpNewLeaseSeconds'
112 :: Text -- ^ 'taskqueue'
113 -> Text -- ^ 'project'
116 -> Int32 -- ^ 'newLeaseSeconds'
118tasksPatch' pTpTaskqueue_ pTpProject_ pTpTask_ pTpTask_ pTpNewLeaseSeconds_ =
120 { _tpTaskqueue = pTpTaskqueue_
121 , _tpQuotaUser = Nothing
122 , _tpPrettyPrint = True
123 , _tpProject = pTpProject_
124 , _tpUserIP = Nothing
128 , _tpOAuthToken = Nothing
129 , _tpNewLeaseSeconds = pTpNewLeaseSeconds_
130 , _tpFields = Nothing
133tpTaskqueue :: Lens' TasksPatch' Text
135 = lens _tpTaskqueue (\ s a -> s{_tpTaskqueue = a})
137-- | Available to use for quota purposes for server-side applications. Can be
138-- any arbitrary string assigned to a user, but should not exceed 40
139-- characters. Overrides userIp if both are provided.
140tpQuotaUser :: Lens' TasksPatch' (Maybe Text)
142 = lens _tpQuotaUser (\ s a -> s{_tpQuotaUser = a})
144-- | Returns response with indentations and line breaks.
145tpPrettyPrint :: Lens' TasksPatch' Bool
147 = lens _tpPrettyPrint
148 (\ s a -> s{_tpPrettyPrint = a})
150-- | The project under which the queue lies.
151tpProject :: Lens' TasksPatch' Text
153 = lens _tpProject (\ s a -> s{_tpProject = a})
155-- | IP address of the site where the request originates. Use this if you
156-- want to enforce per-user limits.
157tpUserIP :: Lens' TasksPatch' (Maybe Text)
158tpUserIP = lens _tpUserIP (\ s a -> s{_tpUserIP = a})
160-- | API key. Your API key identifies your project and provides you with API
161-- access, quota, and reports. Required unless you provide an OAuth 2.0
163tpKey :: Lens' TasksPatch' (Maybe Key)
164tpKey = lens _tpKey (\ s a -> s{_tpKey = a})
166-- | Multipart request metadata.
167tpTask :: Lens' TasksPatch' Task
168tpTask = lens _tpTask (\ s a -> s{_tpTask = a})
170tpTask :: Lens' TasksPatch' Text
171tpTask = lens _tpTask (\ s a -> s{_tpTask = a})
173-- | OAuth 2.0 token for the current user.
174tpOAuthToken :: Lens' TasksPatch' (Maybe OAuthToken)
176 = lens _tpOAuthToken (\ s a -> s{_tpOAuthToken = a})
178-- | The new lease in seconds.
179tpNewLeaseSeconds :: Lens' TasksPatch' Int32
181 = lens _tpNewLeaseSeconds
182 (\ s a -> s{_tpNewLeaseSeconds = a})
184-- | Selector specifying which fields to include in a partial response.
185tpFields :: Lens' TasksPatch' (Maybe Text)
186tpFields = lens _tpFields (\ s a -> s{_tpFields = a})
188instance GoogleAuth TasksPatch' where
189 authKey = tpKey . _Just
190 authToken = tpOAuthToken . _Just
192instance GoogleRequest TasksPatch' where
193 type Rs TasksPatch' = Task
195 = requestWithRoute defReq appEngineTaskQueueURL
196 requestWithRoute r u TasksPatch'{..}
197 = go _tpTaskqueue _tpQuotaUser (Just _tpPrettyPrint)
203 (Just _tpNewLeaseSeconds)
208 = clientWithRoute (Proxy :: Proxy TasksPatchResource)
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