Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 1 | // This is a generated file (see the discoveryapis_generator project). |
| 2 | |
Jakob Andersen | c21146a | 2018-05-25 09:46:20 +0200 | [diff] [blame] | 3 | // ignore_for_file: unnecessary_cast |
| 4 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 5 | library googleapis.doubleclickbidmanager.v1; |
| 6 | |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 7 | import 'dart:core' as core; |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 8 | import 'dart:async' as async; |
| 9 | import 'dart:convert' as convert; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 10 | |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 11 | import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 12 | import 'package:http/http.dart' as http; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 13 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 14 | export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' |
| 15 | show ApiRequestError, DetailedApiRequestError; |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 16 | |
| 17 | const core.String USER_AGENT = 'dart-api-client doubleclickbidmanager/v1'; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 18 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 19 | /// API for viewing and managing your reports in DoubleClick Bid Manager. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 20 | class DoubleclickbidmanagerApi { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 21 | /// View and manage your reports in DoubleClick Bid Manager |
| 22 | static const DoubleclickbidmanagerScope = |
| 23 | "https://www.googleapis.com/auth/doubleclickbidmanager"; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 24 | |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 25 | final commons.ApiRequester _requester; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 26 | |
| 27 | LineitemsResourceApi get lineitems => new LineitemsResourceApi(_requester); |
| 28 | QueriesResourceApi get queries => new QueriesResourceApi(_requester); |
| 29 | ReportsResourceApi get reports => new ReportsResourceApi(_requester); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 30 | SdfResourceApi get sdf => new SdfResourceApi(_requester); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 31 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 32 | 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 Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 37 | } |
| 38 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 39 | class LineitemsResourceApi { |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 40 | final commons.ApiRequester _requester; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 41 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 42 | LineitemsResourceApi(commons.ApiRequester client) : _requester = client; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 43 | |
Martin Kustermann | a525076 | 2018-02-19 12:56:45 +0100 | [diff] [blame] | 44 | /// Retrieves line items in CSV format. TrueView line items are not supported. |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 45 | /// |
| 46 | /// [request] - The metadata request object. |
| 47 | /// |
| 48 | /// Request parameters: |
| 49 | /// |
Martin Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 50 | /// [$fields] - Selector specifying which fields to include in a partial |
| 51 | /// response. |
| 52 | /// |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 53 | /// 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 Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 61 | DownloadLineItemsRequest request, |
| 62 | {core.String $fields}) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 63 | var _url = null; |
Jakob Andersen | 4ce761d | 2018-04-19 11:19:11 +0200 | [diff] [blame] | 64 | var _queryParams = new core.Map<core.String, core.List<core.String>>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 65 | var _uploadMedia = null; |
| 66 | var _uploadOptions = null; |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 67 | var _downloadOptions = commons.DownloadOptions.Metadata; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 68 | var _body = null; |
| 69 | |
| 70 | if (request != null) { |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 71 | _body = convert.json.encode((request).toJson()); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 72 | } |
Martin Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 73 | if ($fields != null) { |
| 74 | _queryParams["fields"] = [$fields]; |
| 75 | } |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 76 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 77 | _url = 'lineitems/downloadlineitems'; |
| 78 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 79 | 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 Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 87 | } |
| 88 | |
Martin Kustermann | a525076 | 2018-02-19 12:56:45 +0100 | [diff] [blame] | 89 | /// Uploads line items in CSV format. TrueView line items are not supported. |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 90 | /// |
| 91 | /// [request] - The metadata request object. |
| 92 | /// |
| 93 | /// Request parameters: |
| 94 | /// |
Martin Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 95 | /// [$fields] - Selector specifying which fields to include in a partial |
| 96 | /// response. |
| 97 | /// |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 98 | /// 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 Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 106 | UploadLineItemsRequest request, |
| 107 | {core.String $fields}) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 108 | var _url = null; |
Jakob Andersen | 4ce761d | 2018-04-19 11:19:11 +0200 | [diff] [blame] | 109 | var _queryParams = new core.Map<core.String, core.List<core.String>>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 110 | var _uploadMedia = null; |
| 111 | var _uploadOptions = null; |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 112 | var _downloadOptions = commons.DownloadOptions.Metadata; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 113 | var _body = null; |
| 114 | |
| 115 | if (request != null) { |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 116 | _body = convert.json.encode((request).toJson()); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 117 | } |
Martin Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 118 | if ($fields != null) { |
| 119 | _queryParams["fields"] = [$fields]; |
| 120 | } |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 121 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 122 | _url = 'lineitems/uploadlineitems'; |
| 123 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 124 | var _response = _requester.request(_url, "POST", |
| 125 | body: _body, |
| 126 | queryParams: _queryParams, |
| 127 | uploadOptions: _uploadOptions, |
| 128 | uploadMedia: _uploadMedia, |
| 129 | downloadOptions: _downloadOptions); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 130 | return _response.then((data) => new UploadLineItemsResponse.fromJson(data)); |
| 131 | } |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 132 | } |
| 133 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 134 | class QueriesResourceApi { |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 135 | final commons.ApiRequester _requester; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 136 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 137 | QueriesResourceApi(commons.ApiRequester client) : _requester = client; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 138 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 139 | /// Creates a query. |
| 140 | /// |
| 141 | /// [request] - The metadata request object. |
| 142 | /// |
| 143 | /// Request parameters: |
| 144 | /// |
Martin Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 145 | /// [$fields] - Selector specifying which fields to include in a partial |
| 146 | /// response. |
| 147 | /// |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 148 | /// 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 Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 155 | async.Future<Query> createquery(Query request, {core.String $fields}) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 156 | var _url = null; |
Jakob Andersen | 4ce761d | 2018-04-19 11:19:11 +0200 | [diff] [blame] | 157 | var _queryParams = new core.Map<core.String, core.List<core.String>>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 158 | var _uploadMedia = null; |
| 159 | var _uploadOptions = null; |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 160 | var _downloadOptions = commons.DownloadOptions.Metadata; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 161 | var _body = null; |
| 162 | |
| 163 | if (request != null) { |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 164 | _body = convert.json.encode((request).toJson()); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 165 | } |
Martin Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 166 | if ($fields != null) { |
| 167 | _queryParams["fields"] = [$fields]; |
| 168 | } |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 169 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 170 | _url = 'query'; |
| 171 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 172 | var _response = _requester.request(_url, "POST", |
| 173 | body: _body, |
| 174 | queryParams: _queryParams, |
| 175 | uploadOptions: _uploadOptions, |
| 176 | uploadMedia: _uploadMedia, |
| 177 | downloadOptions: _downloadOptions); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 178 | return _response.then((data) => new Query.fromJson(data)); |
| 179 | } |
| 180 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 181 | /// Deletes a stored query as well as the associated stored reports. |
| 182 | /// |
| 183 | /// Request parameters: |
| 184 | /// |
| 185 | /// [queryId] - Query ID to delete. |
| 186 | /// |
Martin Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 187 | /// [$fields] - Selector specifying which fields to include in a partial |
| 188 | /// response. |
| 189 | /// |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 190 | /// 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 Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 195 | async.Future deletequery(core.String queryId, {core.String $fields}) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 196 | var _url = null; |
Jakob Andersen | 4ce761d | 2018-04-19 11:19:11 +0200 | [diff] [blame] | 197 | var _queryParams = new core.Map<core.String, core.List<core.String>>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 198 | var _uploadMedia = null; |
| 199 | var _uploadOptions = null; |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 200 | var _downloadOptions = commons.DownloadOptions.Metadata; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 201 | var _body = null; |
| 202 | |
| 203 | if (queryId == null) { |
| 204 | throw new core.ArgumentError("Parameter queryId is required."); |
| 205 | } |
Martin Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 206 | if ($fields != null) { |
| 207 | _queryParams["fields"] = [$fields]; |
| 208 | } |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 209 | |
| 210 | _downloadOptions = null; |
| 211 | |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 212 | _url = 'query/' + commons.Escaper.ecapeVariable('$queryId'); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 213 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 214 | var _response = _requester.request(_url, "DELETE", |
| 215 | body: _body, |
| 216 | queryParams: _queryParams, |
| 217 | uploadOptions: _uploadOptions, |
| 218 | uploadMedia: _uploadMedia, |
| 219 | downloadOptions: _downloadOptions); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 220 | return _response.then((data) => null); |
| 221 | } |
| 222 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 223 | /// Retrieves a stored query. |
| 224 | /// |
| 225 | /// Request parameters: |
| 226 | /// |
| 227 | /// [queryId] - Query ID to retrieve. |
| 228 | /// |
Martin Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 229 | /// [$fields] - Selector specifying which fields to include in a partial |
| 230 | /// response. |
| 231 | /// |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 232 | /// 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 Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 239 | async.Future<Query> getquery(core.String queryId, {core.String $fields}) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 240 | var _url = null; |
Jakob Andersen | 4ce761d | 2018-04-19 11:19:11 +0200 | [diff] [blame] | 241 | var _queryParams = new core.Map<core.String, core.List<core.String>>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 242 | var _uploadMedia = null; |
| 243 | var _uploadOptions = null; |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 244 | var _downloadOptions = commons.DownloadOptions.Metadata; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 245 | var _body = null; |
| 246 | |
| 247 | if (queryId == null) { |
| 248 | throw new core.ArgumentError("Parameter queryId is required."); |
| 249 | } |
Martin Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 250 | if ($fields != null) { |
| 251 | _queryParams["fields"] = [$fields]; |
| 252 | } |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 253 | |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 254 | _url = 'query/' + commons.Escaper.ecapeVariable('$queryId'); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 255 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 256 | var _response = _requester.request(_url, "GET", |
| 257 | body: _body, |
| 258 | queryParams: _queryParams, |
| 259 | uploadOptions: _uploadOptions, |
| 260 | uploadMedia: _uploadMedia, |
| 261 | downloadOptions: _downloadOptions); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 262 | return _response.then((data) => new Query.fromJson(data)); |
| 263 | } |
| 264 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 265 | /// Retrieves stored queries. |
| 266 | /// |
| 267 | /// Request parameters: |
| 268 | /// |
Martin Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 269 | /// [$fields] - Selector specifying which fields to include in a partial |
| 270 | /// response. |
| 271 | /// |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 272 | /// 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 Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 279 | async.Future<ListQueriesResponse> listqueries({core.String $fields}) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 280 | var _url = null; |
Jakob Andersen | 4ce761d | 2018-04-19 11:19:11 +0200 | [diff] [blame] | 281 | var _queryParams = new core.Map<core.String, core.List<core.String>>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 282 | var _uploadMedia = null; |
| 283 | var _uploadOptions = null; |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 284 | var _downloadOptions = commons.DownloadOptions.Metadata; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 285 | var _body = null; |
| 286 | |
Martin Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 287 | if ($fields != null) { |
| 288 | _queryParams["fields"] = [$fields]; |
| 289 | } |
| 290 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 291 | _url = 'queries'; |
| 292 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 293 | var _response = _requester.request(_url, "GET", |
| 294 | body: _body, |
| 295 | queryParams: _queryParams, |
| 296 | uploadOptions: _uploadOptions, |
| 297 | uploadMedia: _uploadMedia, |
| 298 | downloadOptions: _downloadOptions); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 299 | return _response.then((data) => new ListQueriesResponse.fromJson(data)); |
| 300 | } |
| 301 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 302 | /// 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 Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 310 | /// [$fields] - Selector specifying which fields to include in a partial |
| 311 | /// response. |
| 312 | /// |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 313 | /// 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 Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 318 | async.Future runquery(RunQueryRequest request, core.String queryId, |
| 319 | {core.String $fields}) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 320 | var _url = null; |
Jakob Andersen | 4ce761d | 2018-04-19 11:19:11 +0200 | [diff] [blame] | 321 | var _queryParams = new core.Map<core.String, core.List<core.String>>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 322 | var _uploadMedia = null; |
| 323 | var _uploadOptions = null; |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 324 | var _downloadOptions = commons.DownloadOptions.Metadata; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 325 | var _body = null; |
| 326 | |
| 327 | if (request != null) { |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 328 | _body = convert.json.encode((request).toJson()); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 329 | } |
| 330 | if (queryId == null) { |
| 331 | throw new core.ArgumentError("Parameter queryId is required."); |
| 332 | } |
Martin Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 333 | if ($fields != null) { |
| 334 | _queryParams["fields"] = [$fields]; |
| 335 | } |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 336 | |
| 337 | _downloadOptions = null; |
| 338 | |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 339 | _url = 'query/' + commons.Escaper.ecapeVariable('$queryId'); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 340 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 341 | var _response = _requester.request(_url, "POST", |
| 342 | body: _body, |
| 343 | queryParams: _queryParams, |
| 344 | uploadOptions: _uploadOptions, |
| 345 | uploadMedia: _uploadMedia, |
| 346 | downloadOptions: _downloadOptions); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 347 | return _response.then((data) => null); |
| 348 | } |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 349 | } |
| 350 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 351 | class ReportsResourceApi { |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 352 | final commons.ApiRequester _requester; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 353 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 354 | ReportsResourceApi(commons.ApiRequester client) : _requester = client; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 355 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 356 | /// Retrieves stored reports. |
| 357 | /// |
| 358 | /// Request parameters: |
| 359 | /// |
| 360 | /// [queryId] - Query ID with which the reports are associated. |
| 361 | /// |
Martin Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 362 | /// [$fields] - Selector specifying which fields to include in a partial |
| 363 | /// response. |
| 364 | /// |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 365 | /// 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 Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 372 | async.Future<ListReportsResponse> listreports(core.String queryId, |
| 373 | {core.String $fields}) { |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 374 | var _url = null; |
Jakob Andersen | 4ce761d | 2018-04-19 11:19:11 +0200 | [diff] [blame] | 375 | var _queryParams = new core.Map<core.String, core.List<core.String>>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 376 | var _uploadMedia = null; |
| 377 | var _uploadOptions = null; |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 378 | var _downloadOptions = commons.DownloadOptions.Metadata; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 379 | var _body = null; |
| 380 | |
| 381 | if (queryId == null) { |
| 382 | throw new core.ArgumentError("Parameter queryId is required."); |
| 383 | } |
Martin Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 384 | if ($fields != null) { |
| 385 | _queryParams["fields"] = [$fields]; |
| 386 | } |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 387 | |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 388 | _url = 'queries/' + commons.Escaper.ecapeVariable('$queryId') + '/reports'; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 389 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 390 | var _response = _requester.request(_url, "GET", |
| 391 | body: _body, |
| 392 | queryParams: _queryParams, |
| 393 | uploadOptions: _uploadOptions, |
| 394 | uploadMedia: _uploadMedia, |
| 395 | downloadOptions: _downloadOptions); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 396 | return _response.then((data) => new ListReportsResponse.fromJson(data)); |
| 397 | } |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 398 | } |
| 399 | |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 400 | class SdfResourceApi { |
Martin Kustermann | 87dfaba | 2016-02-01 10:23:02 +0100 | [diff] [blame] | 401 | final commons.ApiRequester _requester; |
| 402 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 403 | SdfResourceApi(commons.ApiRequester client) : _requester = client; |
Martin Kustermann | 87dfaba | 2016-02-01 10:23:02 +0100 | [diff] [blame] | 404 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 405 | /// Retrieves entities in SDF format. |
| 406 | /// |
| 407 | /// [request] - The metadata request object. |
| 408 | /// |
| 409 | /// Request parameters: |
| 410 | /// |
Martin Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 411 | /// [$fields] - Selector specifying which fields to include in a partial |
| 412 | /// response. |
| 413 | /// |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 414 | /// 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 Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 421 | async.Future<DownloadResponse> download(DownloadRequest request, |
| 422 | {core.String $fields}) { |
Martin Kustermann | 87dfaba | 2016-02-01 10:23:02 +0100 | [diff] [blame] | 423 | var _url = null; |
Jakob Andersen | 4ce761d | 2018-04-19 11:19:11 +0200 | [diff] [blame] | 424 | var _queryParams = new core.Map<core.String, core.List<core.String>>(); |
Martin Kustermann | 87dfaba | 2016-02-01 10:23:02 +0100 | [diff] [blame] | 425 | var _uploadMedia = null; |
| 426 | var _uploadOptions = null; |
| 427 | var _downloadOptions = commons.DownloadOptions.Metadata; |
| 428 | var _body = null; |
| 429 | |
| 430 | if (request != null) { |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 431 | _body = convert.json.encode((request).toJson()); |
Martin Kustermann | 87dfaba | 2016-02-01 10:23:02 +0100 | [diff] [blame] | 432 | } |
Martin Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 433 | if ($fields != null) { |
| 434 | _queryParams["fields"] = [$fields]; |
| 435 | } |
Martin Kustermann | 87dfaba | 2016-02-01 10:23:02 +0100 | [diff] [blame] | 436 | |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 437 | _url = 'sdf/download'; |
Martin Kustermann | 87dfaba | 2016-02-01 10:23:02 +0100 | [diff] [blame] | 438 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 439 | var _response = _requester.request(_url, "POST", |
| 440 | body: _body, |
| 441 | queryParams: _queryParams, |
| 442 | uploadOptions: _uploadOptions, |
| 443 | uploadMedia: _uploadMedia, |
| 444 | downloadOptions: _downloadOptions); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 445 | return _response.then((data) => new DownloadResponse.fromJson(data)); |
Martin Kustermann | 87dfaba | 2016-02-01 10:23:02 +0100 | [diff] [blame] | 446 | } |
Martin Kustermann | 87dfaba | 2016-02-01 10:23:02 +0100 | [diff] [blame] | 447 | } |
| 448 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 449 | /// Request to fetch stored line items. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 450 | class DownloadLineItemsRequest { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 451 | /// 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 Wibling | 6d47707 | 2015-10-19 16:19:14 +0200 | [diff] [blame] | 455 | core.String fileSpec; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 456 | |
| 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 Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 459 | core.List<core.String> filterIds; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 460 | |
| 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 Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 466 | core.String filterType; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 467 | |
| 468 | /// Format in which the line items will be returned. Default to CSV. |
| 469 | /// Possible string values are: |
| 470 | /// - "CSV" |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 471 | core.String format; |
| 472 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 473 | DownloadLineItemsRequest(); |
| 474 | |
| 475 | DownloadLineItemsRequest.fromJson(core.Map _json) { |
Gustav Wibling | 6d47707 | 2015-10-19 16:19:14 +0200 | [diff] [blame] | 476 | if (_json.containsKey("fileSpec")) { |
| 477 | fileSpec = _json["fileSpec"]; |
| 478 | } |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 479 | if (_json.containsKey("filterIds")) { |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 480 | filterIds = (_json["filterIds"] as core.List).cast<core.String>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 481 | } |
| 482 | if (_json.containsKey("filterType")) { |
| 483 | filterType = _json["filterType"]; |
| 484 | } |
| 485 | if (_json.containsKey("format")) { |
| 486 | format = _json["format"]; |
| 487 | } |
| 488 | } |
| 489 | |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 490 | core.Map<core.String, core.Object> toJson() { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 491 | final core.Map<core.String, core.Object> _json = |
| 492 | new core.Map<core.String, core.Object>(); |
Gustav Wibling | 6d47707 | 2015-10-19 16:19:14 +0200 | [diff] [blame] | 493 | if (fileSpec != null) { |
| 494 | _json["fileSpec"] = fileSpec; |
| 495 | } |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 496 | 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 Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 509 | /// Download line items response. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 510 | class DownloadLineItemsResponse { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 511 | /// Retrieved line items in CSV format. For more information about file |
| 512 | /// formats, see Entity Write File Format. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 513 | core.String lineItems; |
| 514 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 515 | DownloadLineItemsResponse(); |
| 516 | |
| 517 | DownloadLineItemsResponse.fromJson(core.Map _json) { |
| 518 | if (_json.containsKey("lineItems")) { |
| 519 | lineItems = _json["lineItems"]; |
| 520 | } |
| 521 | } |
| 522 | |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 523 | core.Map<core.String, core.Object> toJson() { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 524 | final core.Map<core.String, core.Object> _json = |
| 525 | new core.Map<core.String, core.Object>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 526 | if (lineItems != null) { |
| 527 | _json["lineItems"] = lineItems; |
| 528 | } |
| 529 | return _json; |
| 530 | } |
| 531 | } |
| 532 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 533 | /// Request to fetch stored insertion orders, line items, TrueView ad groups and |
| 534 | /// ads. |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 535 | class DownloadRequest { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 536 | /// File types that will be returned. |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 537 | core.List<core.String> fileTypes; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 538 | |
| 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 Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 543 | core.List<core.String> filterIds; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 544 | |
| 545 | /// Filter type used to filter line items to fetch. |
| 546 | /// Possible string values are: |
| 547 | /// - "ADVERTISER_ID" |
Martin Kustermann | a525076 | 2018-02-19 12:56:45 +0100 | [diff] [blame] | 548 | /// - "CAMPAIGN_ID" |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 549 | /// - "INSERTION_ORDER_ID" |
| 550 | /// - "LINE_ITEM_ID" |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 551 | core.String filterType; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 552 | |
| 553 | /// SDF Version (column names, types, order) in which the entities will be |
| 554 | /// returned. Default to 3. |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 555 | core.String version; |
| 556 | |
| 557 | DownloadRequest(); |
| 558 | |
| 559 | DownloadRequest.fromJson(core.Map _json) { |
| 560 | if (_json.containsKey("fileTypes")) { |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 561 | fileTypes = (_json["fileTypes"] as core.List).cast<core.String>(); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 562 | } |
| 563 | if (_json.containsKey("filterIds")) { |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 564 | filterIds = (_json["filterIds"] as core.List).cast<core.String>(); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 565 | } |
| 566 | if (_json.containsKey("filterType")) { |
| 567 | filterType = _json["filterType"]; |
| 568 | } |
| 569 | if (_json.containsKey("version")) { |
| 570 | version = _json["version"]; |
| 571 | } |
| 572 | } |
| 573 | |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 574 | core.Map<core.String, core.Object> toJson() { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 575 | final core.Map<core.String, core.Object> _json = |
| 576 | new core.Map<core.String, core.Object>(); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 577 | 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 Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 593 | /// Download response. |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 594 | class DownloadResponse { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 595 | /// Retrieved ad groups in SDF format. |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 596 | core.String adGroups; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 597 | |
| 598 | /// Retrieved ads in SDF format. |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 599 | core.String ads; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 600 | |
Martin Kustermann | a525076 | 2018-02-19 12:56:45 +0100 | [diff] [blame] | 601 | /// Retrieved campaigns in SDF format. |
| 602 | core.String campaigns; |
| 603 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 604 | /// Retrieved insertion orders in SDF format. |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 605 | core.String insertionOrders; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 606 | |
| 607 | /// Retrieved line items in SDF format. |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 608 | 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 Kustermann | a525076 | 2018-02-19 12:56:45 +0100 | [diff] [blame] | 619 | if (_json.containsKey("campaigns")) { |
| 620 | campaigns = _json["campaigns"]; |
| 621 | } |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 622 | if (_json.containsKey("insertionOrders")) { |
| 623 | insertionOrders = _json["insertionOrders"]; |
| 624 | } |
| 625 | if (_json.containsKey("lineItems")) { |
| 626 | lineItems = _json["lineItems"]; |
| 627 | } |
| 628 | } |
| 629 | |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 630 | core.Map<core.String, core.Object> toJson() { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 631 | final core.Map<core.String, core.Object> _json = |
| 632 | new core.Map<core.String, core.Object>(); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 633 | if (adGroups != null) { |
| 634 | _json["adGroups"] = adGroups; |
| 635 | } |
| 636 | if (ads != null) { |
| 637 | _json["ads"] = ads; |
| 638 | } |
Martin Kustermann | a525076 | 2018-02-19 12:56:45 +0100 | [diff] [blame] | 639 | if (campaigns != null) { |
| 640 | _json["campaigns"] = campaigns; |
| 641 | } |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 642 | if (insertionOrders != null) { |
| 643 | _json["insertionOrders"] = insertionOrders; |
| 644 | } |
| 645 | if (lineItems != null) { |
| 646 | _json["lineItems"] = lineItems; |
| 647 | } |
| 648 | return _json; |
| 649 | } |
| 650 | } |
| 651 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 652 | /// Filter used to match traffic data in your report. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 653 | class FilterPair { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 654 | /// 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 Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 774 | core.String type; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 775 | |
| 776 | /// Filter value. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 777 | core.String value; |
| 778 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 779 | 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 Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 790 | core.Map<core.String, core.Object> toJson() { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 791 | final core.Map<core.String, core.Object> _json = |
| 792 | new core.Map<core.String, core.Object>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 793 | if (type != null) { |
| 794 | _json["type"] = type; |
| 795 | } |
| 796 | if (value != null) { |
| 797 | _json["value"] = value; |
| 798 | } |
| 799 | return _json; |
| 800 | } |
| 801 | } |
| 802 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 803 | /// List queries response. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 804 | class ListQueriesResponse { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 805 | /// Identifies what kind of resource this is. Value: the fixed string |
| 806 | /// "doubleclickbidmanager#listQueriesResponse". |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 807 | core.String kind; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 808 | |
| 809 | /// Retrieved queries. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 810 | core.List<Query> queries; |
| 811 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 812 | ListQueriesResponse(); |
| 813 | |
| 814 | ListQueriesResponse.fromJson(core.Map _json) { |
| 815 | if (_json.containsKey("kind")) { |
| 816 | kind = _json["kind"]; |
| 817 | } |
| 818 | if (_json.containsKey("queries")) { |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 819 | queries = (_json["queries"] as core.List) |
Jakob Andersen | 4ce761d | 2018-04-19 11:19:11 +0200 | [diff] [blame] | 820 | .map<Query>((value) => new Query.fromJson(value)) |
| 821 | .toList(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 822 | } |
| 823 | } |
| 824 | |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 825 | core.Map<core.String, core.Object> toJson() { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 826 | final core.Map<core.String, core.Object> _json = |
| 827 | new core.Map<core.String, core.Object>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 828 | 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 Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 838 | /// List reports response. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 839 | class ListReportsResponse { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 840 | /// Identifies what kind of resource this is. Value: the fixed string |
| 841 | /// "doubleclickbidmanager#listReportsResponse". |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 842 | core.String kind; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 843 | |
| 844 | /// Retrieved reports. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 845 | core.List<Report> reports; |
| 846 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 847 | ListReportsResponse(); |
| 848 | |
| 849 | ListReportsResponse.fromJson(core.Map _json) { |
| 850 | if (_json.containsKey("kind")) { |
| 851 | kind = _json["kind"]; |
| 852 | } |
| 853 | if (_json.containsKey("reports")) { |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 854 | reports = (_json["reports"] as core.List) |
Jakob Andersen | 4ce761d | 2018-04-19 11:19:11 +0200 | [diff] [blame] | 855 | .map<Report>((value) => new Report.fromJson(value)) |
| 856 | .toList(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 857 | } |
| 858 | } |
| 859 | |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 860 | core.Map<core.String, core.Object> toJson() { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 861 | final core.Map<core.String, core.Object> _json = |
| 862 | new core.Map<core.String, core.Object>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 863 | 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 Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 873 | /// Parameters of a query or report. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 874 | class Parameters { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 875 | /// Filters used to match traffic data in your report. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 876 | core.List<FilterPair> filters; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 877 | |
| 878 | /// Data is grouped by the filters listed in this field. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 879 | core.List<core.String> groupBys; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 880 | |
| 881 | /// Whether to include data from Invite Media. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 882 | core.bool includeInviteData; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 883 | |
| 884 | /// Metrics to include as columns in your report. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 885 | core.List<core.String> metrics; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 886 | |
| 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 Kustermann | a525076 | 2018-02-19 12:56:45 +0100 | [diff] [blame] | 902 | /// - "TYPE_LINEAR_TV_SEARCH_LIFT" |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 903 | /// - "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 Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 921 | core.String type; |
| 922 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 923 | Parameters(); |
| 924 | |
| 925 | Parameters.fromJson(core.Map _json) { |
| 926 | if (_json.containsKey("filters")) { |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 927 | filters = (_json["filters"] as core.List) |
Jakob Andersen | 4ce761d | 2018-04-19 11:19:11 +0200 | [diff] [blame] | 928 | .map<FilterPair>((value) => new FilterPair.fromJson(value)) |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 929 | .toList(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 930 | } |
| 931 | if (_json.containsKey("groupBys")) { |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 932 | groupBys = (_json["groupBys"] as core.List).cast<core.String>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 933 | } |
| 934 | if (_json.containsKey("includeInviteData")) { |
| 935 | includeInviteData = _json["includeInviteData"]; |
| 936 | } |
| 937 | if (_json.containsKey("metrics")) { |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 938 | metrics = (_json["metrics"] as core.List).cast<core.String>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 939 | } |
| 940 | if (_json.containsKey("type")) { |
| 941 | type = _json["type"]; |
| 942 | } |
| 943 | } |
| 944 | |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 945 | core.Map<core.String, core.Object> toJson() { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 946 | final core.Map<core.String, core.Object> _json = |
| 947 | new core.Map<core.String, core.Object>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 948 | 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 Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 967 | /// Represents a query. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 968 | class Query { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 969 | /// Identifies what kind of resource this is. Value: the fixed string |
| 970 | /// "doubleclickbidmanager#query". |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 971 | core.String kind; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 972 | |
| 973 | /// Query metadata. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 974 | QueryMetadata metadata; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 975 | |
| 976 | /// Query parameters. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 977 | Parameters params; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 978 | |
| 979 | /// Query ID. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 980 | core.String queryId; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 981 | |
| 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 Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 985 | core.String reportDataEndTimeMs; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 986 | |
| 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 Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 990 | core.String reportDataStartTimeMs; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 991 | |
| 992 | /// Information on how often and when to run a query. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 993 | QuerySchedule schedule; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 994 | |
| 995 | /// Canonical timezone code for report data time. Defaults to |
| 996 | /// America/New_York. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 997 | core.String timezoneCode; |
| 998 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 999 | 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 Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 1028 | core.Map<core.String, core.Object> toJson() { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1029 | final core.Map<core.String, core.Object> _json = |
| 1030 | new core.Map<core.String, core.Object>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1031 | 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 Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1059 | /// Query metadata. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1060 | class QueryMetadata { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1061 | /// 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 Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1082 | core.String dataRange; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1083 | |
| 1084 | /// Format of the generated report. |
| 1085 | /// Possible string values are: |
| 1086 | /// - "CSV" |
| 1087 | /// - "EXCEL_CSV" |
| 1088 | /// - "XLSX" |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1089 | core.String format; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1090 | |
| 1091 | /// The path to the location in Google Cloud Storage where the latest report |
| 1092 | /// is stored. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1093 | core.String googleCloudStoragePathForLatestReport; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1094 | |
| 1095 | /// The path in Google Drive for the latest report. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1096 | core.String googleDrivePathForLatestReport; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1097 | |
| 1098 | /// The time when the latest report started to run. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1099 | core.String latestReportRunTimeMs; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1100 | |
| 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 Wibling | 73da588 | 2015-02-04 16:41:07 +0100 | [diff] [blame] | 1107 | core.String locale; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1108 | |
| 1109 | /// Number of reports that have been generated for the query. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1110 | core.int reportCount; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1111 | |
| 1112 | /// Whether the latest report is currently running. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1113 | core.bool running; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1114 | |
| 1115 | /// Whether to send an email notification when a report is ready. Default to |
| 1116 | /// false. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1117 | core.bool sendNotification; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1118 | |
| 1119 | /// List of email addresses which are sent email notifications when the report |
| 1120 | /// is finished. Separate from sendNotification. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1121 | core.List<core.String> shareEmailAddress; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1122 | |
| 1123 | /// Query title. It is used to name the reports generated from this query. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1124 | core.String title; |
| 1125 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1126 | 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 Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1136 | googleCloudStoragePathForLatestReport = |
| 1137 | _json["googleCloudStoragePathForLatestReport"]; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1138 | } |
| 1139 | if (_json.containsKey("googleDrivePathForLatestReport")) { |
| 1140 | googleDrivePathForLatestReport = _json["googleDrivePathForLatestReport"]; |
| 1141 | } |
| 1142 | if (_json.containsKey("latestReportRunTimeMs")) { |
| 1143 | latestReportRunTimeMs = _json["latestReportRunTimeMs"]; |
| 1144 | } |
Gustav Wibling | 73da588 | 2015-02-04 16:41:07 +0100 | [diff] [blame] | 1145 | if (_json.containsKey("locale")) { |
| 1146 | locale = _json["locale"]; |
| 1147 | } |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1148 | 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 Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 1158 | shareEmailAddress = |
| 1159 | (_json["shareEmailAddress"] as core.List).cast<core.String>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1160 | } |
| 1161 | if (_json.containsKey("title")) { |
| 1162 | title = _json["title"]; |
| 1163 | } |
| 1164 | } |
| 1165 | |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 1166 | core.Map<core.String, core.Object> toJson() { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1167 | final core.Map<core.String, core.Object> _json = |
| 1168 | new core.Map<core.String, core.Object>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1169 | if (dataRange != null) { |
| 1170 | _json["dataRange"] = dataRange; |
| 1171 | } |
| 1172 | if (format != null) { |
| 1173 | _json["format"] = format; |
| 1174 | } |
| 1175 | if (googleCloudStoragePathForLatestReport != null) { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1176 | _json["googleCloudStoragePathForLatestReport"] = |
| 1177 | googleCloudStoragePathForLatestReport; |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1178 | } |
| 1179 | if (googleDrivePathForLatestReport != null) { |
| 1180 | _json["googleDrivePathForLatestReport"] = googleDrivePathForLatestReport; |
| 1181 | } |
| 1182 | if (latestReportRunTimeMs != null) { |
| 1183 | _json["latestReportRunTimeMs"] = latestReportRunTimeMs; |
| 1184 | } |
Gustav Wibling | 73da588 | 2015-02-04 16:41:07 +0100 | [diff] [blame] | 1185 | if (locale != null) { |
| 1186 | _json["locale"] = locale; |
| 1187 | } |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1188 | 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 Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1207 | /// Information on how frequently and when to run a query. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1208 | class QuerySchedule { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1209 | /// Datetime to periodically run the query until. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1210 | core.String endTimeMs; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1211 | |
| 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 Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1220 | core.String frequency; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1221 | |
| 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 Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1225 | core.int nextRunMinuteOfDay; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1226 | |
| 1227 | /// Canonical timezone code for report generation time. Defaults to |
| 1228 | /// America/New_York. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1229 | core.String nextRunTimezoneCode; |
| 1230 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1231 | 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 Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 1248 | core.Map<core.String, core.Object> toJson() { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1249 | final core.Map<core.String, core.Object> _json = |
| 1250 | new core.Map<core.String, core.Object>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1251 | 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 Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1267 | /// Represents a report. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1268 | class Report { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1269 | /// Key used to identify a report. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1270 | ReportKey key; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1271 | |
| 1272 | /// Report metadata. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1273 | ReportMetadata metadata; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1274 | |
| 1275 | /// Report parameters. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1276 | Parameters params; |
| 1277 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1278 | 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 Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 1292 | core.Map<core.String, core.Object> toJson() { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1293 | final core.Map<core.String, core.Object> _json = |
| 1294 | new core.Map<core.String, core.Object>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1295 | 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 Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1308 | /// An explanation of a report failure. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1309 | class ReportFailure { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1310 | /// 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 Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1330 | core.String errorCode; |
| 1331 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1332 | ReportFailure(); |
| 1333 | |
| 1334 | ReportFailure.fromJson(core.Map _json) { |
| 1335 | if (_json.containsKey("errorCode")) { |
| 1336 | errorCode = _json["errorCode"]; |
| 1337 | } |
| 1338 | } |
| 1339 | |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 1340 | core.Map<core.String, core.Object> toJson() { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1341 | final core.Map<core.String, core.Object> _json = |
| 1342 | new core.Map<core.String, core.Object>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1343 | if (errorCode != null) { |
| 1344 | _json["errorCode"] = errorCode; |
| 1345 | } |
| 1346 | return _json; |
| 1347 | } |
| 1348 | } |
| 1349 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1350 | /// Key used to identify a report. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1351 | class ReportKey { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1352 | /// Query ID. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1353 | core.String queryId; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1354 | |
| 1355 | /// Report ID. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1356 | core.String reportId; |
| 1357 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1358 | 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 Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 1369 | core.Map<core.String, core.Object> toJson() { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1370 | final core.Map<core.String, core.Object> _json = |
| 1371 | new core.Map<core.String, core.Object>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1372 | if (queryId != null) { |
| 1373 | _json["queryId"] = queryId; |
| 1374 | } |
| 1375 | if (reportId != null) { |
| 1376 | _json["reportId"] = reportId; |
| 1377 | } |
| 1378 | return _json; |
| 1379 | } |
| 1380 | } |
| 1381 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1382 | /// Report metadata. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1383 | class ReportMetadata { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1384 | /// The path to the location in Google Cloud Storage where the report is |
| 1385 | /// stored. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1386 | core.String googleCloudStoragePath; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1387 | |
| 1388 | /// The ending time for the data that is shown in the report. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1389 | core.String reportDataEndTimeMs; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1390 | |
| 1391 | /// The starting time for the data that is shown in the report. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1392 | core.String reportDataStartTimeMs; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1393 | |
| 1394 | /// Report status. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1395 | ReportStatus status; |
| 1396 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1397 | 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 Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 1414 | core.Map<core.String, core.Object> toJson() { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1415 | final core.Map<core.String, core.Object> _json = |
| 1416 | new core.Map<core.String, core.Object>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1417 | 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 Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1433 | /// Report status. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1434 | class ReportStatus { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1435 | /// If the report failed, this records the cause. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1436 | ReportFailure failure; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1437 | |
| 1438 | /// The time when this report either completed successfully or failed. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1439 | core.String finishTimeMs; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1440 | |
| 1441 | /// The file type of the report. |
| 1442 | /// Possible string values are: |
| 1443 | /// - "CSV" |
| 1444 | /// - "EXCEL_CSV" |
| 1445 | /// - "XLSX" |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1446 | core.String format; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1447 | |
| 1448 | /// The state of the report. |
| 1449 | /// Possible string values are: |
| 1450 | /// - "DONE" |
| 1451 | /// - "FAILED" |
| 1452 | /// - "RUNNING" |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1453 | core.String state; |
| 1454 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1455 | 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 Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 1472 | core.Map<core.String, core.Object> toJson() { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1473 | final core.Map<core.String, core.Object> _json = |
| 1474 | new core.Map<core.String, core.Object>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1475 | 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 Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1491 | /// Represents the upload status of a row in the request. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1492 | class RowStatus { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1493 | /// Whether the stored entity is changed as a result of upload. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1494 | core.bool changed; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1495 | |
| 1496 | /// Entity Id. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1497 | core.String entityId; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1498 | |
| 1499 | /// Entity name. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1500 | core.String entityName; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1501 | |
| 1502 | /// Reasons why the entity can't be uploaded. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1503 | core.List<core.String> errors; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1504 | |
| 1505 | /// Whether the entity is persisted. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1506 | core.bool persisted; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1507 | |
| 1508 | /// Row number. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1509 | core.int rowNumber; |
| 1510 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1511 | 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 Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 1524 | errors = (_json["errors"] as core.List).cast<core.String>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1525 | } |
| 1526 | if (_json.containsKey("persisted")) { |
| 1527 | persisted = _json["persisted"]; |
| 1528 | } |
| 1529 | if (_json.containsKey("rowNumber")) { |
| 1530 | rowNumber = _json["rowNumber"]; |
| 1531 | } |
| 1532 | } |
| 1533 | |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 1534 | core.Map<core.String, core.Object> toJson() { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1535 | final core.Map<core.String, core.Object> _json = |
| 1536 | new core.Map<core.String, core.Object>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1537 | 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 Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1559 | /// Request to run a stored query to generate a report. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1560 | class RunQueryRequest { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1561 | /// 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 Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1582 | core.String dataRange; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1583 | |
| 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 Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1587 | core.String reportDataEndTimeMs; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1588 | |
| 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 Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1592 | core.String reportDataStartTimeMs; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1593 | |
| 1594 | /// Canonical timezone code for report data time. Defaults to |
| 1595 | /// America/New_York. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1596 | core.String timezoneCode; |
| 1597 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1598 | 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 Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 1615 | core.Map<core.String, core.Object> toJson() { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1616 | final core.Map<core.String, core.Object> _json = |
| 1617 | new core.Map<core.String, core.Object>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1618 | 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 Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1634 | /// Request to upload line items. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1635 | class UploadLineItemsRequest { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1636 | /// Set to true to get upload status without actually persisting the line |
| 1637 | /// items. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1638 | core.bool dryRun; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1639 | |
| 1640 | /// Format the line items are in. Default to CSV. |
| 1641 | /// Possible string values are: |
| 1642 | /// - "CSV" |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1643 | core.String format; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1644 | |
| 1645 | /// Line items in CSV to upload. Refer to Entity Write File Format for more |
| 1646 | /// information on file format. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1647 | core.String lineItems; |
| 1648 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1649 | 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 Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 1663 | core.Map<core.String, core.Object> toJson() { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1664 | final core.Map<core.String, core.Object> _json = |
| 1665 | new core.Map<core.String, core.Object>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1666 | 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 Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1679 | /// Upload line items response. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1680 | class UploadLineItemsResponse { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1681 | /// Status of upload. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1682 | UploadStatus uploadStatus; |
| 1683 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1684 | UploadLineItemsResponse(); |
| 1685 | |
| 1686 | UploadLineItemsResponse.fromJson(core.Map _json) { |
| 1687 | if (_json.containsKey("uploadStatus")) { |
| 1688 | uploadStatus = new UploadStatus.fromJson(_json["uploadStatus"]); |
| 1689 | } |
| 1690 | } |
| 1691 | |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 1692 | core.Map<core.String, core.Object> toJson() { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1693 | final core.Map<core.String, core.Object> _json = |
| 1694 | new core.Map<core.String, core.Object>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1695 | if (uploadStatus != null) { |
| 1696 | _json["uploadStatus"] = (uploadStatus).toJson(); |
| 1697 | } |
| 1698 | return _json; |
| 1699 | } |
| 1700 | } |
| 1701 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1702 | /// Represents the status of upload. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1703 | class UploadStatus { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1704 | /// Reasons why upload can't be completed. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1705 | core.List<core.String> errors; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1706 | |
| 1707 | /// Per-row upload status. |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1708 | core.List<RowStatus> rowStatus; |
| 1709 | |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1710 | UploadStatus(); |
| 1711 | |
| 1712 | UploadStatus.fromJson(core.Map _json) { |
| 1713 | if (_json.containsKey("errors")) { |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 1714 | errors = (_json["errors"] as core.List).cast<core.String>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1715 | } |
| 1716 | if (_json.containsKey("rowStatus")) { |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 1717 | rowStatus = (_json["rowStatus"] as core.List) |
Jakob Andersen | 4ce761d | 2018-04-19 11:19:11 +0200 | [diff] [blame] | 1718 | .map<RowStatus>((value) => new RowStatus.fromJson(value)) |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1719 | .toList(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1720 | } |
| 1721 | } |
| 1722 | |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 1723 | core.Map<core.String, core.Object> toJson() { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1724 | final core.Map<core.String, core.Object> _json = |
| 1725 | new core.Map<core.String, core.Object>(); |
Martin Kustermann | f9c50a2 | 2014-09-10 15:26:11 +0200 | [diff] [blame] | 1726 | 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 | } |