blob: c1e841d1eb27885c1b94f2523cf22edeefc288d0 [file] [log] [blame]
Gustav Wibling042e6462015-04-10 13:40:06 +02001// This is a generated file (see the discoveryapis_generator project).
2
Jakob Andersenc21146a2018-05-25 09:46:20 +02003// ignore_for_file: unnecessary_cast
4
Martin Kustermannf9c50a22014-09-10 15:26:11 +02005library googleapis.doubleclickbidmanager.v1;
6
Gustav Wibling042e6462015-04-10 13:40:06 +02007import 'dart:core' as core;
Gustav Wibling042e6462015-04-10 13:40:06 +02008import 'dart:async' as async;
9import 'dart:convert' as convert;
Martin Kustermannf9c50a22014-09-10 15:26:11 +020010
Gustav Wibling042e6462015-04-10 13:40:06 +020011import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons;
Martin Kustermannf9c50a22014-09-10 15:26:11 +020012import 'package:http/http.dart' as http;
Martin Kustermannf9c50a22014-09-10 15:26:11 +020013
Martin Kustermann5eb85c12017-09-11 12:35:54 +020014export 'package:_discoveryapis_commons/_discoveryapis_commons.dart'
15 show ApiRequestError, DetailedApiRequestError;
Gustav Wibling042e6462015-04-10 13:40:06 +020016
17const core.String USER_AGENT = 'dart-api-client doubleclickbidmanager/v1';
Martin Kustermannf9c50a22014-09-10 15:26:11 +020018
Martin Kustermann5eb85c12017-09-11 12:35:54 +020019/// API for viewing and managing your reports in DoubleClick Bid Manager.
Martin Kustermannf9c50a22014-09-10 15:26:11 +020020class DoubleclickbidmanagerApi {
Martin Kustermann5eb85c12017-09-11 12:35:54 +020021 /// View and manage your reports in DoubleClick Bid Manager
22 static const DoubleclickbidmanagerScope =
23 "https://www.googleapis.com/auth/doubleclickbidmanager";
Martin Kustermannf9c50a22014-09-10 15:26:11 +020024
Gustav Wibling042e6462015-04-10 13:40:06 +020025 final commons.ApiRequester _requester;
Martin Kustermannf9c50a22014-09-10 15:26:11 +020026
27 LineitemsResourceApi get lineitems => new LineitemsResourceApi(_requester);
28 QueriesResourceApi get queries => new QueriesResourceApi(_requester);
29 ReportsResourceApi get reports => new ReportsResourceApi(_requester);
Martin Kustermann4ff71db2016-11-09 10:46:40 +010030 SdfResourceApi get sdf => new SdfResourceApi(_requester);
Martin Kustermannf9c50a22014-09-10 15:26:11 +020031
Martin Kustermann5eb85c12017-09-11 12:35:54 +020032 DoubleclickbidmanagerApi(http.Client client,
33 {core.String rootUrl: "https://www.googleapis.com/",
34 core.String servicePath: "doubleclickbidmanager/v1/"})
35 : _requester =
36 new commons.ApiRequester(client, rootUrl, servicePath, USER_AGENT);
Martin Kustermannf9c50a22014-09-10 15:26:11 +020037}
38
Martin Kustermannf9c50a22014-09-10 15:26:11 +020039class LineitemsResourceApi {
Gustav Wibling042e6462015-04-10 13:40:06 +020040 final commons.ApiRequester _requester;
Martin Kustermannf9c50a22014-09-10 15:26:11 +020041
Martin Kustermann5eb85c12017-09-11 12:35:54 +020042 LineitemsResourceApi(commons.ApiRequester client) : _requester = client;
Martin Kustermannf9c50a22014-09-10 15:26:11 +020043
Martin Kustermanna5250762018-02-19 12:56:45 +010044 /// Retrieves line items in CSV format. TrueView line items are not supported.
Martin Kustermann5eb85c12017-09-11 12:35:54 +020045 ///
46 /// [request] - The metadata request object.
47 ///
48 /// Request parameters:
49 ///
Martin Kustermann7a3b5f52017-10-23 11:34:19 +020050 /// [$fields] - Selector specifying which fields to include in a partial
51 /// response.
52 ///
Martin Kustermann5eb85c12017-09-11 12:35:54 +020053 /// Completes with a [DownloadLineItemsResponse].
54 ///
55 /// Completes with a [commons.ApiRequestError] if the API endpoint returned an
56 /// error.
57 ///
58 /// If the used [http.Client] completes with an error when making a REST call,
59 /// this method will complete with the same error.
60 async.Future<DownloadLineItemsResponse> downloadlineitems(
Martin Kustermann7a3b5f52017-10-23 11:34:19 +020061 DownloadLineItemsRequest request,
62 {core.String $fields}) {
Martin Kustermannf9c50a22014-09-10 15:26:11 +020063 var _url = null;
Jakob Andersen4ce761d2018-04-19 11:19:11 +020064 var _queryParams = new core.Map<core.String, core.List<core.String>>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +020065 var _uploadMedia = null;
66 var _uploadOptions = null;
Gustav Wibling042e6462015-04-10 13:40:06 +020067 var _downloadOptions = commons.DownloadOptions.Metadata;
Martin Kustermannf9c50a22014-09-10 15:26:11 +020068 var _body = null;
69
70 if (request != null) {
Jakob Andersen52715df2018-05-01 13:58:48 +020071 _body = convert.json.encode((request).toJson());
Martin Kustermannf9c50a22014-09-10 15:26:11 +020072 }
Martin Kustermann7a3b5f52017-10-23 11:34:19 +020073 if ($fields != null) {
74 _queryParams["fields"] = [$fields];
75 }
Martin Kustermannf9c50a22014-09-10 15:26:11 +020076
Martin Kustermannf9c50a22014-09-10 15:26:11 +020077 _url = 'lineitems/downloadlineitems';
78
Martin Kustermann5eb85c12017-09-11 12:35:54 +020079 var _response = _requester.request(_url, "POST",
80 body: _body,
81 queryParams: _queryParams,
82 uploadOptions: _uploadOptions,
83 uploadMedia: _uploadMedia,
84 downloadOptions: _downloadOptions);
85 return _response
86 .then((data) => new DownloadLineItemsResponse.fromJson(data));
Martin Kustermannf9c50a22014-09-10 15:26:11 +020087 }
88
Martin Kustermanna5250762018-02-19 12:56:45 +010089 /// Uploads line items in CSV format. TrueView line items are not supported.
Martin Kustermann5eb85c12017-09-11 12:35:54 +020090 ///
91 /// [request] - The metadata request object.
92 ///
93 /// Request parameters:
94 ///
Martin Kustermann7a3b5f52017-10-23 11:34:19 +020095 /// [$fields] - Selector specifying which fields to include in a partial
96 /// response.
97 ///
Martin Kustermann5eb85c12017-09-11 12:35:54 +020098 /// Completes with a [UploadLineItemsResponse].
99 ///
100 /// Completes with a [commons.ApiRequestError] if the API endpoint returned an
101 /// error.
102 ///
103 /// If the used [http.Client] completes with an error when making a REST call,
104 /// this method will complete with the same error.
105 async.Future<UploadLineItemsResponse> uploadlineitems(
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200106 UploadLineItemsRequest request,
107 {core.String $fields}) {
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200108 var _url = null;
Jakob Andersen4ce761d2018-04-19 11:19:11 +0200109 var _queryParams = new core.Map<core.String, core.List<core.String>>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200110 var _uploadMedia = null;
111 var _uploadOptions = null;
Gustav Wibling042e6462015-04-10 13:40:06 +0200112 var _downloadOptions = commons.DownloadOptions.Metadata;
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200113 var _body = null;
114
115 if (request != null) {
Jakob Andersen52715df2018-05-01 13:58:48 +0200116 _body = convert.json.encode((request).toJson());
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200117 }
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200118 if ($fields != null) {
119 _queryParams["fields"] = [$fields];
120 }
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200121
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200122 _url = 'lineitems/uploadlineitems';
123
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200124 var _response = _requester.request(_url, "POST",
125 body: _body,
126 queryParams: _queryParams,
127 uploadOptions: _uploadOptions,
128 uploadMedia: _uploadMedia,
129 downloadOptions: _downloadOptions);
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200130 return _response.then((data) => new UploadLineItemsResponse.fromJson(data));
131 }
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200132}
133
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200134class QueriesResourceApi {
Gustav Wibling042e6462015-04-10 13:40:06 +0200135 final commons.ApiRequester _requester;
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200136
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200137 QueriesResourceApi(commons.ApiRequester client) : _requester = client;
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200138
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200139 /// Creates a query.
140 ///
141 /// [request] - The metadata request object.
142 ///
143 /// Request parameters:
144 ///
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200145 /// [$fields] - Selector specifying which fields to include in a partial
146 /// response.
147 ///
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200148 /// Completes with a [Query].
149 ///
150 /// Completes with a [commons.ApiRequestError] if the API endpoint returned an
151 /// error.
152 ///
153 /// If the used [http.Client] completes with an error when making a REST call,
154 /// this method will complete with the same error.
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200155 async.Future<Query> createquery(Query request, {core.String $fields}) {
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200156 var _url = null;
Jakob Andersen4ce761d2018-04-19 11:19:11 +0200157 var _queryParams = new core.Map<core.String, core.List<core.String>>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200158 var _uploadMedia = null;
159 var _uploadOptions = null;
Gustav Wibling042e6462015-04-10 13:40:06 +0200160 var _downloadOptions = commons.DownloadOptions.Metadata;
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200161 var _body = null;
162
163 if (request != null) {
Jakob Andersen52715df2018-05-01 13:58:48 +0200164 _body = convert.json.encode((request).toJson());
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200165 }
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200166 if ($fields != null) {
167 _queryParams["fields"] = [$fields];
168 }
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200169
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200170 _url = 'query';
171
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200172 var _response = _requester.request(_url, "POST",
173 body: _body,
174 queryParams: _queryParams,
175 uploadOptions: _uploadOptions,
176 uploadMedia: _uploadMedia,
177 downloadOptions: _downloadOptions);
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200178 return _response.then((data) => new Query.fromJson(data));
179 }
180
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200181 /// Deletes a stored query as well as the associated stored reports.
182 ///
183 /// Request parameters:
184 ///
185 /// [queryId] - Query ID to delete.
186 ///
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200187 /// [$fields] - Selector specifying which fields to include in a partial
188 /// response.
189 ///
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200190 /// Completes with a [commons.ApiRequestError] if the API endpoint returned an
191 /// error.
192 ///
193 /// If the used [http.Client] completes with an error when making a REST call,
194 /// this method will complete with the same error.
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200195 async.Future deletequery(core.String queryId, {core.String $fields}) {
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200196 var _url = null;
Jakob Andersen4ce761d2018-04-19 11:19:11 +0200197 var _queryParams = new core.Map<core.String, core.List<core.String>>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200198 var _uploadMedia = null;
199 var _uploadOptions = null;
Gustav Wibling042e6462015-04-10 13:40:06 +0200200 var _downloadOptions = commons.DownloadOptions.Metadata;
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200201 var _body = null;
202
203 if (queryId == null) {
204 throw new core.ArgumentError("Parameter queryId is required.");
205 }
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200206 if ($fields != null) {
207 _queryParams["fields"] = [$fields];
208 }
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200209
210 _downloadOptions = null;
211
Gustav Wibling042e6462015-04-10 13:40:06 +0200212 _url = 'query/' + commons.Escaper.ecapeVariable('$queryId');
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200213
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200214 var _response = _requester.request(_url, "DELETE",
215 body: _body,
216 queryParams: _queryParams,
217 uploadOptions: _uploadOptions,
218 uploadMedia: _uploadMedia,
219 downloadOptions: _downloadOptions);
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200220 return _response.then((data) => null);
221 }
222
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200223 /// Retrieves a stored query.
224 ///
225 /// Request parameters:
226 ///
227 /// [queryId] - Query ID to retrieve.
228 ///
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200229 /// [$fields] - Selector specifying which fields to include in a partial
230 /// response.
231 ///
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200232 /// Completes with a [Query].
233 ///
234 /// Completes with a [commons.ApiRequestError] if the API endpoint returned an
235 /// error.
236 ///
237 /// If the used [http.Client] completes with an error when making a REST call,
238 /// this method will complete with the same error.
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200239 async.Future<Query> getquery(core.String queryId, {core.String $fields}) {
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200240 var _url = null;
Jakob Andersen4ce761d2018-04-19 11:19:11 +0200241 var _queryParams = new core.Map<core.String, core.List<core.String>>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200242 var _uploadMedia = null;
243 var _uploadOptions = null;
Gustav Wibling042e6462015-04-10 13:40:06 +0200244 var _downloadOptions = commons.DownloadOptions.Metadata;
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200245 var _body = null;
246
247 if (queryId == null) {
248 throw new core.ArgumentError("Parameter queryId is required.");
249 }
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200250 if ($fields != null) {
251 _queryParams["fields"] = [$fields];
252 }
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200253
Gustav Wibling042e6462015-04-10 13:40:06 +0200254 _url = 'query/' + commons.Escaper.ecapeVariable('$queryId');
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200255
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200256 var _response = _requester.request(_url, "GET",
257 body: _body,
258 queryParams: _queryParams,
259 uploadOptions: _uploadOptions,
260 uploadMedia: _uploadMedia,
261 downloadOptions: _downloadOptions);
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200262 return _response.then((data) => new Query.fromJson(data));
263 }
264
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200265 /// Retrieves stored queries.
266 ///
267 /// Request parameters:
268 ///
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200269 /// [$fields] - Selector specifying which fields to include in a partial
270 /// response.
271 ///
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200272 /// Completes with a [ListQueriesResponse].
273 ///
274 /// Completes with a [commons.ApiRequestError] if the API endpoint returned an
275 /// error.
276 ///
277 /// If the used [http.Client] completes with an error when making a REST call,
278 /// this method will complete with the same error.
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200279 async.Future<ListQueriesResponse> listqueries({core.String $fields}) {
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200280 var _url = null;
Jakob Andersen4ce761d2018-04-19 11:19:11 +0200281 var _queryParams = new core.Map<core.String, core.List<core.String>>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200282 var _uploadMedia = null;
283 var _uploadOptions = null;
Gustav Wibling042e6462015-04-10 13:40:06 +0200284 var _downloadOptions = commons.DownloadOptions.Metadata;
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200285 var _body = null;
286
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200287 if ($fields != null) {
288 _queryParams["fields"] = [$fields];
289 }
290
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200291 _url = 'queries';
292
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200293 var _response = _requester.request(_url, "GET",
294 body: _body,
295 queryParams: _queryParams,
296 uploadOptions: _uploadOptions,
297 uploadMedia: _uploadMedia,
298 downloadOptions: _downloadOptions);
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200299 return _response.then((data) => new ListQueriesResponse.fromJson(data));
300 }
301
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200302 /// Runs a stored query to generate a report.
303 ///
304 /// [request] - The metadata request object.
305 ///
306 /// Request parameters:
307 ///
308 /// [queryId] - Query ID to run.
309 ///
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200310 /// [$fields] - Selector specifying which fields to include in a partial
311 /// response.
312 ///
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200313 /// Completes with a [commons.ApiRequestError] if the API endpoint returned an
314 /// error.
315 ///
316 /// If the used [http.Client] completes with an error when making a REST call,
317 /// this method will complete with the same error.
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200318 async.Future runquery(RunQueryRequest request, core.String queryId,
319 {core.String $fields}) {
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200320 var _url = null;
Jakob Andersen4ce761d2018-04-19 11:19:11 +0200321 var _queryParams = new core.Map<core.String, core.List<core.String>>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200322 var _uploadMedia = null;
323 var _uploadOptions = null;
Gustav Wibling042e6462015-04-10 13:40:06 +0200324 var _downloadOptions = commons.DownloadOptions.Metadata;
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200325 var _body = null;
326
327 if (request != null) {
Jakob Andersen52715df2018-05-01 13:58:48 +0200328 _body = convert.json.encode((request).toJson());
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200329 }
330 if (queryId == null) {
331 throw new core.ArgumentError("Parameter queryId is required.");
332 }
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200333 if ($fields != null) {
334 _queryParams["fields"] = [$fields];
335 }
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200336
337 _downloadOptions = null;
338
Gustav Wibling042e6462015-04-10 13:40:06 +0200339 _url = 'query/' + commons.Escaper.ecapeVariable('$queryId');
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200340
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200341 var _response = _requester.request(_url, "POST",
342 body: _body,
343 queryParams: _queryParams,
344 uploadOptions: _uploadOptions,
345 uploadMedia: _uploadMedia,
346 downloadOptions: _downloadOptions);
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200347 return _response.then((data) => null);
348 }
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200349}
350
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200351class ReportsResourceApi {
Gustav Wibling042e6462015-04-10 13:40:06 +0200352 final commons.ApiRequester _requester;
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200353
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200354 ReportsResourceApi(commons.ApiRequester client) : _requester = client;
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200355
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200356 /// Retrieves stored reports.
357 ///
358 /// Request parameters:
359 ///
360 /// [queryId] - Query ID with which the reports are associated.
361 ///
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200362 /// [$fields] - Selector specifying which fields to include in a partial
363 /// response.
364 ///
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200365 /// Completes with a [ListReportsResponse].
366 ///
367 /// Completes with a [commons.ApiRequestError] if the API endpoint returned an
368 /// error.
369 ///
370 /// If the used [http.Client] completes with an error when making a REST call,
371 /// this method will complete with the same error.
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200372 async.Future<ListReportsResponse> listreports(core.String queryId,
373 {core.String $fields}) {
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200374 var _url = null;
Jakob Andersen4ce761d2018-04-19 11:19:11 +0200375 var _queryParams = new core.Map<core.String, core.List<core.String>>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200376 var _uploadMedia = null;
377 var _uploadOptions = null;
Gustav Wibling042e6462015-04-10 13:40:06 +0200378 var _downloadOptions = commons.DownloadOptions.Metadata;
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200379 var _body = null;
380
381 if (queryId == null) {
382 throw new core.ArgumentError("Parameter queryId is required.");
383 }
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200384 if ($fields != null) {
385 _queryParams["fields"] = [$fields];
386 }
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200387
Gustav Wibling042e6462015-04-10 13:40:06 +0200388 _url = 'queries/' + commons.Escaper.ecapeVariable('$queryId') + '/reports';
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200389
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200390 var _response = _requester.request(_url, "GET",
391 body: _body,
392 queryParams: _queryParams,
393 uploadOptions: _uploadOptions,
394 uploadMedia: _uploadMedia,
395 downloadOptions: _downloadOptions);
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200396 return _response.then((data) => new ListReportsResponse.fromJson(data));
397 }
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200398}
399
Martin Kustermann4ff71db2016-11-09 10:46:40 +0100400class SdfResourceApi {
Martin Kustermann87dfaba2016-02-01 10:23:02 +0100401 final commons.ApiRequester _requester;
402
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200403 SdfResourceApi(commons.ApiRequester client) : _requester = client;
Martin Kustermann87dfaba2016-02-01 10:23:02 +0100404
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200405 /// Retrieves entities in SDF format.
406 ///
407 /// [request] - The metadata request object.
408 ///
409 /// Request parameters:
410 ///
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200411 /// [$fields] - Selector specifying which fields to include in a partial
412 /// response.
413 ///
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200414 /// Completes with a [DownloadResponse].
415 ///
416 /// Completes with a [commons.ApiRequestError] if the API endpoint returned an
417 /// error.
418 ///
419 /// If the used [http.Client] completes with an error when making a REST call,
420 /// this method will complete with the same error.
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200421 async.Future<DownloadResponse> download(DownloadRequest request,
422 {core.String $fields}) {
Martin Kustermann87dfaba2016-02-01 10:23:02 +0100423 var _url = null;
Jakob Andersen4ce761d2018-04-19 11:19:11 +0200424 var _queryParams = new core.Map<core.String, core.List<core.String>>();
Martin Kustermann87dfaba2016-02-01 10:23:02 +0100425 var _uploadMedia = null;
426 var _uploadOptions = null;
427 var _downloadOptions = commons.DownloadOptions.Metadata;
428 var _body = null;
429
430 if (request != null) {
Jakob Andersen52715df2018-05-01 13:58:48 +0200431 _body = convert.json.encode((request).toJson());
Martin Kustermann87dfaba2016-02-01 10:23:02 +0100432 }
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200433 if ($fields != null) {
434 _queryParams["fields"] = [$fields];
435 }
Martin Kustermann87dfaba2016-02-01 10:23:02 +0100436
Martin Kustermann4ff71db2016-11-09 10:46:40 +0100437 _url = 'sdf/download';
Martin Kustermann87dfaba2016-02-01 10:23:02 +0100438
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200439 var _response = _requester.request(_url, "POST",
440 body: _body,
441 queryParams: _queryParams,
442 uploadOptions: _uploadOptions,
443 uploadMedia: _uploadMedia,
444 downloadOptions: _downloadOptions);
Martin Kustermann4ff71db2016-11-09 10:46:40 +0100445 return _response.then((data) => new DownloadResponse.fromJson(data));
Martin Kustermann87dfaba2016-02-01 10:23:02 +0100446 }
Martin Kustermann87dfaba2016-02-01 10:23:02 +0100447}
448
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200449/// Request to fetch stored line items.
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200450class DownloadLineItemsRequest {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200451 /// File specification (column names, types, order) in which the line items
452 /// will be returned. Default to EWF.
453 /// Possible string values are:
454 /// - "EWF"
Gustav Wibling6d477072015-10-19 16:19:14 +0200455 core.String fileSpec;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200456
457 /// Ids of the specified filter type used to filter line items to fetch. If
458 /// omitted, all the line items will be returned.
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200459 core.List<core.String> filterIds;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200460
461 /// Filter type used to filter line items to fetch.
462 /// Possible string values are:
463 /// - "ADVERTISER_ID"
464 /// - "INSERTION_ORDER_ID"
465 /// - "LINE_ITEM_ID"
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200466 core.String filterType;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200467
468 /// Format in which the line items will be returned. Default to CSV.
469 /// Possible string values are:
470 /// - "CSV"
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200471 core.String format;
472
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200473 DownloadLineItemsRequest();
474
475 DownloadLineItemsRequest.fromJson(core.Map _json) {
Gustav Wibling6d477072015-10-19 16:19:14 +0200476 if (_json.containsKey("fileSpec")) {
477 fileSpec = _json["fileSpec"];
478 }
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200479 if (_json.containsKey("filterIds")) {
Jakob Andersen52715df2018-05-01 13:58:48 +0200480 filterIds = (_json["filterIds"] as core.List).cast<core.String>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200481 }
482 if (_json.containsKey("filterType")) {
483 filterType = _json["filterType"];
484 }
485 if (_json.containsKey("format")) {
486 format = _json["format"];
487 }
488 }
489
Martin Kustermann3953f0d2017-06-12 16:59:53 +0200490 core.Map<core.String, core.Object> toJson() {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200491 final core.Map<core.String, core.Object> _json =
492 new core.Map<core.String, core.Object>();
Gustav Wibling6d477072015-10-19 16:19:14 +0200493 if (fileSpec != null) {
494 _json["fileSpec"] = fileSpec;
495 }
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200496 if (filterIds != null) {
497 _json["filterIds"] = filterIds;
498 }
499 if (filterType != null) {
500 _json["filterType"] = filterType;
501 }
502 if (format != null) {
503 _json["format"] = format;
504 }
505 return _json;
506 }
507}
508
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200509/// Download line items response.
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200510class DownloadLineItemsResponse {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200511 /// Retrieved line items in CSV format. For more information about file
512 /// formats, see Entity Write File Format.
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200513 core.String lineItems;
514
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200515 DownloadLineItemsResponse();
516
517 DownloadLineItemsResponse.fromJson(core.Map _json) {
518 if (_json.containsKey("lineItems")) {
519 lineItems = _json["lineItems"];
520 }
521 }
522
Martin Kustermann3953f0d2017-06-12 16:59:53 +0200523 core.Map<core.String, core.Object> toJson() {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200524 final core.Map<core.String, core.Object> _json =
525 new core.Map<core.String, core.Object>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200526 if (lineItems != null) {
527 _json["lineItems"] = lineItems;
528 }
529 return _json;
530 }
531}
532
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200533/// Request to fetch stored insertion orders, line items, TrueView ad groups and
534/// ads.
Martin Kustermann4ff71db2016-11-09 10:46:40 +0100535class DownloadRequest {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200536 /// File types that will be returned.
Martin Kustermann4ff71db2016-11-09 10:46:40 +0100537 core.List<core.String> fileTypes;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200538
539 /// The IDs of the specified filter type. This is used to filter entities to
540 /// fetch. At least one ID must be specified. Only one ID is allowed for the
541 /// ADVERTISER_ID filter type. For INSERTION_ORDER_ID or LINE_ITEM_ID filter
542 /// types, all IDs must be from the same Advertiser.
Martin Kustermann4ff71db2016-11-09 10:46:40 +0100543 core.List<core.String> filterIds;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200544
545 /// Filter type used to filter line items to fetch.
546 /// Possible string values are:
547 /// - "ADVERTISER_ID"
Martin Kustermanna5250762018-02-19 12:56:45 +0100548 /// - "CAMPAIGN_ID"
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200549 /// - "INSERTION_ORDER_ID"
550 /// - "LINE_ITEM_ID"
Martin Kustermann4ff71db2016-11-09 10:46:40 +0100551 core.String filterType;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200552
553 /// SDF Version (column names, types, order) in which the entities will be
554 /// returned. Default to 3.
Martin Kustermann4ff71db2016-11-09 10:46:40 +0100555 core.String version;
556
557 DownloadRequest();
558
559 DownloadRequest.fromJson(core.Map _json) {
560 if (_json.containsKey("fileTypes")) {
Jakob Andersen52715df2018-05-01 13:58:48 +0200561 fileTypes = (_json["fileTypes"] as core.List).cast<core.String>();
Martin Kustermann4ff71db2016-11-09 10:46:40 +0100562 }
563 if (_json.containsKey("filterIds")) {
Jakob Andersen52715df2018-05-01 13:58:48 +0200564 filterIds = (_json["filterIds"] as core.List).cast<core.String>();
Martin Kustermann4ff71db2016-11-09 10:46:40 +0100565 }
566 if (_json.containsKey("filterType")) {
567 filterType = _json["filterType"];
568 }
569 if (_json.containsKey("version")) {
570 version = _json["version"];
571 }
572 }
573
Martin Kustermann3953f0d2017-06-12 16:59:53 +0200574 core.Map<core.String, core.Object> toJson() {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200575 final core.Map<core.String, core.Object> _json =
576 new core.Map<core.String, core.Object>();
Martin Kustermann4ff71db2016-11-09 10:46:40 +0100577 if (fileTypes != null) {
578 _json["fileTypes"] = fileTypes;
579 }
580 if (filterIds != null) {
581 _json["filterIds"] = filterIds;
582 }
583 if (filterType != null) {
584 _json["filterType"] = filterType;
585 }
586 if (version != null) {
587 _json["version"] = version;
588 }
589 return _json;
590 }
591}
592
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200593/// Download response.
Martin Kustermann4ff71db2016-11-09 10:46:40 +0100594class DownloadResponse {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200595 /// Retrieved ad groups in SDF format.
Martin Kustermann4ff71db2016-11-09 10:46:40 +0100596 core.String adGroups;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200597
598 /// Retrieved ads in SDF format.
Martin Kustermann4ff71db2016-11-09 10:46:40 +0100599 core.String ads;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200600
Martin Kustermanna5250762018-02-19 12:56:45 +0100601 /// Retrieved campaigns in SDF format.
602 core.String campaigns;
603
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200604 /// Retrieved insertion orders in SDF format.
Martin Kustermann4ff71db2016-11-09 10:46:40 +0100605 core.String insertionOrders;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200606
607 /// Retrieved line items in SDF format.
Martin Kustermann4ff71db2016-11-09 10:46:40 +0100608 core.String lineItems;
609
610 DownloadResponse();
611
612 DownloadResponse.fromJson(core.Map _json) {
613 if (_json.containsKey("adGroups")) {
614 adGroups = _json["adGroups"];
615 }
616 if (_json.containsKey("ads")) {
617 ads = _json["ads"];
618 }
Martin Kustermanna5250762018-02-19 12:56:45 +0100619 if (_json.containsKey("campaigns")) {
620 campaigns = _json["campaigns"];
621 }
Martin Kustermann4ff71db2016-11-09 10:46:40 +0100622 if (_json.containsKey("insertionOrders")) {
623 insertionOrders = _json["insertionOrders"];
624 }
625 if (_json.containsKey("lineItems")) {
626 lineItems = _json["lineItems"];
627 }
628 }
629
Martin Kustermann3953f0d2017-06-12 16:59:53 +0200630 core.Map<core.String, core.Object> toJson() {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200631 final core.Map<core.String, core.Object> _json =
632 new core.Map<core.String, core.Object>();
Martin Kustermann4ff71db2016-11-09 10:46:40 +0100633 if (adGroups != null) {
634 _json["adGroups"] = adGroups;
635 }
636 if (ads != null) {
637 _json["ads"] = ads;
638 }
Martin Kustermanna5250762018-02-19 12:56:45 +0100639 if (campaigns != null) {
640 _json["campaigns"] = campaigns;
641 }
Martin Kustermann4ff71db2016-11-09 10:46:40 +0100642 if (insertionOrders != null) {
643 _json["insertionOrders"] = insertionOrders;
644 }
645 if (lineItems != null) {
646 _json["lineItems"] = lineItems;
647 }
648 return _json;
649 }
650}
651
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200652/// Filter used to match traffic data in your report.
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200653class FilterPair {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200654 /// Filter type.
655 /// Possible string values are:
656 /// - "FILTER_ACTIVE_VIEW_EXPECTED_VIEWABILITY"
657 /// - "FILTER_ACTIVITY_ID"
658 /// - "FILTER_ADVERTISER"
659 /// - "FILTER_ADVERTISER_CURRENCY"
660 /// - "FILTER_ADVERTISER_TIMEZONE"
661 /// - "FILTER_AD_POSITION"
662 /// - "FILTER_AGE"
663 /// - "FILTER_BRANDSAFE_CHANNEL_ID"
664 /// - "FILTER_BROWSER"
665 /// - "FILTER_BUDGET_SEGMENT_DESCRIPTION"
666 /// - "FILTER_CAMPAIGN_DAILY_FREQUENCY"
667 /// - "FILTER_CARRIER"
668 /// - "FILTER_CHANNEL_ID"
669 /// - "FILTER_CITY"
670 /// - "FILTER_COMPANION_CREATIVE_ID"
671 /// - "FILTER_CONVERSION_DELAY"
672 /// - "FILTER_COUNTRY"
673 /// - "FILTER_CREATIVE_HEIGHT"
674 /// - "FILTER_CREATIVE_ID"
675 /// - "FILTER_CREATIVE_SIZE"
676 /// - "FILTER_CREATIVE_TYPE"
677 /// - "FILTER_CREATIVE_WIDTH"
678 /// - "FILTER_DATA_PROVIDER"
679 /// - "FILTER_DATE"
680 /// - "FILTER_DAY_OF_WEEK"
681 /// - "FILTER_DFP_ORDER_ID"
682 /// - "FILTER_DMA"
683 /// - "FILTER_EXCHANGE_ID"
684 /// - "FILTER_FLOODLIGHT_PIXEL_ID"
685 /// - "FILTER_GENDER"
686 /// - "FILTER_INSERTION_ORDER"
687 /// - "FILTER_INVENTORY_FORMAT"
688 /// - "FILTER_INVENTORY_SOURCE"
689 /// - "FILTER_INVENTORY_SOURCE_TYPE"
690 /// - "FILTER_KEYWORD"
691 /// - "FILTER_LINE_ITEM"
692 /// - "FILTER_LINE_ITEM_DAILY_FREQUENCY"
693 /// - "FILTER_LINE_ITEM_LIFETIME_FREQUENCY"
694 /// - "FILTER_LINE_ITEM_TYPE"
695 /// - "FILTER_MEDIA_PLAN"
696 /// - "FILTER_MOBILE_DEVICE_MAKE"
697 /// - "FILTER_MOBILE_DEVICE_MAKE_MODEL"
698 /// - "FILTER_MOBILE_DEVICE_TYPE"
699 /// - "FILTER_MOBILE_GEO"
700 /// - "FILTER_MONTH"
701 /// - "FILTER_MRAID_SUPPORT"
702 /// - "FILTER_NIELSEN_AGE"
703 /// - "FILTER_NIELSEN_COUNTRY_CODE"
704 /// - "FILTER_NIELSEN_DEVICE_ID"
705 /// - "FILTER_NIELSEN_GENDER"
706 /// - "FILTER_NOT_SUPPORTED"
707 /// - "FILTER_ORDER_ID"
708 /// - "FILTER_OS"
709 /// - "FILTER_PAGE_CATEGORY"
710 /// - "FILTER_PAGE_LAYOUT"
711 /// - "FILTER_PARTNER"
712 /// - "FILTER_PARTNER_CURRENCY"
713 /// - "FILTER_PUBLIC_INVENTORY"
714 /// - "FILTER_QUARTER"
715 /// - "FILTER_REGION"
716 /// - "FILTER_REGULAR_CHANNEL_ID"
717 /// - "FILTER_SITE_ID"
718 /// - "FILTER_SITE_LANGUAGE"
719 /// - "FILTER_SKIPPABLE_SUPPORT"
720 /// - "FILTER_TARGETED_USER_LIST"
721 /// - "FILTER_TIME_OF_DAY"
722 /// - "FILTER_TRUEVIEW_AD_GROUP_AD_ID"
723 /// - "FILTER_TRUEVIEW_AD_GROUP_ID"
724 /// - "FILTER_TRUEVIEW_AGE"
725 /// - "FILTER_TRUEVIEW_CATEGORY"
726 /// - "FILTER_TRUEVIEW_CITY"
727 /// - "FILTER_TRUEVIEW_CONVERSION_TYPE"
728 /// - "FILTER_TRUEVIEW_COUNTRY"
729 /// - "FILTER_TRUEVIEW_CUSTOM_AFFINITY"
730 /// - "FILTER_TRUEVIEW_DMA"
731 /// - "FILTER_TRUEVIEW_GENDER"
732 /// - "FILTER_TRUEVIEW_IAR_AGE"
733 /// - "FILTER_TRUEVIEW_IAR_CATEGORY"
734 /// - "FILTER_TRUEVIEW_IAR_CITY"
735 /// - "FILTER_TRUEVIEW_IAR_COUNTRY"
736 /// - "FILTER_TRUEVIEW_IAR_GENDER"
737 /// - "FILTER_TRUEVIEW_IAR_INTEREST"
738 /// - "FILTER_TRUEVIEW_IAR_LANGUAGE"
739 /// - "FILTER_TRUEVIEW_IAR_PARENTAL_STATUS"
740 /// - "FILTER_TRUEVIEW_IAR_REGION"
741 /// - "FILTER_TRUEVIEW_IAR_REMARKETING_LIST"
742 /// - "FILTER_TRUEVIEW_IAR_TIME_OF_DAY"
743 /// - "FILTER_TRUEVIEW_IAR_YOUTUBE_CHANNEL"
744 /// - "FILTER_TRUEVIEW_IAR_YOUTUBE_VIDEO"
745 /// - "FILTER_TRUEVIEW_IAR_ZIPCODE"
746 /// - "FILTER_TRUEVIEW_INTEREST"
747 /// - "FILTER_TRUEVIEW_KEYWORD"
748 /// - "FILTER_TRUEVIEW_PARENTAL_STATUS"
749 /// - "FILTER_TRUEVIEW_PLACEMENT"
750 /// - "FILTER_TRUEVIEW_REGION"
751 /// - "FILTER_TRUEVIEW_REMARKETING_LIST"
752 /// - "FILTER_TRUEVIEW_URL"
753 /// - "FILTER_TRUEVIEW_ZIPCODE"
754 /// - "FILTER_UNKNOWN"
755 /// - "FILTER_USER_LIST"
756 /// - "FILTER_USER_LIST_FIRST_PARTY"
757 /// - "FILTER_USER_LIST_THIRD_PARTY"
758 /// - "FILTER_VIDEO_AD_POSITION_IN_STREAM"
759 /// - "FILTER_VIDEO_COMPANION_SIZE"
760 /// - "FILTER_VIDEO_COMPANION_TYPE"
761 /// - "FILTER_VIDEO_CREATIVE_DURATION"
762 /// - "FILTER_VIDEO_CREATIVE_DURATION_SKIPPABLE"
763 /// - "FILTER_VIDEO_DURATION_SECONDS"
764 /// - "FILTER_VIDEO_FORMAT_SUPPORT"
765 /// - "FILTER_VIDEO_INVENTORY_TYPE"
766 /// - "FILTER_VIDEO_PLAYER_SIZE"
767 /// - "FILTER_VIDEO_RATING_TIER"
768 /// - "FILTER_VIDEO_SKIPPABLE_SUPPORT"
769 /// - "FILTER_VIDEO_VPAID_SUPPORT"
770 /// - "FILTER_WEEK"
771 /// - "FILTER_YEAR"
772 /// - "FILTER_YOUTUBE_VERTICAL"
773 /// - "FILTER_ZIP_CODE"
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200774 core.String type;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200775
776 /// Filter value.
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200777 core.String value;
778
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200779 FilterPair();
780
781 FilterPair.fromJson(core.Map _json) {
782 if (_json.containsKey("type")) {
783 type = _json["type"];
784 }
785 if (_json.containsKey("value")) {
786 value = _json["value"];
787 }
788 }
789
Martin Kustermann3953f0d2017-06-12 16:59:53 +0200790 core.Map<core.String, core.Object> toJson() {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200791 final core.Map<core.String, core.Object> _json =
792 new core.Map<core.String, core.Object>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200793 if (type != null) {
794 _json["type"] = type;
795 }
796 if (value != null) {
797 _json["value"] = value;
798 }
799 return _json;
800 }
801}
802
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200803/// List queries response.
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200804class ListQueriesResponse {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200805 /// Identifies what kind of resource this is. Value: the fixed string
806 /// "doubleclickbidmanager#listQueriesResponse".
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200807 core.String kind;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200808
809 /// Retrieved queries.
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200810 core.List<Query> queries;
811
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200812 ListQueriesResponse();
813
814 ListQueriesResponse.fromJson(core.Map _json) {
815 if (_json.containsKey("kind")) {
816 kind = _json["kind"];
817 }
818 if (_json.containsKey("queries")) {
Jakob Andersen52715df2018-05-01 13:58:48 +0200819 queries = (_json["queries"] as core.List)
Jakob Andersen4ce761d2018-04-19 11:19:11 +0200820 .map<Query>((value) => new Query.fromJson(value))
821 .toList();
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200822 }
823 }
824
Martin Kustermann3953f0d2017-06-12 16:59:53 +0200825 core.Map<core.String, core.Object> toJson() {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200826 final core.Map<core.String, core.Object> _json =
827 new core.Map<core.String, core.Object>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200828 if (kind != null) {
829 _json["kind"] = kind;
830 }
831 if (queries != null) {
832 _json["queries"] = queries.map((value) => (value).toJson()).toList();
833 }
834 return _json;
835 }
836}
837
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200838/// List reports response.
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200839class ListReportsResponse {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200840 /// Identifies what kind of resource this is. Value: the fixed string
841 /// "doubleclickbidmanager#listReportsResponse".
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200842 core.String kind;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200843
844 /// Retrieved reports.
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200845 core.List<Report> reports;
846
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200847 ListReportsResponse();
848
849 ListReportsResponse.fromJson(core.Map _json) {
850 if (_json.containsKey("kind")) {
851 kind = _json["kind"];
852 }
853 if (_json.containsKey("reports")) {
Jakob Andersen52715df2018-05-01 13:58:48 +0200854 reports = (_json["reports"] as core.List)
Jakob Andersen4ce761d2018-04-19 11:19:11 +0200855 .map<Report>((value) => new Report.fromJson(value))
856 .toList();
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200857 }
858 }
859
Martin Kustermann3953f0d2017-06-12 16:59:53 +0200860 core.Map<core.String, core.Object> toJson() {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200861 final core.Map<core.String, core.Object> _json =
862 new core.Map<core.String, core.Object>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200863 if (kind != null) {
864 _json["kind"] = kind;
865 }
866 if (reports != null) {
867 _json["reports"] = reports.map((value) => (value).toJson()).toList();
868 }
869 return _json;
870 }
871}
872
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200873/// Parameters of a query or report.
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200874class Parameters {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200875 /// Filters used to match traffic data in your report.
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200876 core.List<FilterPair> filters;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200877
878 /// Data is grouped by the filters listed in this field.
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200879 core.List<core.String> groupBys;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200880
881 /// Whether to include data from Invite Media.
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200882 core.bool includeInviteData;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200883
884 /// Metrics to include as columns in your report.
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200885 core.List<core.String> metrics;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200886
887 /// Report type.
888 /// Possible string values are:
889 /// - "TYPE_ACTIVE_GRP"
890 /// - "TYPE_AUDIENCE_COMPOSITION"
891 /// - "TYPE_AUDIENCE_PERFORMANCE"
892 /// - "TYPE_CLIENT_SAFE"
893 /// - "TYPE_COMSCORE_VCE"
894 /// - "TYPE_CROSS_FEE"
895 /// - "TYPE_CROSS_PARTNER"
896 /// - "TYPE_CROSS_PARTNER_THIRD_PARTY_DATA_PROVIDER"
897 /// - "TYPE_ESTIMATED_CONVERSION"
898 /// - "TYPE_FEE"
899 /// - "TYPE_GENERAL"
900 /// - "TYPE_INVENTORY_AVAILABILITY"
901 /// - "TYPE_KEYWORD"
Martin Kustermanna5250762018-02-19 12:56:45 +0100902 /// - "TYPE_LINEAR_TV_SEARCH_LIFT"
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200903 /// - "TYPE_NIELSEN_AUDIENCE_PROFILE"
904 /// - "TYPE_NIELSEN_DAILY_REACH_BUILD"
905 /// - "TYPE_NIELSEN_ONLINE_GLOBAL_MARKET"
906 /// - "TYPE_NIELSEN_SITE"
907 /// - "TYPE_NOT_SUPPORTED"
908 /// - "TYPE_ORDER_ID"
909 /// - "TYPE_PAGE_CATEGORY"
910 /// - "TYPE_PETRA_NIELSEN_AUDIENCE_PROFILE"
911 /// - "TYPE_PETRA_NIELSEN_DAILY_REACH_BUILD"
912 /// - "TYPE_PETRA_NIELSEN_ONLINE_GLOBAL_MARKET"
913 /// - "TYPE_PIXEL_LOAD"
914 /// - "TYPE_REACH_AND_FREQUENCY"
915 /// - "TYPE_REACH_AUDIENCE"
916 /// - "TYPE_THIRD_PARTY_DATA_PROVIDER"
917 /// - "TYPE_TRUEVIEW"
918 /// - "TYPE_TRUEVIEW_IAR"
919 /// - "TYPE_VERIFICATION"
920 /// - "TYPE_YOUTUBE_VERTICAL"
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200921 core.String type;
922
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200923 Parameters();
924
925 Parameters.fromJson(core.Map _json) {
926 if (_json.containsKey("filters")) {
Jakob Andersen52715df2018-05-01 13:58:48 +0200927 filters = (_json["filters"] as core.List)
Jakob Andersen4ce761d2018-04-19 11:19:11 +0200928 .map<FilterPair>((value) => new FilterPair.fromJson(value))
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200929 .toList();
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200930 }
931 if (_json.containsKey("groupBys")) {
Jakob Andersen52715df2018-05-01 13:58:48 +0200932 groupBys = (_json["groupBys"] as core.List).cast<core.String>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200933 }
934 if (_json.containsKey("includeInviteData")) {
935 includeInviteData = _json["includeInviteData"];
936 }
937 if (_json.containsKey("metrics")) {
Jakob Andersen52715df2018-05-01 13:58:48 +0200938 metrics = (_json["metrics"] as core.List).cast<core.String>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200939 }
940 if (_json.containsKey("type")) {
941 type = _json["type"];
942 }
943 }
944
Martin Kustermann3953f0d2017-06-12 16:59:53 +0200945 core.Map<core.String, core.Object> toJson() {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200946 final core.Map<core.String, core.Object> _json =
947 new core.Map<core.String, core.Object>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200948 if (filters != null) {
949 _json["filters"] = filters.map((value) => (value).toJson()).toList();
950 }
951 if (groupBys != null) {
952 _json["groupBys"] = groupBys;
953 }
954 if (includeInviteData != null) {
955 _json["includeInviteData"] = includeInviteData;
956 }
957 if (metrics != null) {
958 _json["metrics"] = metrics;
959 }
960 if (type != null) {
961 _json["type"] = type;
962 }
963 return _json;
964 }
965}
966
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200967/// Represents a query.
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200968class Query {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200969 /// Identifies what kind of resource this is. Value: the fixed string
970 /// "doubleclickbidmanager#query".
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200971 core.String kind;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200972
973 /// Query metadata.
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200974 QueryMetadata metadata;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200975
976 /// Query parameters.
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200977 Parameters params;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200978
979 /// Query ID.
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200980 core.String queryId;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200981
982 /// The ending time for the data that is shown in the report. Note,
983 /// reportDataEndTimeMs is required if metadata.dataRange is CUSTOM_DATES and
984 /// ignored otherwise.
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200985 core.String reportDataEndTimeMs;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200986
987 /// The starting time for the data that is shown in the report. Note,
988 /// reportDataStartTimeMs is required if metadata.dataRange is CUSTOM_DATES
989 /// and ignored otherwise.
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200990 core.String reportDataStartTimeMs;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200991
992 /// Information on how often and when to run a query.
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200993 QuerySchedule schedule;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200994
995 /// Canonical timezone code for report data time. Defaults to
996 /// America/New_York.
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200997 core.String timezoneCode;
998
Martin Kustermannf9c50a22014-09-10 15:26:11 +0200999 Query();
1000
1001 Query.fromJson(core.Map _json) {
1002 if (_json.containsKey("kind")) {
1003 kind = _json["kind"];
1004 }
1005 if (_json.containsKey("metadata")) {
1006 metadata = new QueryMetadata.fromJson(_json["metadata"]);
1007 }
1008 if (_json.containsKey("params")) {
1009 params = new Parameters.fromJson(_json["params"]);
1010 }
1011 if (_json.containsKey("queryId")) {
1012 queryId = _json["queryId"];
1013 }
1014 if (_json.containsKey("reportDataEndTimeMs")) {
1015 reportDataEndTimeMs = _json["reportDataEndTimeMs"];
1016 }
1017 if (_json.containsKey("reportDataStartTimeMs")) {
1018 reportDataStartTimeMs = _json["reportDataStartTimeMs"];
1019 }
1020 if (_json.containsKey("schedule")) {
1021 schedule = new QuerySchedule.fromJson(_json["schedule"]);
1022 }
1023 if (_json.containsKey("timezoneCode")) {
1024 timezoneCode = _json["timezoneCode"];
1025 }
1026 }
1027
Martin Kustermann3953f0d2017-06-12 16:59:53 +02001028 core.Map<core.String, core.Object> toJson() {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001029 final core.Map<core.String, core.Object> _json =
1030 new core.Map<core.String, core.Object>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001031 if (kind != null) {
1032 _json["kind"] = kind;
1033 }
1034 if (metadata != null) {
1035 _json["metadata"] = (metadata).toJson();
1036 }
1037 if (params != null) {
1038 _json["params"] = (params).toJson();
1039 }
1040 if (queryId != null) {
1041 _json["queryId"] = queryId;
1042 }
1043 if (reportDataEndTimeMs != null) {
1044 _json["reportDataEndTimeMs"] = reportDataEndTimeMs;
1045 }
1046 if (reportDataStartTimeMs != null) {
1047 _json["reportDataStartTimeMs"] = reportDataStartTimeMs;
1048 }
1049 if (schedule != null) {
1050 _json["schedule"] = (schedule).toJson();
1051 }
1052 if (timezoneCode != null) {
1053 _json["timezoneCode"] = timezoneCode;
1054 }
1055 return _json;
1056 }
1057}
1058
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001059/// Query metadata.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001060class QueryMetadata {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001061 /// Range of report data.
1062 /// Possible string values are:
1063 /// - "ALL_TIME"
1064 /// - "CURRENT_DAY"
1065 /// - "CUSTOM_DATES"
1066 /// - "LAST_14_DAYS"
1067 /// - "LAST_30_DAYS"
1068 /// - "LAST_365_DAYS"
1069 /// - "LAST_7_DAYS"
1070 /// - "LAST_90_DAYS"
1071 /// - "MONTH_TO_DATE"
1072 /// - "PREVIOUS_DAY"
1073 /// - "PREVIOUS_HALF_MONTH"
1074 /// - "PREVIOUS_MONTH"
1075 /// - "PREVIOUS_QUARTER"
1076 /// - "PREVIOUS_WEEK"
1077 /// - "PREVIOUS_YEAR"
1078 /// - "QUARTER_TO_DATE"
1079 /// - "TYPE_NOT_SUPPORTED"
1080 /// - "WEEK_TO_DATE"
1081 /// - "YEAR_TO_DATE"
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001082 core.String dataRange;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001083
1084 /// Format of the generated report.
1085 /// Possible string values are:
1086 /// - "CSV"
1087 /// - "EXCEL_CSV"
1088 /// - "XLSX"
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001089 core.String format;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001090
1091 /// The path to the location in Google Cloud Storage where the latest report
1092 /// is stored.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001093 core.String googleCloudStoragePathForLatestReport;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001094
1095 /// The path in Google Drive for the latest report.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001096 core.String googleDrivePathForLatestReport;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001097
1098 /// The time when the latest report started to run.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001099 core.String latestReportRunTimeMs;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001100
1101 /// Locale of the generated reports. Valid values are cs CZECH de GERMAN en
1102 /// ENGLISH es SPANISH fr FRENCH it ITALIAN ja JAPANESE ko KOREAN pl POLISH
1103 /// pt-BR BRAZILIAN_PORTUGUESE ru RUSSIAN tr TURKISH uk UKRAINIAN zh-CN
1104 /// CHINA_CHINESE zh-TW TAIWAN_CHINESE
1105 ///
1106 /// An locale string not in the list above will generate reports in English.
Gustav Wibling73da5882015-02-04 16:41:07 +01001107 core.String locale;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001108
1109 /// Number of reports that have been generated for the query.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001110 core.int reportCount;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001111
1112 /// Whether the latest report is currently running.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001113 core.bool running;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001114
1115 /// Whether to send an email notification when a report is ready. Default to
1116 /// false.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001117 core.bool sendNotification;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001118
1119 /// List of email addresses which are sent email notifications when the report
1120 /// is finished. Separate from sendNotification.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001121 core.List<core.String> shareEmailAddress;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001122
1123 /// Query title. It is used to name the reports generated from this query.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001124 core.String title;
1125
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001126 QueryMetadata();
1127
1128 QueryMetadata.fromJson(core.Map _json) {
1129 if (_json.containsKey("dataRange")) {
1130 dataRange = _json["dataRange"];
1131 }
1132 if (_json.containsKey("format")) {
1133 format = _json["format"];
1134 }
1135 if (_json.containsKey("googleCloudStoragePathForLatestReport")) {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001136 googleCloudStoragePathForLatestReport =
1137 _json["googleCloudStoragePathForLatestReport"];
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001138 }
1139 if (_json.containsKey("googleDrivePathForLatestReport")) {
1140 googleDrivePathForLatestReport = _json["googleDrivePathForLatestReport"];
1141 }
1142 if (_json.containsKey("latestReportRunTimeMs")) {
1143 latestReportRunTimeMs = _json["latestReportRunTimeMs"];
1144 }
Gustav Wibling73da5882015-02-04 16:41:07 +01001145 if (_json.containsKey("locale")) {
1146 locale = _json["locale"];
1147 }
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001148 if (_json.containsKey("reportCount")) {
1149 reportCount = _json["reportCount"];
1150 }
1151 if (_json.containsKey("running")) {
1152 running = _json["running"];
1153 }
1154 if (_json.containsKey("sendNotification")) {
1155 sendNotification = _json["sendNotification"];
1156 }
1157 if (_json.containsKey("shareEmailAddress")) {
Jakob Andersen52715df2018-05-01 13:58:48 +02001158 shareEmailAddress =
1159 (_json["shareEmailAddress"] as core.List).cast<core.String>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001160 }
1161 if (_json.containsKey("title")) {
1162 title = _json["title"];
1163 }
1164 }
1165
Martin Kustermann3953f0d2017-06-12 16:59:53 +02001166 core.Map<core.String, core.Object> toJson() {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001167 final core.Map<core.String, core.Object> _json =
1168 new core.Map<core.String, core.Object>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001169 if (dataRange != null) {
1170 _json["dataRange"] = dataRange;
1171 }
1172 if (format != null) {
1173 _json["format"] = format;
1174 }
1175 if (googleCloudStoragePathForLatestReport != null) {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001176 _json["googleCloudStoragePathForLatestReport"] =
1177 googleCloudStoragePathForLatestReport;
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001178 }
1179 if (googleDrivePathForLatestReport != null) {
1180 _json["googleDrivePathForLatestReport"] = googleDrivePathForLatestReport;
1181 }
1182 if (latestReportRunTimeMs != null) {
1183 _json["latestReportRunTimeMs"] = latestReportRunTimeMs;
1184 }
Gustav Wibling73da5882015-02-04 16:41:07 +01001185 if (locale != null) {
1186 _json["locale"] = locale;
1187 }
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001188 if (reportCount != null) {
1189 _json["reportCount"] = reportCount;
1190 }
1191 if (running != null) {
1192 _json["running"] = running;
1193 }
1194 if (sendNotification != null) {
1195 _json["sendNotification"] = sendNotification;
1196 }
1197 if (shareEmailAddress != null) {
1198 _json["shareEmailAddress"] = shareEmailAddress;
1199 }
1200 if (title != null) {
1201 _json["title"] = title;
1202 }
1203 return _json;
1204 }
1205}
1206
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001207/// Information on how frequently and when to run a query.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001208class QuerySchedule {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001209 /// Datetime to periodically run the query until.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001210 core.String endTimeMs;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001211
1212 /// How often the query is run.
1213 /// Possible string values are:
1214 /// - "DAILY"
1215 /// - "MONTHLY"
1216 /// - "ONE_TIME"
1217 /// - "QUARTERLY"
1218 /// - "SEMI_MONTHLY"
1219 /// - "WEEKLY"
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001220 core.String frequency;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001221
1222 /// Time of day at which a new report will be generated, represented as
1223 /// minutes past midnight. Range is 0 to 1439. Only applies to scheduled
1224 /// reports.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001225 core.int nextRunMinuteOfDay;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001226
1227 /// Canonical timezone code for report generation time. Defaults to
1228 /// America/New_York.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001229 core.String nextRunTimezoneCode;
1230
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001231 QuerySchedule();
1232
1233 QuerySchedule.fromJson(core.Map _json) {
1234 if (_json.containsKey("endTimeMs")) {
1235 endTimeMs = _json["endTimeMs"];
1236 }
1237 if (_json.containsKey("frequency")) {
1238 frequency = _json["frequency"];
1239 }
1240 if (_json.containsKey("nextRunMinuteOfDay")) {
1241 nextRunMinuteOfDay = _json["nextRunMinuteOfDay"];
1242 }
1243 if (_json.containsKey("nextRunTimezoneCode")) {
1244 nextRunTimezoneCode = _json["nextRunTimezoneCode"];
1245 }
1246 }
1247
Martin Kustermann3953f0d2017-06-12 16:59:53 +02001248 core.Map<core.String, core.Object> toJson() {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001249 final core.Map<core.String, core.Object> _json =
1250 new core.Map<core.String, core.Object>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001251 if (endTimeMs != null) {
1252 _json["endTimeMs"] = endTimeMs;
1253 }
1254 if (frequency != null) {
1255 _json["frequency"] = frequency;
1256 }
1257 if (nextRunMinuteOfDay != null) {
1258 _json["nextRunMinuteOfDay"] = nextRunMinuteOfDay;
1259 }
1260 if (nextRunTimezoneCode != null) {
1261 _json["nextRunTimezoneCode"] = nextRunTimezoneCode;
1262 }
1263 return _json;
1264 }
1265}
1266
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001267/// Represents a report.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001268class Report {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001269 /// Key used to identify a report.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001270 ReportKey key;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001271
1272 /// Report metadata.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001273 ReportMetadata metadata;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001274
1275 /// Report parameters.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001276 Parameters params;
1277
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001278 Report();
1279
1280 Report.fromJson(core.Map _json) {
1281 if (_json.containsKey("key")) {
1282 key = new ReportKey.fromJson(_json["key"]);
1283 }
1284 if (_json.containsKey("metadata")) {
1285 metadata = new ReportMetadata.fromJson(_json["metadata"]);
1286 }
1287 if (_json.containsKey("params")) {
1288 params = new Parameters.fromJson(_json["params"]);
1289 }
1290 }
1291
Martin Kustermann3953f0d2017-06-12 16:59:53 +02001292 core.Map<core.String, core.Object> toJson() {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001293 final core.Map<core.String, core.Object> _json =
1294 new core.Map<core.String, core.Object>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001295 if (key != null) {
1296 _json["key"] = (key).toJson();
1297 }
1298 if (metadata != null) {
1299 _json["metadata"] = (metadata).toJson();
1300 }
1301 if (params != null) {
1302 _json["params"] = (params).toJson();
1303 }
1304 return _json;
1305 }
1306}
1307
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001308/// An explanation of a report failure.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001309class ReportFailure {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001310 /// Error code that shows why the report was not created.
1311 /// Possible string values are:
1312 /// - "AUTHENTICATION_ERROR"
1313 /// - "DEPRECATED_REPORTING_INVALID_QUERY"
1314 /// - "REPORTING_BUCKET_NOT_FOUND"
1315 /// - "REPORTING_CREATE_BUCKET_FAILED"
1316 /// - "REPORTING_DELETE_BUCKET_FAILED"
1317 /// - "REPORTING_FATAL_ERROR"
1318 /// - "REPORTING_ILLEGAL_FILENAME"
1319 /// - "REPORTING_IMCOMPATIBLE_METRICS"
1320 /// - "REPORTING_INVALID_QUERY_MISSING_PARTNER_AND_ADVERTISER_FILTERS"
1321 /// - "REPORTING_INVALID_QUERY_TITLE_MISSING"
1322 /// - "REPORTING_INVALID_QUERY_TOO_MANY_UNFILTERED_LARGE_GROUP_BYS"
1323 /// - "REPORTING_QUERY_NOT_FOUND"
1324 /// - "REPORTING_TRANSIENT_ERROR"
1325 /// - "REPORTING_UPDATE_BUCKET_PERMISSION_FAILED"
1326 /// - "REPORTING_WRITE_BUCKET_OBJECT_FAILED"
1327 /// - "SERVER_ERROR"
1328 /// - "UNAUTHORIZED_API_ACCESS"
1329 /// - "VALIDATION_ERROR"
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001330 core.String errorCode;
1331
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001332 ReportFailure();
1333
1334 ReportFailure.fromJson(core.Map _json) {
1335 if (_json.containsKey("errorCode")) {
1336 errorCode = _json["errorCode"];
1337 }
1338 }
1339
Martin Kustermann3953f0d2017-06-12 16:59:53 +02001340 core.Map<core.String, core.Object> toJson() {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001341 final core.Map<core.String, core.Object> _json =
1342 new core.Map<core.String, core.Object>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001343 if (errorCode != null) {
1344 _json["errorCode"] = errorCode;
1345 }
1346 return _json;
1347 }
1348}
1349
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001350/// Key used to identify a report.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001351class ReportKey {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001352 /// Query ID.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001353 core.String queryId;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001354
1355 /// Report ID.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001356 core.String reportId;
1357
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001358 ReportKey();
1359
1360 ReportKey.fromJson(core.Map _json) {
1361 if (_json.containsKey("queryId")) {
1362 queryId = _json["queryId"];
1363 }
1364 if (_json.containsKey("reportId")) {
1365 reportId = _json["reportId"];
1366 }
1367 }
1368
Martin Kustermann3953f0d2017-06-12 16:59:53 +02001369 core.Map<core.String, core.Object> toJson() {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001370 final core.Map<core.String, core.Object> _json =
1371 new core.Map<core.String, core.Object>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001372 if (queryId != null) {
1373 _json["queryId"] = queryId;
1374 }
1375 if (reportId != null) {
1376 _json["reportId"] = reportId;
1377 }
1378 return _json;
1379 }
1380}
1381
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001382/// Report metadata.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001383class ReportMetadata {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001384 /// The path to the location in Google Cloud Storage where the report is
1385 /// stored.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001386 core.String googleCloudStoragePath;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001387
1388 /// The ending time for the data that is shown in the report.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001389 core.String reportDataEndTimeMs;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001390
1391 /// The starting time for the data that is shown in the report.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001392 core.String reportDataStartTimeMs;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001393
1394 /// Report status.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001395 ReportStatus status;
1396
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001397 ReportMetadata();
1398
1399 ReportMetadata.fromJson(core.Map _json) {
1400 if (_json.containsKey("googleCloudStoragePath")) {
1401 googleCloudStoragePath = _json["googleCloudStoragePath"];
1402 }
1403 if (_json.containsKey("reportDataEndTimeMs")) {
1404 reportDataEndTimeMs = _json["reportDataEndTimeMs"];
1405 }
1406 if (_json.containsKey("reportDataStartTimeMs")) {
1407 reportDataStartTimeMs = _json["reportDataStartTimeMs"];
1408 }
1409 if (_json.containsKey("status")) {
1410 status = new ReportStatus.fromJson(_json["status"]);
1411 }
1412 }
1413
Martin Kustermann3953f0d2017-06-12 16:59:53 +02001414 core.Map<core.String, core.Object> toJson() {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001415 final core.Map<core.String, core.Object> _json =
1416 new core.Map<core.String, core.Object>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001417 if (googleCloudStoragePath != null) {
1418 _json["googleCloudStoragePath"] = googleCloudStoragePath;
1419 }
1420 if (reportDataEndTimeMs != null) {
1421 _json["reportDataEndTimeMs"] = reportDataEndTimeMs;
1422 }
1423 if (reportDataStartTimeMs != null) {
1424 _json["reportDataStartTimeMs"] = reportDataStartTimeMs;
1425 }
1426 if (status != null) {
1427 _json["status"] = (status).toJson();
1428 }
1429 return _json;
1430 }
1431}
1432
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001433/// Report status.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001434class ReportStatus {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001435 /// If the report failed, this records the cause.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001436 ReportFailure failure;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001437
1438 /// The time when this report either completed successfully or failed.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001439 core.String finishTimeMs;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001440
1441 /// The file type of the report.
1442 /// Possible string values are:
1443 /// - "CSV"
1444 /// - "EXCEL_CSV"
1445 /// - "XLSX"
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001446 core.String format;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001447
1448 /// The state of the report.
1449 /// Possible string values are:
1450 /// - "DONE"
1451 /// - "FAILED"
1452 /// - "RUNNING"
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001453 core.String state;
1454
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001455 ReportStatus();
1456
1457 ReportStatus.fromJson(core.Map _json) {
1458 if (_json.containsKey("failure")) {
1459 failure = new ReportFailure.fromJson(_json["failure"]);
1460 }
1461 if (_json.containsKey("finishTimeMs")) {
1462 finishTimeMs = _json["finishTimeMs"];
1463 }
1464 if (_json.containsKey("format")) {
1465 format = _json["format"];
1466 }
1467 if (_json.containsKey("state")) {
1468 state = _json["state"];
1469 }
1470 }
1471
Martin Kustermann3953f0d2017-06-12 16:59:53 +02001472 core.Map<core.String, core.Object> toJson() {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001473 final core.Map<core.String, core.Object> _json =
1474 new core.Map<core.String, core.Object>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001475 if (failure != null) {
1476 _json["failure"] = (failure).toJson();
1477 }
1478 if (finishTimeMs != null) {
1479 _json["finishTimeMs"] = finishTimeMs;
1480 }
1481 if (format != null) {
1482 _json["format"] = format;
1483 }
1484 if (state != null) {
1485 _json["state"] = state;
1486 }
1487 return _json;
1488 }
1489}
1490
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001491/// Represents the upload status of a row in the request.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001492class RowStatus {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001493 /// Whether the stored entity is changed as a result of upload.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001494 core.bool changed;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001495
1496 /// Entity Id.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001497 core.String entityId;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001498
1499 /// Entity name.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001500 core.String entityName;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001501
1502 /// Reasons why the entity can't be uploaded.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001503 core.List<core.String> errors;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001504
1505 /// Whether the entity is persisted.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001506 core.bool persisted;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001507
1508 /// Row number.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001509 core.int rowNumber;
1510
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001511 RowStatus();
1512
1513 RowStatus.fromJson(core.Map _json) {
1514 if (_json.containsKey("changed")) {
1515 changed = _json["changed"];
1516 }
1517 if (_json.containsKey("entityId")) {
1518 entityId = _json["entityId"];
1519 }
1520 if (_json.containsKey("entityName")) {
1521 entityName = _json["entityName"];
1522 }
1523 if (_json.containsKey("errors")) {
Jakob Andersen52715df2018-05-01 13:58:48 +02001524 errors = (_json["errors"] as core.List).cast<core.String>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001525 }
1526 if (_json.containsKey("persisted")) {
1527 persisted = _json["persisted"];
1528 }
1529 if (_json.containsKey("rowNumber")) {
1530 rowNumber = _json["rowNumber"];
1531 }
1532 }
1533
Martin Kustermann3953f0d2017-06-12 16:59:53 +02001534 core.Map<core.String, core.Object> toJson() {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001535 final core.Map<core.String, core.Object> _json =
1536 new core.Map<core.String, core.Object>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001537 if (changed != null) {
1538 _json["changed"] = changed;
1539 }
1540 if (entityId != null) {
1541 _json["entityId"] = entityId;
1542 }
1543 if (entityName != null) {
1544 _json["entityName"] = entityName;
1545 }
1546 if (errors != null) {
1547 _json["errors"] = errors;
1548 }
1549 if (persisted != null) {
1550 _json["persisted"] = persisted;
1551 }
1552 if (rowNumber != null) {
1553 _json["rowNumber"] = rowNumber;
1554 }
1555 return _json;
1556 }
1557}
1558
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001559/// Request to run a stored query to generate a report.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001560class RunQueryRequest {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001561 /// Report data range used to generate the report.
1562 /// Possible string values are:
1563 /// - "ALL_TIME"
1564 /// - "CURRENT_DAY"
1565 /// - "CUSTOM_DATES"
1566 /// - "LAST_14_DAYS"
1567 /// - "LAST_30_DAYS"
1568 /// - "LAST_365_DAYS"
1569 /// - "LAST_7_DAYS"
1570 /// - "LAST_90_DAYS"
1571 /// - "MONTH_TO_DATE"
1572 /// - "PREVIOUS_DAY"
1573 /// - "PREVIOUS_HALF_MONTH"
1574 /// - "PREVIOUS_MONTH"
1575 /// - "PREVIOUS_QUARTER"
1576 /// - "PREVIOUS_WEEK"
1577 /// - "PREVIOUS_YEAR"
1578 /// - "QUARTER_TO_DATE"
1579 /// - "TYPE_NOT_SUPPORTED"
1580 /// - "WEEK_TO_DATE"
1581 /// - "YEAR_TO_DATE"
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001582 core.String dataRange;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001583
1584 /// The ending time for the data that is shown in the report. Note,
1585 /// reportDataEndTimeMs is required if dataRange is CUSTOM_DATES and ignored
1586 /// otherwise.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001587 core.String reportDataEndTimeMs;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001588
1589 /// The starting time for the data that is shown in the report. Note,
1590 /// reportDataStartTimeMs is required if dataRange is CUSTOM_DATES and ignored
1591 /// otherwise.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001592 core.String reportDataStartTimeMs;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001593
1594 /// Canonical timezone code for report data time. Defaults to
1595 /// America/New_York.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001596 core.String timezoneCode;
1597
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001598 RunQueryRequest();
1599
1600 RunQueryRequest.fromJson(core.Map _json) {
1601 if (_json.containsKey("dataRange")) {
1602 dataRange = _json["dataRange"];
1603 }
1604 if (_json.containsKey("reportDataEndTimeMs")) {
1605 reportDataEndTimeMs = _json["reportDataEndTimeMs"];
1606 }
1607 if (_json.containsKey("reportDataStartTimeMs")) {
1608 reportDataStartTimeMs = _json["reportDataStartTimeMs"];
1609 }
1610 if (_json.containsKey("timezoneCode")) {
1611 timezoneCode = _json["timezoneCode"];
1612 }
1613 }
1614
Martin Kustermann3953f0d2017-06-12 16:59:53 +02001615 core.Map<core.String, core.Object> toJson() {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001616 final core.Map<core.String, core.Object> _json =
1617 new core.Map<core.String, core.Object>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001618 if (dataRange != null) {
1619 _json["dataRange"] = dataRange;
1620 }
1621 if (reportDataEndTimeMs != null) {
1622 _json["reportDataEndTimeMs"] = reportDataEndTimeMs;
1623 }
1624 if (reportDataStartTimeMs != null) {
1625 _json["reportDataStartTimeMs"] = reportDataStartTimeMs;
1626 }
1627 if (timezoneCode != null) {
1628 _json["timezoneCode"] = timezoneCode;
1629 }
1630 return _json;
1631 }
1632}
1633
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001634/// Request to upload line items.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001635class UploadLineItemsRequest {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001636 /// Set to true to get upload status without actually persisting the line
1637 /// items.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001638 core.bool dryRun;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001639
1640 /// Format the line items are in. Default to CSV.
1641 /// Possible string values are:
1642 /// - "CSV"
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001643 core.String format;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001644
1645 /// Line items in CSV to upload. Refer to Entity Write File Format for more
1646 /// information on file format.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001647 core.String lineItems;
1648
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001649 UploadLineItemsRequest();
1650
1651 UploadLineItemsRequest.fromJson(core.Map _json) {
1652 if (_json.containsKey("dryRun")) {
1653 dryRun = _json["dryRun"];
1654 }
1655 if (_json.containsKey("format")) {
1656 format = _json["format"];
1657 }
1658 if (_json.containsKey("lineItems")) {
1659 lineItems = _json["lineItems"];
1660 }
1661 }
1662
Martin Kustermann3953f0d2017-06-12 16:59:53 +02001663 core.Map<core.String, core.Object> toJson() {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001664 final core.Map<core.String, core.Object> _json =
1665 new core.Map<core.String, core.Object>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001666 if (dryRun != null) {
1667 _json["dryRun"] = dryRun;
1668 }
1669 if (format != null) {
1670 _json["format"] = format;
1671 }
1672 if (lineItems != null) {
1673 _json["lineItems"] = lineItems;
1674 }
1675 return _json;
1676 }
1677}
1678
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001679/// Upload line items response.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001680class UploadLineItemsResponse {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001681 /// Status of upload.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001682 UploadStatus uploadStatus;
1683
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001684 UploadLineItemsResponse();
1685
1686 UploadLineItemsResponse.fromJson(core.Map _json) {
1687 if (_json.containsKey("uploadStatus")) {
1688 uploadStatus = new UploadStatus.fromJson(_json["uploadStatus"]);
1689 }
1690 }
1691
Martin Kustermann3953f0d2017-06-12 16:59:53 +02001692 core.Map<core.String, core.Object> toJson() {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001693 final core.Map<core.String, core.Object> _json =
1694 new core.Map<core.String, core.Object>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001695 if (uploadStatus != null) {
1696 _json["uploadStatus"] = (uploadStatus).toJson();
1697 }
1698 return _json;
1699 }
1700}
1701
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001702/// Represents the status of upload.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001703class UploadStatus {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001704 /// Reasons why upload can't be completed.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001705 core.List<core.String> errors;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001706
1707 /// Per-row upload status.
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001708 core.List<RowStatus> rowStatus;
1709
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001710 UploadStatus();
1711
1712 UploadStatus.fromJson(core.Map _json) {
1713 if (_json.containsKey("errors")) {
Jakob Andersen52715df2018-05-01 13:58:48 +02001714 errors = (_json["errors"] as core.List).cast<core.String>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001715 }
1716 if (_json.containsKey("rowStatus")) {
Jakob Andersen52715df2018-05-01 13:58:48 +02001717 rowStatus = (_json["rowStatus"] as core.List)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02001718 .map<RowStatus>((value) => new RowStatus.fromJson(value))
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001719 .toList();
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001720 }
1721 }
1722
Martin Kustermann3953f0d2017-06-12 16:59:53 +02001723 core.Map<core.String, core.Object> toJson() {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001724 final core.Map<core.String, core.Object> _json =
1725 new core.Map<core.String, core.Object>();
Martin Kustermannf9c50a22014-09-10 15:26:11 +02001726 if (errors != null) {
1727 _json["errors"] = errors;
1728 }
1729 if (rowStatus != null) {
1730 _json["rowStatus"] = rowStatus.map((value) => (value).toJson()).toList();
1731 }
1732 return _json;
1733 }
1734}