on 88441d2 help sign in
184 lines 5.5 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.Taskqueues.Get
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-- | Get detailed information about a TaskQueue.
20--
21-- /See:/ <https://developers.google.com/appengine/docs/python/taskqueue/rest TaskQueue API Reference> for @taskqueue.taskqueues.get@.
22module Network.Google.API.Taskqueue.Taskqueues.Get
23 (
24 -- * REST Resource
25 TaskqueuesGetAPI
27 -- * Creating a Request
28 , taskqueuesGet'
29 , TaskqueuesGet'
31 -- * Request Lenses
32 , tTaskqueue
33 , tQuotaUser
34 , tPrettyPrint
35 , tProject
36 , tUserIp
37 , tKey
38 , tGetStats
39 , tOauthToken
40 , tFields
41 , tAlt
42 ) where
44import Network.Google.AppEngine.TaskQueue.Types
45import Network.Google.Prelude
47-- | A resource alias for taskqueue.taskqueues.get which the
48-- 'TaskqueuesGet'' request conforms to.
49type TaskqueuesGetAPI =
50 Capture "project" Text :>
51 "taskqueues" :>
52 Capture "taskqueue" Text :>
53 QueryParam "quotaUser" Text :>
54 QueryParam "prettyPrint" Bool :>
55 QueryParam "userIp" Text :>
56 QueryParam "key" Text :>
57 QueryParam "getStats" Bool :>
58 QueryParam "oauth_token" Text :>
59 QueryParam "fields" Text :>
60 QueryParam "alt" Alt :> Get '[JSON] TaskQueue
62-- | Get detailed information about a TaskQueue.
63--
64-- /See:/ 'taskqueuesGet'' smart constructor.
65data TaskqueuesGet' = TaskqueuesGet'
66 { _tTaskqueue :: !Text
67 , _tQuotaUser :: !(Maybe Text)
68 , _tPrettyPrint :: !Bool
69 , _tProject :: !Text
70 , _tUserIp :: !(Maybe Text)
71 , _tKey :: !(Maybe Text)
72 , _tGetStats :: !(Maybe Bool)
73 , _tOauthToken :: !(Maybe Text)
74 , _tFields :: !(Maybe Text)
75 , _tAlt :: !Alt
76 } deriving (Eq,Read,Show,Data,Typeable,Generic)
78-- | Creates a value of 'TaskqueuesGet'' with the minimum fields required to make a request.
79--
80-- Use one of the following lenses to modify other fields as desired:
81--
82-- * 'tTaskqueue'
83--
84-- * 'tQuotaUser'
85--
86-- * 'tPrettyPrint'
87--
88-- * 'tProject'
89--
90-- * 'tUserIp'
91--
92-- * 'tKey'
93--
94-- * 'tGetStats'
95--
96-- * 'tOauthToken'
97--
98-- * 'tFields'
99--
100-- * 'tAlt'
101taskqueuesGet'
102 :: Text -- ^ 'taskqueue'
103 -> Text -- ^ 'project'
104 -> TaskqueuesGet'
105taskqueuesGet' pTTaskqueue_ pTProject_ =
106 TaskqueuesGet'
107 { _tTaskqueue = pTTaskqueue_
108 , _tQuotaUser = Nothing
109 , _tPrettyPrint = True
110 , _tProject = pTProject_
111 , _tUserIp = Nothing
112 , _tKey = Nothing
113 , _tGetStats = Nothing
114 , _tOauthToken = Nothing
115 , _tFields = Nothing
116 , _tAlt = JSON
117 }
119-- | The id of the taskqueue to get the properties of.
120tTaskqueue :: Lens' TaskqueuesGet' Text
121tTaskqueue
122 = lens _tTaskqueue (\ s a -> s{_tTaskqueue = a})
124-- | Available to use for quota purposes for server-side applications. Can be
125-- any arbitrary string assigned to a user, but should not exceed 40
126-- characters. Overrides userIp if both are provided.
127tQuotaUser :: Lens' TaskqueuesGet' (Maybe Text)
128tQuotaUser
129 = lens _tQuotaUser (\ s a -> s{_tQuotaUser = a})
131-- | Returns response with indentations and line breaks.
132tPrettyPrint :: Lens' TaskqueuesGet' Bool
133tPrettyPrint
134 = lens _tPrettyPrint (\ s a -> s{_tPrettyPrint = a})
136-- | The project under which the queue lies.
137tProject :: Lens' TaskqueuesGet' Text
138tProject = lens _tProject (\ s a -> s{_tProject = a})
140-- | IP address of the site where the request originates. Use this if you
141-- want to enforce per-user limits.
142tUserIp :: Lens' TaskqueuesGet' (Maybe Text)
143tUserIp = lens _tUserIp (\ s a -> s{_tUserIp = 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
147-- token.
148tKey :: Lens' TaskqueuesGet' (Maybe Text)
149tKey = lens _tKey (\ s a -> s{_tKey = a})
151-- | Whether to get stats. Optional.
152tGetStats :: Lens' TaskqueuesGet' (Maybe Bool)
153tGetStats
154 = lens _tGetStats (\ s a -> s{_tGetStats = a})
156-- | OAuth 2.0 token for the current user.
157tOauthToken :: Lens' TaskqueuesGet' (Maybe Text)
158tOauthToken
159 = lens _tOauthToken (\ s a -> s{_tOauthToken = a})
161-- | Selector specifying which fields to include in a partial response.
162tFields :: Lens' TaskqueuesGet' (Maybe Text)
163tFields = lens _tFields (\ s a -> s{_tFields = a})
165-- | Data format for the response.
166tAlt :: Lens' TaskqueuesGet' Alt
167tAlt = lens _tAlt (\ s a -> s{_tAlt = a})
169instance GoogleRequest TaskqueuesGet' where
170 type Rs TaskqueuesGet' = TaskQueue
171 request
172 = requestWithRoute defReq appEngineTaskQueueURL
173 requestWithRoute r u TaskqueuesGet'{..}
174 = go _tTaskqueue _tQuotaUser (Just _tPrettyPrint)
175 _tProject
176 _tUserIp
177 _tKey
178 _tGetStats
179 _tOauthToken
180 _tFields
181 (Just _tAlt)
182 where go
183 = clientWithRoute (Proxy :: Proxy TaskqueuesGetAPI) r
184 u