OLD | NEW |
| 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 |
1 library googleapis.mirror.v1; | 3 library googleapis.mirror.v1; |
2 | 4 |
3 import "dart:core" as core; | 5 import 'dart:core' as core; |
4 import "dart:collection" as collection_1; | 6 import 'dart:collection' as collection_1; |
5 import "dart:async" as async; | 7 import 'dart:async' as async; |
6 import "dart:convert" as convert; | 8 import 'dart:convert' as convert; |
7 | 9 |
8 import "package:crypto/crypto.dart" as crypto; | 10 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
| 11 import 'package:crypto/crypto.dart' as crypto; |
9 import 'package:http/http.dart' as http; | 12 import 'package:http/http.dart' as http; |
10 import '../src/common_internal.dart' as common_internal; | |
11 import '../common/common.dart' as common; | |
12 | 13 |
13 export '../common/common.dart' show ApiRequestError; | 14 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show |
14 export '../common/common.dart' show DetailedApiRequestError; | 15 ApiRequestError, DetailedApiRequestError, Media, UploadOptions, |
| 16 ResumableUploadOptions, DownloadOptions, PartialDownloadOptions, |
| 17 ByteRange; |
| 18 |
| 19 const core.String USER_AGENT = 'dart-api-client mirror/v1'; |
15 | 20 |
16 /** API for interacting with Glass users via the timeline. */ | 21 /** API for interacting with Glass users via the timeline. */ |
17 class MirrorApi { | 22 class MirrorApi { |
18 /** View your location */ | 23 /** View your location */ |
19 static const GlassLocationScope = "https://www.googleapis.com/auth/glass.locat
ion"; | 24 static const GlassLocationScope = "https://www.googleapis.com/auth/glass.locat
ion"; |
20 | 25 |
21 /** View and manage your Glass timeline */ | 26 /** View and manage your Glass timeline */ |
22 static const GlassTimelineScope = "https://www.googleapis.com/auth/glass.timel
ine"; | 27 static const GlassTimelineScope = "https://www.googleapis.com/auth/glass.timel
ine"; |
23 | 28 |
24 | 29 |
25 final common_internal.ApiRequester _requester; | 30 final commons.ApiRequester _requester; |
26 | 31 |
27 AccountsResourceApi get accounts => new AccountsResourceApi(_requester); | 32 AccountsResourceApi get accounts => new AccountsResourceApi(_requester); |
28 ContactsResourceApi get contacts => new ContactsResourceApi(_requester); | 33 ContactsResourceApi get contacts => new ContactsResourceApi(_requester); |
29 LocationsResourceApi get locations => new LocationsResourceApi(_requester); | 34 LocationsResourceApi get locations => new LocationsResourceApi(_requester); |
30 SettingsResourceApi get settings => new SettingsResourceApi(_requester); | 35 SettingsResourceApi get settings => new SettingsResourceApi(_requester); |
31 SubscriptionsResourceApi get subscriptions => new SubscriptionsResourceApi(_re
quester); | 36 SubscriptionsResourceApi get subscriptions => new SubscriptionsResourceApi(_re
quester); |
32 TimelineResourceApi get timeline => new TimelineResourceApi(_requester); | 37 TimelineResourceApi get timeline => new TimelineResourceApi(_requester); |
33 | 38 |
34 MirrorApi(http.Client client, {core.String rootUrl: "https://www.googleapis.co
m/", core.String servicePath: "mirror/v1/"}) : | 39 MirrorApi(http.Client client, {core.String rootUrl: "https://www.googleapis.co
m/", core.String servicePath: "mirror/v1/"}) : |
35 _requester = new common_internal.ApiRequester(client, rootUrl, servicePath
); | 40 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
36 } | 41 } |
37 | 42 |
38 | 43 |
39 /** Not documented yet. */ | |
40 class AccountsResourceApi { | 44 class AccountsResourceApi { |
41 final common_internal.ApiRequester _requester; | 45 final commons.ApiRequester _requester; |
42 | 46 |
43 AccountsResourceApi(common_internal.ApiRequester client) : | 47 AccountsResourceApi(commons.ApiRequester client) : |
44 _requester = client; | 48 _requester = client; |
45 | 49 |
46 /** | 50 /** |
47 * Inserts a new account for a user | 51 * Inserts a new account for a user |
48 * | 52 * |
49 * [request] - The metadata request object. | 53 * [request] - The metadata request object. |
50 * | 54 * |
51 * Request parameters: | 55 * Request parameters: |
52 * | 56 * |
53 * [userToken] - The ID for the user. | 57 * [userToken] - The ID for the user. |
54 * | 58 * |
55 * [accountType] - Account type to be passed to Android Account Manager. | 59 * [accountType] - Account type to be passed to Android Account Manager. |
56 * | 60 * |
57 * [accountName] - The name of the account to be passed to the Android Account | 61 * [accountName] - The name of the account to be passed to the Android Account |
58 * Manager. | 62 * Manager. |
59 * | 63 * |
60 * Completes with a [Account]. | 64 * Completes with a [Account]. |
61 * | 65 * |
62 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 66 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
63 * error. | 67 * error. |
64 * | 68 * |
65 * If the used [http.Client] completes with an error when making a REST call, | 69 * If the used [http.Client] completes with an error when making a REST call, |
66 * this method will complete with the same error. | 70 * this method will complete with the same error. |
67 */ | 71 */ |
68 async.Future<Account> insert(Account request, core.String userToken, core.Stri
ng accountType, core.String accountName) { | 72 async.Future<Account> insert(Account request, core.String userToken, core.Stri
ng accountType, core.String accountName) { |
69 var _url = null; | 73 var _url = null; |
70 var _queryParams = new core.Map(); | 74 var _queryParams = new core.Map(); |
71 var _uploadMedia = null; | 75 var _uploadMedia = null; |
72 var _uploadOptions = null; | 76 var _uploadOptions = null; |
73 var _downloadOptions = common.DownloadOptions.Metadata; | 77 var _downloadOptions = commons.DownloadOptions.Metadata; |
74 var _body = null; | 78 var _body = null; |
75 | 79 |
76 if (request != null) { | 80 if (request != null) { |
77 _body = convert.JSON.encode((request).toJson()); | 81 _body = convert.JSON.encode((request).toJson()); |
78 } | 82 } |
79 if (userToken == null) { | 83 if (userToken == null) { |
80 throw new core.ArgumentError("Parameter userToken is required."); | 84 throw new core.ArgumentError("Parameter userToken is required."); |
81 } | 85 } |
82 if (accountType == null) { | 86 if (accountType == null) { |
83 throw new core.ArgumentError("Parameter accountType is required."); | 87 throw new core.ArgumentError("Parameter accountType is required."); |
84 } | 88 } |
85 if (accountName == null) { | 89 if (accountName == null) { |
86 throw new core.ArgumentError("Parameter accountName is required."); | 90 throw new core.ArgumentError("Parameter accountName is required."); |
87 } | 91 } |
88 | 92 |
89 | 93 |
90 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$userToken') + '
/' + common_internal.Escaper.ecapeVariable('$accountType') + '/' + common_intern
al.Escaper.ecapeVariable('$accountName'); | 94 _url = 'accounts/' + commons.Escaper.ecapeVariable('$userToken') + '/' + com
mons.Escaper.ecapeVariable('$accountType') + '/' + commons.Escaper.ecapeVariable
('$accountName'); |
91 | 95 |
92 var _response = _requester.request(_url, | 96 var _response = _requester.request(_url, |
93 "POST", | 97 "POST", |
94 body: _body, | 98 body: _body, |
95 queryParams: _queryParams, | 99 queryParams: _queryParams, |
96 uploadOptions: _uploadOptions, | 100 uploadOptions: _uploadOptions, |
97 uploadMedia: _uploadMedia, | 101 uploadMedia: _uploadMedia, |
98 downloadOptions: _downloadOptions); | 102 downloadOptions: _downloadOptions); |
99 return _response.then((data) => new Account.fromJson(data)); | 103 return _response.then((data) => new Account.fromJson(data)); |
100 } | 104 } |
101 | 105 |
102 } | 106 } |
103 | 107 |
104 | 108 |
105 /** Not documented yet. */ | |
106 class ContactsResourceApi { | 109 class ContactsResourceApi { |
107 final common_internal.ApiRequester _requester; | 110 final commons.ApiRequester _requester; |
108 | 111 |
109 ContactsResourceApi(common_internal.ApiRequester client) : | 112 ContactsResourceApi(commons.ApiRequester client) : |
110 _requester = client; | 113 _requester = client; |
111 | 114 |
112 /** | 115 /** |
113 * Deletes a contact. | 116 * Deletes a contact. |
114 * | 117 * |
115 * Request parameters: | 118 * Request parameters: |
116 * | 119 * |
117 * [id] - The ID of the contact. | 120 * [id] - The ID of the contact. |
118 * | 121 * |
119 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 122 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
120 * error. | 123 * error. |
121 * | 124 * |
122 * If the used [http.Client] completes with an error when making a REST call, | 125 * If the used [http.Client] completes with an error when making a REST call, |
123 * this method will complete with the same error. | 126 * this method will complete with the same error. |
124 */ | 127 */ |
125 async.Future delete(core.String id) { | 128 async.Future delete(core.String id) { |
126 var _url = null; | 129 var _url = null; |
127 var _queryParams = new core.Map(); | 130 var _queryParams = new core.Map(); |
128 var _uploadMedia = null; | 131 var _uploadMedia = null; |
129 var _uploadOptions = null; | 132 var _uploadOptions = null; |
130 var _downloadOptions = common.DownloadOptions.Metadata; | 133 var _downloadOptions = commons.DownloadOptions.Metadata; |
131 var _body = null; | 134 var _body = null; |
132 | 135 |
133 if (id == null) { | 136 if (id == null) { |
134 throw new core.ArgumentError("Parameter id is required."); | 137 throw new core.ArgumentError("Parameter id is required."); |
135 } | 138 } |
136 | 139 |
137 _downloadOptions = null; | 140 _downloadOptions = null; |
138 | 141 |
139 _url = 'contacts/' + common_internal.Escaper.ecapeVariable('$id'); | 142 _url = 'contacts/' + commons.Escaper.ecapeVariable('$id'); |
140 | 143 |
141 var _response = _requester.request(_url, | 144 var _response = _requester.request(_url, |
142 "DELETE", | 145 "DELETE", |
143 body: _body, | 146 body: _body, |
144 queryParams: _queryParams, | 147 queryParams: _queryParams, |
145 uploadOptions: _uploadOptions, | 148 uploadOptions: _uploadOptions, |
146 uploadMedia: _uploadMedia, | 149 uploadMedia: _uploadMedia, |
147 downloadOptions: _downloadOptions); | 150 downloadOptions: _downloadOptions); |
148 return _response.then((data) => null); | 151 return _response.then((data) => null); |
149 } | 152 } |
150 | 153 |
151 /** | 154 /** |
152 * Gets a single contact by ID. | 155 * Gets a single contact by ID. |
153 * | 156 * |
154 * Request parameters: | 157 * Request parameters: |
155 * | 158 * |
156 * [id] - The ID of the contact. | 159 * [id] - The ID of the contact. |
157 * | 160 * |
158 * Completes with a [Contact]. | 161 * Completes with a [Contact]. |
159 * | 162 * |
160 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 163 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
161 * error. | 164 * error. |
162 * | 165 * |
163 * If the used [http.Client] completes with an error when making a REST call, | 166 * If the used [http.Client] completes with an error when making a REST call, |
164 * this method will complete with the same error. | 167 * this method will complete with the same error. |
165 */ | 168 */ |
166 async.Future<Contact> get(core.String id) { | 169 async.Future<Contact> get(core.String id) { |
167 var _url = null; | 170 var _url = null; |
168 var _queryParams = new core.Map(); | 171 var _queryParams = new core.Map(); |
169 var _uploadMedia = null; | 172 var _uploadMedia = null; |
170 var _uploadOptions = null; | 173 var _uploadOptions = null; |
171 var _downloadOptions = common.DownloadOptions.Metadata; | 174 var _downloadOptions = commons.DownloadOptions.Metadata; |
172 var _body = null; | 175 var _body = null; |
173 | 176 |
174 if (id == null) { | 177 if (id == null) { |
175 throw new core.ArgumentError("Parameter id is required."); | 178 throw new core.ArgumentError("Parameter id is required."); |
176 } | 179 } |
177 | 180 |
178 | 181 |
179 _url = 'contacts/' + common_internal.Escaper.ecapeVariable('$id'); | 182 _url = 'contacts/' + commons.Escaper.ecapeVariable('$id'); |
180 | 183 |
181 var _response = _requester.request(_url, | 184 var _response = _requester.request(_url, |
182 "GET", | 185 "GET", |
183 body: _body, | 186 body: _body, |
184 queryParams: _queryParams, | 187 queryParams: _queryParams, |
185 uploadOptions: _uploadOptions, | 188 uploadOptions: _uploadOptions, |
186 uploadMedia: _uploadMedia, | 189 uploadMedia: _uploadMedia, |
187 downloadOptions: _downloadOptions); | 190 downloadOptions: _downloadOptions); |
188 return _response.then((data) => new Contact.fromJson(data)); | 191 return _response.then((data) => new Contact.fromJson(data)); |
189 } | 192 } |
190 | 193 |
191 /** | 194 /** |
192 * Inserts a new contact. | 195 * Inserts a new contact. |
193 * | 196 * |
194 * [request] - The metadata request object. | 197 * [request] - The metadata request object. |
195 * | 198 * |
196 * Request parameters: | 199 * Request parameters: |
197 * | 200 * |
198 * Completes with a [Contact]. | 201 * Completes with a [Contact]. |
199 * | 202 * |
200 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 203 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
201 * error. | 204 * error. |
202 * | 205 * |
203 * If the used [http.Client] completes with an error when making a REST call, | 206 * If the used [http.Client] completes with an error when making a REST call, |
204 * this method will complete with the same error. | 207 * this method will complete with the same error. |
205 */ | 208 */ |
206 async.Future<Contact> insert(Contact request) { | 209 async.Future<Contact> insert(Contact request) { |
207 var _url = null; | 210 var _url = null; |
208 var _queryParams = new core.Map(); | 211 var _queryParams = new core.Map(); |
209 var _uploadMedia = null; | 212 var _uploadMedia = null; |
210 var _uploadOptions = null; | 213 var _uploadOptions = null; |
211 var _downloadOptions = common.DownloadOptions.Metadata; | 214 var _downloadOptions = commons.DownloadOptions.Metadata; |
212 var _body = null; | 215 var _body = null; |
213 | 216 |
214 if (request != null) { | 217 if (request != null) { |
215 _body = convert.JSON.encode((request).toJson()); | 218 _body = convert.JSON.encode((request).toJson()); |
216 } | 219 } |
217 | 220 |
218 | 221 |
219 _url = 'contacts'; | 222 _url = 'contacts'; |
220 | 223 |
221 var _response = _requester.request(_url, | 224 var _response = _requester.request(_url, |
222 "POST", | 225 "POST", |
223 body: _body, | 226 body: _body, |
224 queryParams: _queryParams, | 227 queryParams: _queryParams, |
225 uploadOptions: _uploadOptions, | 228 uploadOptions: _uploadOptions, |
226 uploadMedia: _uploadMedia, | 229 uploadMedia: _uploadMedia, |
227 downloadOptions: _downloadOptions); | 230 downloadOptions: _downloadOptions); |
228 return _response.then((data) => new Contact.fromJson(data)); | 231 return _response.then((data) => new Contact.fromJson(data)); |
229 } | 232 } |
230 | 233 |
231 /** | 234 /** |
232 * Retrieves a list of contacts for the authenticated user. | 235 * Retrieves a list of contacts for the authenticated user. |
233 * | 236 * |
234 * Request parameters: | 237 * Request parameters: |
235 * | 238 * |
236 * Completes with a [ContactsListResponse]. | 239 * Completes with a [ContactsListResponse]. |
237 * | 240 * |
238 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 241 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
239 * error. | 242 * error. |
240 * | 243 * |
241 * If the used [http.Client] completes with an error when making a REST call, | 244 * If the used [http.Client] completes with an error when making a REST call, |
242 * this method will complete with the same error. | 245 * this method will complete with the same error. |
243 */ | 246 */ |
244 async.Future<ContactsListResponse> list() { | 247 async.Future<ContactsListResponse> list() { |
245 var _url = null; | 248 var _url = null; |
246 var _queryParams = new core.Map(); | 249 var _queryParams = new core.Map(); |
247 var _uploadMedia = null; | 250 var _uploadMedia = null; |
248 var _uploadOptions = null; | 251 var _uploadOptions = null; |
249 var _downloadOptions = common.DownloadOptions.Metadata; | 252 var _downloadOptions = commons.DownloadOptions.Metadata; |
250 var _body = null; | 253 var _body = null; |
251 | 254 |
252 | 255 |
253 | 256 |
254 _url = 'contacts'; | 257 _url = 'contacts'; |
255 | 258 |
256 var _response = _requester.request(_url, | 259 var _response = _requester.request(_url, |
257 "GET", | 260 "GET", |
258 body: _body, | 261 body: _body, |
259 queryParams: _queryParams, | 262 queryParams: _queryParams, |
260 uploadOptions: _uploadOptions, | 263 uploadOptions: _uploadOptions, |
261 uploadMedia: _uploadMedia, | 264 uploadMedia: _uploadMedia, |
262 downloadOptions: _downloadOptions); | 265 downloadOptions: _downloadOptions); |
263 return _response.then((data) => new ContactsListResponse.fromJson(data)); | 266 return _response.then((data) => new ContactsListResponse.fromJson(data)); |
264 } | 267 } |
265 | 268 |
266 /** | 269 /** |
267 * Updates a contact in place. This method supports patch semantics. | 270 * Updates a contact in place. This method supports patch semantics. |
268 * | 271 * |
269 * [request] - The metadata request object. | 272 * [request] - The metadata request object. |
270 * | 273 * |
271 * Request parameters: | 274 * Request parameters: |
272 * | 275 * |
273 * [id] - The ID of the contact. | 276 * [id] - The ID of the contact. |
274 * | 277 * |
275 * Completes with a [Contact]. | 278 * Completes with a [Contact]. |
276 * | 279 * |
277 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 280 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
278 * error. | 281 * error. |
279 * | 282 * |
280 * If the used [http.Client] completes with an error when making a REST call, | 283 * If the used [http.Client] completes with an error when making a REST call, |
281 * this method will complete with the same error. | 284 * this method will complete with the same error. |
282 */ | 285 */ |
283 async.Future<Contact> patch(Contact request, core.String id) { | 286 async.Future<Contact> patch(Contact request, core.String id) { |
284 var _url = null; | 287 var _url = null; |
285 var _queryParams = new core.Map(); | 288 var _queryParams = new core.Map(); |
286 var _uploadMedia = null; | 289 var _uploadMedia = null; |
287 var _uploadOptions = null; | 290 var _uploadOptions = null; |
288 var _downloadOptions = common.DownloadOptions.Metadata; | 291 var _downloadOptions = commons.DownloadOptions.Metadata; |
289 var _body = null; | 292 var _body = null; |
290 | 293 |
291 if (request != null) { | 294 if (request != null) { |
292 _body = convert.JSON.encode((request).toJson()); | 295 _body = convert.JSON.encode((request).toJson()); |
293 } | 296 } |
294 if (id == null) { | 297 if (id == null) { |
295 throw new core.ArgumentError("Parameter id is required."); | 298 throw new core.ArgumentError("Parameter id is required."); |
296 } | 299 } |
297 | 300 |
298 | 301 |
299 _url = 'contacts/' + common_internal.Escaper.ecapeVariable('$id'); | 302 _url = 'contacts/' + commons.Escaper.ecapeVariable('$id'); |
300 | 303 |
301 var _response = _requester.request(_url, | 304 var _response = _requester.request(_url, |
302 "PATCH", | 305 "PATCH", |
303 body: _body, | 306 body: _body, |
304 queryParams: _queryParams, | 307 queryParams: _queryParams, |
305 uploadOptions: _uploadOptions, | 308 uploadOptions: _uploadOptions, |
306 uploadMedia: _uploadMedia, | 309 uploadMedia: _uploadMedia, |
307 downloadOptions: _downloadOptions); | 310 downloadOptions: _downloadOptions); |
308 return _response.then((data) => new Contact.fromJson(data)); | 311 return _response.then((data) => new Contact.fromJson(data)); |
309 } | 312 } |
310 | 313 |
311 /** | 314 /** |
312 * Updates a contact in place. | 315 * Updates a contact in place. |
313 * | 316 * |
314 * [request] - The metadata request object. | 317 * [request] - The metadata request object. |
315 * | 318 * |
316 * Request parameters: | 319 * Request parameters: |
317 * | 320 * |
318 * [id] - The ID of the contact. | 321 * [id] - The ID of the contact. |
319 * | 322 * |
320 * Completes with a [Contact]. | 323 * Completes with a [Contact]. |
321 * | 324 * |
322 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 325 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
323 * error. | 326 * error. |
324 * | 327 * |
325 * If the used [http.Client] completes with an error when making a REST call, | 328 * If the used [http.Client] completes with an error when making a REST call, |
326 * this method will complete with the same error. | 329 * this method will complete with the same error. |
327 */ | 330 */ |
328 async.Future<Contact> update(Contact request, core.String id) { | 331 async.Future<Contact> update(Contact request, core.String id) { |
329 var _url = null; | 332 var _url = null; |
330 var _queryParams = new core.Map(); | 333 var _queryParams = new core.Map(); |
331 var _uploadMedia = null; | 334 var _uploadMedia = null; |
332 var _uploadOptions = null; | 335 var _uploadOptions = null; |
333 var _downloadOptions = common.DownloadOptions.Metadata; | 336 var _downloadOptions = commons.DownloadOptions.Metadata; |
334 var _body = null; | 337 var _body = null; |
335 | 338 |
336 if (request != null) { | 339 if (request != null) { |
337 _body = convert.JSON.encode((request).toJson()); | 340 _body = convert.JSON.encode((request).toJson()); |
338 } | 341 } |
339 if (id == null) { | 342 if (id == null) { |
340 throw new core.ArgumentError("Parameter id is required."); | 343 throw new core.ArgumentError("Parameter id is required."); |
341 } | 344 } |
342 | 345 |
343 | 346 |
344 _url = 'contacts/' + common_internal.Escaper.ecapeVariable('$id'); | 347 _url = 'contacts/' + commons.Escaper.ecapeVariable('$id'); |
345 | 348 |
346 var _response = _requester.request(_url, | 349 var _response = _requester.request(_url, |
347 "PUT", | 350 "PUT", |
348 body: _body, | 351 body: _body, |
349 queryParams: _queryParams, | 352 queryParams: _queryParams, |
350 uploadOptions: _uploadOptions, | 353 uploadOptions: _uploadOptions, |
351 uploadMedia: _uploadMedia, | 354 uploadMedia: _uploadMedia, |
352 downloadOptions: _downloadOptions); | 355 downloadOptions: _downloadOptions); |
353 return _response.then((data) => new Contact.fromJson(data)); | 356 return _response.then((data) => new Contact.fromJson(data)); |
354 } | 357 } |
355 | 358 |
356 } | 359 } |
357 | 360 |
358 | 361 |
359 /** Not documented yet. */ | |
360 class LocationsResourceApi { | 362 class LocationsResourceApi { |
361 final common_internal.ApiRequester _requester; | 363 final commons.ApiRequester _requester; |
362 | 364 |
363 LocationsResourceApi(common_internal.ApiRequester client) : | 365 LocationsResourceApi(commons.ApiRequester client) : |
364 _requester = client; | 366 _requester = client; |
365 | 367 |
366 /** | 368 /** |
367 * Gets a single location by ID. | 369 * Gets a single location by ID. |
368 * | 370 * |
369 * Request parameters: | 371 * Request parameters: |
370 * | 372 * |
371 * [id] - The ID of the location or latest for the last known location. | 373 * [id] - The ID of the location or latest for the last known location. |
372 * | 374 * |
373 * Completes with a [Location]. | 375 * Completes with a [Location]. |
374 * | 376 * |
375 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 377 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
376 * error. | 378 * error. |
377 * | 379 * |
378 * If the used [http.Client] completes with an error when making a REST call, | 380 * If the used [http.Client] completes with an error when making a REST call, |
379 * this method will complete with the same error. | 381 * this method will complete with the same error. |
380 */ | 382 */ |
381 async.Future<Location> get(core.String id) { | 383 async.Future<Location> get(core.String id) { |
382 var _url = null; | 384 var _url = null; |
383 var _queryParams = new core.Map(); | 385 var _queryParams = new core.Map(); |
384 var _uploadMedia = null; | 386 var _uploadMedia = null; |
385 var _uploadOptions = null; | 387 var _uploadOptions = null; |
386 var _downloadOptions = common.DownloadOptions.Metadata; | 388 var _downloadOptions = commons.DownloadOptions.Metadata; |
387 var _body = null; | 389 var _body = null; |
388 | 390 |
389 if (id == null) { | 391 if (id == null) { |
390 throw new core.ArgumentError("Parameter id is required."); | 392 throw new core.ArgumentError("Parameter id is required."); |
391 } | 393 } |
392 | 394 |
393 | 395 |
394 _url = 'locations/' + common_internal.Escaper.ecapeVariable('$id'); | 396 _url = 'locations/' + commons.Escaper.ecapeVariable('$id'); |
395 | 397 |
396 var _response = _requester.request(_url, | 398 var _response = _requester.request(_url, |
397 "GET", | 399 "GET", |
398 body: _body, | 400 body: _body, |
399 queryParams: _queryParams, | 401 queryParams: _queryParams, |
400 uploadOptions: _uploadOptions, | 402 uploadOptions: _uploadOptions, |
401 uploadMedia: _uploadMedia, | 403 uploadMedia: _uploadMedia, |
402 downloadOptions: _downloadOptions); | 404 downloadOptions: _downloadOptions); |
403 return _response.then((data) => new Location.fromJson(data)); | 405 return _response.then((data) => new Location.fromJson(data)); |
404 } | 406 } |
405 | 407 |
406 /** | 408 /** |
407 * Retrieves a list of locations for the user. | 409 * Retrieves a list of locations for the user. |
408 * | 410 * |
409 * Request parameters: | 411 * Request parameters: |
410 * | 412 * |
411 * Completes with a [LocationsListResponse]. | 413 * Completes with a [LocationsListResponse]. |
412 * | 414 * |
413 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 415 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
414 * error. | 416 * error. |
415 * | 417 * |
416 * If the used [http.Client] completes with an error when making a REST call, | 418 * If the used [http.Client] completes with an error when making a REST call, |
417 * this method will complete with the same error. | 419 * this method will complete with the same error. |
418 */ | 420 */ |
419 async.Future<LocationsListResponse> list() { | 421 async.Future<LocationsListResponse> list() { |
420 var _url = null; | 422 var _url = null; |
421 var _queryParams = new core.Map(); | 423 var _queryParams = new core.Map(); |
422 var _uploadMedia = null; | 424 var _uploadMedia = null; |
423 var _uploadOptions = null; | 425 var _uploadOptions = null; |
424 var _downloadOptions = common.DownloadOptions.Metadata; | 426 var _downloadOptions = commons.DownloadOptions.Metadata; |
425 var _body = null; | 427 var _body = null; |
426 | 428 |
427 | 429 |
428 | 430 |
429 _url = 'locations'; | 431 _url = 'locations'; |
430 | 432 |
431 var _response = _requester.request(_url, | 433 var _response = _requester.request(_url, |
432 "GET", | 434 "GET", |
433 body: _body, | 435 body: _body, |
434 queryParams: _queryParams, | 436 queryParams: _queryParams, |
435 uploadOptions: _uploadOptions, | 437 uploadOptions: _uploadOptions, |
436 uploadMedia: _uploadMedia, | 438 uploadMedia: _uploadMedia, |
437 downloadOptions: _downloadOptions); | 439 downloadOptions: _downloadOptions); |
438 return _response.then((data) => new LocationsListResponse.fromJson(data)); | 440 return _response.then((data) => new LocationsListResponse.fromJson(data)); |
439 } | 441 } |
440 | 442 |
441 } | 443 } |
442 | 444 |
443 | 445 |
444 /** Not documented yet. */ | |
445 class SettingsResourceApi { | 446 class SettingsResourceApi { |
446 final common_internal.ApiRequester _requester; | 447 final commons.ApiRequester _requester; |
447 | 448 |
448 SettingsResourceApi(common_internal.ApiRequester client) : | 449 SettingsResourceApi(commons.ApiRequester client) : |
449 _requester = client; | 450 _requester = client; |
450 | 451 |
451 /** | 452 /** |
452 * Gets a single setting by ID. | 453 * Gets a single setting by ID. |
453 * | 454 * |
454 * Request parameters: | 455 * Request parameters: |
455 * | 456 * |
456 * [id] - The ID of the setting. The following IDs are valid: | 457 * [id] - The ID of the setting. The following IDs are valid: |
457 * - locale - The key to the user’s language/locale (BCP 47 identifier) that | 458 * - locale - The key to the user’s language/locale (BCP 47 identifier) that |
458 * Glassware should use to render localized content. | 459 * Glassware should use to render localized content. |
459 * - timezone - The key to the user’s current time zone region as defined in | 460 * - timezone - The key to the user’s current time zone region as defined in |
460 * the tz database. Example: America/Los_Angeles. | 461 * the tz database. Example: America/Los_Angeles. |
461 * | 462 * |
462 * Completes with a [Setting]. | 463 * Completes with a [Setting]. |
463 * | 464 * |
464 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 465 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
465 * error. | 466 * error. |
466 * | 467 * |
467 * If the used [http.Client] completes with an error when making a REST call, | 468 * If the used [http.Client] completes with an error when making a REST call, |
468 * this method will complete with the same error. | 469 * this method will complete with the same error. |
469 */ | 470 */ |
470 async.Future<Setting> get(core.String id) { | 471 async.Future<Setting> get(core.String id) { |
471 var _url = null; | 472 var _url = null; |
472 var _queryParams = new core.Map(); | 473 var _queryParams = new core.Map(); |
473 var _uploadMedia = null; | 474 var _uploadMedia = null; |
474 var _uploadOptions = null; | 475 var _uploadOptions = null; |
475 var _downloadOptions = common.DownloadOptions.Metadata; | 476 var _downloadOptions = commons.DownloadOptions.Metadata; |
476 var _body = null; | 477 var _body = null; |
477 | 478 |
478 if (id == null) { | 479 if (id == null) { |
479 throw new core.ArgumentError("Parameter id is required."); | 480 throw new core.ArgumentError("Parameter id is required."); |
480 } | 481 } |
481 | 482 |
482 | 483 |
483 _url = 'settings/' + common_internal.Escaper.ecapeVariable('$id'); | 484 _url = 'settings/' + commons.Escaper.ecapeVariable('$id'); |
484 | 485 |
485 var _response = _requester.request(_url, | 486 var _response = _requester.request(_url, |
486 "GET", | 487 "GET", |
487 body: _body, | 488 body: _body, |
488 queryParams: _queryParams, | 489 queryParams: _queryParams, |
489 uploadOptions: _uploadOptions, | 490 uploadOptions: _uploadOptions, |
490 uploadMedia: _uploadMedia, | 491 uploadMedia: _uploadMedia, |
491 downloadOptions: _downloadOptions); | 492 downloadOptions: _downloadOptions); |
492 return _response.then((data) => new Setting.fromJson(data)); | 493 return _response.then((data) => new Setting.fromJson(data)); |
493 } | 494 } |
494 | 495 |
495 } | 496 } |
496 | 497 |
497 | 498 |
498 /** Not documented yet. */ | |
499 class SubscriptionsResourceApi { | 499 class SubscriptionsResourceApi { |
500 final common_internal.ApiRequester _requester; | 500 final commons.ApiRequester _requester; |
501 | 501 |
502 SubscriptionsResourceApi(common_internal.ApiRequester client) : | 502 SubscriptionsResourceApi(commons.ApiRequester client) : |
503 _requester = client; | 503 _requester = client; |
504 | 504 |
505 /** | 505 /** |
506 * Deletes a subscription. | 506 * Deletes a subscription. |
507 * | 507 * |
508 * Request parameters: | 508 * Request parameters: |
509 * | 509 * |
510 * [id] - The ID of the subscription. | 510 * [id] - The ID of the subscription. |
511 * | 511 * |
512 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 512 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
513 * error. | 513 * error. |
514 * | 514 * |
515 * If the used [http.Client] completes with an error when making a REST call, | 515 * If the used [http.Client] completes with an error when making a REST call, |
516 * this method will complete with the same error. | 516 * this method will complete with the same error. |
517 */ | 517 */ |
518 async.Future delete(core.String id) { | 518 async.Future delete(core.String id) { |
519 var _url = null; | 519 var _url = null; |
520 var _queryParams = new core.Map(); | 520 var _queryParams = new core.Map(); |
521 var _uploadMedia = null; | 521 var _uploadMedia = null; |
522 var _uploadOptions = null; | 522 var _uploadOptions = null; |
523 var _downloadOptions = common.DownloadOptions.Metadata; | 523 var _downloadOptions = commons.DownloadOptions.Metadata; |
524 var _body = null; | 524 var _body = null; |
525 | 525 |
526 if (id == null) { | 526 if (id == null) { |
527 throw new core.ArgumentError("Parameter id is required."); | 527 throw new core.ArgumentError("Parameter id is required."); |
528 } | 528 } |
529 | 529 |
530 _downloadOptions = null; | 530 _downloadOptions = null; |
531 | 531 |
532 _url = 'subscriptions/' + common_internal.Escaper.ecapeVariable('$id'); | 532 _url = 'subscriptions/' + commons.Escaper.ecapeVariable('$id'); |
533 | 533 |
534 var _response = _requester.request(_url, | 534 var _response = _requester.request(_url, |
535 "DELETE", | 535 "DELETE", |
536 body: _body, | 536 body: _body, |
537 queryParams: _queryParams, | 537 queryParams: _queryParams, |
538 uploadOptions: _uploadOptions, | 538 uploadOptions: _uploadOptions, |
539 uploadMedia: _uploadMedia, | 539 uploadMedia: _uploadMedia, |
540 downloadOptions: _downloadOptions); | 540 downloadOptions: _downloadOptions); |
541 return _response.then((data) => null); | 541 return _response.then((data) => null); |
542 } | 542 } |
543 | 543 |
544 /** | 544 /** |
545 * Creates a new subscription. | 545 * Creates a new subscription. |
546 * | 546 * |
547 * [request] - The metadata request object. | 547 * [request] - The metadata request object. |
548 * | 548 * |
549 * Request parameters: | 549 * Request parameters: |
550 * | 550 * |
551 * Completes with a [Subscription]. | 551 * Completes with a [Subscription]. |
552 * | 552 * |
553 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 553 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
554 * error. | 554 * error. |
555 * | 555 * |
556 * If the used [http.Client] completes with an error when making a REST call, | 556 * If the used [http.Client] completes with an error when making a REST call, |
557 * this method will complete with the same error. | 557 * this method will complete with the same error. |
558 */ | 558 */ |
559 async.Future<Subscription> insert(Subscription request) { | 559 async.Future<Subscription> insert(Subscription request) { |
560 var _url = null; | 560 var _url = null; |
561 var _queryParams = new core.Map(); | 561 var _queryParams = new core.Map(); |
562 var _uploadMedia = null; | 562 var _uploadMedia = null; |
563 var _uploadOptions = null; | 563 var _uploadOptions = null; |
564 var _downloadOptions = common.DownloadOptions.Metadata; | 564 var _downloadOptions = commons.DownloadOptions.Metadata; |
565 var _body = null; | 565 var _body = null; |
566 | 566 |
567 if (request != null) { | 567 if (request != null) { |
568 _body = convert.JSON.encode((request).toJson()); | 568 _body = convert.JSON.encode((request).toJson()); |
569 } | 569 } |
570 | 570 |
571 | 571 |
572 _url = 'subscriptions'; | 572 _url = 'subscriptions'; |
573 | 573 |
574 var _response = _requester.request(_url, | 574 var _response = _requester.request(_url, |
575 "POST", | 575 "POST", |
576 body: _body, | 576 body: _body, |
577 queryParams: _queryParams, | 577 queryParams: _queryParams, |
578 uploadOptions: _uploadOptions, | 578 uploadOptions: _uploadOptions, |
579 uploadMedia: _uploadMedia, | 579 uploadMedia: _uploadMedia, |
580 downloadOptions: _downloadOptions); | 580 downloadOptions: _downloadOptions); |
581 return _response.then((data) => new Subscription.fromJson(data)); | 581 return _response.then((data) => new Subscription.fromJson(data)); |
582 } | 582 } |
583 | 583 |
584 /** | 584 /** |
585 * Retrieves a list of subscriptions for the authenticated user and service. | 585 * Retrieves a list of subscriptions for the authenticated user and service. |
586 * | 586 * |
587 * Request parameters: | 587 * Request parameters: |
588 * | 588 * |
589 * Completes with a [SubscriptionsListResponse]. | 589 * Completes with a [SubscriptionsListResponse]. |
590 * | 590 * |
591 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 591 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
592 * error. | 592 * error. |
593 * | 593 * |
594 * If the used [http.Client] completes with an error when making a REST call, | 594 * If the used [http.Client] completes with an error when making a REST call, |
595 * this method will complete with the same error. | 595 * this method will complete with the same error. |
596 */ | 596 */ |
597 async.Future<SubscriptionsListResponse> list() { | 597 async.Future<SubscriptionsListResponse> list() { |
598 var _url = null; | 598 var _url = null; |
599 var _queryParams = new core.Map(); | 599 var _queryParams = new core.Map(); |
600 var _uploadMedia = null; | 600 var _uploadMedia = null; |
601 var _uploadOptions = null; | 601 var _uploadOptions = null; |
602 var _downloadOptions = common.DownloadOptions.Metadata; | 602 var _downloadOptions = commons.DownloadOptions.Metadata; |
603 var _body = null; | 603 var _body = null; |
604 | 604 |
605 | 605 |
606 | 606 |
607 _url = 'subscriptions'; | 607 _url = 'subscriptions'; |
608 | 608 |
609 var _response = _requester.request(_url, | 609 var _response = _requester.request(_url, |
610 "GET", | 610 "GET", |
611 body: _body, | 611 body: _body, |
612 queryParams: _queryParams, | 612 queryParams: _queryParams, |
613 uploadOptions: _uploadOptions, | 613 uploadOptions: _uploadOptions, |
614 uploadMedia: _uploadMedia, | 614 uploadMedia: _uploadMedia, |
615 downloadOptions: _downloadOptions); | 615 downloadOptions: _downloadOptions); |
616 return _response.then((data) => new SubscriptionsListResponse.fromJson(data)
); | 616 return _response.then((data) => new SubscriptionsListResponse.fromJson(data)
); |
617 } | 617 } |
618 | 618 |
619 /** | 619 /** |
620 * Updates an existing subscription in place. | 620 * Updates an existing subscription in place. |
621 * | 621 * |
622 * [request] - The metadata request object. | 622 * [request] - The metadata request object. |
623 * | 623 * |
624 * Request parameters: | 624 * Request parameters: |
625 * | 625 * |
626 * [id] - The ID of the subscription. | 626 * [id] - The ID of the subscription. |
627 * | 627 * |
628 * Completes with a [Subscription]. | 628 * Completes with a [Subscription]. |
629 * | 629 * |
630 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 630 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
631 * error. | 631 * error. |
632 * | 632 * |
633 * If the used [http.Client] completes with an error when making a REST call, | 633 * If the used [http.Client] completes with an error when making a REST call, |
634 * this method will complete with the same error. | 634 * this method will complete with the same error. |
635 */ | 635 */ |
636 async.Future<Subscription> update(Subscription request, core.String id) { | 636 async.Future<Subscription> update(Subscription request, core.String id) { |
637 var _url = null; | 637 var _url = null; |
638 var _queryParams = new core.Map(); | 638 var _queryParams = new core.Map(); |
639 var _uploadMedia = null; | 639 var _uploadMedia = null; |
640 var _uploadOptions = null; | 640 var _uploadOptions = null; |
641 var _downloadOptions = common.DownloadOptions.Metadata; | 641 var _downloadOptions = commons.DownloadOptions.Metadata; |
642 var _body = null; | 642 var _body = null; |
643 | 643 |
644 if (request != null) { | 644 if (request != null) { |
645 _body = convert.JSON.encode((request).toJson()); | 645 _body = convert.JSON.encode((request).toJson()); |
646 } | 646 } |
647 if (id == null) { | 647 if (id == null) { |
648 throw new core.ArgumentError("Parameter id is required."); | 648 throw new core.ArgumentError("Parameter id is required."); |
649 } | 649 } |
650 | 650 |
651 | 651 |
652 _url = 'subscriptions/' + common_internal.Escaper.ecapeVariable('$id'); | 652 _url = 'subscriptions/' + commons.Escaper.ecapeVariable('$id'); |
653 | 653 |
654 var _response = _requester.request(_url, | 654 var _response = _requester.request(_url, |
655 "PUT", | 655 "PUT", |
656 body: _body, | 656 body: _body, |
657 queryParams: _queryParams, | 657 queryParams: _queryParams, |
658 uploadOptions: _uploadOptions, | 658 uploadOptions: _uploadOptions, |
659 uploadMedia: _uploadMedia, | 659 uploadMedia: _uploadMedia, |
660 downloadOptions: _downloadOptions); | 660 downloadOptions: _downloadOptions); |
661 return _response.then((data) => new Subscription.fromJson(data)); | 661 return _response.then((data) => new Subscription.fromJson(data)); |
662 } | 662 } |
663 | 663 |
664 } | 664 } |
665 | 665 |
666 | 666 |
667 /** Not documented yet. */ | |
668 class TimelineResourceApi { | 667 class TimelineResourceApi { |
669 final common_internal.ApiRequester _requester; | 668 final commons.ApiRequester _requester; |
670 | 669 |
671 TimelineAttachmentsResourceApi get attachments => new TimelineAttachmentsResou
rceApi(_requester); | 670 TimelineAttachmentsResourceApi get attachments => new TimelineAttachmentsResou
rceApi(_requester); |
672 | 671 |
673 TimelineResourceApi(common_internal.ApiRequester client) : | 672 TimelineResourceApi(commons.ApiRequester client) : |
674 _requester = client; | 673 _requester = client; |
675 | 674 |
676 /** | 675 /** |
677 * Deletes a timeline item. | 676 * Deletes a timeline item. |
678 * | 677 * |
679 * Request parameters: | 678 * Request parameters: |
680 * | 679 * |
681 * [id] - The ID of the timeline item. | 680 * [id] - The ID of the timeline item. |
682 * | 681 * |
683 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 682 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
684 * error. | 683 * error. |
685 * | 684 * |
686 * If the used [http.Client] completes with an error when making a REST call, | 685 * If the used [http.Client] completes with an error when making a REST call, |
687 * this method will complete with the same error. | 686 * this method will complete with the same error. |
688 */ | 687 */ |
689 async.Future delete(core.String id) { | 688 async.Future delete(core.String id) { |
690 var _url = null; | 689 var _url = null; |
691 var _queryParams = new core.Map(); | 690 var _queryParams = new core.Map(); |
692 var _uploadMedia = null; | 691 var _uploadMedia = null; |
693 var _uploadOptions = null; | 692 var _uploadOptions = null; |
694 var _downloadOptions = common.DownloadOptions.Metadata; | 693 var _downloadOptions = commons.DownloadOptions.Metadata; |
695 var _body = null; | 694 var _body = null; |
696 | 695 |
697 if (id == null) { | 696 if (id == null) { |
698 throw new core.ArgumentError("Parameter id is required."); | 697 throw new core.ArgumentError("Parameter id is required."); |
699 } | 698 } |
700 | 699 |
701 _downloadOptions = null; | 700 _downloadOptions = null; |
702 | 701 |
703 _url = 'timeline/' + common_internal.Escaper.ecapeVariable('$id'); | 702 _url = 'timeline/' + commons.Escaper.ecapeVariable('$id'); |
704 | 703 |
705 var _response = _requester.request(_url, | 704 var _response = _requester.request(_url, |
706 "DELETE", | 705 "DELETE", |
707 body: _body, | 706 body: _body, |
708 queryParams: _queryParams, | 707 queryParams: _queryParams, |
709 uploadOptions: _uploadOptions, | 708 uploadOptions: _uploadOptions, |
710 uploadMedia: _uploadMedia, | 709 uploadMedia: _uploadMedia, |
711 downloadOptions: _downloadOptions); | 710 downloadOptions: _downloadOptions); |
712 return _response.then((data) => null); | 711 return _response.then((data) => null); |
713 } | 712 } |
714 | 713 |
715 /** | 714 /** |
716 * Gets a single timeline item by ID. | 715 * Gets a single timeline item by ID. |
717 * | 716 * |
718 * Request parameters: | 717 * Request parameters: |
719 * | 718 * |
720 * [id] - The ID of the timeline item. | 719 * [id] - The ID of the timeline item. |
721 * | 720 * |
722 * Completes with a [TimelineItem]. | 721 * Completes with a [TimelineItem]. |
723 * | 722 * |
724 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 723 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
725 * error. | 724 * error. |
726 * | 725 * |
727 * If the used [http.Client] completes with an error when making a REST call, | 726 * If the used [http.Client] completes with an error when making a REST call, |
728 * this method will complete with the same error. | 727 * this method will complete with the same error. |
729 */ | 728 */ |
730 async.Future<TimelineItem> get(core.String id) { | 729 async.Future<TimelineItem> get(core.String id) { |
731 var _url = null; | 730 var _url = null; |
732 var _queryParams = new core.Map(); | 731 var _queryParams = new core.Map(); |
733 var _uploadMedia = null; | 732 var _uploadMedia = null; |
734 var _uploadOptions = null; | 733 var _uploadOptions = null; |
735 var _downloadOptions = common.DownloadOptions.Metadata; | 734 var _downloadOptions = commons.DownloadOptions.Metadata; |
736 var _body = null; | 735 var _body = null; |
737 | 736 |
738 if (id == null) { | 737 if (id == null) { |
739 throw new core.ArgumentError("Parameter id is required."); | 738 throw new core.ArgumentError("Parameter id is required."); |
740 } | 739 } |
741 | 740 |
742 | 741 |
743 _url = 'timeline/' + common_internal.Escaper.ecapeVariable('$id'); | 742 _url = 'timeline/' + commons.Escaper.ecapeVariable('$id'); |
744 | 743 |
745 var _response = _requester.request(_url, | 744 var _response = _requester.request(_url, |
746 "GET", | 745 "GET", |
747 body: _body, | 746 body: _body, |
748 queryParams: _queryParams, | 747 queryParams: _queryParams, |
749 uploadOptions: _uploadOptions, | 748 uploadOptions: _uploadOptions, |
750 uploadMedia: _uploadMedia, | 749 uploadMedia: _uploadMedia, |
751 downloadOptions: _downloadOptions); | 750 downloadOptions: _downloadOptions); |
752 return _response.then((data) => new TimelineItem.fromJson(data)); | 751 return _response.then((data) => new TimelineItem.fromJson(data)); |
753 } | 752 } |
754 | 753 |
755 /** | 754 /** |
756 * Inserts a new item into the timeline. | 755 * Inserts a new item into the timeline. |
757 * | 756 * |
758 * [request] - The metadata request object. | 757 * [request] - The metadata request object. |
759 * | 758 * |
760 * Request parameters: | 759 * Request parameters: |
761 * | 760 * |
762 * [uploadMedia] - The media to upload. | 761 * [uploadMedia] - The media to upload. |
763 * | 762 * |
764 * [uploadOptions] - Options for the media upload. Streaming Media without the | 763 * [uploadOptions] - Options for the media upload. Streaming Media without the |
765 * length being known ahead of time is only supported via resumable uploads. | 764 * length being known ahead of time is only supported via resumable uploads. |
766 * | 765 * |
767 * Completes with a [TimelineItem]. | 766 * Completes with a [TimelineItem]. |
768 * | 767 * |
769 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 768 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
770 * error. | 769 * error. |
771 * | 770 * |
772 * If the used [http.Client] completes with an error when making a REST call, | 771 * If the used [http.Client] completes with an error when making a REST call, |
773 * this method will complete with the same error. | 772 * this method will complete with the same error. |
774 */ | 773 */ |
775 async.Future<TimelineItem> insert(TimelineItem request, {common.UploadOptions
uploadOptions : common.UploadOptions.Default, common.Media uploadMedia}) { | 774 async.Future<TimelineItem> insert(TimelineItem request, {commons.UploadOptions
uploadOptions : commons.UploadOptions.Default, commons.Media uploadMedia}) { |
776 var _url = null; | 775 var _url = null; |
777 var _queryParams = new core.Map(); | 776 var _queryParams = new core.Map(); |
778 var _uploadMedia = null; | 777 var _uploadMedia = null; |
779 var _uploadOptions = null; | 778 var _uploadOptions = null; |
780 var _downloadOptions = common.DownloadOptions.Metadata; | 779 var _downloadOptions = commons.DownloadOptions.Metadata; |
781 var _body = null; | 780 var _body = null; |
782 | 781 |
783 if (request != null) { | 782 if (request != null) { |
784 _body = convert.JSON.encode((request).toJson()); | 783 _body = convert.JSON.encode((request).toJson()); |
785 } | 784 } |
786 | 785 |
787 _uploadMedia = uploadMedia; | 786 _uploadMedia = uploadMedia; |
788 _uploadOptions = uploadOptions; | 787 _uploadOptions = uploadOptions; |
789 | 788 |
790 if (_uploadMedia == null) { | 789 if (_uploadMedia == null) { |
791 _url = 'timeline'; | 790 _url = 'timeline'; |
792 } else if (_uploadOptions is common.ResumableUploadOptions) { | 791 } else if (_uploadOptions is commons.ResumableUploadOptions) { |
793 _url = '/resumable/upload/mirror/v1/timeline'; | 792 _url = '/resumable/upload/mirror/v1/timeline'; |
794 } else { | 793 } else { |
795 _url = '/upload/mirror/v1/timeline'; | 794 _url = '/upload/mirror/v1/timeline'; |
796 } | 795 } |
797 | 796 |
798 | 797 |
799 var _response = _requester.request(_url, | 798 var _response = _requester.request(_url, |
800 "POST", | 799 "POST", |
801 body: _body, | 800 body: _body, |
802 queryParams: _queryParams, | 801 queryParams: _queryParams, |
(...skipping 26 matching lines...) Expand all Loading... |
829 * | 828 * |
830 * [pageToken] - Token for the page of results to return. | 829 * [pageToken] - Token for the page of results to return. |
831 * | 830 * |
832 * [pinnedOnly] - If true, only pinned items will be returned. | 831 * [pinnedOnly] - If true, only pinned items will be returned. |
833 * | 832 * |
834 * [sourceItemId] - If provided, only items with the given sourceItemId will | 833 * [sourceItemId] - If provided, only items with the given sourceItemId will |
835 * be returned. | 834 * be returned. |
836 * | 835 * |
837 * Completes with a [TimelineListResponse]. | 836 * Completes with a [TimelineListResponse]. |
838 * | 837 * |
839 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 838 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
840 * error. | 839 * error. |
841 * | 840 * |
842 * If the used [http.Client] completes with an error when making a REST call, | 841 * If the used [http.Client] completes with an error when making a REST call, |
843 * this method will complete with the same error. | 842 * this method will complete with the same error. |
844 */ | 843 */ |
845 async.Future<TimelineListResponse> list({core.String bundleId, core.bool inclu
deDeleted, core.int maxResults, core.String orderBy, core.String pageToken, core
.bool pinnedOnly, core.String sourceItemId}) { | 844 async.Future<TimelineListResponse> list({core.String bundleId, core.bool inclu
deDeleted, core.int maxResults, core.String orderBy, core.String pageToken, core
.bool pinnedOnly, core.String sourceItemId}) { |
846 var _url = null; | 845 var _url = null; |
847 var _queryParams = new core.Map(); | 846 var _queryParams = new core.Map(); |
848 var _uploadMedia = null; | 847 var _uploadMedia = null; |
849 var _uploadOptions = null; | 848 var _uploadOptions = null; |
850 var _downloadOptions = common.DownloadOptions.Metadata; | 849 var _downloadOptions = commons.DownloadOptions.Metadata; |
851 var _body = null; | 850 var _body = null; |
852 | 851 |
853 if (bundleId != null) { | 852 if (bundleId != null) { |
854 _queryParams["bundleId"] = [bundleId]; | 853 _queryParams["bundleId"] = [bundleId]; |
855 } | 854 } |
856 if (includeDeleted != null) { | 855 if (includeDeleted != null) { |
857 _queryParams["includeDeleted"] = ["${includeDeleted}"]; | 856 _queryParams["includeDeleted"] = ["${includeDeleted}"]; |
858 } | 857 } |
859 if (maxResults != null) { | 858 if (maxResults != null) { |
860 _queryParams["maxResults"] = ["${maxResults}"]; | 859 _queryParams["maxResults"] = ["${maxResults}"]; |
(...skipping 28 matching lines...) Expand all Loading... |
889 * Updates a timeline item in place. This method supports patch semantics. | 888 * Updates a timeline item in place. This method supports patch semantics. |
890 * | 889 * |
891 * [request] - The metadata request object. | 890 * [request] - The metadata request object. |
892 * | 891 * |
893 * Request parameters: | 892 * Request parameters: |
894 * | 893 * |
895 * [id] - The ID of the timeline item. | 894 * [id] - The ID of the timeline item. |
896 * | 895 * |
897 * Completes with a [TimelineItem]. | 896 * Completes with a [TimelineItem]. |
898 * | 897 * |
899 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 898 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
900 * error. | 899 * error. |
901 * | 900 * |
902 * If the used [http.Client] completes with an error when making a REST call, | 901 * If the used [http.Client] completes with an error when making a REST call, |
903 * this method will complete with the same error. | 902 * this method will complete with the same error. |
904 */ | 903 */ |
905 async.Future<TimelineItem> patch(TimelineItem request, core.String id) { | 904 async.Future<TimelineItem> patch(TimelineItem request, core.String id) { |
906 var _url = null; | 905 var _url = null; |
907 var _queryParams = new core.Map(); | 906 var _queryParams = new core.Map(); |
908 var _uploadMedia = null; | 907 var _uploadMedia = null; |
909 var _uploadOptions = null; | 908 var _uploadOptions = null; |
910 var _downloadOptions = common.DownloadOptions.Metadata; | 909 var _downloadOptions = commons.DownloadOptions.Metadata; |
911 var _body = null; | 910 var _body = null; |
912 | 911 |
913 if (request != null) { | 912 if (request != null) { |
914 _body = convert.JSON.encode((request).toJson()); | 913 _body = convert.JSON.encode((request).toJson()); |
915 } | 914 } |
916 if (id == null) { | 915 if (id == null) { |
917 throw new core.ArgumentError("Parameter id is required."); | 916 throw new core.ArgumentError("Parameter id is required."); |
918 } | 917 } |
919 | 918 |
920 | 919 |
921 _url = 'timeline/' + common_internal.Escaper.ecapeVariable('$id'); | 920 _url = 'timeline/' + commons.Escaper.ecapeVariable('$id'); |
922 | 921 |
923 var _response = _requester.request(_url, | 922 var _response = _requester.request(_url, |
924 "PATCH", | 923 "PATCH", |
925 body: _body, | 924 body: _body, |
926 queryParams: _queryParams, | 925 queryParams: _queryParams, |
927 uploadOptions: _uploadOptions, | 926 uploadOptions: _uploadOptions, |
928 uploadMedia: _uploadMedia, | 927 uploadMedia: _uploadMedia, |
929 downloadOptions: _downloadOptions); | 928 downloadOptions: _downloadOptions); |
930 return _response.then((data) => new TimelineItem.fromJson(data)); | 929 return _response.then((data) => new TimelineItem.fromJson(data)); |
931 } | 930 } |
932 | 931 |
933 /** | 932 /** |
934 * Updates a timeline item in place. | 933 * Updates a timeline item in place. |
935 * | 934 * |
936 * [request] - The metadata request object. | 935 * [request] - The metadata request object. |
937 * | 936 * |
938 * Request parameters: | 937 * Request parameters: |
939 * | 938 * |
940 * [id] - The ID of the timeline item. | 939 * [id] - The ID of the timeline item. |
941 * | 940 * |
942 * [uploadMedia] - The media to upload. | 941 * [uploadMedia] - The media to upload. |
943 * | 942 * |
944 * [uploadOptions] - Options for the media upload. Streaming Media without the | 943 * [uploadOptions] - Options for the media upload. Streaming Media without the |
945 * length being known ahead of time is only supported via resumable uploads. | 944 * length being known ahead of time is only supported via resumable uploads. |
946 * | 945 * |
947 * Completes with a [TimelineItem]. | 946 * Completes with a [TimelineItem]. |
948 * | 947 * |
949 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 948 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
950 * error. | 949 * error. |
951 * | 950 * |
952 * If the used [http.Client] completes with an error when making a REST call, | 951 * If the used [http.Client] completes with an error when making a REST call, |
953 * this method will complete with the same error. | 952 * this method will complete with the same error. |
954 */ | 953 */ |
955 async.Future<TimelineItem> update(TimelineItem request, core.String id, {commo
n.UploadOptions uploadOptions : common.UploadOptions.Default, common.Media uploa
dMedia}) { | 954 async.Future<TimelineItem> update(TimelineItem request, core.String id, {commo
ns.UploadOptions uploadOptions : commons.UploadOptions.Default, commons.Media up
loadMedia}) { |
956 var _url = null; | 955 var _url = null; |
957 var _queryParams = new core.Map(); | 956 var _queryParams = new core.Map(); |
958 var _uploadMedia = null; | 957 var _uploadMedia = null; |
959 var _uploadOptions = null; | 958 var _uploadOptions = null; |
960 var _downloadOptions = common.DownloadOptions.Metadata; | 959 var _downloadOptions = commons.DownloadOptions.Metadata; |
961 var _body = null; | 960 var _body = null; |
962 | 961 |
963 if (request != null) { | 962 if (request != null) { |
964 _body = convert.JSON.encode((request).toJson()); | 963 _body = convert.JSON.encode((request).toJson()); |
965 } | 964 } |
966 if (id == null) { | 965 if (id == null) { |
967 throw new core.ArgumentError("Parameter id is required."); | 966 throw new core.ArgumentError("Parameter id is required."); |
968 } | 967 } |
969 | 968 |
970 _uploadMedia = uploadMedia; | 969 _uploadMedia = uploadMedia; |
971 _uploadOptions = uploadOptions; | 970 _uploadOptions = uploadOptions; |
972 | 971 |
973 if (_uploadMedia == null) { | 972 if (_uploadMedia == null) { |
974 _url = 'timeline/' + common_internal.Escaper.ecapeVariable('$id'); | 973 _url = 'timeline/' + commons.Escaper.ecapeVariable('$id'); |
975 } else if (_uploadOptions is common.ResumableUploadOptions) { | 974 } else if (_uploadOptions is commons.ResumableUploadOptions) { |
976 _url = '/resumable/upload/mirror/v1/timeline/' + common_internal.Escaper.e
capeVariable('$id'); | 975 _url = '/resumable/upload/mirror/v1/timeline/' + commons.Escaper.ecapeVari
able('$id'); |
977 } else { | 976 } else { |
978 _url = '/upload/mirror/v1/timeline/' + common_internal.Escaper.ecapeVariab
le('$id'); | 977 _url = '/upload/mirror/v1/timeline/' + commons.Escaper.ecapeVariable('$id'
); |
979 } | 978 } |
980 | 979 |
981 | 980 |
982 var _response = _requester.request(_url, | 981 var _response = _requester.request(_url, |
983 "PUT", | 982 "PUT", |
984 body: _body, | 983 body: _body, |
985 queryParams: _queryParams, | 984 queryParams: _queryParams, |
986 uploadOptions: _uploadOptions, | 985 uploadOptions: _uploadOptions, |
987 uploadMedia: _uploadMedia, | 986 uploadMedia: _uploadMedia, |
988 downloadOptions: _downloadOptions); | 987 downloadOptions: _downloadOptions); |
989 return _response.then((data) => new TimelineItem.fromJson(data)); | 988 return _response.then((data) => new TimelineItem.fromJson(data)); |
990 } | 989 } |
991 | 990 |
992 } | 991 } |
993 | 992 |
994 | 993 |
995 /** Not documented yet. */ | |
996 class TimelineAttachmentsResourceApi { | 994 class TimelineAttachmentsResourceApi { |
997 final common_internal.ApiRequester _requester; | 995 final commons.ApiRequester _requester; |
998 | 996 |
999 TimelineAttachmentsResourceApi(common_internal.ApiRequester client) : | 997 TimelineAttachmentsResourceApi(commons.ApiRequester client) : |
1000 _requester = client; | 998 _requester = client; |
1001 | 999 |
1002 /** | 1000 /** |
1003 * Deletes an attachment from a timeline item. | 1001 * Deletes an attachment from a timeline item. |
1004 * | 1002 * |
1005 * Request parameters: | 1003 * Request parameters: |
1006 * | 1004 * |
1007 * [itemId] - The ID of the timeline item the attachment belongs to. | 1005 * [itemId] - The ID of the timeline item the attachment belongs to. |
1008 * | 1006 * |
1009 * [attachmentId] - The ID of the attachment. | 1007 * [attachmentId] - The ID of the attachment. |
1010 * | 1008 * |
1011 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1009 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
1012 * error. | 1010 * error. |
1013 * | 1011 * |
1014 * If the used [http.Client] completes with an error when making a REST call, | 1012 * If the used [http.Client] completes with an error when making a REST call, |
1015 * this method will complete with the same error. | 1013 * this method will complete with the same error. |
1016 */ | 1014 */ |
1017 async.Future delete(core.String itemId, core.String attachmentId) { | 1015 async.Future delete(core.String itemId, core.String attachmentId) { |
1018 var _url = null; | 1016 var _url = null; |
1019 var _queryParams = new core.Map(); | 1017 var _queryParams = new core.Map(); |
1020 var _uploadMedia = null; | 1018 var _uploadMedia = null; |
1021 var _uploadOptions = null; | 1019 var _uploadOptions = null; |
1022 var _downloadOptions = common.DownloadOptions.Metadata; | 1020 var _downloadOptions = commons.DownloadOptions.Metadata; |
1023 var _body = null; | 1021 var _body = null; |
1024 | 1022 |
1025 if (itemId == null) { | 1023 if (itemId == null) { |
1026 throw new core.ArgumentError("Parameter itemId is required."); | 1024 throw new core.ArgumentError("Parameter itemId is required."); |
1027 } | 1025 } |
1028 if (attachmentId == null) { | 1026 if (attachmentId == null) { |
1029 throw new core.ArgumentError("Parameter attachmentId is required."); | 1027 throw new core.ArgumentError("Parameter attachmentId is required."); |
1030 } | 1028 } |
1031 | 1029 |
1032 _downloadOptions = null; | 1030 _downloadOptions = null; |
1033 | 1031 |
1034 _url = 'timeline/' + common_internal.Escaper.ecapeVariable('$itemId') + '/at
tachments/' + common_internal.Escaper.ecapeVariable('$attachmentId'); | 1032 _url = 'timeline/' + commons.Escaper.ecapeVariable('$itemId') + '/attachment
s/' + commons.Escaper.ecapeVariable('$attachmentId'); |
1035 | 1033 |
1036 var _response = _requester.request(_url, | 1034 var _response = _requester.request(_url, |
1037 "DELETE", | 1035 "DELETE", |
1038 body: _body, | 1036 body: _body, |
1039 queryParams: _queryParams, | 1037 queryParams: _queryParams, |
1040 uploadOptions: _uploadOptions, | 1038 uploadOptions: _uploadOptions, |
1041 uploadMedia: _uploadMedia, | 1039 uploadMedia: _uploadMedia, |
1042 downloadOptions: _downloadOptions); | 1040 downloadOptions: _downloadOptions); |
1043 return _response.then((data) => null); | 1041 return _response.then((data) => null); |
1044 } | 1042 } |
1045 | 1043 |
1046 /** | 1044 /** |
1047 * Retrieves an attachment on a timeline item by item ID and attachment ID. | 1045 * Retrieves an attachment on a timeline item by item ID and attachment ID. |
1048 * | 1046 * |
1049 * Request parameters: | 1047 * Request parameters: |
1050 * | 1048 * |
1051 * [itemId] - The ID of the timeline item the attachment belongs to. | 1049 * [itemId] - The ID of the timeline item the attachment belongs to. |
1052 * | 1050 * |
1053 * [attachmentId] - The ID of the attachment. | 1051 * [attachmentId] - The ID of the attachment. |
1054 * | 1052 * |
1055 * [downloadOptions] - Options for downloading. A download can be either a | 1053 * [downloadOptions] - Options for downloading. A download can be either a |
1056 * Metadata (default) or Media download. Partial Media downloads are possible | 1054 * Metadata (default) or Media download. Partial Media downloads are possible |
1057 * as well. | 1055 * as well. |
1058 * | 1056 * |
1059 * Completes with a | 1057 * Completes with a |
1060 * | 1058 * |
1061 * - [Attachment] for Metadata downloads (see [downloadOptions]). | 1059 * - [Attachment] for Metadata downloads (see [downloadOptions]). |
1062 * | 1060 * |
1063 * - [common.Media] for Media downloads (see [downloadOptions]). | 1061 * - [commons.Media] for Media downloads (see [downloadOptions]). |
1064 * | 1062 * |
1065 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1063 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
1066 * error. | 1064 * error. |
1067 * | 1065 * |
1068 * If the used [http.Client] completes with an error when making a REST call, | 1066 * If the used [http.Client] completes with an error when making a REST call, |
1069 * this method will complete with the same error. | 1067 * this method will complete with the same error. |
1070 */ | 1068 */ |
1071 async.Future get(core.String itemId, core.String attachmentId, {common.Downloa
dOptions downloadOptions: common.DownloadOptions.Metadata}) { | 1069 async.Future get(core.String itemId, core.String attachmentId, {commons.Downlo
adOptions downloadOptions: commons.DownloadOptions.Metadata}) { |
1072 var _url = null; | 1070 var _url = null; |
1073 var _queryParams = new core.Map(); | 1071 var _queryParams = new core.Map(); |
1074 var _uploadMedia = null; | 1072 var _uploadMedia = null; |
1075 var _uploadOptions = null; | 1073 var _uploadOptions = null; |
1076 var _downloadOptions = common.DownloadOptions.Metadata; | 1074 var _downloadOptions = commons.DownloadOptions.Metadata; |
1077 var _body = null; | 1075 var _body = null; |
1078 | 1076 |
1079 if (itemId == null) { | 1077 if (itemId == null) { |
1080 throw new core.ArgumentError("Parameter itemId is required."); | 1078 throw new core.ArgumentError("Parameter itemId is required."); |
1081 } | 1079 } |
1082 if (attachmentId == null) { | 1080 if (attachmentId == null) { |
1083 throw new core.ArgumentError("Parameter attachmentId is required."); | 1081 throw new core.ArgumentError("Parameter attachmentId is required."); |
1084 } | 1082 } |
1085 | 1083 |
1086 _downloadOptions = downloadOptions; | 1084 _downloadOptions = downloadOptions; |
1087 | 1085 |
1088 _url = 'timeline/' + common_internal.Escaper.ecapeVariable('$itemId') + '/at
tachments/' + common_internal.Escaper.ecapeVariable('$attachmentId'); | 1086 _url = 'timeline/' + commons.Escaper.ecapeVariable('$itemId') + '/attachment
s/' + commons.Escaper.ecapeVariable('$attachmentId'); |
1089 | 1087 |
1090 var _response = _requester.request(_url, | 1088 var _response = _requester.request(_url, |
1091 "GET", | 1089 "GET", |
1092 body: _body, | 1090 body: _body, |
1093 queryParams: _queryParams, | 1091 queryParams: _queryParams, |
1094 uploadOptions: _uploadOptions, | 1092 uploadOptions: _uploadOptions, |
1095 uploadMedia: _uploadMedia, | 1093 uploadMedia: _uploadMedia, |
1096 downloadOptions: _downloadOptions); | 1094 downloadOptions: _downloadOptions); |
1097 if (_downloadOptions == null || | 1095 if (_downloadOptions == null || |
1098 _downloadOptions == common.DownloadOptions.Metadata) { | 1096 _downloadOptions == commons.DownloadOptions.Metadata) { |
1099 return _response.then((data) => new Attachment.fromJson(data)); | 1097 return _response.then((data) => new Attachment.fromJson(data)); |
1100 } else { | 1098 } else { |
1101 return _response; | 1099 return _response; |
1102 } | 1100 } |
1103 } | 1101 } |
1104 | 1102 |
1105 /** | 1103 /** |
1106 * Adds a new attachment to a timeline item. | 1104 * Adds a new attachment to a timeline item. |
1107 * | 1105 * |
1108 * Request parameters: | 1106 * Request parameters: |
1109 * | 1107 * |
1110 * [itemId] - The ID of the timeline item the attachment belongs to. | 1108 * [itemId] - The ID of the timeline item the attachment belongs to. |
1111 * | 1109 * |
1112 * [uploadMedia] - The media to upload. | 1110 * [uploadMedia] - The media to upload. |
1113 * | 1111 * |
1114 * [uploadOptions] - Options for the media upload. Streaming Media without the | 1112 * [uploadOptions] - Options for the media upload. Streaming Media without the |
1115 * length being known ahead of time is only supported via resumable uploads. | 1113 * length being known ahead of time is only supported via resumable uploads. |
1116 * | 1114 * |
1117 * Completes with a [Attachment]. | 1115 * Completes with a [Attachment]. |
1118 * | 1116 * |
1119 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1117 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
1120 * error. | 1118 * error. |
1121 * | 1119 * |
1122 * If the used [http.Client] completes with an error when making a REST call, | 1120 * If the used [http.Client] completes with an error when making a REST call, |
1123 * this method will complete with the same error. | 1121 * this method will complete with the same error. |
1124 */ | 1122 */ |
1125 async.Future<Attachment> insert(core.String itemId, {common.UploadOptions uplo
adOptions : common.UploadOptions.Default, common.Media uploadMedia}) { | 1123 async.Future<Attachment> insert(core.String itemId, {commons.UploadOptions upl
oadOptions : commons.UploadOptions.Default, commons.Media uploadMedia}) { |
1126 var _url = null; | 1124 var _url = null; |
1127 var _queryParams = new core.Map(); | 1125 var _queryParams = new core.Map(); |
1128 var _uploadMedia = null; | 1126 var _uploadMedia = null; |
1129 var _uploadOptions = null; | 1127 var _uploadOptions = null; |
1130 var _downloadOptions = common.DownloadOptions.Metadata; | 1128 var _downloadOptions = commons.DownloadOptions.Metadata; |
1131 var _body = null; | 1129 var _body = null; |
1132 | 1130 |
1133 if (itemId == null) { | 1131 if (itemId == null) { |
1134 throw new core.ArgumentError("Parameter itemId is required."); | 1132 throw new core.ArgumentError("Parameter itemId is required."); |
1135 } | 1133 } |
1136 | 1134 |
1137 _uploadMedia = uploadMedia; | 1135 _uploadMedia = uploadMedia; |
1138 _uploadOptions = uploadOptions; | 1136 _uploadOptions = uploadOptions; |
1139 | 1137 |
1140 if (_uploadMedia == null) { | 1138 if (_uploadMedia == null) { |
1141 _url = 'timeline/' + common_internal.Escaper.ecapeVariable('$itemId') + '/
attachments'; | 1139 _url = 'timeline/' + commons.Escaper.ecapeVariable('$itemId') + '/attachme
nts'; |
1142 } else if (_uploadOptions is common.ResumableUploadOptions) { | 1140 } else if (_uploadOptions is commons.ResumableUploadOptions) { |
1143 _url = '/resumable/upload/mirror/v1/timeline/' + common_internal.Escaper.e
capeVariable('$itemId') + '/attachments'; | 1141 _url = '/resumable/upload/mirror/v1/timeline/' + commons.Escaper.ecapeVari
able('$itemId') + '/attachments'; |
1144 } else { | 1142 } else { |
1145 _url = '/upload/mirror/v1/timeline/' + common_internal.Escaper.ecapeVariab
le('$itemId') + '/attachments'; | 1143 _url = '/upload/mirror/v1/timeline/' + commons.Escaper.ecapeVariable('$ite
mId') + '/attachments'; |
1146 } | 1144 } |
1147 | 1145 |
1148 | 1146 |
1149 var _response = _requester.request(_url, | 1147 var _response = _requester.request(_url, |
1150 "POST", | 1148 "POST", |
1151 body: _body, | 1149 body: _body, |
1152 queryParams: _queryParams, | 1150 queryParams: _queryParams, |
1153 uploadOptions: _uploadOptions, | 1151 uploadOptions: _uploadOptions, |
1154 uploadMedia: _uploadMedia, | 1152 uploadMedia: _uploadMedia, |
1155 downloadOptions: _downloadOptions); | 1153 downloadOptions: _downloadOptions); |
1156 return _response.then((data) => new Attachment.fromJson(data)); | 1154 return _response.then((data) => new Attachment.fromJson(data)); |
1157 } | 1155 } |
1158 | 1156 |
1159 /** | 1157 /** |
1160 * Returns a list of attachments for a timeline item. | 1158 * Returns a list of attachments for a timeline item. |
1161 * | 1159 * |
1162 * Request parameters: | 1160 * Request parameters: |
1163 * | 1161 * |
1164 * [itemId] - The ID of the timeline item whose attachments should be listed. | 1162 * [itemId] - The ID of the timeline item whose attachments should be listed. |
1165 * | 1163 * |
1166 * Completes with a [AttachmentsListResponse]. | 1164 * Completes with a [AttachmentsListResponse]. |
1167 * | 1165 * |
1168 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1166 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
1169 * error. | 1167 * error. |
1170 * | 1168 * |
1171 * If the used [http.Client] completes with an error when making a REST call, | 1169 * If the used [http.Client] completes with an error when making a REST call, |
1172 * this method will complete with the same error. | 1170 * this method will complete with the same error. |
1173 */ | 1171 */ |
1174 async.Future<AttachmentsListResponse> list(core.String itemId) { | 1172 async.Future<AttachmentsListResponse> list(core.String itemId) { |
1175 var _url = null; | 1173 var _url = null; |
1176 var _queryParams = new core.Map(); | 1174 var _queryParams = new core.Map(); |
1177 var _uploadMedia = null; | 1175 var _uploadMedia = null; |
1178 var _uploadOptions = null; | 1176 var _uploadOptions = null; |
1179 var _downloadOptions = common.DownloadOptions.Metadata; | 1177 var _downloadOptions = commons.DownloadOptions.Metadata; |
1180 var _body = null; | 1178 var _body = null; |
1181 | 1179 |
1182 if (itemId == null) { | 1180 if (itemId == null) { |
1183 throw new core.ArgumentError("Parameter itemId is required."); | 1181 throw new core.ArgumentError("Parameter itemId is required."); |
1184 } | 1182 } |
1185 | 1183 |
1186 | 1184 |
1187 _url = 'timeline/' + common_internal.Escaper.ecapeVariable('$itemId') + '/at
tachments'; | 1185 _url = 'timeline/' + commons.Escaper.ecapeVariable('$itemId') + '/attachment
s'; |
1188 | 1186 |
1189 var _response = _requester.request(_url, | 1187 var _response = _requester.request(_url, |
1190 "GET", | 1188 "GET", |
1191 body: _body, | 1189 body: _body, |
1192 queryParams: _queryParams, | 1190 queryParams: _queryParams, |
1193 uploadOptions: _uploadOptions, | 1191 uploadOptions: _uploadOptions, |
1194 uploadMedia: _uploadMedia, | 1192 uploadMedia: _uploadMedia, |
1195 downloadOptions: _downloadOptions); | 1193 downloadOptions: _downloadOptions); |
1196 return _response.then((data) => new AttachmentsListResponse.fromJson(data)); | 1194 return _response.then((data) => new AttachmentsListResponse.fromJson(data)); |
1197 } | 1195 } |
1198 | 1196 |
1199 } | 1197 } |
1200 | 1198 |
1201 | 1199 |
1202 | 1200 |
1203 /** Represents an account passed into the Account Manager on Glass. */ | 1201 /** Represents an account passed into the Account Manager on Glass. */ |
1204 class Account { | 1202 class Account { |
1205 /** Not documented yet. */ | |
1206 core.List<AuthToken> authTokens; | 1203 core.List<AuthToken> authTokens; |
1207 | 1204 |
1208 /** Not documented yet. */ | |
1209 core.List<core.String> features; | 1205 core.List<core.String> features; |
1210 | 1206 |
1211 /** Not documented yet. */ | |
1212 core.String password; | 1207 core.String password; |
1213 | 1208 |
1214 /** Not documented yet. */ | |
1215 core.List<UserData> userData; | 1209 core.List<UserData> userData; |
1216 | 1210 |
1217 | 1211 |
1218 Account(); | 1212 Account(); |
1219 | 1213 |
1220 Account.fromJson(core.Map _json) { | 1214 Account.fromJson(core.Map _json) { |
1221 if (_json.containsKey("authTokens")) { | 1215 if (_json.containsKey("authTokens")) { |
1222 authTokens = _json["authTokens"].map((value) => new AuthToken.fromJson(val
ue)).toList(); | 1216 authTokens = _json["authTokens"].map((value) => new AuthToken.fromJson(val
ue)).toList(); |
1223 } | 1217 } |
1224 if (_json.containsKey("features")) { | 1218 if (_json.containsKey("features")) { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1338 _json["items"] = items.map((value) => (value).toJson()).toList(); | 1332 _json["items"] = items.map((value) => (value).toJson()).toList(); |
1339 } | 1333 } |
1340 if (kind != null) { | 1334 if (kind != null) { |
1341 _json["kind"] = kind; | 1335 _json["kind"] = kind; |
1342 } | 1336 } |
1343 return _json; | 1337 return _json; |
1344 } | 1338 } |
1345 } | 1339 } |
1346 | 1340 |
1347 | 1341 |
1348 /** Not documented yet. */ | |
1349 class AuthToken { | 1342 class AuthToken { |
1350 /** Not documented yet. */ | |
1351 core.String authToken; | 1343 core.String authToken; |
1352 | 1344 |
1353 /** Not documented yet. */ | |
1354 core.String type; | 1345 core.String type; |
1355 | 1346 |
1356 | 1347 |
1357 AuthToken(); | 1348 AuthToken(); |
1358 | 1349 |
1359 AuthToken.fromJson(core.Map _json) { | 1350 AuthToken.fromJson(core.Map _json) { |
1360 if (_json.containsKey("authToken")) { | 1351 if (_json.containsKey("authToken")) { |
1361 authToken = _json["authToken"]; | 1352 authToken = _json["authToken"]; |
1362 } | 1353 } |
1363 if (_json.containsKey("type")) { | 1354 if (_json.containsKey("type")) { |
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2689 _json["payload"] = payload; | 2680 _json["payload"] = payload; |
2690 } | 2681 } |
2691 if (type != null) { | 2682 if (type != null) { |
2692 _json["type"] = type; | 2683 _json["type"] = type; |
2693 } | 2684 } |
2694 return _json; | 2685 return _json; |
2695 } | 2686 } |
2696 } | 2687 } |
2697 | 2688 |
2698 | 2689 |
2699 /** Not documented yet. */ | |
2700 class UserData { | 2690 class UserData { |
2701 /** Not documented yet. */ | |
2702 core.String key; | 2691 core.String key; |
2703 | 2692 |
2704 /** Not documented yet. */ | |
2705 core.String value; | 2693 core.String value; |
2706 | 2694 |
2707 | 2695 |
2708 UserData(); | 2696 UserData(); |
2709 | 2697 |
2710 UserData.fromJson(core.Map _json) { | 2698 UserData.fromJson(core.Map _json) { |
2711 if (_json.containsKey("key")) { | 2699 if (_json.containsKey("key")) { |
2712 key = _json["key"]; | 2700 key = _json["key"]; |
2713 } | 2701 } |
2714 if (_json.containsKey("value")) { | 2702 if (_json.containsKey("value")) { |
2715 value = _json["value"]; | 2703 value = _json["value"]; |
2716 } | 2704 } |
2717 } | 2705 } |
2718 | 2706 |
2719 core.Map toJson() { | 2707 core.Map toJson() { |
2720 var _json = new core.Map(); | 2708 var _json = new core.Map(); |
2721 if (key != null) { | 2709 if (key != null) { |
2722 _json["key"] = key; | 2710 _json["key"] = key; |
2723 } | 2711 } |
2724 if (value != null) { | 2712 if (value != null) { |
2725 _json["value"] = value; | 2713 _json["value"] = value; |
2726 } | 2714 } |
2727 return _json; | 2715 return _json; |
2728 } | 2716 } |
2729 } | 2717 } |
2730 | |
2731 | |
OLD | NEW |