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.Insert
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-- | Insert a new task in a TaskQueue
22-- /See:/ <https://developers.google.com/appengine/docs/python/taskqueue/rest TaskQueue API Reference> for @TaskqueueTasksInsert@.
23module Network.Google.Resource.Taskqueue.Tasks.Insert
28 -- * Creating a Request
44import Network.Google.AppEngineTaskQueue.Types
45import Network.Google.Prelude
47-- | A resource alias for @TaskqueueTasksInsert@ which the
48-- 'TasksInsert'' request conforms to.
49type TasksInsertResource =
50 Capture "project" Text :>
52 Capture "taskqueue" Text :>
54 QueryParam "quotaUser" Text :>
55 QueryParam "prettyPrint" Bool :>
56 QueryParam "userIp" Text :>
57 QueryParam "key" Key :>
58 QueryParam "oauth_token" OAuthToken :>
59 QueryParam "fields" Text :>
60 QueryParam "alt" AltJSON :>
61 ReqBody '[JSON] Task :> Post '[JSON] Task
63-- | Insert a new task in a TaskQueue
65-- /See:/ 'tasksInsert'' smart constructor.
66data TasksInsert' = TasksInsert'
67 { _tiTaskqueue :: !Text
68 , _tiQuotaUser :: !(Maybe Text)
69 , _tiPrettyPrint :: !Bool
71 , _tiUserIP :: !(Maybe Text)
72 , _tiKey :: !(Maybe Key)
74 , _tiOAuthToken :: !(Maybe OAuthToken)
75 , _tiFields :: !(Maybe Text)
76 } deriving (Eq,Read,Show,Data,Typeable,Generic)
78-- | Creates a value of 'TasksInsert'' with the minimum fields required to make a request.
80-- Use one of the following lenses to modify other fields as desired:
100 :: Text -- ^ 'taskqueue'
101 -> Text -- ^ 'project'
104tasksInsert' pTiTaskqueue_ pTiProject_ pTiTask_ =
106 { _tiTaskqueue = pTiTaskqueue_
107 , _tiQuotaUser = Nothing
108 , _tiPrettyPrint = True
109 , _tiProject = pTiProject_
110 , _tiUserIP = Nothing
113 , _tiOAuthToken = Nothing
114 , _tiFields = Nothing
117-- | The taskqueue to insert the task into
118tiTaskqueue :: Lens' TasksInsert' Text
120 = lens _tiTaskqueue (\ s a -> s{_tiTaskqueue = a})
122-- | Available to use for quota purposes for server-side applications. Can be
123-- any arbitrary string assigned to a user, but should not exceed 40
124-- characters. Overrides userIp if both are provided.
125tiQuotaUser :: Lens' TasksInsert' (Maybe Text)
127 = lens _tiQuotaUser (\ s a -> s{_tiQuotaUser = a})
129-- | Returns response with indentations and line breaks.
130tiPrettyPrint :: Lens' TasksInsert' Bool
132 = lens _tiPrettyPrint
133 (\ s a -> s{_tiPrettyPrint = a})
135-- | The project under which the queue lies
136tiProject :: Lens' TasksInsert' Text
138 = lens _tiProject (\ s a -> s{_tiProject = a})
140-- | IP address of the site where the request originates. Use this if you
141-- want to enforce per-user limits.
142tiUserIP :: Lens' TasksInsert' (Maybe Text)
143tiUserIP = lens _tiUserIP (\ s a -> s{_tiUserIP = a})
145-- | API key. Your API key identifies your project and provides you with API
146-- access, quota, and reports. Required unless you provide an OAuth 2.0
148tiKey :: Lens' TasksInsert' (Maybe Key)
149tiKey = lens _tiKey (\ s a -> s{_tiKey = a})
151-- | Multipart request metadata.
152tiTask :: Lens' TasksInsert' Task
153tiTask = lens _tiTask (\ s a -> s{_tiTask = a})
155-- | OAuth 2.0 token for the current user.
156tiOAuthToken :: Lens' TasksInsert' (Maybe OAuthToken)
158 = lens _tiOAuthToken (\ s a -> s{_tiOAuthToken = a})
160-- | Selector specifying which fields to include in a partial response.
161tiFields :: Lens' TasksInsert' (Maybe Text)
162tiFields = lens _tiFields (\ s a -> s{_tiFields = a})
164instance GoogleAuth TasksInsert' where
165 authKey = tiKey . _Just
166 authToken = tiOAuthToken . _Just
168instance GoogleRequest TasksInsert' where
169 type Rs TasksInsert' = Task
171 = requestWithRoute defReq appEngineTaskQueueURL
172 requestWithRoute r u TasksInsert'{..}
173 = go _tiTaskqueue _tiQuotaUser (Just _tiPrettyPrint)
183 (Proxy :: Proxy TasksInsertResource)
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