Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: generated/googleapis_beta/lib/logging/v1beta3.dart

Issue 1078053002: Roll of googleapis as of 4/7/2015. (Closed) Base URL: https://github.com/dart-lang/googleapis.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // This is a generated file (see the discoveryapis_generator project).
2
3 library googleapis_beta.logging.v1beta3;
4
5 import 'dart:core' as core;
6 import 'dart:collection' as collection;
7 import 'dart:async' as async;
8 import 'dart:convert' as convert;
9
10 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons;
11 import 'package:crypto/crypto.dart' as crypto;
12 import 'package:http/http.dart' as http;
13
14 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show
15 ApiRequestError, DetailedApiRequestError;
16
17 const core.String USER_AGENT = 'dart-api-client logging/v1beta3';
18
19 /**
20 * Google Cloud Logging API lets you create logs, ingest log entries, and manage
21 * log sinks.
22 */
23 class LoggingApi {
24 /** View and manage your data across Google Cloud Platform services */
25 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf orm";
26
27
28 final commons.ApiRequester _requester;
29
30 ProjectsResourceApi get projects => new ProjectsResourceApi(_requester);
31
32 LoggingApi(http.Client client, {core.String rootUrl: "https://logging.googleap is.com/", core.String servicePath: ""}) :
33 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A GENT);
34 }
35
36
37 class ProjectsResourceApi {
38 final commons.ApiRequester _requester;
39
40 ProjectsLogServicesResourceApi get logServices => new ProjectsLogServicesResou rceApi(_requester);
41 ProjectsLogsResourceApi get logs => new ProjectsLogsResourceApi(_requester);
42
43 ProjectsResourceApi(commons.ApiRequester client) :
44 _requester = client;
45 }
46
47
48 class ProjectsLogServicesResourceApi {
49 final commons.ApiRequester _requester;
50
51 ProjectsLogServicesIndexesResourceApi get indexes => new ProjectsLogServicesIn dexesResourceApi(_requester);
52 ProjectsLogServicesSinksResourceApi get sinks => new ProjectsLogServicesSinksR esourceApi(_requester);
53
54 ProjectsLogServicesResourceApi(commons.ApiRequester client) :
55 _requester = client;
56
57 /**
58 * Lists log services associated with log entries ingested for a project.
59 *
60 * Request parameters:
61 *
62 * [projectsId] - Part of `projectName`. The project resource whose services
63 * are to be listed.
64 *
65 * [log] - The name of the log resource whose services are to be listed. log
66 * for which to list services. When empty, all services are listed.
67 *
68 * [pageSize] - The maximum number of `LogService` objects to return in one
69 * operation.
70 *
71 * [pageToken] - An opaque token, returned as `nextPageToken` by a prior
72 * `ListLogServices` operation. If `pageToken` is supplied, then the other
73 * fields of this request are ignored, and instead the previous
74 * `ListLogServices` operation is continued.
75 *
76 * Completes with a [ListLogServicesResponse].
77 *
78 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
79 * error.
80 *
81 * If the used [http.Client] completes with an error when making a REST call,
82 * this method will complete with the same error.
83 */
84 async.Future<ListLogServicesResponse> list(core.String projectsId, {core.Strin g log, core.int pageSize, core.String pageToken}) {
85 var _url = null;
86 var _queryParams = new core.Map();
87 var _uploadMedia = null;
88 var _uploadOptions = null;
89 var _downloadOptions = commons.DownloadOptions.Metadata;
90 var _body = null;
91
92 if (projectsId == null) {
93 throw new core.ArgumentError("Parameter projectsId is required.");
94 }
95 if (log != null) {
96 _queryParams["log"] = [log];
97 }
98 if (pageSize != null) {
99 _queryParams["pageSize"] = ["${pageSize}"];
100 }
101 if (pageToken != null) {
102 _queryParams["pageToken"] = [pageToken];
103 }
104
105
106 _url = 'v1beta3/projects/' + commons.Escaper.ecapeVariable('$projectsId') + '/logServices';
107
108 var _response = _requester.request(_url,
109 "GET",
110 body: _body,
111 queryParams: _queryParams,
112 uploadOptions: _uploadOptions,
113 uploadMedia: _uploadMedia,
114 downloadOptions: _downloadOptions);
115 return _response.then((data) => new ListLogServicesResponse.fromJson(data));
116 }
117
118 }
119
120
121 class ProjectsLogServicesIndexesResourceApi {
122 final commons.ApiRequester _requester;
123
124 ProjectsLogServicesIndexesResourceApi(commons.ApiRequester client) :
125 _requester = client;
126
127 /**
128 * Lists log service indexes associated with a log service.
129 *
130 * Request parameters:
131 *
132 * [projectsId] - Part of `serviceName`. A log service resource of the form
133 * `/projects / * /logServices / * `. The service indexes of the log service
134 * are returned. Example:
135 * `"/projects/myProj/logServices/appengine.googleapis.com"`.
136 *
137 * [logServicesId] - Part of `serviceName`. See documentation of `projectsId`.
138 *
139 * [indexPrefix] - Restricts the indexes returned to be those with a specified
140 * prefix. The prefix has the form `"/label_value/label_value/..."`, in order
141 * corresponding to the [`LogService
142 * indexKeys`][google.logging.v1.LogService.index_keys]. Non-empty prefixes
143 * must begin with `/` . Example prefixes: + `"/myModule/"` retrieves App
144 * Engine versions associated with `myModule`. The trailing slash terminates
145 * the value. + `"/myModule"` retrieves App Engine modules with names
146 * beginning with `myModule`. + `""` retrieves all indexes.
147 *
148 * [depth] - A limit to the number of levels of the index hierarchy that are
149 * expanded. If `depth` is 0, it defaults to the level specified by the prefix
150 * field (the number of slash separators). The default empty prefix implies a
151 * `depth` of 1. It is an error for `depth` to be any non-zero value less than
152 * the number of components in `indexPrefix`.
153 *
154 * [log] - A log resource like `/projects/project_id/logs/log_name`,
155 * identifying the log for which to list service indexes.
156 *
157 * [pageSize] - The maximum number of log service index resources to return in
158 * one operation.
159 *
160 * [pageToken] - An opaque token, returned as `nextPageToken` by a prior
161 * `ListLogServiceIndexes` operation. If `pageToken` is supplied, then the
162 * other fields of this request are ignored, and instead the previous
163 * `ListLogServiceIndexes` operation is continued.
164 *
165 * Completes with a [ListLogServiceIndexesResponse].
166 *
167 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
168 * error.
169 *
170 * If the used [http.Client] completes with an error when making a REST call,
171 * this method will complete with the same error.
172 */
173 async.Future<ListLogServiceIndexesResponse> list(core.String projectsId, core. String logServicesId, {core.String indexPrefix, core.int depth, core.String log, core.int pageSize, core.String pageToken}) {
174 var _url = null;
175 var _queryParams = new core.Map();
176 var _uploadMedia = null;
177 var _uploadOptions = null;
178 var _downloadOptions = commons.DownloadOptions.Metadata;
179 var _body = null;
180
181 if (projectsId == null) {
182 throw new core.ArgumentError("Parameter projectsId is required.");
183 }
184 if (logServicesId == null) {
185 throw new core.ArgumentError("Parameter logServicesId is required.");
186 }
187 if (indexPrefix != null) {
188 _queryParams["indexPrefix"] = [indexPrefix];
189 }
190 if (depth != null) {
191 _queryParams["depth"] = ["${depth}"];
192 }
193 if (log != null) {
194 _queryParams["log"] = [log];
195 }
196 if (pageSize != null) {
197 _queryParams["pageSize"] = ["${pageSize}"];
198 }
199 if (pageToken != null) {
200 _queryParams["pageToken"] = [pageToken];
201 }
202
203
204 _url = 'v1beta3/projects/' + commons.Escaper.ecapeVariable('$projectsId') + '/logServices/' + commons.Escaper.ecapeVariable('$logServicesId') + '/indexes';
205
206 var _response = _requester.request(_url,
207 "GET",
208 body: _body,
209 queryParams: _queryParams,
210 uploadOptions: _uploadOptions,
211 uploadMedia: _uploadMedia,
212 downloadOptions: _downloadOptions);
213 return _response.then((data) => new ListLogServiceIndexesResponse.fromJson(d ata));
214 }
215
216 }
217
218
219 class ProjectsLogServicesSinksResourceApi {
220 final commons.ApiRequester _requester;
221
222 ProjectsLogServicesSinksResourceApi(commons.ApiRequester client) :
223 _requester = client;
224
225 /**
226 * Creates the specified log service sink resource.
227 *
228 * [request] - The metadata request object.
229 *
230 * Request parameters:
231 *
232 * [projectsId] - Part of `serviceName`. The name of the service in which to
233 * create a sink.
234 *
235 * [logServicesId] - Part of `serviceName`. See documentation of `projectsId`.
236 *
237 * Completes with a [LogSink].
238 *
239 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
240 * error.
241 *
242 * If the used [http.Client] completes with an error when making a REST call,
243 * this method will complete with the same error.
244 */
245 async.Future<LogSink> create(LogSink request, core.String projectsId, core.Str ing logServicesId) {
246 var _url = null;
247 var _queryParams = new core.Map();
248 var _uploadMedia = null;
249 var _uploadOptions = null;
250 var _downloadOptions = commons.DownloadOptions.Metadata;
251 var _body = null;
252
253 if (request != null) {
254 _body = convert.JSON.encode((request).toJson());
255 }
256 if (projectsId == null) {
257 throw new core.ArgumentError("Parameter projectsId is required.");
258 }
259 if (logServicesId == null) {
260 throw new core.ArgumentError("Parameter logServicesId is required.");
261 }
262
263
264 _url = 'v1beta3/projects/' + commons.Escaper.ecapeVariable('$projectsId') + '/logServices/' + commons.Escaper.ecapeVariable('$logServicesId') + '/sinks';
265
266 var _response = _requester.request(_url,
267 "POST",
268 body: _body,
269 queryParams: _queryParams,
270 uploadOptions: _uploadOptions,
271 uploadMedia: _uploadMedia,
272 downloadOptions: _downloadOptions);
273 return _response.then((data) => new LogSink.fromJson(data));
274 }
275
276 /**
277 * Deletes the specified log service sink.
278 *
279 * Request parameters:
280 *
281 * [projectsId] - Part of `sinkName`. The name of the sink to delete.
282 *
283 * [logServicesId] - Part of `sinkName`. See documentation of `projectsId`.
284 *
285 * [sinksId] - Part of `sinkName`. See documentation of `projectsId`.
286 *
287 * Completes with a [Empty].
288 *
289 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
290 * error.
291 *
292 * If the used [http.Client] completes with an error when making a REST call,
293 * this method will complete with the same error.
294 */
295 async.Future<Empty> delete(core.String projectsId, core.String logServicesId, core.String sinksId) {
296 var _url = null;
297 var _queryParams = new core.Map();
298 var _uploadMedia = null;
299 var _uploadOptions = null;
300 var _downloadOptions = commons.DownloadOptions.Metadata;
301 var _body = null;
302
303 if (projectsId == null) {
304 throw new core.ArgumentError("Parameter projectsId is required.");
305 }
306 if (logServicesId == null) {
307 throw new core.ArgumentError("Parameter logServicesId is required.");
308 }
309 if (sinksId == null) {
310 throw new core.ArgumentError("Parameter sinksId is required.");
311 }
312
313
314 _url = 'v1beta3/projects/' + commons.Escaper.ecapeVariable('$projectsId') + '/logServices/' + commons.Escaper.ecapeVariable('$logServicesId') + '/sinks/' + commons.Escaper.ecapeVariable('$sinksId');
315
316 var _response = _requester.request(_url,
317 "DELETE",
318 body: _body,
319 queryParams: _queryParams,
320 uploadOptions: _uploadOptions,
321 uploadMedia: _uploadMedia,
322 downloadOptions: _downloadOptions);
323 return _response.then((data) => new Empty.fromJson(data));
324 }
325
326 /**
327 * Gets the specified log service sink resource.
328 *
329 * Request parameters:
330 *
331 * [projectsId] - Part of `sinkName`. The name of the sink to return.
332 *
333 * [logServicesId] - Part of `sinkName`. See documentation of `projectsId`.
334 *
335 * [sinksId] - Part of `sinkName`. See documentation of `projectsId`.
336 *
337 * Completes with a [LogSink].
338 *
339 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
340 * error.
341 *
342 * If the used [http.Client] completes with an error when making a REST call,
343 * this method will complete with the same error.
344 */
345 async.Future<LogSink> get(core.String projectsId, core.String logServicesId, c ore.String sinksId) {
346 var _url = null;
347 var _queryParams = new core.Map();
348 var _uploadMedia = null;
349 var _uploadOptions = null;
350 var _downloadOptions = commons.DownloadOptions.Metadata;
351 var _body = null;
352
353 if (projectsId == null) {
354 throw new core.ArgumentError("Parameter projectsId is required.");
355 }
356 if (logServicesId == null) {
357 throw new core.ArgumentError("Parameter logServicesId is required.");
358 }
359 if (sinksId == null) {
360 throw new core.ArgumentError("Parameter sinksId is required.");
361 }
362
363
364 _url = 'v1beta3/projects/' + commons.Escaper.ecapeVariable('$projectsId') + '/logServices/' + commons.Escaper.ecapeVariable('$logServicesId') + '/sinks/' + commons.Escaper.ecapeVariable('$sinksId');
365
366 var _response = _requester.request(_url,
367 "GET",
368 body: _body,
369 queryParams: _queryParams,
370 uploadOptions: _uploadOptions,
371 uploadMedia: _uploadMedia,
372 downloadOptions: _downloadOptions);
373 return _response.then((data) => new LogSink.fromJson(data));
374 }
375
376 /**
377 * Lists log service sinks associated with the specified service.
378 *
379 * Request parameters:
380 *
381 * [projectsId] - Part of `serviceName`. The name of the service for which to
382 * list sinks.
383 *
384 * [logServicesId] - Part of `serviceName`. See documentation of `projectsId`.
385 *
386 * Completes with a [ListLogServiceSinksResponse].
387 *
388 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
389 * error.
390 *
391 * If the used [http.Client] completes with an error when making a REST call,
392 * this method will complete with the same error.
393 */
394 async.Future<ListLogServiceSinksResponse> list(core.String projectsId, core.St ring logServicesId) {
395 var _url = null;
396 var _queryParams = new core.Map();
397 var _uploadMedia = null;
398 var _uploadOptions = null;
399 var _downloadOptions = commons.DownloadOptions.Metadata;
400 var _body = null;
401
402 if (projectsId == null) {
403 throw new core.ArgumentError("Parameter projectsId is required.");
404 }
405 if (logServicesId == null) {
406 throw new core.ArgumentError("Parameter logServicesId is required.");
407 }
408
409
410 _url = 'v1beta3/projects/' + commons.Escaper.ecapeVariable('$projectsId') + '/logServices/' + commons.Escaper.ecapeVariable('$logServicesId') + '/sinks';
411
412 var _response = _requester.request(_url,
413 "GET",
414 body: _body,
415 queryParams: _queryParams,
416 uploadOptions: _uploadOptions,
417 uploadMedia: _uploadMedia,
418 downloadOptions: _downloadOptions);
419 return _response.then((data) => new ListLogServiceSinksResponse.fromJson(dat a));
420 }
421
422 /**
423 * Creates or update the specified log service sink resource.
424 *
425 * [request] - The metadata request object.
426 *
427 * Request parameters:
428 *
429 * [projectsId] - Part of `sinkName`. The name of the sink to update.
430 *
431 * [logServicesId] - Part of `sinkName`. See documentation of `projectsId`.
432 *
433 * [sinksId] - Part of `sinkName`. See documentation of `projectsId`.
434 *
435 * Completes with a [LogSink].
436 *
437 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
438 * error.
439 *
440 * If the used [http.Client] completes with an error when making a REST call,
441 * this method will complete with the same error.
442 */
443 async.Future<LogSink> update(LogSink request, core.String projectsId, core.Str ing logServicesId, core.String sinksId) {
444 var _url = null;
445 var _queryParams = new core.Map();
446 var _uploadMedia = null;
447 var _uploadOptions = null;
448 var _downloadOptions = commons.DownloadOptions.Metadata;
449 var _body = null;
450
451 if (request != null) {
452 _body = convert.JSON.encode((request).toJson());
453 }
454 if (projectsId == null) {
455 throw new core.ArgumentError("Parameter projectsId is required.");
456 }
457 if (logServicesId == null) {
458 throw new core.ArgumentError("Parameter logServicesId is required.");
459 }
460 if (sinksId == null) {
461 throw new core.ArgumentError("Parameter sinksId is required.");
462 }
463
464
465 _url = 'v1beta3/projects/' + commons.Escaper.ecapeVariable('$projectsId') + '/logServices/' + commons.Escaper.ecapeVariable('$logServicesId') + '/sinks/' + commons.Escaper.ecapeVariable('$sinksId');
466
467 var _response = _requester.request(_url,
468 "PUT",
469 body: _body,
470 queryParams: _queryParams,
471 uploadOptions: _uploadOptions,
472 uploadMedia: _uploadMedia,
473 downloadOptions: _downloadOptions);
474 return _response.then((data) => new LogSink.fromJson(data));
475 }
476
477 }
478
479
480 class ProjectsLogsResourceApi {
481 final commons.ApiRequester _requester;
482
483 ProjectsLogsEntriesResourceApi get entries => new ProjectsLogsEntriesResourceA pi(_requester);
484 ProjectsLogsSinksResourceApi get sinks => new ProjectsLogsSinksResourceApi(_re quester);
485
486 ProjectsLogsResourceApi(commons.ApiRequester client) :
487 _requester = client;
488
489 /**
490 * Deletes the specified log resource and all log entries contained in it.
491 *
492 * Request parameters:
493 *
494 * [projectsId] - Part of `logName`. The log resource to delete.
495 *
496 * [logsId] - Part of `logName`. See documentation of `projectsId`.
497 *
498 * Completes with a [Empty].
499 *
500 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
501 * error.
502 *
503 * If the used [http.Client] completes with an error when making a REST call,
504 * this method will complete with the same error.
505 */
506 async.Future<Empty> delete(core.String projectsId, core.String logsId) {
507 var _url = null;
508 var _queryParams = new core.Map();
509 var _uploadMedia = null;
510 var _uploadOptions = null;
511 var _downloadOptions = commons.DownloadOptions.Metadata;
512 var _body = null;
513
514 if (projectsId == null) {
515 throw new core.ArgumentError("Parameter projectsId is required.");
516 }
517 if (logsId == null) {
518 throw new core.ArgumentError("Parameter logsId is required.");
519 }
520
521
522 _url = 'v1beta3/projects/' + commons.Escaper.ecapeVariable('$projectsId') + '/logs/' + commons.Escaper.ecapeVariable('$logsId');
523
524 var _response = _requester.request(_url,
525 "DELETE",
526 body: _body,
527 queryParams: _queryParams,
528 uploadOptions: _uploadOptions,
529 uploadMedia: _uploadMedia,
530 downloadOptions: _downloadOptions);
531 return _response.then((data) => new Empty.fromJson(data));
532 }
533
534 /**
535 * Lists log resources belonging to the specified project.
536 *
537 * Request parameters:
538 *
539 * [projectsId] - Part of `projectName`. The project name for which to list
540 * the log resources.
541 *
542 * [serviceName] - A service name for which to list logs. Only logs containing
543 * entries whose metadata includes this service name are returned. If
544 * `serviceName` and `serviceIndexPrefix` are both empty, then all log names
545 * are returned. To list all log names, regardless of service, leave both the
546 * `serviceName` and `serviceIndexPrefix` empty. To list log names containing
547 * entries with a particular service name (or explicitly empty service name)
548 * set `serviceName` to the desired value and `serviceIndexPrefix` to `"/"`.
549 *
550 * [serviceIndexPrefix] - A log service index prefix for which to list logs.
551 * Only logs containing entries whose metadata that includes these label
552 * values (associated with index keys) are returned. The prefix is a slash
553 * separated list of values, and need not specify all index labels. An empty
554 * index (or a single slash) matches all log service indexes.
555 *
556 * [pageSize] - The maximum number of results to return.
557 *
558 * [pageToken] - An opaque token, returned as `nextPageToken` by a prior
559 * `ListLogs` operation. If `pageToken` is supplied, then the other fields of
560 * this request are ignored, and instead the previous `ListLogs` operation is
561 * continued.
562 *
563 * Completes with a [ListLogsResponse].
564 *
565 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
566 * error.
567 *
568 * If the used [http.Client] completes with an error when making a REST call,
569 * this method will complete with the same error.
570 */
571 async.Future<ListLogsResponse> list(core.String projectsId, {core.String servi ceName, core.String serviceIndexPrefix, core.int pageSize, core.String pageToken }) {
572 var _url = null;
573 var _queryParams = new core.Map();
574 var _uploadMedia = null;
575 var _uploadOptions = null;
576 var _downloadOptions = commons.DownloadOptions.Metadata;
577 var _body = null;
578
579 if (projectsId == null) {
580 throw new core.ArgumentError("Parameter projectsId is required.");
581 }
582 if (serviceName != null) {
583 _queryParams["serviceName"] = [serviceName];
584 }
585 if (serviceIndexPrefix != null) {
586 _queryParams["serviceIndexPrefix"] = [serviceIndexPrefix];
587 }
588 if (pageSize != null) {
589 _queryParams["pageSize"] = ["${pageSize}"];
590 }
591 if (pageToken != null) {
592 _queryParams["pageToken"] = [pageToken];
593 }
594
595
596 _url = 'v1beta3/projects/' + commons.Escaper.ecapeVariable('$projectsId') + '/logs';
597
598 var _response = _requester.request(_url,
599 "GET",
600 body: _body,
601 queryParams: _queryParams,
602 uploadOptions: _uploadOptions,
603 uploadMedia: _uploadMedia,
604 downloadOptions: _downloadOptions);
605 return _response.then((data) => new ListLogsResponse.fromJson(data));
606 }
607
608 }
609
610
611 class ProjectsLogsEntriesResourceApi {
612 final commons.ApiRequester _requester;
613
614 ProjectsLogsEntriesResourceApi(commons.ApiRequester client) :
615 _requester = client;
616
617 /**
618 * Creates one or more log entries in a log. You must supply a list of
619 * `LogEntry` objects, named `entries`. Each `LogEntry` object must contain a
620 * payload object and a `LogEntryMetadata` object that describes the entry.
621 * You must fill in all the fields of the entry, metadata, and payload. You
622 * can also supply a map, `commonLabels`, that supplies default (key, value)
623 * data for the `entries[].metadata.labels` maps, saving you the trouble of
624 * creating identical copies for each entry.
625 *
626 * [request] - The metadata request object.
627 *
628 * Request parameters:
629 *
630 * [projectsId] - Part of `logName`. The name of the log resource into which
631 * to insert the log entries.
632 *
633 * [logsId] - Part of `logName`. See documentation of `projectsId`.
634 *
635 * Completes with a [WriteLogEntriesResponse].
636 *
637 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
638 * error.
639 *
640 * If the used [http.Client] completes with an error when making a REST call,
641 * this method will complete with the same error.
642 */
643 async.Future<WriteLogEntriesResponse> write(WriteLogEntriesRequest request, co re.String projectsId, core.String logsId) {
644 var _url = null;
645 var _queryParams = new core.Map();
646 var _uploadMedia = null;
647 var _uploadOptions = null;
648 var _downloadOptions = commons.DownloadOptions.Metadata;
649 var _body = null;
650
651 if (request != null) {
652 _body = convert.JSON.encode((request).toJson());
653 }
654 if (projectsId == null) {
655 throw new core.ArgumentError("Parameter projectsId is required.");
656 }
657 if (logsId == null) {
658 throw new core.ArgumentError("Parameter logsId is required.");
659 }
660
661
662 _url = 'v1beta3/projects/' + commons.Escaper.ecapeVariable('$projectsId') + '/logs/' + commons.Escaper.ecapeVariable('$logsId') + '/entries:write';
663
664 var _response = _requester.request(_url,
665 "POST",
666 body: _body,
667 queryParams: _queryParams,
668 uploadOptions: _uploadOptions,
669 uploadMedia: _uploadMedia,
670 downloadOptions: _downloadOptions);
671 return _response.then((data) => new WriteLogEntriesResponse.fromJson(data));
672 }
673
674 }
675
676
677 class ProjectsLogsSinksResourceApi {
678 final commons.ApiRequester _requester;
679
680 ProjectsLogsSinksResourceApi(commons.ApiRequester client) :
681 _requester = client;
682
683 /**
684 * Creates the specified log sink resource.
685 *
686 * [request] - The metadata request object.
687 *
688 * Request parameters:
689 *
690 * [projectsId] - Part of `logName`. The log in which to create a sink
691 * resource.
692 *
693 * [logsId] - Part of `logName`. See documentation of `projectsId`.
694 *
695 * Completes with a [LogSink].
696 *
697 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
698 * error.
699 *
700 * If the used [http.Client] completes with an error when making a REST call,
701 * this method will complete with the same error.
702 */
703 async.Future<LogSink> create(LogSink request, core.String projectsId, core.Str ing logsId) {
704 var _url = null;
705 var _queryParams = new core.Map();
706 var _uploadMedia = null;
707 var _uploadOptions = null;
708 var _downloadOptions = commons.DownloadOptions.Metadata;
709 var _body = null;
710
711 if (request != null) {
712 _body = convert.JSON.encode((request).toJson());
713 }
714 if (projectsId == null) {
715 throw new core.ArgumentError("Parameter projectsId is required.");
716 }
717 if (logsId == null) {
718 throw new core.ArgumentError("Parameter logsId is required.");
719 }
720
721
722 _url = 'v1beta3/projects/' + commons.Escaper.ecapeVariable('$projectsId') + '/logs/' + commons.Escaper.ecapeVariable('$logsId') + '/sinks';
723
724 var _response = _requester.request(_url,
725 "POST",
726 body: _body,
727 queryParams: _queryParams,
728 uploadOptions: _uploadOptions,
729 uploadMedia: _uploadMedia,
730 downloadOptions: _downloadOptions);
731 return _response.then((data) => new LogSink.fromJson(data));
732 }
733
734 /**
735 * Deletes the specified log sink resource.
736 *
737 * Request parameters:
738 *
739 * [projectsId] - Part of `sinkName`. The name of the sink to delete.
740 *
741 * [logsId] - Part of `sinkName`. See documentation of `projectsId`.
742 *
743 * [sinksId] - Part of `sinkName`. See documentation of `projectsId`.
744 *
745 * Completes with a [Empty].
746 *
747 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
748 * error.
749 *
750 * If the used [http.Client] completes with an error when making a REST call,
751 * this method will complete with the same error.
752 */
753 async.Future<Empty> delete(core.String projectsId, core.String logsId, core.St ring sinksId) {
754 var _url = null;
755 var _queryParams = new core.Map();
756 var _uploadMedia = null;
757 var _uploadOptions = null;
758 var _downloadOptions = commons.DownloadOptions.Metadata;
759 var _body = null;
760
761 if (projectsId == null) {
762 throw new core.ArgumentError("Parameter projectsId is required.");
763 }
764 if (logsId == null) {
765 throw new core.ArgumentError("Parameter logsId is required.");
766 }
767 if (sinksId == null) {
768 throw new core.ArgumentError("Parameter sinksId is required.");
769 }
770
771
772 _url = 'v1beta3/projects/' + commons.Escaper.ecapeVariable('$projectsId') + '/logs/' + commons.Escaper.ecapeVariable('$logsId') + '/sinks/' + commons.Escape r.ecapeVariable('$sinksId');
773
774 var _response = _requester.request(_url,
775 "DELETE",
776 body: _body,
777 queryParams: _queryParams,
778 uploadOptions: _uploadOptions,
779 uploadMedia: _uploadMedia,
780 downloadOptions: _downloadOptions);
781 return _response.then((data) => new Empty.fromJson(data));
782 }
783
784 /**
785 * Gets the specified log sink resource.
786 *
787 * Request parameters:
788 *
789 * [projectsId] - Part of `sinkName`. The name of the sink resource to return.
790 *
791 * [logsId] - Part of `sinkName`. See documentation of `projectsId`.
792 *
793 * [sinksId] - Part of `sinkName`. See documentation of `projectsId`.
794 *
795 * Completes with a [LogSink].
796 *
797 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
798 * error.
799 *
800 * If the used [http.Client] completes with an error when making a REST call,
801 * this method will complete with the same error.
802 */
803 async.Future<LogSink> get(core.String projectsId, core.String logsId, core.Str ing sinksId) {
804 var _url = null;
805 var _queryParams = new core.Map();
806 var _uploadMedia = null;
807 var _uploadOptions = null;
808 var _downloadOptions = commons.DownloadOptions.Metadata;
809 var _body = null;
810
811 if (projectsId == null) {
812 throw new core.ArgumentError("Parameter projectsId is required.");
813 }
814 if (logsId == null) {
815 throw new core.ArgumentError("Parameter logsId is required.");
816 }
817 if (sinksId == null) {
818 throw new core.ArgumentError("Parameter sinksId is required.");
819 }
820
821
822 _url = 'v1beta3/projects/' + commons.Escaper.ecapeVariable('$projectsId') + '/logs/' + commons.Escaper.ecapeVariable('$logsId') + '/sinks/' + commons.Escape r.ecapeVariable('$sinksId');
823
824 var _response = _requester.request(_url,
825 "GET",
826 body: _body,
827 queryParams: _queryParams,
828 uploadOptions: _uploadOptions,
829 uploadMedia: _uploadMedia,
830 downloadOptions: _downloadOptions);
831 return _response.then((data) => new LogSink.fromJson(data));
832 }
833
834 /**
835 * Lists log sinks associated with the specified log.
836 *
837 * Request parameters:
838 *
839 * [projectsId] - Part of `logName`. The log for which to list sinks.
840 *
841 * [logsId] - Part of `logName`. See documentation of `projectsId`.
842 *
843 * Completes with a [ListLogSinksResponse].
844 *
845 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
846 * error.
847 *
848 * If the used [http.Client] completes with an error when making a REST call,
849 * this method will complete with the same error.
850 */
851 async.Future<ListLogSinksResponse> list(core.String projectsId, core.String lo gsId) {
852 var _url = null;
853 var _queryParams = new core.Map();
854 var _uploadMedia = null;
855 var _uploadOptions = null;
856 var _downloadOptions = commons.DownloadOptions.Metadata;
857 var _body = null;
858
859 if (projectsId == null) {
860 throw new core.ArgumentError("Parameter projectsId is required.");
861 }
862 if (logsId == null) {
863 throw new core.ArgumentError("Parameter logsId is required.");
864 }
865
866
867 _url = 'v1beta3/projects/' + commons.Escaper.ecapeVariable('$projectsId') + '/logs/' + commons.Escaper.ecapeVariable('$logsId') + '/sinks';
868
869 var _response = _requester.request(_url,
870 "GET",
871 body: _body,
872 queryParams: _queryParams,
873 uploadOptions: _uploadOptions,
874 uploadMedia: _uploadMedia,
875 downloadOptions: _downloadOptions);
876 return _response.then((data) => new ListLogSinksResponse.fromJson(data));
877 }
878
879 /**
880 * Creates or updates the specified log sink resource.
881 *
882 * [request] - The metadata request object.
883 *
884 * Request parameters:
885 *
886 * [projectsId] - Part of `sinkName`. The name of the sink to update.
887 *
888 * [logsId] - Part of `sinkName`. See documentation of `projectsId`.
889 *
890 * [sinksId] - Part of `sinkName`. See documentation of `projectsId`.
891 *
892 * Completes with a [LogSink].
893 *
894 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
895 * error.
896 *
897 * If the used [http.Client] completes with an error when making a REST call,
898 * this method will complete with the same error.
899 */
900 async.Future<LogSink> update(LogSink request, core.String projectsId, core.Str ing logsId, core.String sinksId) {
901 var _url = null;
902 var _queryParams = new core.Map();
903 var _uploadMedia = null;
904 var _uploadOptions = null;
905 var _downloadOptions = commons.DownloadOptions.Metadata;
906 var _body = null;
907
908 if (request != null) {
909 _body = convert.JSON.encode((request).toJson());
910 }
911 if (projectsId == null) {
912 throw new core.ArgumentError("Parameter projectsId is required.");
913 }
914 if (logsId == null) {
915 throw new core.ArgumentError("Parameter logsId is required.");
916 }
917 if (sinksId == null) {
918 throw new core.ArgumentError("Parameter sinksId is required.");
919 }
920
921
922 _url = 'v1beta3/projects/' + commons.Escaper.ecapeVariable('$projectsId') + '/logs/' + commons.Escaper.ecapeVariable('$logsId') + '/sinks/' + commons.Escape r.ecapeVariable('$sinksId');
923
924 var _response = _requester.request(_url,
925 "PUT",
926 body: _body,
927 queryParams: _queryParams,
928 uploadOptions: _uploadOptions,
929 uploadMedia: _uploadMedia,
930 downloadOptions: _downloadOptions);
931 return _response.then((data) => new LogSink.fromJson(data));
932 }
933
934 }
935
936
937
938 /**
939 * A generic empty message that you can re-use to avoid defining duplicated
940 * empty messages in your APIs. A typical example is to use it as the request or
941 * the response type of an API method. For instance: service Foo { rpc
942 * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
943 */
944 class Empty {
945
946 Empty();
947
948 Empty.fromJson(core.Map _json) {
949 }
950
951 core.Map toJson() {
952 var _json = new core.Map();
953 return _json;
954 }
955 }
956
957
958 /** Result returned from ListLogServiceIndexesRequest. */
959 class ListLogServiceIndexesResponse {
960 /**
961 * If there are more results, then `nextPageToken` is returned in the
962 * response. To get the next batch of indexes, use the value of
963 * `nextPageToken` as `pageToken` in the next call of
964 * `ListLogServiceIndexess`. If `nextPageToken` is empty, then there are no
965 * more results.
966 */
967 core.String nextPageToken;
968
969 /** A list of log service index prefixes. */
970 core.List<core.String> serviceIndexPrefixes;
971
972
973 ListLogServiceIndexesResponse();
974
975 ListLogServiceIndexesResponse.fromJson(core.Map _json) {
976 if (_json.containsKey("nextPageToken")) {
977 nextPageToken = _json["nextPageToken"];
978 }
979 if (_json.containsKey("serviceIndexPrefixes")) {
980 serviceIndexPrefixes = _json["serviceIndexPrefixes"];
981 }
982 }
983
984 core.Map toJson() {
985 var _json = new core.Map();
986 if (nextPageToken != null) {
987 _json["nextPageToken"] = nextPageToken;
988 }
989 if (serviceIndexPrefixes != null) {
990 _json["serviceIndexPrefixes"] = serviceIndexPrefixes;
991 }
992 return _json;
993 }
994 }
995
996
997 /** Result returned from `ListLogServiceSinks`. */
998 class ListLogServiceSinksResponse {
999 /**
1000 * The requested log service sinks. If any of the returned `LogSink` objects
1001 * have an empty `destination` field, then call `logServices.sinks.get` to
1002 * retrieve the complete `LogSink` object.
1003 */
1004 core.List<LogSink> sinks;
1005
1006
1007 ListLogServiceSinksResponse();
1008
1009 ListLogServiceSinksResponse.fromJson(core.Map _json) {
1010 if (_json.containsKey("sinks")) {
1011 sinks = _json["sinks"].map((value) => new LogSink.fromJson(value)).toList( );
1012 }
1013 }
1014
1015 core.Map toJson() {
1016 var _json = new core.Map();
1017 if (sinks != null) {
1018 _json["sinks"] = sinks.map((value) => (value).toJson()).toList();
1019 }
1020 return _json;
1021 }
1022 }
1023
1024
1025 /** Result returned from `ListLogServicesRequest`. */
1026 class ListLogServicesResponse {
1027 /** A list of log services. */
1028 core.List<LogService> logServices;
1029
1030 /**
1031 * If there are more results, then `nextPageToken` is returned in the
1032 * response. To get the next batch of services, use the value of
1033 * `nextPageToken` as `pageToken` in the next call of `ListLogServices`. If
1034 * `nextPageToken` is empty, then there are no more results.
1035 */
1036 core.String nextPageToken;
1037
1038
1039 ListLogServicesResponse();
1040
1041 ListLogServicesResponse.fromJson(core.Map _json) {
1042 if (_json.containsKey("logServices")) {
1043 logServices = _json["logServices"].map((value) => new LogService.fromJson( value)).toList();
1044 }
1045 if (_json.containsKey("nextPageToken")) {
1046 nextPageToken = _json["nextPageToken"];
1047 }
1048 }
1049
1050 core.Map toJson() {
1051 var _json = new core.Map();
1052 if (logServices != null) {
1053 _json["logServices"] = logServices.map((value) => (value).toJson()).toList ();
1054 }
1055 if (nextPageToken != null) {
1056 _json["nextPageToken"] = nextPageToken;
1057 }
1058 return _json;
1059 }
1060 }
1061
1062
1063 /** Result returned from `ListLogSinks`. */
1064 class ListLogSinksResponse {
1065 /**
1066 * The requested log sinks. If any of the returned `LogSink` objects have an
1067 * empty `destination` field, then call `logServices.sinks.get` to retrieve
1068 * the complete `LogSink` object.
1069 */
1070 core.List<LogSink> sinks;
1071
1072
1073 ListLogSinksResponse();
1074
1075 ListLogSinksResponse.fromJson(core.Map _json) {
1076 if (_json.containsKey("sinks")) {
1077 sinks = _json["sinks"].map((value) => new LogSink.fromJson(value)).toList( );
1078 }
1079 }
1080
1081 core.Map toJson() {
1082 var _json = new core.Map();
1083 if (sinks != null) {
1084 _json["sinks"] = sinks.map((value) => (value).toJson()).toList();
1085 }
1086 return _json;
1087 }
1088 }
1089
1090
1091 /** Result returned from ListLogs. */
1092 class ListLogsResponse {
1093 /** A list of log resources. */
1094 core.List<Log> logs;
1095
1096 /**
1097 * If there are more results, then `nextPageToken` is returned in the
1098 * response. To get the next batch of logs, use the value of `nextPageToken`
1099 * as `pageToken` in the next call of `ListLogs`. If `nextPageToken` is empty,
1100 * then there are no more results.
1101 */
1102 core.String nextPageToken;
1103
1104
1105 ListLogsResponse();
1106
1107 ListLogsResponse.fromJson(core.Map _json) {
1108 if (_json.containsKey("logs")) {
1109 logs = _json["logs"].map((value) => new Log.fromJson(value)).toList();
1110 }
1111 if (_json.containsKey("nextPageToken")) {
1112 nextPageToken = _json["nextPageToken"];
1113 }
1114 }
1115
1116 core.Map toJson() {
1117 var _json = new core.Map();
1118 if (logs != null) {
1119 _json["logs"] = logs.map((value) => (value).toJson()).toList();
1120 }
1121 if (nextPageToken != null) {
1122 _json["nextPageToken"] = nextPageToken;
1123 }
1124 return _json;
1125 }
1126 }
1127
1128
1129 /** A log object. */
1130 class Log {
1131 /**
1132 * Name used when displaying the log to the user (for example, in a UI).
1133 * Example: `"activity_log"`
1134 */
1135 core.String displayName;
1136
1137 /**
1138 * REQUIRED: The log's name name. Example:
1139 * `"compute.googleapis.com/activity_log"`.
1140 */
1141 core.String name;
1142
1143 /** Type URL describing the expected payload type for the log. */
1144 core.String payloadType;
1145
1146
1147 Log();
1148
1149 Log.fromJson(core.Map _json) {
1150 if (_json.containsKey("displayName")) {
1151 displayName = _json["displayName"];
1152 }
1153 if (_json.containsKey("name")) {
1154 name = _json["name"];
1155 }
1156 if (_json.containsKey("payloadType")) {
1157 payloadType = _json["payloadType"];
1158 }
1159 }
1160
1161 core.Map toJson() {
1162 var _json = new core.Map();
1163 if (displayName != null) {
1164 _json["displayName"] = displayName;
1165 }
1166 if (name != null) {
1167 _json["name"] = name;
1168 }
1169 if (payloadType != null) {
1170 _json["payloadType"] = payloadType;
1171 }
1172 return _json;
1173 }
1174 }
1175
1176
1177 /** An individual entry in a log. */
1178 class LogEntry {
1179 /**
1180 * A unique ID for the log entry. If you provide this field, the logging
1181 * service considers other log entries in the same log with the same ID as
1182 * duplicates which can be removed.
1183 */
1184 core.String insertId;
1185
1186 /**
1187 * The log to which this entry belongs. When a log entry is ingested, the
1188 * value of this field is set by the logging system.
1189 */
1190 core.String log;
1191
1192 /** Information about the log entry. */
1193 LogEntryMetadata metadata;
1194
1195 /**
1196 * The log entry payload, represented as a protocol buffer that is expressed
1197 * as a JSON object. You can only pass `protoPayload` values that belong to a
1198 * set of approved types.
1199 *
1200 * The values for Object must be JSON objects. It can consist of `num`,
1201 * `String`, `bool` and `null` as well as `Map` and `List` values.
1202 */
1203 core.Map<core.String, core.Object> protoPayload;
1204
1205 /**
1206 * The log entry payload, represented as a structure that is expressed as a
1207 * JSON object.
1208 *
1209 * The values for Object must be JSON objects. It can consist of `num`,
1210 * `String`, `bool` and `null` as well as `Map` and `List` values.
1211 */
1212 core.Map<core.String, core.Object> structPayload;
1213
1214 /** The log entry payload, represented as a text string. */
1215 core.String textPayload;
1216
1217
1218 LogEntry();
1219
1220 LogEntry.fromJson(core.Map _json) {
1221 if (_json.containsKey("insertId")) {
1222 insertId = _json["insertId"];
1223 }
1224 if (_json.containsKey("log")) {
1225 log = _json["log"];
1226 }
1227 if (_json.containsKey("metadata")) {
1228 metadata = new LogEntryMetadata.fromJson(_json["metadata"]);
1229 }
1230 if (_json.containsKey("protoPayload")) {
1231 protoPayload = _json["protoPayload"];
1232 }
1233 if (_json.containsKey("structPayload")) {
1234 structPayload = _json["structPayload"];
1235 }
1236 if (_json.containsKey("textPayload")) {
1237 textPayload = _json["textPayload"];
1238 }
1239 }
1240
1241 core.Map toJson() {
1242 var _json = new core.Map();
1243 if (insertId != null) {
1244 _json["insertId"] = insertId;
1245 }
1246 if (log != null) {
1247 _json["log"] = log;
1248 }
1249 if (metadata != null) {
1250 _json["metadata"] = (metadata).toJson();
1251 }
1252 if (protoPayload != null) {
1253 _json["protoPayload"] = protoPayload;
1254 }
1255 if (structPayload != null) {
1256 _json["structPayload"] = structPayload;
1257 }
1258 if (textPayload != null) {
1259 _json["textPayload"] = textPayload;
1260 }
1261 return _json;
1262 }
1263 }
1264
1265
1266 /**
1267 * Additional data that is associated with a log entry, set by the service
1268 * creating the log entry.
1269 */
1270 class LogEntryMetadata {
1271 /**
1272 * A set of (key, value) data that provides additional information about the
1273 * log entry. If the log entry is from one of the Google Cloud Platform
1274 * sources listed below, the indicated (key, value) information must be
1275 * provided: Google App Engine, service_name `appengine.googleapis.com`:
1276 * "appengine.googleapis.com/module_id",
1277 * "appengine.googleapis.com/version_id", and one of:
1278 * "appengine.googleapis.com/replica_index",
1279 * "appengine.googleapis.com/clone_id", or else provide the following Compute
1280 * Engine labels: Google Compute Engine, service_name
1281 * `compute.googleapis.com`: "compute.googleapis.com/resource_type",
1282 * "instance" "compute.googleapis.com/resource_id",
1283 */
1284 core.Map<core.String, core.String> labels;
1285
1286 /**
1287 * The project ID of the Google Cloud Platform service that created the log
1288 * entry.
1289 */
1290 core.String projectId;
1291
1292 /**
1293 * The region name of the Google Cloud Platform service that created the log
1294 * entry. For example, `"us-central1"`.
1295 */
1296 core.String region;
1297
1298 /**
1299 * The API name of the Google Cloud Platform service that created the log
1300 * entry. For example, `"compute.googleapis.com"`.
1301 */
1302 core.String serviceName;
1303
1304 /**
1305 * The severity of the log entry.
1306 * Possible string values are:
1307 * - "DEFAULT" : A DEFAULT.
1308 * - "DEBUG" : A DEBUG.
1309 * - "INFO" : A INFO.
1310 * - "NOTICE" : A NOTICE.
1311 * - "WARNING" : A WARNING.
1312 * - "ERROR" : A ERROR.
1313 * - "CRITICAL" : A CRITICAL.
1314 * - "ALERT" : A ALERT.
1315 * - "EMERGENCY" : A EMERGENCY.
1316 */
1317 core.String severity;
1318
1319 /**
1320 * The time the event described by the log entry occurred. Timestamps must be
1321 * later than January 1, 1970.
1322 */
1323 core.String timestamp;
1324
1325 /**
1326 * The fully-qualified email address of the authenticated user that performed
1327 * or requested the action represented by the log entry. If the log entry does
1328 * not apply to an action taken by an authenticated user, then the field
1329 * should be empty.
1330 */
1331 core.String userId;
1332
1333 /**
1334 * The zone of the Google Cloud Platform service that created the log entry.
1335 * For example, `"us-central1-a"`.
1336 */
1337 core.String zone;
1338
1339
1340 LogEntryMetadata();
1341
1342 LogEntryMetadata.fromJson(core.Map _json) {
1343 if (_json.containsKey("labels")) {
1344 labels = _json["labels"];
1345 }
1346 if (_json.containsKey("projectId")) {
1347 projectId = _json["projectId"];
1348 }
1349 if (_json.containsKey("region")) {
1350 region = _json["region"];
1351 }
1352 if (_json.containsKey("serviceName")) {
1353 serviceName = _json["serviceName"];
1354 }
1355 if (_json.containsKey("severity")) {
1356 severity = _json["severity"];
1357 }
1358 if (_json.containsKey("timestamp")) {
1359 timestamp = _json["timestamp"];
1360 }
1361 if (_json.containsKey("userId")) {
1362 userId = _json["userId"];
1363 }
1364 if (_json.containsKey("zone")) {
1365 zone = _json["zone"];
1366 }
1367 }
1368
1369 core.Map toJson() {
1370 var _json = new core.Map();
1371 if (labels != null) {
1372 _json["labels"] = labels;
1373 }
1374 if (projectId != null) {
1375 _json["projectId"] = projectId;
1376 }
1377 if (region != null) {
1378 _json["region"] = region;
1379 }
1380 if (serviceName != null) {
1381 _json["serviceName"] = serviceName;
1382 }
1383 if (severity != null) {
1384 _json["severity"] = severity;
1385 }
1386 if (timestamp != null) {
1387 _json["timestamp"] = timestamp;
1388 }
1389 if (userId != null) {
1390 _json["userId"] = userId;
1391 }
1392 if (zone != null) {
1393 _json["zone"] = zone;
1394 }
1395 return _json;
1396 }
1397 }
1398
1399
1400 /** A problem in a sink or the sink's configuration. */
1401 class LogError {
1402 /**
1403 * The resource associated with the error. It may be different from the sink
1404 * destination. For example, the sink may point to a BigQuery dataset, but the
1405 * error may refer to a table resource inside the dataset.
1406 */
1407 core.String resource;
1408
1409 /** The description of the last error observed. */
1410 Status status;
1411
1412 /**
1413 * The last time the error was observed, in nanoseconds since the Unix epoch.
1414 */
1415 core.String timeNanos;
1416
1417
1418 LogError();
1419
1420 LogError.fromJson(core.Map _json) {
1421 if (_json.containsKey("resource")) {
1422 resource = _json["resource"];
1423 }
1424 if (_json.containsKey("status")) {
1425 status = new Status.fromJson(_json["status"]);
1426 }
1427 if (_json.containsKey("timeNanos")) {
1428 timeNanos = _json["timeNanos"];
1429 }
1430 }
1431
1432 core.Map toJson() {
1433 var _json = new core.Map();
1434 if (resource != null) {
1435 _json["resource"] = resource;
1436 }
1437 if (status != null) {
1438 _json["status"] = (status).toJson();
1439 }
1440 if (timeNanos != null) {
1441 _json["timeNanos"] = timeNanos;
1442 }
1443 return _json;
1444 }
1445 }
1446
1447
1448 /** A log service object. */
1449 class LogService {
1450 /**
1451 * Label keys used when labeling log entries for this service. The order of
1452 * the keys is significant, with higher priority keys coming earlier in the
1453 * list.
1454 */
1455 core.List<core.String> indexKeys;
1456
1457 /** The service's name. */
1458 core.String name;
1459
1460
1461 LogService();
1462
1463 LogService.fromJson(core.Map _json) {
1464 if (_json.containsKey("indexKeys")) {
1465 indexKeys = _json["indexKeys"];
1466 }
1467 if (_json.containsKey("name")) {
1468 name = _json["name"];
1469 }
1470 }
1471
1472 core.Map toJson() {
1473 var _json = new core.Map();
1474 if (indexKeys != null) {
1475 _json["indexKeys"] = indexKeys;
1476 }
1477 if (name != null) {
1478 _json["name"] = name;
1479 }
1480 return _json;
1481 }
1482 }
1483
1484
1485 /** An object that describes where a log may be written. */
1486 class LogSink {
1487 /**
1488 * The resource to send log entries to. The supported sink resource types are:
1489 * + Google Cloud Storage: `storage.googleapis.com/BUCKET` or
1490 * `BUCKET.storage.googleapis.com/` + Google BigQuery:
1491 * `bigquery.googleapis.com/projects/PROJECT/datasets/DATASET` Currently the
1492 * Cloud Logging API supports at most one sink for each resource type per log
1493 * or log service resource.
1494 */
1495 core.String destination;
1496
1497 /** _Output only._ All active errors found for this sink. */
1498 core.List<LogError> errors;
1499
1500 /**
1501 * The name of this sink. This is a client-assigned identifier for the
1502 * resource. This is ignored by UpdateLogSink and UpdateLogServicesSink.
1503 */
1504 core.String name;
1505
1506
1507 LogSink();
1508
1509 LogSink.fromJson(core.Map _json) {
1510 if (_json.containsKey("destination")) {
1511 destination = _json["destination"];
1512 }
1513 if (_json.containsKey("errors")) {
1514 errors = _json["errors"].map((value) => new LogError.fromJson(value)).toLi st();
1515 }
1516 if (_json.containsKey("name")) {
1517 name = _json["name"];
1518 }
1519 }
1520
1521 core.Map toJson() {
1522 var _json = new core.Map();
1523 if (destination != null) {
1524 _json["destination"] = destination;
1525 }
1526 if (errors != null) {
1527 _json["errors"] = errors.map((value) => (value).toJson()).toList();
1528 }
1529 if (name != null) {
1530 _json["name"] = name;
1531 }
1532 return _json;
1533 }
1534 }
1535
1536
1537 /**
1538 * Represents the RPC error status for Google APIs. See http://go/errormodel for
1539 * details.
1540 */
1541 class Status {
1542 /** The status code, which should be an enum value of [google.rpc.Code][]. */
1543 core.int code;
1544
1545 /**
1546 * A list of messages that carry the error details. There will be a common set
1547 * of message types for APIs to use.
1548 *
1549 * The values for Object must be JSON objects. It can consist of `num`,
1550 * `String`, `bool` and `null` as well as `Map` and `List` values.
1551 */
1552 core.List<core.Map<core.String, core.Object>> details;
1553
1554 /**
1555 * A developer-facing error message, which should be in English. The
1556 * user-facing error message should be localized and stored in the
1557 * [google.rpc.Status.details][google.rpc.Status.details] field.
1558 */
1559 core.String message;
1560
1561
1562 Status();
1563
1564 Status.fromJson(core.Map _json) {
1565 if (_json.containsKey("code")) {
1566 code = _json["code"];
1567 }
1568 if (_json.containsKey("details")) {
1569 details = _json["details"];
1570 }
1571 if (_json.containsKey("message")) {
1572 message = _json["message"];
1573 }
1574 }
1575
1576 core.Map toJson() {
1577 var _json = new core.Map();
1578 if (code != null) {
1579 _json["code"] = code;
1580 }
1581 if (details != null) {
1582 _json["details"] = details;
1583 }
1584 if (message != null) {
1585 _json["message"] = message;
1586 }
1587 return _json;
1588 }
1589 }
1590
1591
1592 /** The parameters to WriteLogEntries. */
1593 class WriteLogEntriesRequest {
1594 /**
1595 * Metadata labels that apply to all entries in this request. If one of the
1596 * log entries contains a (key, value) with the same key that is in
1597 * `commonLabels`, then the entry's (key, value) overrides the one in
1598 * `commonLabels`.
1599 */
1600 core.Map<core.String, core.String> commonLabels;
1601
1602 /** Log entries to insert. */
1603 core.List<LogEntry> entries;
1604
1605
1606 WriteLogEntriesRequest();
1607
1608 WriteLogEntriesRequest.fromJson(core.Map _json) {
1609 if (_json.containsKey("commonLabels")) {
1610 commonLabels = _json["commonLabels"];
1611 }
1612 if (_json.containsKey("entries")) {
1613 entries = _json["entries"].map((value) => new LogEntry.fromJson(value)).to List();
1614 }
1615 }
1616
1617 core.Map toJson() {
1618 var _json = new core.Map();
1619 if (commonLabels != null) {
1620 _json["commonLabels"] = commonLabels;
1621 }
1622 if (entries != null) {
1623 _json["entries"] = entries.map((value) => (value).toJson()).toList();
1624 }
1625 return _json;
1626 }
1627 }
1628
1629
1630 /** Result returned from WriteLogEntries. empty */
1631 class WriteLogEntriesResponse {
1632
1633 WriteLogEntriesResponse();
1634
1635 WriteLogEntriesResponse.fromJson(core.Map _json) {
1636 }
1637
1638 core.Map toJson() {
1639 var _json = new core.Map();
1640 return _json;
1641 }
1642 }
OLDNEW
« no previous file with comments | « generated/googleapis_beta/lib/genomics/v1beta2.dart ('k') | generated/googleapis_beta/lib/manager/v1beta2.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698