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

Side by Side Diff: generated/googleapis/lib/youtubeanalytics/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. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 library googleapis.youtubeAnalytics.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 /** Retrieve your YouTube Analytics reports. */
17 class YoutubeAnalyticsApi {
18 /** View YouTube Analytics monetary reports for your YouTube content */
19 static const YtAnalyticsMonetaryReadonlyScope = "https://www.googleapis.com/au th/yt-analytics-monetary.readonly";
20
21 /** View YouTube Analytics reports for your YouTube content */
22 static const YtAnalyticsReadonlyScope = "https://www.googleapis.com/auth/yt-an alytics.readonly";
23
24
25 final common_internal.ApiRequester _requester;
26
27 BatchReportDefinitionsResourceApi get batchReportDefinitions => new BatchRepor tDefinitionsResourceApi(_requester);
28 BatchReportsResourceApi get batchReports => new BatchReportsResourceApi(_reque ster);
29 ReportsResourceApi get reports => new ReportsResourceApi(_requester);
30
31 YoutubeAnalyticsApi(http.Client client) :
32 _requester = new common_internal.ApiRequester(client, "https://www.googlea pis.com/", "/youtube/analytics/v1/");
33 }
34
35
36 /** Not documented yet. */
37 class BatchReportDefinitionsResourceApi {
38 final common_internal.ApiRequester _requester;
39
40 BatchReportDefinitionsResourceApi(common_internal.ApiRequester client) :
41 _requester = client;
42
43 /**
44 * Retrieves a list of available batch report definitions.
45 *
46 * Request parameters:
47 *
48 * [onBehalfOfContentOwner] - The onBehalfOfContentOwner parameter identifies
49 * the content owner that the user is acting on behalf of.
50 *
51 * Completes with a [BatchReportDefinitionList].
52 *
53 * Completes with a [common.ApiRequestError] if the API endpoint returned an
54 * error.
55 *
56 * If the used [http.Client] completes with an error when making a REST call,
57 * this method will complete with the same error.
58 */
59 async.Future<BatchReportDefinitionList> list(core.String onBehalfOfContentOwne r) {
60 var _url = null;
61 var _queryParams = new core.Map();
62 var _uploadMedia = null;
63 var _uploadOptions = null;
64 var _downloadOptions = common.DownloadOptions.Metadata;
65 var _body = null;
66
67 if (onBehalfOfContentOwner == null) {
68 throw new core.ArgumentError("Parameter onBehalfOfContentOwner is required .");
69 }
70 _queryParams["onBehalfOfContentOwner"] = [onBehalfOfContentOwner];
71
72
73 _url = 'batchReportDefinitions';
74
75 var _response = _requester.request(_url,
76 "GET",
77 body: _body,
78 queryParams: _queryParams,
79 uploadOptions: _uploadOptions,
80 uploadMedia: _uploadMedia,
81 downloadOptions: _downloadOptions);
82 return _response.then((data) => new BatchReportDefinitionList.fromJson(data) );
83 }
84
85 }
86
87
88 /** Not documented yet. */
89 class BatchReportsResourceApi {
90 final common_internal.ApiRequester _requester;
91
92 BatchReportsResourceApi(common_internal.ApiRequester client) :
93 _requester = client;
94
95 /**
96 * Retrieves a list of processed batch reports.
97 *
98 * Request parameters:
99 *
100 * [batchReportDefinitionId] - The batchReportDefinitionId parameter specifies
101 * the ID of the batch reportort definition for which you are retrieving
102 * reports.
103 *
104 * [onBehalfOfContentOwner] - The onBehalfOfContentOwner parameter identifies
105 * the content owner that the user is acting on behalf of.
106 *
107 * Completes with a [BatchReportList].
108 *
109 * Completes with a [common.ApiRequestError] if the API endpoint returned an
110 * error.
111 *
112 * If the used [http.Client] completes with an error when making a REST call,
113 * this method will complete with the same error.
114 */
115 async.Future<BatchReportList> list(core.String batchReportDefinitionId, core.S tring onBehalfOfContentOwner) {
116 var _url = null;
117 var _queryParams = new core.Map();
118 var _uploadMedia = null;
119 var _uploadOptions = null;
120 var _downloadOptions = common.DownloadOptions.Metadata;
121 var _body = null;
122
123 if (batchReportDefinitionId == null) {
124 throw new core.ArgumentError("Parameter batchReportDefinitionId is require d.");
125 }
126 _queryParams["batchReportDefinitionId"] = [batchReportDefinitionId];
127 if (onBehalfOfContentOwner == null) {
128 throw new core.ArgumentError("Parameter onBehalfOfContentOwner is required .");
129 }
130 _queryParams["onBehalfOfContentOwner"] = [onBehalfOfContentOwner];
131
132
133 _url = 'batchReports';
134
135 var _response = _requester.request(_url,
136 "GET",
137 body: _body,
138 queryParams: _queryParams,
139 uploadOptions: _uploadOptions,
140 uploadMedia: _uploadMedia,
141 downloadOptions: _downloadOptions);
142 return _response.then((data) => new BatchReportList.fromJson(data));
143 }
144
145 }
146
147
148 /** Not documented yet. */
149 class ReportsResourceApi {
150 final common_internal.ApiRequester _requester;
151
152 ReportsResourceApi(common_internal.ApiRequester client) :
153 _requester = client;
154
155 /**
156 * Retrieve your YouTube Analytics reports.
157 *
158 * Request parameters:
159 *
160 * [ids] - Identifies the YouTube channel or content owner for which you are
161 * retrieving YouTube Analytics data.
162 * - To request data for a YouTube user, set the ids parameter value to
163 * channel==CHANNEL_ID, where CHANNEL_ID specifies the unique YouTube channel
164 * ID.
165 * - To request data for a YouTube CMS content owner, set the ids parameter
166 * value to contentOwner==OWNER_NAME, where OWNER_NAME is the CMS name of the
167 * content owner.
168 * Value must have pattern "[a-zA-Z]+==[a-zA-Z0-9_+-]+".
169 *
170 * [start_date] - The start date for fetching YouTube Analytics data. The
171 * value should be in YYYY-MM-DD format.
172 * Value must have pattern "[0-9]{4}-[0-9]{2}-[0-9]{2}".
173 *
174 * [end_date] - The end date for fetching YouTube Analytics data. The value
175 * should be in YYYY-MM-DD format.
176 * Value must have pattern "[0-9]{4}-[0-9]{2}-[0-9]{2}".
177 *
178 * [metrics] - A comma-separated list of YouTube Analytics metrics, such as
179 * views or likes,dislikes. See the Available Reports document for a list of
180 * the reports that you can retrieve and the metrics available in each report,
181 * and see the Metrics document for definitions of those metrics.
182 * Value must have pattern "[0-9a-zA-Z,]+".
183 *
184 * [dimensions] - A comma-separated list of YouTube Analytics dimensions, such
185 * as views or ageGroup,gender. See the Available Reports document for a list
186 * of the reports that you can retrieve and the dimensions used for those
187 * reports. Also see the Dimensions document for definitions of those
188 * dimensions.
189 * Value must have pattern "[0-9a-zA-Z,]+".
190 *
191 * [filters] - A list of filters that should be applied when retrieving
192 * YouTube Analytics data. The Available Reports document identifies the
193 * dimensions that can be used to filter each report, and the Dimensions
194 * document defines those dimensions. If a request uses multiple filters, join
195 * them together with a semicolon (;), and the returned result table will
196 * satisfy both filters. For example, a filters parameter value of
197 * video==dMH0bHeiRNg;country==IT restricts the result set to include data for
198 * the given video in Italy.
199 *
200 * [max_results] - The maximum number of rows to include in the response.
201 *
202 * [sort] - A comma-separated list of dimensions or metrics that determine the
203 * sort order for YouTube Analytics data. By default the sort order is
204 * ascending. The '-' prefix causes descending sort order.
205 * Value must have pattern "[-0-9a-zA-Z,]+".
206 *
207 * [start_index] - An index of the first entity to retrieve. Use this
208 * parameter as a pagination mechanism along with the max-results parameter
209 * (one-based, inclusive).
210 *
211 * Completes with a [ResultTable].
212 *
213 * Completes with a [common.ApiRequestError] if the API endpoint returned an
214 * error.
215 *
216 * If the used [http.Client] completes with an error when making a REST call,
217 * this method will complete with the same error.
218 */
219 async.Future<ResultTable> query(core.String ids, core.String start_date, core. String end_date, core.String metrics, {core.String dimensions, core.String filte rs, core.int max_results, core.String sort, core.int start_index}) {
220 var _url = null;
221 var _queryParams = new core.Map();
222 var _uploadMedia = null;
223 var _uploadOptions = null;
224 var _downloadOptions = common.DownloadOptions.Metadata;
225 var _body = null;
226
227 if (ids == null) {
228 throw new core.ArgumentError("Parameter ids is required.");
229 }
230 _queryParams["ids"] = [ids];
231 if (start_date == null) {
232 throw new core.ArgumentError("Parameter start_date is required.");
233 }
234 _queryParams["start-date"] = [start_date];
235 if (end_date == null) {
236 throw new core.ArgumentError("Parameter end_date is required.");
237 }
238 _queryParams["end-date"] = [end_date];
239 if (metrics == null) {
240 throw new core.ArgumentError("Parameter metrics is required.");
241 }
242 _queryParams["metrics"] = [metrics];
243 if (dimensions != null) {
244 _queryParams["dimensions"] = [dimensions];
245 }
246 if (filters != null) {
247 _queryParams["filters"] = [filters];
248 }
249 if (max_results != null) {
250 _queryParams["max-results"] = ["${max_results}"];
251 }
252 if (sort != null) {
253 _queryParams["sort"] = [sort];
254 }
255 if (start_index != null) {
256 _queryParams["start-index"] = ["${start_index}"];
257 }
258
259
260 _url = 'reports';
261
262 var _response = _requester.request(_url,
263 "GET",
264 body: _body,
265 queryParams: _queryParams,
266 uploadOptions: _uploadOptions,
267 uploadMedia: _uploadMedia,
268 downloadOptions: _downloadOptions);
269 return _response.then((data) => new ResultTable.fromJson(data));
270 }
271
272 }
273
274
275
276 /**
277 * A paginated list of batchReportDefinition resources returned in response to a
278 * youtubeAnalytics.batchReportDefinitions.list request.
279 */
280 class BatchReportDefinitionList {
281 /**
282 * A list of batchReportDefinition resources that match the request criteria.
283 */
284 core.List<BatchReportDefinitionTemplate> items;
285
286 /**
287 * This value specifies the type of data included in the API response. For the
288 * list method, the kind property value is
289 * youtubeAnalytics#batchReportDefinitionList.
290 */
291 core.String kind;
292
293
294 BatchReportDefinitionList();
295
296 BatchReportDefinitionList.fromJson(core.Map _json) {
297 if (_json.containsKey("items")) {
298 items = _json["items"].map((value) => new BatchReportDefinitionTemplate.fr omJson(value)).toList();
299 }
300 if (_json.containsKey("kind")) {
301 kind = _json["kind"];
302 }
303 }
304
305 core.Map toJson() {
306 var _json = new core.Map();
307 if (items != null) {
308 _json["items"] = items.map((value) => (value).toJson()).toList();
309 }
310 if (kind != null) {
311 _json["kind"] = kind;
312 }
313 return _json;
314 }
315 }
316
317
318 /** Not documented yet. */
319 class BatchReportDefinitionTemplateDefaultOutput {
320 /** Format of the output. */
321 core.String format;
322
323 /** Type of the output. */
324 core.String type;
325
326
327 BatchReportDefinitionTemplateDefaultOutput();
328
329 BatchReportDefinitionTemplateDefaultOutput.fromJson(core.Map _json) {
330 if (_json.containsKey("format")) {
331 format = _json["format"];
332 }
333 if (_json.containsKey("type")) {
334 type = _json["type"];
335 }
336 }
337
338 core.Map toJson() {
339 var _json = new core.Map();
340 if (format != null) {
341 _json["format"] = format;
342 }
343 if (type != null) {
344 _json["type"] = type;
345 }
346 return _json;
347 }
348 }
349
350
351 /** Contains single batchReportDefinition resource. */
352 class BatchReportDefinitionTemplate {
353 /** Default report definition's output. */
354 core.List<BatchReportDefinitionTemplateDefaultOutput> defaultOutput;
355
356 /**
357 * The ID that YouTube assigns and uses to uniquely identify the report
358 * definition.
359 */
360 core.String id;
361
362 /** Name of the report definition. */
363 core.String name;
364
365 /** Status of the report definition. */
366 core.String status;
367
368 /** Type of the report definition. */
369 core.String type;
370
371
372 BatchReportDefinitionTemplate();
373
374 BatchReportDefinitionTemplate.fromJson(core.Map _json) {
375 if (_json.containsKey("defaultOutput")) {
376 defaultOutput = _json["defaultOutput"].map((value) => new BatchReportDefin itionTemplateDefaultOutput.fromJson(value)).toList();
377 }
378 if (_json.containsKey("id")) {
379 id = _json["id"];
380 }
381 if (_json.containsKey("name")) {
382 name = _json["name"];
383 }
384 if (_json.containsKey("status")) {
385 status = _json["status"];
386 }
387 if (_json.containsKey("type")) {
388 type = _json["type"];
389 }
390 }
391
392 core.Map toJson() {
393 var _json = new core.Map();
394 if (defaultOutput != null) {
395 _json["defaultOutput"] = defaultOutput.map((value) => (value).toJson()).to List();
396 }
397 if (id != null) {
398 _json["id"] = id;
399 }
400 if (name != null) {
401 _json["name"] = name;
402 }
403 if (status != null) {
404 _json["status"] = status;
405 }
406 if (type != null) {
407 _json["type"] = type;
408 }
409 return _json;
410 }
411 }
412
413
414 /**
415 * A paginated list of batchReport resources returned in response to a
416 * youtubeAnalytics.batchReport.list request.
417 */
418 class BatchReportList {
419 /** A list of batchReport resources that match the request criteria. */
420 core.List<BatchReportTemplate> items;
421
422 /**
423 * This value specifies the type of data included in the API response. For the
424 * list method, the kind property value is youtubeAnalytics#batchReportList.
425 */
426 core.String kind;
427
428
429 BatchReportList();
430
431 BatchReportList.fromJson(core.Map _json) {
432 if (_json.containsKey("items")) {
433 items = _json["items"].map((value) => new BatchReportTemplate.fromJson(val ue)).toList();
434 }
435 if (_json.containsKey("kind")) {
436 kind = _json["kind"];
437 }
438 }
439
440 core.Map toJson() {
441 var _json = new core.Map();
442 if (items != null) {
443 _json["items"] = items.map((value) => (value).toJson()).toList();
444 }
445 if (kind != null) {
446 _json["kind"] = kind;
447 }
448 return _json;
449 }
450 }
451
452
453 /** Not documented yet. */
454 class BatchReportTemplateOutputs {
455 /**
456 * Cloud storage URL to download this report. This URL is valid for 30
457 * minutes.
458 */
459 core.String downloadUrl;
460
461 /** Format of the output. */
462 core.String format;
463
464 /** Type of the output. */
465 core.String type;
466
467
468 BatchReportTemplateOutputs();
469
470 BatchReportTemplateOutputs.fromJson(core.Map _json) {
471 if (_json.containsKey("downloadUrl")) {
472 downloadUrl = _json["downloadUrl"];
473 }
474 if (_json.containsKey("format")) {
475 format = _json["format"];
476 }
477 if (_json.containsKey("type")) {
478 type = _json["type"];
479 }
480 }
481
482 core.Map toJson() {
483 var _json = new core.Map();
484 if (downloadUrl != null) {
485 _json["downloadUrl"] = downloadUrl;
486 }
487 if (format != null) {
488 _json["format"] = format;
489 }
490 if (type != null) {
491 _json["type"] = type;
492 }
493 return _json;
494 }
495 }
496
497
498 /**
499 * Period included in the report. For reports containing all entities endTime is
500 * not set. Both startTime and endTime are inclusive.
501 */
502 class BatchReportTemplateTimeSpan {
503 /**
504 * End of the period included in the report. Inclusive. For reports containing
505 * all entities endTime is not set.
506 */
507 core.DateTime endTime;
508
509 /** Start of the period included in the report. Inclusive. */
510 core.DateTime startTime;
511
512
513 BatchReportTemplateTimeSpan();
514
515 BatchReportTemplateTimeSpan.fromJson(core.Map _json) {
516 if (_json.containsKey("endTime")) {
517 endTime = core.DateTime.parse(_json["endTime"]);
518 }
519 if (_json.containsKey("startTime")) {
520 startTime = core.DateTime.parse(_json["startTime"]);
521 }
522 }
523
524 core.Map toJson() {
525 var _json = new core.Map();
526 if (endTime != null) {
527 _json["endTime"] = (endTime).toIso8601String();
528 }
529 if (startTime != null) {
530 _json["startTime"] = (startTime).toIso8601String();
531 }
532 return _json;
533 }
534 }
535
536
537 /** Contains single batchReport resource. */
538 class BatchReportTemplate {
539 /** The ID that YouTube assigns and uses to uniquely identify the report. */
540 core.String id;
541
542 /** Report outputs. */
543 core.List<BatchReportTemplateOutputs> outputs;
544
545 /** The ID of the the report definition. */
546 core.String reportId;
547
548 /**
549 * Period included in the report. For reports containing all entities endTime
550 * is not set. Both startTime and endTime are inclusive.
551 */
552 BatchReportTemplateTimeSpan timeSpan;
553
554 /** The time when the report was updated. */
555 core.DateTime timeUpdated;
556
557
558 BatchReportTemplate();
559
560 BatchReportTemplate.fromJson(core.Map _json) {
561 if (_json.containsKey("id")) {
562 id = _json["id"];
563 }
564 if (_json.containsKey("outputs")) {
565 outputs = _json["outputs"].map((value) => new BatchReportTemplateOutputs.f romJson(value)).toList();
566 }
567 if (_json.containsKey("report_id")) {
568 reportId = _json["report_id"];
569 }
570 if (_json.containsKey("timeSpan")) {
571 timeSpan = new BatchReportTemplateTimeSpan.fromJson(_json["timeSpan"]);
572 }
573 if (_json.containsKey("timeUpdated")) {
574 timeUpdated = core.DateTime.parse(_json["timeUpdated"]);
575 }
576 }
577
578 core.Map toJson() {
579 var _json = new core.Map();
580 if (id != null) {
581 _json["id"] = id;
582 }
583 if (outputs != null) {
584 _json["outputs"] = outputs.map((value) => (value).toJson()).toList();
585 }
586 if (reportId != null) {
587 _json["report_id"] = reportId;
588 }
589 if (timeSpan != null) {
590 _json["timeSpan"] = (timeSpan).toJson();
591 }
592 if (timeUpdated != null) {
593 _json["timeUpdated"] = (timeUpdated).toIso8601String();
594 }
595 return _json;
596 }
597 }
598
599
600 /** Not documented yet. */
601 class ResultTableColumnHeaders {
602 /** The type of the column (DIMENSION or METRIC). */
603 core.String columnType;
604
605 /** The type of the data in the column (STRING, INTEGER, FLOAT, etc.). */
606 core.String dataType;
607
608 /** The name of the dimension or metric. */
609 core.String name;
610
611
612 ResultTableColumnHeaders();
613
614 ResultTableColumnHeaders.fromJson(core.Map _json) {
615 if (_json.containsKey("columnType")) {
616 columnType = _json["columnType"];
617 }
618 if (_json.containsKey("dataType")) {
619 dataType = _json["dataType"];
620 }
621 if (_json.containsKey("name")) {
622 name = _json["name"];
623 }
624 }
625
626 core.Map toJson() {
627 var _json = new core.Map();
628 if (columnType != null) {
629 _json["columnType"] = columnType;
630 }
631 if (dataType != null) {
632 _json["dataType"] = dataType;
633 }
634 if (name != null) {
635 _json["name"] = name;
636 }
637 return _json;
638 }
639 }
640
641
642 /**
643 * Contains a single result table. The table is returned as an array of rows
644 * that contain the values for the cells of the table. Depending on the metric
645 * or dimension, the cell can contain a string (video ID, country code) or a
646 * number (number of views or number of likes).
647 */
648 class ResultTable {
649 /**
650 * This value specifies information about the data returned in the rows
651 * fields. Each item in the columnHeaders list identifies a field returned in
652 * the rows value, which contains a list of comma-delimited data. The
653 * columnHeaders list will begin with the dimensions specified in the API
654 * request, which will be followed by the metrics specified in the API
655 * request. The order of both dimensions and metrics will match the ordering
656 * in the API request. For example, if the API request contains the parameters
657 * dimensions=ageGroup,gender&metrics=viewerPercentage, the API response will
658 * return columns in this order: ageGroup,gender,viewerPercentage.
659 */
660 core.List<ResultTableColumnHeaders> columnHeaders;
661
662 /**
663 * This value specifies the type of data included in the API response. For the
664 * query method, the kind property value will be youtubeAnalytics#resultTable.
665 */
666 core.String kind;
667
668 /**
669 * The list contains all rows of the result table. Each item in the list is an
670 * array that contains comma-delimited data corresponding to a single row of
671 * data. The order of the comma-delimited data fields will match the order of
672 * the columns listed in the columnHeaders field. If no data is available for
673 * the given query, the rows element will be omitted from the response. The
674 * response for a query with the day dimension will not contain rows for the
675 * most recent days.
676 *
677 * The values for Object must be JSON objects. It can consist of `num`,
678 * `String`, `bool` and `null` as well as `Map` and `List` values.
679 */
680 core.List<core.List<core.Object>> rows;
681
682
683 ResultTable();
684
685 ResultTable.fromJson(core.Map _json) {
686 if (_json.containsKey("columnHeaders")) {
687 columnHeaders = _json["columnHeaders"].map((value) => new ResultTableColum nHeaders.fromJson(value)).toList();
688 }
689 if (_json.containsKey("kind")) {
690 kind = _json["kind"];
691 }
692 if (_json.containsKey("rows")) {
693 rows = _json["rows"];
694 }
695 }
696
697 core.Map toJson() {
698 var _json = new core.Map();
699 if (columnHeaders != null) {
700 _json["columnHeaders"] = columnHeaders.map((value) => (value).toJson()).to List();
701 }
702 if (kind != null) {
703 _json["kind"] = kind;
704 }
705 if (rows != null) {
706 _json["rows"] = rows;
707 }
708 return _json;
709 }
710 }
711
712
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698