Chromium Code Reviews

Side by Side Diff: generated/googleapis/lib/admin/reports_v1.dart

Issue 559053002: Generate 0.1.0 version of googleapis/googleapis_beta (Closed) Base URL: git@github.com:dart-lang/googleapis.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
(Empty)
1 library googleapis.admin.reports_v1;
2
3 import "dart:core" as core;
4 import "dart:collection" as collection;
5 import "dart:async" as async;
6 import "dart:convert" as convert;
7
8 import "package:crypto/crypto.dart" as crypto;
9 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 export '../common/common.dart' show ApiRequestError;
14 export '../common/common.dart' show DetailedApiRequestError;
15
16 /**
17 * Allows the administrators of Google Apps customers to fetch reports about the
18 * usage, collaboration, security and risk for their users.
19 */
20 class AdminApi {
21 /** View audit reports of Google Apps for your domain */
22 static const AdminReportsAuditReadonlyScope = "https://www.googleapis.com/auth /admin.reports.audit.readonly";
23
24 /** View usage reports of Google Apps for your domain */
25 static const AdminReportsUsageReadonlyScope = "https://www.googleapis.com/auth /admin.reports.usage.readonly";
26
27
28 final common_internal.ApiRequester _requester;
29
30 ActivitiesResourceApi get activities => new ActivitiesResourceApi(_requester);
31 ChannelsResourceApi get channels => new ChannelsResourceApi(_requester);
32 CustomerUsageReportsResourceApi get customerUsageReports => new CustomerUsageR eportsResourceApi(_requester);
33 UserUsageReportResourceApi get userUsageReport => new UserUsageReportResourceA pi(_requester);
34
35 AdminApi(http.Client client) :
36 _requester = new common_internal.ApiRequester(client, "https://www.googlea pis.com/", "/admin/reports/v1/");
37 }
38
39
40 /** Not documented yet. */
41 class ActivitiesResourceApi {
42 final common_internal.ApiRequester _requester;
43
44 ActivitiesResourceApi(common_internal.ApiRequester client) :
45 _requester = client;
46
47 /**
48 * Retrieves a list of activities for a specific customer and application.
49 *
50 * Request parameters:
51 *
52 * [userKey] - Represents the profile id or the user email for which the data
53 * should be filtered. When 'all' is specified as the userKey, it returns
54 * usageReports for all users.
55 *
56 * [applicationName] - Application name for which the events are to be
57 * retrieved.
58 * Value must have pattern "(admin)|(docs)|(drive)|(login)".
59 *
60 * [actorIpAddress] - IP Address of host where the event was performed.
61 * Supports both IPv4 and IPv6 addresses.
62 *
63 * [customerId] - Represents the customer for which the data is to be fetched.
64 * Value must have pattern "C.+".
65 *
66 * [endTime] - Return events which occured at or before this time.
67 * Value must have pattern
68 * "(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)(?:\.(\d+))?(?:(Z)|([-+])(\d\ d):(\d\d))".
69 *
70 * [eventName] - Name of the event being queried.
71 *
72 * [filters] - Event parameters in the form [parameter1
73 * name][operator][parameter1 value],[parameter2 name][operator][parameter2
74 * value],...
75 * Value must have pattern "(.+[<,<=,==,>=,>,<>].+,)*(.+[<,<=,==,>=,>,<>].+)".
76 *
77 * [maxResults] - Number of activity records to be shown in each page.
78 * Value must be between "1" and "1000".
79 *
80 * [pageToken] - Token to specify next page.
81 *
82 * [startTime] - Return events which occured at or after this time.
83 * Value must have pattern
84 * "(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)(?:\.(\d+))?(?:(Z)|([-+])(\d\ d):(\d\d))".
85 *
86 * Completes with a [Activities].
87 *
88 * Completes with a [common.ApiRequestError] if the API endpoint returned an
89 * error.
90 *
91 * If the used [http.Client] completes with an error when making a REST call,
92 * this method will complete with the same error.
93 */
94 async.Future<Activities> list(core.String userKey, core.String applicationName , {core.String actorIpAddress, core.String customerId, core.String endTime, core .String eventName, core.String filters, core.int maxResults, core.String pageTok en, core.String startTime}) {
95 var _url = null;
96 var _queryParams = new core.Map();
97 var _uploadMedia = null;
98 var _uploadOptions = null;
99 var _downloadOptions = common.DownloadOptions.Metadata;
100 var _body = null;
101
102 if (userKey == null) {
103 throw new core.ArgumentError("Parameter userKey is required.");
104 }
105 if (applicationName == null) {
106 throw new core.ArgumentError("Parameter applicationName is required.");
107 }
108 if (actorIpAddress != null) {
109 _queryParams["actorIpAddress"] = [actorIpAddress];
110 }
111 if (customerId != null) {
112 _queryParams["customerId"] = [customerId];
113 }
114 if (endTime != null) {
115 _queryParams["endTime"] = [endTime];
116 }
117 if (eventName != null) {
118 _queryParams["eventName"] = [eventName];
119 }
120 if (filters != null) {
121 _queryParams["filters"] = [filters];
122 }
123 if (maxResults != null) {
124 _queryParams["maxResults"] = ["${maxResults}"];
125 }
126 if (pageToken != null) {
127 _queryParams["pageToken"] = [pageToken];
128 }
129 if (startTime != null) {
130 _queryParams["startTime"] = [startTime];
131 }
132
133
134 _url = 'activity/users/' + common_internal.Escaper.ecapeVariable('$userKey') + '/applications/' + common_internal.Escaper.ecapeVariable('$applicationName');
135
136 var _response = _requester.request(_url,
137 "GET",
138 body: _body,
139 queryParams: _queryParams,
140 uploadOptions: _uploadOptions,
141 uploadMedia: _uploadMedia,
142 downloadOptions: _downloadOptions);
143 return _response.then((data) => new Activities.fromJson(data));
144 }
145
146 /**
147 * Push changes to activities
148 *
149 * [request] - The metadata request object.
150 *
151 * Request parameters:
152 *
153 * [userKey] - Represents the profile id or the user email for which the data
154 * should be filtered. When 'all' is specified as the userKey, it returns
155 * usageReports for all users.
156 *
157 * [applicationName] - Application name for which the events are to be
158 * retrieved.
159 * Value must have pattern "(admin)|(docs)|(drive)|(login)".
160 *
161 * [actorIpAddress] - IP Address of host where the event was performed.
162 * Supports both IPv4 and IPv6 addresses.
163 *
164 * [customerId] - Represents the customer for which the data is to be fetched.
165 * Value must have pattern "C.+".
166 *
167 * [endTime] - Return events which occured at or before this time.
168 * Value must have pattern
169 * "(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)(?:\.(\d+))?(?:(Z)|([-+])(\d\ d):(\d\d))".
170 *
171 * [eventName] - Name of the event being queried.
172 *
173 * [filters] - Event parameters in the form [parameter1
174 * name][operator][parameter1 value],[parameter2 name][operator][parameter2
175 * value],...
176 * Value must have pattern "(.+[<,<=,==,>=,>,<>].+,)*(.+[<,<=,==,>=,>,<>].+)".
177 *
178 * [maxResults] - Number of activity records to be shown in each page.
179 * Value must be between "1" and "1000".
180 *
181 * [pageToken] - Token to specify next page.
182 *
183 * [startTime] - Return events which occured at or after this time.
184 * Value must have pattern
185 * "(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)(?:\.(\d+))?(?:(Z)|([-+])(\d\ d):(\d\d))".
186 *
187 * Completes with a [Channel].
188 *
189 * Completes with a [common.ApiRequestError] if the API endpoint returned an
190 * error.
191 *
192 * If the used [http.Client] completes with an error when making a REST call,
193 * this method will complete with the same error.
194 */
195 async.Future<Channel> watch(Channel request, core.String userKey, core.String applicationName, {core.String actorIpAddress, core.String customerId, core.Strin g endTime, core.String eventName, core.String filters, core.int maxResults, core .String pageToken, core.String startTime}) {
196 var _url = null;
197 var _queryParams = new core.Map();
198 var _uploadMedia = null;
199 var _uploadOptions = null;
200 var _downloadOptions = common.DownloadOptions.Metadata;
201 var _body = null;
202
203 if (request != null) {
204 _body = convert.JSON.encode((request).toJson());
205 }
206 if (userKey == null) {
207 throw new core.ArgumentError("Parameter userKey is required.");
208 }
209 if (applicationName == null) {
210 throw new core.ArgumentError("Parameter applicationName is required.");
211 }
212 if (actorIpAddress != null) {
213 _queryParams["actorIpAddress"] = [actorIpAddress];
214 }
215 if (customerId != null) {
216 _queryParams["customerId"] = [customerId];
217 }
218 if (endTime != null) {
219 _queryParams["endTime"] = [endTime];
220 }
221 if (eventName != null) {
222 _queryParams["eventName"] = [eventName];
223 }
224 if (filters != null) {
225 _queryParams["filters"] = [filters];
226 }
227 if (maxResults != null) {
228 _queryParams["maxResults"] = ["${maxResults}"];
229 }
230 if (pageToken != null) {
231 _queryParams["pageToken"] = [pageToken];
232 }
233 if (startTime != null) {
234 _queryParams["startTime"] = [startTime];
235 }
236
237
238 _url = 'activity/users/' + common_internal.Escaper.ecapeVariable('$userKey') + '/applications/' + common_internal.Escaper.ecapeVariable('$applicationName') + '/watch';
239
240 var _response = _requester.request(_url,
241 "POST",
242 body: _body,
243 queryParams: _queryParams,
244 uploadOptions: _uploadOptions,
245 uploadMedia: _uploadMedia,
246 downloadOptions: _downloadOptions);
247 return _response.then((data) => new Channel.fromJson(data));
248 }
249
250 }
251
252
253 /** Not documented yet. */
254 class ChannelsResourceApi {
255 final common_internal.ApiRequester _requester;
256
257 ChannelsResourceApi(common_internal.ApiRequester client) :
258 _requester = client;
259
260 /**
261 * Stop watching resources through this channel
262 *
263 * [request] - The metadata request object.
264 *
265 * Request parameters:
266 *
267 * Completes with a [common.ApiRequestError] if the API endpoint returned an
268 * error.
269 *
270 * If the used [http.Client] completes with an error when making a REST call,
271 * this method will complete with the same error.
272 */
273 async.Future stop(Channel request) {
274 var _url = null;
275 var _queryParams = new core.Map();
276 var _uploadMedia = null;
277 var _uploadOptions = null;
278 var _downloadOptions = common.DownloadOptions.Metadata;
279 var _body = null;
280
281 if (request != null) {
282 _body = convert.JSON.encode((request).toJson());
283 }
284
285 _downloadOptions = null;
286
287 _url = '/admin/reports_v1/channels/stop';
288
289 var _response = _requester.request(_url,
290 "POST",
291 body: _body,
292 queryParams: _queryParams,
293 uploadOptions: _uploadOptions,
294 uploadMedia: _uploadMedia,
295 downloadOptions: _downloadOptions);
296 return _response.then((data) => null);
297 }
298
299 }
300
301
302 /** Not documented yet. */
303 class CustomerUsageReportsResourceApi {
304 final common_internal.ApiRequester _requester;
305
306 CustomerUsageReportsResourceApi(common_internal.ApiRequester client) :
307 _requester = client;
308
309 /**
310 * Retrieves a report which is a collection of properties / statistics for a
311 * specific customer.
312 *
313 * Request parameters:
314 *
315 * [date] - Represents the date in yyyy-mm-dd format for which the data is to
316 * be fetched.
317 * Value must have pattern "(\d){4}-(\d){2}-(\d){2}".
318 *
319 * [customerId] - Represents the customer for which the data is to be fetched.
320 * Value must have pattern "C.+".
321 *
322 * [pageToken] - Token to specify next page.
323 *
324 * [parameters] - Represents the application name, parameter name pairs to
325 * fetch in csv as app_name1:param_name1, app_name2:param_name2.
326 * Value must have pattern
327 * "(((accounts)|(gmail)|(calendar)|(docs)|(gplus)):.+,)*(((accounts)|(gmail)| (calendar)|(docs)|(gplus)):.+)".
328 *
329 * Completes with a [UsageReports].
330 *
331 * Completes with a [common.ApiRequestError] if the API endpoint returned an
332 * error.
333 *
334 * If the used [http.Client] completes with an error when making a REST call,
335 * this method will complete with the same error.
336 */
337 async.Future<UsageReports> get(core.String date, {core.String customerId, core .String pageToken, core.String parameters}) {
338 var _url = null;
339 var _queryParams = new core.Map();
340 var _uploadMedia = null;
341 var _uploadOptions = null;
342 var _downloadOptions = common.DownloadOptions.Metadata;
343 var _body = null;
344
345 if (date == null) {
346 throw new core.ArgumentError("Parameter date is required.");
347 }
348 if (customerId != null) {
349 _queryParams["customerId"] = [customerId];
350 }
351 if (pageToken != null) {
352 _queryParams["pageToken"] = [pageToken];
353 }
354 if (parameters != null) {
355 _queryParams["parameters"] = [parameters];
356 }
357
358
359 _url = 'usage/dates/' + common_internal.Escaper.ecapeVariable('$date');
360
361 var _response = _requester.request(_url,
362 "GET",
363 body: _body,
364 queryParams: _queryParams,
365 uploadOptions: _uploadOptions,
366 uploadMedia: _uploadMedia,
367 downloadOptions: _downloadOptions);
368 return _response.then((data) => new UsageReports.fromJson(data));
369 }
370
371 }
372
373
374 /** Not documented yet. */
375 class UserUsageReportResourceApi {
376 final common_internal.ApiRequester _requester;
377
378 UserUsageReportResourceApi(common_internal.ApiRequester client) :
379 _requester = client;
380
381 /**
382 * Retrieves a report which is a collection of properties / statistics for a
383 * set of users.
384 *
385 * Request parameters:
386 *
387 * [userKey] - Represents the profile id or the user email for which the data
388 * should be filtered.
389 *
390 * [date] - Represents the date in yyyy-mm-dd format for which the data is to
391 * be fetched.
392 * Value must have pattern "(\d){4}-(\d){2}-(\d){2}".
393 *
394 * [customerId] - Represents the customer for which the data is to be fetched.
395 * Value must have pattern "C.+".
396 *
397 * [filters] - Represents the set of filters including parameter operator
398 * value.
399 * Value must have pattern
400 * "(((accounts)|(gmail)|(calendar)|(docs)|(gplus)):.+[<,<=,==,>=,>,!=].+,)*(( (accounts)|(gmail)|(calendar)|(docs)|(gplus)):.+[<,<=,==,>=,>,!=].+)".
401 *
402 * [maxResults] - Maximum number of results to return. Maximum allowed is 1000
403 *
404 * [pageToken] - Token to specify next page.
405 *
406 * [parameters] - Represents the application name, parameter name pairs to
407 * fetch in csv as app_name1:param_name1, app_name2:param_name2.
408 * Value must have pattern
409 * "(((accounts)|(gmail)|(calendar)|(docs)|(gplus)):.+,)*(((accounts)|(gmail)| (calendar)|(docs)|(gplus)):.+)".
410 *
411 * Completes with a [UsageReports].
412 *
413 * Completes with a [common.ApiRequestError] if the API endpoint returned an
414 * error.
415 *
416 * If the used [http.Client] completes with an error when making a REST call,
417 * this method will complete with the same error.
418 */
419 async.Future<UsageReports> get(core.String userKey, core.String date, {core.St ring customerId, core.String filters, core.int maxResults, core.String pageToken , core.String parameters}) {
420 var _url = null;
421 var _queryParams = new core.Map();
422 var _uploadMedia = null;
423 var _uploadOptions = null;
424 var _downloadOptions = common.DownloadOptions.Metadata;
425 var _body = null;
426
427 if (userKey == null) {
428 throw new core.ArgumentError("Parameter userKey is required.");
429 }
430 if (date == null) {
431 throw new core.ArgumentError("Parameter date is required.");
432 }
433 if (customerId != null) {
434 _queryParams["customerId"] = [customerId];
435 }
436 if (filters != null) {
437 _queryParams["filters"] = [filters];
438 }
439 if (maxResults != null) {
440 _queryParams["maxResults"] = ["${maxResults}"];
441 }
442 if (pageToken != null) {
443 _queryParams["pageToken"] = [pageToken];
444 }
445 if (parameters != null) {
446 _queryParams["parameters"] = [parameters];
447 }
448
449
450 _url = 'usage/users/' + common_internal.Escaper.ecapeVariable('$userKey') + '/dates/' + common_internal.Escaper.ecapeVariable('$date');
451
452 var _response = _requester.request(_url,
453 "GET",
454 body: _body,
455 queryParams: _queryParams,
456 uploadOptions: _uploadOptions,
457 uploadMedia: _uploadMedia,
458 downloadOptions: _downloadOptions);
459 return _response.then((data) => new UsageReports.fromJson(data));
460 }
461
462 }
463
464
465
466 /** JSON template for a collection of activites. */
467 class Activities {
468 /** ETag of the resource. */
469 core.String etag;
470
471 /** Each record in read response. */
472 core.List<Activity> items;
473
474 /** Kind of list response this is. */
475 core.String kind;
476
477 /** Token for retrieving the next page */
478 core.String nextPageToken;
479
480
481 Activities();
482
483 Activities.fromJson(core.Map _json) {
484 if (_json.containsKey("etag")) {
485 etag = _json["etag"];
486 }
487 if (_json.containsKey("items")) {
488 items = _json["items"].map((value) => new Activity.fromJson(value)).toList ();
489 }
490 if (_json.containsKey("kind")) {
491 kind = _json["kind"];
492 }
493 if (_json.containsKey("nextPageToken")) {
494 nextPageToken = _json["nextPageToken"];
495 }
496 }
497
498 core.Map toJson() {
499 var _json = new core.Map();
500 if (etag != null) {
501 _json["etag"] = etag;
502 }
503 if (items != null) {
504 _json["items"] = items.map((value) => (value).toJson()).toList();
505 }
506 if (kind != null) {
507 _json["kind"] = kind;
508 }
509 if (nextPageToken != null) {
510 _json["nextPageToken"] = nextPageToken;
511 }
512 return _json;
513 }
514 }
515
516
517 /** User doing the action. */
518 class ActivityActor {
519 /** User or OAuth 2LO request. */
520 core.String callerType;
521
522 /** Email address of the user. */
523 core.String email;
524
525 /** For OAuth 2LO API requests, consumer_key of the requestor. */
526 core.String key;
527
528 /** Obfuscated user id of the user. */
529 core.String profileId;
530
531
532 ActivityActor();
533
534 ActivityActor.fromJson(core.Map _json) {
535 if (_json.containsKey("callerType")) {
536 callerType = _json["callerType"];
537 }
538 if (_json.containsKey("email")) {
539 email = _json["email"];
540 }
541 if (_json.containsKey("key")) {
542 key = _json["key"];
543 }
544 if (_json.containsKey("profileId")) {
545 profileId = _json["profileId"];
546 }
547 }
548
549 core.Map toJson() {
550 var _json = new core.Map();
551 if (callerType != null) {
552 _json["callerType"] = callerType;
553 }
554 if (email != null) {
555 _json["email"] = email;
556 }
557 if (key != null) {
558 _json["key"] = key;
559 }
560 if (profileId != null) {
561 _json["profileId"] = profileId;
562 }
563 return _json;
564 }
565 }
566
567
568 /** Not documented yet. */
569 class ActivityEventsParameters {
570 /** Boolean value of the parameter. */
571 core.bool boolValue;
572
573 /** Integral value of the parameter. */
574 core.String intValue;
575
576 /** The name of the parameter. */
577 core.String name;
578
579 /** String value of the parameter. */
580 core.String value;
581
582
583 ActivityEventsParameters();
584
585 ActivityEventsParameters.fromJson(core.Map _json) {
586 if (_json.containsKey("boolValue")) {
587 boolValue = _json["boolValue"];
588 }
589 if (_json.containsKey("intValue")) {
590 intValue = _json["intValue"];
591 }
592 if (_json.containsKey("name")) {
593 name = _json["name"];
594 }
595 if (_json.containsKey("value")) {
596 value = _json["value"];
597 }
598 }
599
600 core.Map toJson() {
601 var _json = new core.Map();
602 if (boolValue != null) {
603 _json["boolValue"] = boolValue;
604 }
605 if (intValue != null) {
606 _json["intValue"] = intValue;
607 }
608 if (name != null) {
609 _json["name"] = name;
610 }
611 if (value != null) {
612 _json["value"] = value;
613 }
614 return _json;
615 }
616 }
617
618
619 /** Not documented yet. */
620 class ActivityEvents {
621 /** Name of event. */
622 core.String name;
623
624 /** Parameter value pairs for various applications. */
625 core.List<ActivityEventsParameters> parameters;
626
627 /** Type of event. */
628 core.String type;
629
630
631 ActivityEvents();
632
633 ActivityEvents.fromJson(core.Map _json) {
634 if (_json.containsKey("name")) {
635 name = _json["name"];
636 }
637 if (_json.containsKey("parameters")) {
638 parameters = _json["parameters"].map((value) => new ActivityEventsParamete rs.fromJson(value)).toList();
639 }
640 if (_json.containsKey("type")) {
641 type = _json["type"];
642 }
643 }
644
645 core.Map toJson() {
646 var _json = new core.Map();
647 if (name != null) {
648 _json["name"] = name;
649 }
650 if (parameters != null) {
651 _json["parameters"] = parameters.map((value) => (value).toJson()).toList() ;
652 }
653 if (type != null) {
654 _json["type"] = type;
655 }
656 return _json;
657 }
658 }
659
660
661 /** Unique identifier for each activity record. */
662 class ActivityId {
663 /** Application name to which the event belongs. */
664 core.String applicationName;
665
666 /** Obfuscated customer ID of the source customer. */
667 core.String customerId;
668
669 /** Time of occurrence of the activity. */
670 core.DateTime time;
671
672 /** Unique qualifier if multiple events have the same time. */
673 core.String uniqueQualifier;
674
675
676 ActivityId();
677
678 ActivityId.fromJson(core.Map _json) {
679 if (_json.containsKey("applicationName")) {
680 applicationName = _json["applicationName"];
681 }
682 if (_json.containsKey("customerId")) {
683 customerId = _json["customerId"];
684 }
685 if (_json.containsKey("time")) {
686 time = core.DateTime.parse(_json["time"]);
687 }
688 if (_json.containsKey("uniqueQualifier")) {
689 uniqueQualifier = _json["uniqueQualifier"];
690 }
691 }
692
693 core.Map toJson() {
694 var _json = new core.Map();
695 if (applicationName != null) {
696 _json["applicationName"] = applicationName;
697 }
698 if (customerId != null) {
699 _json["customerId"] = customerId;
700 }
701 if (time != null) {
702 _json["time"] = (time).toIso8601String();
703 }
704 if (uniqueQualifier != null) {
705 _json["uniqueQualifier"] = uniqueQualifier;
706 }
707 return _json;
708 }
709 }
710
711
712 /** JSON template for the activity resource. */
713 class Activity {
714 /** User doing the action. */
715 ActivityActor actor;
716
717 /** ETag of the entry. */
718 core.String etag;
719
720 /** Activity events. */
721 core.List<ActivityEvents> events;
722
723 /** Unique identifier for each activity record. */
724 ActivityId id;
725
726 /** IP Address of the user doing the action. */
727 core.String ipAddress;
728
729 /** Kind of resource this is. */
730 core.String kind;
731
732 /** Domain of source customer. */
733 core.String ownerDomain;
734
735
736 Activity();
737
738 Activity.fromJson(core.Map _json) {
739 if (_json.containsKey("actor")) {
740 actor = new ActivityActor.fromJson(_json["actor"]);
741 }
742 if (_json.containsKey("etag")) {
743 etag = _json["etag"];
744 }
745 if (_json.containsKey("events")) {
746 events = _json["events"].map((value) => new ActivityEvents.fromJson(value) ).toList();
747 }
748 if (_json.containsKey("id")) {
749 id = new ActivityId.fromJson(_json["id"]);
750 }
751 if (_json.containsKey("ipAddress")) {
752 ipAddress = _json["ipAddress"];
753 }
754 if (_json.containsKey("kind")) {
755 kind = _json["kind"];
756 }
757 if (_json.containsKey("ownerDomain")) {
758 ownerDomain = _json["ownerDomain"];
759 }
760 }
761
762 core.Map toJson() {
763 var _json = new core.Map();
764 if (actor != null) {
765 _json["actor"] = (actor).toJson();
766 }
767 if (etag != null) {
768 _json["etag"] = etag;
769 }
770 if (events != null) {
771 _json["events"] = events.map((value) => (value).toJson()).toList();
772 }
773 if (id != null) {
774 _json["id"] = (id).toJson();
775 }
776 if (ipAddress != null) {
777 _json["ipAddress"] = ipAddress;
778 }
779 if (kind != null) {
780 _json["kind"] = kind;
781 }
782 if (ownerDomain != null) {
783 _json["ownerDomain"] = ownerDomain;
784 }
785 return _json;
786 }
787 }
788
789
790 /** An notification channel used to watch for resource changes. */
791 class Channel {
792 /** The address where notifications are delivered for this channel. */
793 core.String address;
794
795 /**
796 * Date and time of notification channel expiration, expressed as a Unix
797 * timestamp, in milliseconds. Optional.
798 */
799 core.String expiration;
800
801 /** A UUID or similar unique string that identifies this channel. */
802 core.String id;
803
804 /**
805 * Identifies this as a notification channel used to watch for changes to a
806 * resource. Value: the fixed string "api#channel".
807 */
808 core.String kind;
809
810 /** Additional parameters controlling delivery channel behavior. Optional. */
811 core.Map<core.String, core.String> params;
812
813 /** A Boolean value to indicate whether payload is wanted. Optional. */
814 core.bool payload;
815
816 /**
817 * An opaque ID that identifies the resource being watched on this channel.
818 * Stable across different API versions.
819 */
820 core.String resourceId;
821
822 /** A version-specific identifier for the watched resource. */
823 core.String resourceUri;
824
825 /**
826 * An arbitrary string delivered to the target address with each notification
827 * delivered over this channel. Optional.
828 */
829 core.String token;
830
831 /** The type of delivery mechanism used for this channel. */
832 core.String type;
833
834
835 Channel();
836
837 Channel.fromJson(core.Map _json) {
838 if (_json.containsKey("address")) {
839 address = _json["address"];
840 }
841 if (_json.containsKey("expiration")) {
842 expiration = _json["expiration"];
843 }
844 if (_json.containsKey("id")) {
845 id = _json["id"];
846 }
847 if (_json.containsKey("kind")) {
848 kind = _json["kind"];
849 }
850 if (_json.containsKey("params")) {
851 params = _json["params"];
852 }
853 if (_json.containsKey("payload")) {
854 payload = _json["payload"];
855 }
856 if (_json.containsKey("resourceId")) {
857 resourceId = _json["resourceId"];
858 }
859 if (_json.containsKey("resourceUri")) {
860 resourceUri = _json["resourceUri"];
861 }
862 if (_json.containsKey("token")) {
863 token = _json["token"];
864 }
865 if (_json.containsKey("type")) {
866 type = _json["type"];
867 }
868 }
869
870 core.Map toJson() {
871 var _json = new core.Map();
872 if (address != null) {
873 _json["address"] = address;
874 }
875 if (expiration != null) {
876 _json["expiration"] = expiration;
877 }
878 if (id != null) {
879 _json["id"] = id;
880 }
881 if (kind != null) {
882 _json["kind"] = kind;
883 }
884 if (params != null) {
885 _json["params"] = params;
886 }
887 if (payload != null) {
888 _json["payload"] = payload;
889 }
890 if (resourceId != null) {
891 _json["resourceId"] = resourceId;
892 }
893 if (resourceUri != null) {
894 _json["resourceUri"] = resourceUri;
895 }
896 if (token != null) {
897 _json["token"] = token;
898 }
899 if (type != null) {
900 _json["type"] = type;
901 }
902 return _json;
903 }
904 }
905
906
907 /** Information about the type of the item. */
908 class UsageReportEntity {
909 /** Obfuscated customer id for the record. */
910 core.String customerId;
911
912 /** Obfuscated user id for the record. */
913 core.String profileId;
914
915 /** The type of item, can be a customer or user. */
916 core.String type;
917
918 /** user's email. */
919 core.String userEmail;
920
921
922 UsageReportEntity();
923
924 UsageReportEntity.fromJson(core.Map _json) {
925 if (_json.containsKey("customerId")) {
926 customerId = _json["customerId"];
927 }
928 if (_json.containsKey("profileId")) {
929 profileId = _json["profileId"];
930 }
931 if (_json.containsKey("type")) {
932 type = _json["type"];
933 }
934 if (_json.containsKey("userEmail")) {
935 userEmail = _json["userEmail"];
936 }
937 }
938
939 core.Map toJson() {
940 var _json = new core.Map();
941 if (customerId != null) {
942 _json["customerId"] = customerId;
943 }
944 if (profileId != null) {
945 _json["profileId"] = profileId;
946 }
947 if (type != null) {
948 _json["type"] = type;
949 }
950 if (userEmail != null) {
951 _json["userEmail"] = userEmail;
952 }
953 return _json;
954 }
955 }
956
957
958 /** Not documented yet. */
959 class UsageReportParameters {
960 /** Boolean value of the parameter. */
961 core.bool boolValue;
962
963 /** RFC 3339 formatted value of the parameter. */
964 core.DateTime datetimeValue;
965
966 /** Integral value of the parameter. */
967 core.String intValue;
968
969 /**
970 * Nested message value of the parameter.
971 *
972 * The values for Object must be JSON objects. It can consist of `num`,
973 * `String`, `bool` and `null` as well as `Map` and `List` values.
974 */
975 core.List<core.Map<core.String, core.Object>> msgValue;
976
977 /** The name of the parameter. */
978 core.String name;
979
980 /** String value of the parameter. */
981 core.String stringValue;
982
983
984 UsageReportParameters();
985
986 UsageReportParameters.fromJson(core.Map _json) {
987 if (_json.containsKey("boolValue")) {
988 boolValue = _json["boolValue"];
989 }
990 if (_json.containsKey("datetimeValue")) {
991 datetimeValue = core.DateTime.parse(_json["datetimeValue"]);
992 }
993 if (_json.containsKey("intValue")) {
994 intValue = _json["intValue"];
995 }
996 if (_json.containsKey("msgValue")) {
997 msgValue = _json["msgValue"];
998 }
999 if (_json.containsKey("name")) {
1000 name = _json["name"];
1001 }
1002 if (_json.containsKey("stringValue")) {
1003 stringValue = _json["stringValue"];
1004 }
1005 }
1006
1007 core.Map toJson() {
1008 var _json = new core.Map();
1009 if (boolValue != null) {
1010 _json["boolValue"] = boolValue;
1011 }
1012 if (datetimeValue != null) {
1013 _json["datetimeValue"] = (datetimeValue).toIso8601String();
1014 }
1015 if (intValue != null) {
1016 _json["intValue"] = intValue;
1017 }
1018 if (msgValue != null) {
1019 _json["msgValue"] = msgValue;
1020 }
1021 if (name != null) {
1022 _json["name"] = name;
1023 }
1024 if (stringValue != null) {
1025 _json["stringValue"] = stringValue;
1026 }
1027 return _json;
1028 }
1029 }
1030
1031
1032 /** JSON template for a usage report. */
1033 class UsageReport {
1034 /** The date to which the record belongs. */
1035 core.String date;
1036
1037 /** Information about the type of the item. */
1038 UsageReportEntity entity;
1039
1040 /** ETag of the resource. */
1041 core.String etag;
1042
1043 /** The kind of object. */
1044 core.String kind;
1045
1046 /** Parameter value pairs for various applications. */
1047 core.List<UsageReportParameters> parameters;
1048
1049
1050 UsageReport();
1051
1052 UsageReport.fromJson(core.Map _json) {
1053 if (_json.containsKey("date")) {
1054 date = _json["date"];
1055 }
1056 if (_json.containsKey("entity")) {
1057 entity = new UsageReportEntity.fromJson(_json["entity"]);
1058 }
1059 if (_json.containsKey("etag")) {
1060 etag = _json["etag"];
1061 }
1062 if (_json.containsKey("kind")) {
1063 kind = _json["kind"];
1064 }
1065 if (_json.containsKey("parameters")) {
1066 parameters = _json["parameters"].map((value) => new UsageReportParameters. fromJson(value)).toList();
1067 }
1068 }
1069
1070 core.Map toJson() {
1071 var _json = new core.Map();
1072 if (date != null) {
1073 _json["date"] = date;
1074 }
1075 if (entity != null) {
1076 _json["entity"] = (entity).toJson();
1077 }
1078 if (etag != null) {
1079 _json["etag"] = etag;
1080 }
1081 if (kind != null) {
1082 _json["kind"] = kind;
1083 }
1084 if (parameters != null) {
1085 _json["parameters"] = parameters.map((value) => (value).toJson()).toList() ;
1086 }
1087 return _json;
1088 }
1089 }
1090
1091
1092 /** Not documented yet. */
1093 class UsageReportsWarningsData {
1094 /**
1095 * Key associated with a key-value pair to give detailed information on the
1096 * warning.
1097 */
1098 core.String key;
1099
1100 /**
1101 * Value associated with a key-value pair to give detailed information on the
1102 * warning.
1103 */
1104 core.String value;
1105
1106
1107 UsageReportsWarningsData();
1108
1109 UsageReportsWarningsData.fromJson(core.Map _json) {
1110 if (_json.containsKey("key")) {
1111 key = _json["key"];
1112 }
1113 if (_json.containsKey("value")) {
1114 value = _json["value"];
1115 }
1116 }
1117
1118 core.Map toJson() {
1119 var _json = new core.Map();
1120 if (key != null) {
1121 _json["key"] = key;
1122 }
1123 if (value != null) {
1124 _json["value"] = value;
1125 }
1126 return _json;
1127 }
1128 }
1129
1130
1131 /** Not documented yet. */
1132 class UsageReportsWarnings {
1133 /** Machine readable code / warning type. */
1134 core.String code;
1135
1136 /** Key-Value pairs to give detailed information on the warning. */
1137 core.List<UsageReportsWarningsData> data;
1138
1139 /** Human readable message for the warning. */
1140 core.String message;
1141
1142
1143 UsageReportsWarnings();
1144
1145 UsageReportsWarnings.fromJson(core.Map _json) {
1146 if (_json.containsKey("code")) {
1147 code = _json["code"];
1148 }
1149 if (_json.containsKey("data")) {
1150 data = _json["data"].map((value) => new UsageReportsWarningsData.fromJson( value)).toList();
1151 }
1152 if (_json.containsKey("message")) {
1153 message = _json["message"];
1154 }
1155 }
1156
1157 core.Map toJson() {
1158 var _json = new core.Map();
1159 if (code != null) {
1160 _json["code"] = code;
1161 }
1162 if (data != null) {
1163 _json["data"] = data.map((value) => (value).toJson()).toList();
1164 }
1165 if (message != null) {
1166 _json["message"] = message;
1167 }
1168 return _json;
1169 }
1170 }
1171
1172
1173 /** JSON template for a collection of usage reports. */
1174 class UsageReports {
1175 /** ETag of the resource. */
1176 core.String etag;
1177
1178 /** The kind of object. */
1179 core.String kind;
1180
1181 /** Token for retrieving the next page */
1182 core.String nextPageToken;
1183
1184 /** Various application parameter records. */
1185 core.List<UsageReport> usageReports;
1186
1187 /** Warnings if any. */
1188 core.List<UsageReportsWarnings> warnings;
1189
1190
1191 UsageReports();
1192
1193 UsageReports.fromJson(core.Map _json) {
1194 if (_json.containsKey("etag")) {
1195 etag = _json["etag"];
1196 }
1197 if (_json.containsKey("kind")) {
1198 kind = _json["kind"];
1199 }
1200 if (_json.containsKey("nextPageToken")) {
1201 nextPageToken = _json["nextPageToken"];
1202 }
1203 if (_json.containsKey("usageReports")) {
1204 usageReports = _json["usageReports"].map((value) => new UsageReport.fromJs on(value)).toList();
1205 }
1206 if (_json.containsKey("warnings")) {
1207 warnings = _json["warnings"].map((value) => new UsageReportsWarnings.fromJ son(value)).toList();
1208 }
1209 }
1210
1211 core.Map toJson() {
1212 var _json = new core.Map();
1213 if (etag != null) {
1214 _json["etag"] = etag;
1215 }
1216 if (kind != null) {
1217 _json["kind"] = kind;
1218 }
1219 if (nextPageToken != null) {
1220 _json["nextPageToken"] = nextPageToken;
1221 }
1222 if (usageReports != null) {
1223 _json["usageReports"] = usageReports.map((value) => (value).toJson()).toLi st();
1224 }
1225 if (warnings != null) {
1226 _json["warnings"] = warnings.map((value) => (value).toJson()).toList();
1227 }
1228 return _json;
1229 }
1230 }
1231
1232
OLDNEW

Powered by Google App Engine