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.Insert
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-- | Insert a new task in a TaskQueue
25-- /See:/ <https://developers.google.com/appengine/docs/python/taskqueue/rest TaskQueue API Reference> for @TaskqueueTasksInsert@.
26module Network.Google.Resource.TaskQueue.Tasks.Insert
31 -- * Creating a Request
47import Network.Google.Prelude
48import Network.Google.TaskQueue.Types
50-- | A resource alias for @TaskqueueTasksInsert@ method which the
51-- 'TasksInsert'' request conforms to.
52type TasksInsertResource =
53 Capture "project" Text :>
55 Capture "taskqueue" Text :>
57 QueryParam "quotaUser" Text :>
58 QueryParam "prettyPrint" Bool :>
59 QueryParam "userIp" Text :>
60 QueryParam "fields" Text :>
61 QueryParam "key" AuthKey :>
62 QueryParam "oauth_token" OAuthToken :>
63 QueryParam "alt" AltJSON :>
64 ReqBody '[JSON] Task :> Post '[JSON] Task
66-- | Insert a new task in a TaskQueue
68-- /See:/ 'tasksInsert'' smart constructor.
69data TasksInsert' = TasksInsert'
70 { _tiTaskqueue :: !Text
71 , _tiQuotaUser :: !(Maybe Text)
72 , _tiPrettyPrint :: !Bool
74 , _tiUserIP :: !(Maybe Text)
76 , _tiKey :: !(Maybe AuthKey)
77 , _tiOAuthToken :: !(Maybe OAuthToken)
78 , _tiFields :: !(Maybe Text)
79 } deriving (Eq,Show,Data,Typeable,Generic)
81-- | Creates a value of 'TasksInsert'' with the minimum fields required to make a request.
83-- Use one of the following lenses to modify other fields as desired:
103 :: Text -- ^ 'taskqueue'
104 -> Text -- ^ 'project'
105 -> Task -- ^ 'payload'
107tasksInsert' pTiTaskqueue_ pTiProject_ pTiPayload_ =
109 { _tiTaskqueue = pTiTaskqueue_
110 , _tiQuotaUser = Nothing
111 , _tiPrettyPrint = True
112 , _tiProject = pTiProject_
113 , _tiUserIP = Nothing
114 , _tiPayload = pTiPayload_
116 , _tiOAuthToken = Nothing
117 , _tiFields = Nothing
120-- | The taskqueue to insert the task into
121tiTaskqueue :: Lens' TasksInsert' Text
123 = lens _tiTaskqueue (\ s a -> s{_tiTaskqueue = a})
125-- | Available to use for quota purposes for server-side applications. Can be
126-- any arbitrary string assigned to a user, but should not exceed 40
127-- characters. Overrides userIp if both are provided.
128tiQuotaUser :: Lens' TasksInsert' (Maybe Text)
130 = lens _tiQuotaUser (\ s a -> s{_tiQuotaUser = a})
132-- | Returns response with indentations and line breaks.
133tiPrettyPrint :: Lens' TasksInsert' Bool
135 = lens _tiPrettyPrint
136 (\ s a -> s{_tiPrettyPrint = a})
138-- | The project under which the queue lies
139tiProject :: Lens' TasksInsert' Text
141 = lens _tiProject (\ s a -> s{_tiProject = a})
143-- | IP address of the site where the request originates. Use this if you
144-- want to enforce per-user limits.
145tiUserIP :: Lens' TasksInsert' (Maybe Text)
146tiUserIP = lens _tiUserIP (\ s a -> s{_tiUserIP = a})
148-- | Multipart request metadata.
149tiPayload :: Lens' TasksInsert' Task
151 = lens _tiPayload (\ s a -> s{_tiPayload = a})
153-- | API key. Your API key identifies your project and provides you with API
154-- access, quota, and reports. Required unless you provide an OAuth 2.0
156tiKey :: Lens' TasksInsert' (Maybe AuthKey)
157tiKey = lens _tiKey (\ s a -> s{_tiKey = a})
159-- | OAuth 2.0 token for the current user.
160tiOAuthToken :: Lens' TasksInsert' (Maybe OAuthToken)
162 = lens _tiOAuthToken (\ s a -> s{_tiOAuthToken = a})
164-- | Selector specifying which fields to include in a partial response.
165tiFields :: Lens' TasksInsert' (Maybe Text)
166tiFields = lens _tiFields (\ s a -> s{_tiFields = a})
168instance GoogleAuth TasksInsert' where
169 _AuthKey = tiKey . _Just
170 _AuthToken = tiOAuthToken . _Just
172instance GoogleRequest TasksInsert' where
173 type Rs TasksInsert' = Task
174 request = requestWith taskQueueRequest
175 requestWith rq TasksInsert'{..}
176 = go _tiProject _tiTaskqueue _tiQuotaUser
177 (Just _tiPrettyPrint)
185 = clientBuild (Proxy :: Proxy TasksInsertResource) 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