on 88441d2 help sign in
174 lines 5.2 kB history raw
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 #-}
11-- |
12-- Module : Network.Google.API.Taskqueue.Tasks.List
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)
18--
19-- | List Tasks in a TaskQueue
20--
21-- /See:/ <https://developers.google.com/appengine/docs/python/taskqueue/rest TaskQueue API Reference> for @taskqueue.tasks.list@.
22module Network.Google.API.Taskqueue.Tasks.List
23 (
24 -- * REST Resource
25 TasksListAPI
27 -- * Creating a Request
28 , tasksList'
29 , TasksList'
31 -- * Request Lenses
32 , tlTaskqueue
33 , tlQuotaUser
34 , tlPrettyPrint
35 , tlProject
36 , tlUserIp
37 , tlKey
38 , tlOauthToken
39 , tlFields
40 , tlAlt
41 ) where
43import Network.Google.AppEngine.TaskQueue.Types
44import Network.Google.Prelude
46-- | A resource alias for taskqueue.tasks.list which the
47-- 'TasksList'' request conforms to.
48type TasksListAPI =
49 Capture "project" Text :>
50 "taskqueues" :>
51 Capture "taskqueue" Text :>
52 "tasks" :>
53 QueryParam "quotaUser" Text :>
54 QueryParam "prettyPrint" Bool :>
55 QueryParam "userIp" Text :>
56 QueryParam "key" Text :>
57 QueryParam "oauth_token" Text :>
58 QueryParam "fields" Text :>
59 QueryParam "alt" Alt :> Get '[JSON] Tasks2
61-- | List Tasks in a TaskQueue
62--
63-- /See:/ 'tasksList'' smart constructor.
64data TasksList' = TasksList'
65 { _tlTaskqueue :: !Text
66 , _tlQuotaUser :: !(Maybe Text)
67 , _tlPrettyPrint :: !Bool
68 , _tlProject :: !Text
69 , _tlUserIp :: !(Maybe Text)
70 , _tlKey :: !(Maybe Text)
71 , _tlOauthToken :: !(Maybe Text)
72 , _tlFields :: !(Maybe Text)
73 , _tlAlt :: !Alt
74 } deriving (Eq,Read,Show,Data,Typeable,Generic)
76-- | Creates a value of 'TasksList'' with the minimum fields required to make a request.
77--
78-- Use one of the following lenses to modify other fields as desired:
79--
80-- * 'tlTaskqueue'
81--
82-- * 'tlQuotaUser'
83--
84-- * 'tlPrettyPrint'
85--
86-- * 'tlProject'
87--
88-- * 'tlUserIp'
89--
90-- * 'tlKey'
91--
92-- * 'tlOauthToken'
93--
94-- * 'tlFields'
95--
96-- * 'tlAlt'
97tasksList'
98 :: Text -- ^ 'taskqueue'
99 -> Text -- ^ 'project'
100 -> TasksList'
101tasksList' pTlTaskqueue_ pTlProject_ =
102 TasksList'
103 { _tlTaskqueue = pTlTaskqueue_
104 , _tlQuotaUser = Nothing
105 , _tlPrettyPrint = True
106 , _tlProject = pTlProject_
107 , _tlUserIp = Nothing
108 , _tlKey = Nothing
109 , _tlOauthToken = Nothing
110 , _tlFields = Nothing
111 , _tlAlt = JSON
112 }
114-- | The id of the taskqueue to list tasks from.
115tlTaskqueue :: Lens' TasksList' Text
116tlTaskqueue
117 = lens _tlTaskqueue (\ s a -> s{_tlTaskqueue = a})
119-- | Available to use for quota purposes for server-side applications. Can be
120-- any arbitrary string assigned to a user, but should not exceed 40
121-- characters. Overrides userIp if both are provided.
122tlQuotaUser :: Lens' TasksList' (Maybe Text)
123tlQuotaUser
124 = lens _tlQuotaUser (\ s a -> s{_tlQuotaUser = a})
126-- | Returns response with indentations and line breaks.
127tlPrettyPrint :: Lens' TasksList' Bool
128tlPrettyPrint
129 = lens _tlPrettyPrint
130 (\ s a -> s{_tlPrettyPrint = a})
132-- | The project under which the queue lies.
133tlProject :: Lens' TasksList' Text
134tlProject
135 = lens _tlProject (\ s a -> s{_tlProject = a})
137-- | IP address of the site where the request originates. Use this if you
138-- want to enforce per-user limits.
139tlUserIp :: Lens' TasksList' (Maybe Text)
140tlUserIp = lens _tlUserIp (\ s a -> s{_tlUserIp = a})
142-- | API key. Your API key identifies your project and provides you with API
143-- access, quota, and reports. Required unless you provide an OAuth 2.0
144-- token.
145tlKey :: Lens' TasksList' (Maybe Text)
146tlKey = lens _tlKey (\ s a -> s{_tlKey = a})
148-- | OAuth 2.0 token for the current user.
149tlOauthToken :: Lens' TasksList' (Maybe Text)
150tlOauthToken
151 = lens _tlOauthToken (\ s a -> s{_tlOauthToken = a})
153-- | Selector specifying which fields to include in a partial response.
154tlFields :: Lens' TasksList' (Maybe Text)
155tlFields = lens _tlFields (\ s a -> s{_tlFields = a})
157-- | Data format for the response.
158tlAlt :: Lens' TasksList' Alt
159tlAlt = lens _tlAlt (\ s a -> s{_tlAlt = a})
161instance GoogleRequest TasksList' where
162 type Rs TasksList' = Tasks2
163 request
164 = requestWithRoute defReq appEngineTaskQueueURL
165 requestWithRoute r u TasksList'{..}
166 = go _tlTaskqueue _tlQuotaUser (Just _tlPrettyPrint)
167 _tlProject
168 _tlUserIp
169 _tlKey
170 _tlOauthToken
171 _tlFields
172 (Just _tlAlt)
173 where go
174 = clientWithRoute (Proxy :: Proxy TasksListAPI) r u