OLD | NEW |
(Empty) | |
| 1 library googleapis.doubleclicksearch.v2; |
| 2 |
| 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; |
| 7 |
| 8 import "package:crypto/crypto.dart" as crypto; |
| 9 import 'package:http/http.dart' as http; |
| 10 import '../src/common_internal.dart' as common_internal; |
| 11 import '../common/common.dart' as common; |
| 12 |
| 13 export '../common/common.dart' show ApiRequestError; |
| 14 export '../common/common.dart' show DetailedApiRequestError; |
| 15 |
| 16 /** |
| 17 * Report and modify your advertising data in DoubleClick Search (for example, |
| 18 * campaigns, ad groups, keywords, and conversions). |
| 19 */ |
| 20 class DoubleclicksearchApi { |
| 21 /** View and manage your advertising data in DoubleClick Search */ |
| 22 static const DoubleclicksearchScope = "https://www.googleapis.com/auth/doublec
licksearch"; |
| 23 |
| 24 |
| 25 final common_internal.ApiRequester _requester; |
| 26 |
| 27 ConversionResourceApi get conversion => new ConversionResourceApi(_requester); |
| 28 ReportsResourceApi get reports => new ReportsResourceApi(_requester); |
| 29 SavedColumnsResourceApi get savedColumns => new SavedColumnsResourceApi(_reque
ster); |
| 30 |
| 31 DoubleclicksearchApi(http.Client client) : |
| 32 _requester = new common_internal.ApiRequester(client, "https://www.googlea
pis.com/", "/doubleclicksearch/v2/"); |
| 33 } |
| 34 |
| 35 |
| 36 /** Not documented yet. */ |
| 37 class ConversionResourceApi { |
| 38 final common_internal.ApiRequester _requester; |
| 39 |
| 40 ConversionResourceApi(common_internal.ApiRequester client) : |
| 41 _requester = client; |
| 42 |
| 43 /** |
| 44 * Retrieves a list of conversions from a DoubleClick Search engine account. |
| 45 * |
| 46 * Request parameters: |
| 47 * |
| 48 * [agencyId] - Numeric ID of the agency. |
| 49 * |
| 50 * [advertiserId] - Numeric ID of the advertiser. |
| 51 * |
| 52 * [engineAccountId] - Numeric ID of the engine account. |
| 53 * |
| 54 * [endDate] - Last date (inclusive) on which to retrieve conversions. Format |
| 55 * is yyyymmdd. |
| 56 * Value must be between "20091101" and "99991231". |
| 57 * |
| 58 * [rowCount] - The number of conversions to return per call. |
| 59 * Value must be between "1" and "1000". |
| 60 * |
| 61 * [startDate] - First date (inclusive) on which to retrieve conversions. |
| 62 * Format is yyyymmdd. |
| 63 * Value must be between "20091101" and "99991231". |
| 64 * |
| 65 * [startRow] - The 0-based starting index for retrieving conversions results. |
| 66 * |
| 67 * [adGroupId] - Numeric ID of the ad group. |
| 68 * |
| 69 * [adId] - Numeric ID of the ad. |
| 70 * |
| 71 * [campaignId] - Numeric ID of the campaign. |
| 72 * |
| 73 * [criterionId] - Numeric ID of the criterion. |
| 74 * |
| 75 * Completes with a [ConversionList]. |
| 76 * |
| 77 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 78 * error. |
| 79 * |
| 80 * If the used [http.Client] completes with an error when making a REST call, |
| 81 * this method will complete with the same error. |
| 82 */ |
| 83 async.Future<ConversionList> get(core.String agencyId, core.String advertiserI
d, core.String engineAccountId, core.int endDate, core.int rowCount, core.int st
artDate, core.int startRow, {core.String adGroupId, core.String adId, core.Strin
g campaignId, core.String criterionId}) { |
| 84 var _url = null; |
| 85 var _queryParams = new core.Map(); |
| 86 var _uploadMedia = null; |
| 87 var _uploadOptions = null; |
| 88 var _downloadOptions = common.DownloadOptions.Metadata; |
| 89 var _body = null; |
| 90 |
| 91 if (agencyId == null) { |
| 92 throw new core.ArgumentError("Parameter agencyId is required."); |
| 93 } |
| 94 if (advertiserId == null) { |
| 95 throw new core.ArgumentError("Parameter advertiserId is required."); |
| 96 } |
| 97 if (engineAccountId == null) { |
| 98 throw new core.ArgumentError("Parameter engineAccountId is required."); |
| 99 } |
| 100 if (endDate == null) { |
| 101 throw new core.ArgumentError("Parameter endDate is required."); |
| 102 } |
| 103 _queryParams["endDate"] = ["${endDate}"]; |
| 104 if (rowCount == null) { |
| 105 throw new core.ArgumentError("Parameter rowCount is required."); |
| 106 } |
| 107 _queryParams["rowCount"] = ["${rowCount}"]; |
| 108 if (startDate == null) { |
| 109 throw new core.ArgumentError("Parameter startDate is required."); |
| 110 } |
| 111 _queryParams["startDate"] = ["${startDate}"]; |
| 112 if (startRow == null) { |
| 113 throw new core.ArgumentError("Parameter startRow is required."); |
| 114 } |
| 115 _queryParams["startRow"] = ["${startRow}"]; |
| 116 if (adGroupId != null) { |
| 117 _queryParams["adGroupId"] = [adGroupId]; |
| 118 } |
| 119 if (adId != null) { |
| 120 _queryParams["adId"] = [adId]; |
| 121 } |
| 122 if (campaignId != null) { |
| 123 _queryParams["campaignId"] = [campaignId]; |
| 124 } |
| 125 if (criterionId != null) { |
| 126 _queryParams["criterionId"] = [criterionId]; |
| 127 } |
| 128 |
| 129 |
| 130 _url = 'agency/' + common_internal.Escaper.ecapeVariable('$agencyId') + '/ad
vertiser/' + common_internal.Escaper.ecapeVariable('$advertiserId') + '/engine/'
+ common_internal.Escaper.ecapeVariable('$engineAccountId') + '/conversion'; |
| 131 |
| 132 var _response = _requester.request(_url, |
| 133 "GET", |
| 134 body: _body, |
| 135 queryParams: _queryParams, |
| 136 uploadOptions: _uploadOptions, |
| 137 uploadMedia: _uploadMedia, |
| 138 downloadOptions: _downloadOptions); |
| 139 return _response.then((data) => new ConversionList.fromJson(data)); |
| 140 } |
| 141 |
| 142 /** |
| 143 * Inserts a batch of new conversions into DoubleClick Search. |
| 144 * |
| 145 * [request] - The metadata request object. |
| 146 * |
| 147 * Request parameters: |
| 148 * |
| 149 * Completes with a [ConversionList]. |
| 150 * |
| 151 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 152 * error. |
| 153 * |
| 154 * If the used [http.Client] completes with an error when making a REST call, |
| 155 * this method will complete with the same error. |
| 156 */ |
| 157 async.Future<ConversionList> insert(ConversionList request) { |
| 158 var _url = null; |
| 159 var _queryParams = new core.Map(); |
| 160 var _uploadMedia = null; |
| 161 var _uploadOptions = null; |
| 162 var _downloadOptions = common.DownloadOptions.Metadata; |
| 163 var _body = null; |
| 164 |
| 165 if (request != null) { |
| 166 _body = convert.JSON.encode((request).toJson()); |
| 167 } |
| 168 |
| 169 |
| 170 _url = 'conversion'; |
| 171 |
| 172 var _response = _requester.request(_url, |
| 173 "POST", |
| 174 body: _body, |
| 175 queryParams: _queryParams, |
| 176 uploadOptions: _uploadOptions, |
| 177 uploadMedia: _uploadMedia, |
| 178 downloadOptions: _downloadOptions); |
| 179 return _response.then((data) => new ConversionList.fromJson(data)); |
| 180 } |
| 181 |
| 182 /** |
| 183 * Updates a batch of conversions in DoubleClick Search. This method supports |
| 184 * patch semantics. |
| 185 * |
| 186 * [request] - The metadata request object. |
| 187 * |
| 188 * Request parameters: |
| 189 * |
| 190 * [advertiserId] - Numeric ID of the advertiser. |
| 191 * |
| 192 * [agencyId] - Numeric ID of the agency. |
| 193 * |
| 194 * [endDate] - Last date (inclusive) on which to retrieve conversions. Format |
| 195 * is yyyymmdd. |
| 196 * Value must be between "20091101" and "99991231". |
| 197 * |
| 198 * [engineAccountId] - Numeric ID of the engine account. |
| 199 * |
| 200 * [rowCount] - The number of conversions to return per call. |
| 201 * Value must be between "1" and "1000". |
| 202 * |
| 203 * [startDate] - First date (inclusive) on which to retrieve conversions. |
| 204 * Format is yyyymmdd. |
| 205 * Value must be between "20091101" and "99991231". |
| 206 * |
| 207 * [startRow] - The 0-based starting index for retrieving conversions results. |
| 208 * |
| 209 * Completes with a [ConversionList]. |
| 210 * |
| 211 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 212 * error. |
| 213 * |
| 214 * If the used [http.Client] completes with an error when making a REST call, |
| 215 * this method will complete with the same error. |
| 216 */ |
| 217 async.Future<ConversionList> patch(ConversionList request, core.String adverti
serId, core.String agencyId, core.int endDate, core.String engineAccountId, core
.int rowCount, core.int startDate, core.int startRow) { |
| 218 var _url = null; |
| 219 var _queryParams = new core.Map(); |
| 220 var _uploadMedia = null; |
| 221 var _uploadOptions = null; |
| 222 var _downloadOptions = common.DownloadOptions.Metadata; |
| 223 var _body = null; |
| 224 |
| 225 if (request != null) { |
| 226 _body = convert.JSON.encode((request).toJson()); |
| 227 } |
| 228 if (advertiserId == null) { |
| 229 throw new core.ArgumentError("Parameter advertiserId is required."); |
| 230 } |
| 231 _queryParams["advertiserId"] = [advertiserId]; |
| 232 if (agencyId == null) { |
| 233 throw new core.ArgumentError("Parameter agencyId is required."); |
| 234 } |
| 235 _queryParams["agencyId"] = [agencyId]; |
| 236 if (endDate == null) { |
| 237 throw new core.ArgumentError("Parameter endDate is required."); |
| 238 } |
| 239 _queryParams["endDate"] = ["${endDate}"]; |
| 240 if (engineAccountId == null) { |
| 241 throw new core.ArgumentError("Parameter engineAccountId is required."); |
| 242 } |
| 243 _queryParams["engineAccountId"] = [engineAccountId]; |
| 244 if (rowCount == null) { |
| 245 throw new core.ArgumentError("Parameter rowCount is required."); |
| 246 } |
| 247 _queryParams["rowCount"] = ["${rowCount}"]; |
| 248 if (startDate == null) { |
| 249 throw new core.ArgumentError("Parameter startDate is required."); |
| 250 } |
| 251 _queryParams["startDate"] = ["${startDate}"]; |
| 252 if (startRow == null) { |
| 253 throw new core.ArgumentError("Parameter startRow is required."); |
| 254 } |
| 255 _queryParams["startRow"] = ["${startRow}"]; |
| 256 |
| 257 |
| 258 _url = 'conversion'; |
| 259 |
| 260 var _response = _requester.request(_url, |
| 261 "PATCH", |
| 262 body: _body, |
| 263 queryParams: _queryParams, |
| 264 uploadOptions: _uploadOptions, |
| 265 uploadMedia: _uploadMedia, |
| 266 downloadOptions: _downloadOptions); |
| 267 return _response.then((data) => new ConversionList.fromJson(data)); |
| 268 } |
| 269 |
| 270 /** |
| 271 * Updates a batch of conversions in DoubleClick Search. |
| 272 * |
| 273 * [request] - The metadata request object. |
| 274 * |
| 275 * Request parameters: |
| 276 * |
| 277 * Completes with a [ConversionList]. |
| 278 * |
| 279 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 280 * error. |
| 281 * |
| 282 * If the used [http.Client] completes with an error when making a REST call, |
| 283 * this method will complete with the same error. |
| 284 */ |
| 285 async.Future<ConversionList> update(ConversionList request) { |
| 286 var _url = null; |
| 287 var _queryParams = new core.Map(); |
| 288 var _uploadMedia = null; |
| 289 var _uploadOptions = null; |
| 290 var _downloadOptions = common.DownloadOptions.Metadata; |
| 291 var _body = null; |
| 292 |
| 293 if (request != null) { |
| 294 _body = convert.JSON.encode((request).toJson()); |
| 295 } |
| 296 |
| 297 |
| 298 _url = 'conversion'; |
| 299 |
| 300 var _response = _requester.request(_url, |
| 301 "PUT", |
| 302 body: _body, |
| 303 queryParams: _queryParams, |
| 304 uploadOptions: _uploadOptions, |
| 305 uploadMedia: _uploadMedia, |
| 306 downloadOptions: _downloadOptions); |
| 307 return _response.then((data) => new ConversionList.fromJson(data)); |
| 308 } |
| 309 |
| 310 /** |
| 311 * Updates the availabilities of a batch of floodlight activities in |
| 312 * DoubleClick Search. |
| 313 * |
| 314 * [request] - The metadata request object. |
| 315 * |
| 316 * Request parameters: |
| 317 * |
| 318 * Completes with a [UpdateAvailabilityResponse]. |
| 319 * |
| 320 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 321 * error. |
| 322 * |
| 323 * If the used [http.Client] completes with an error when making a REST call, |
| 324 * this method will complete with the same error. |
| 325 */ |
| 326 async.Future<UpdateAvailabilityResponse> updateAvailability(UpdateAvailability
Request request) { |
| 327 var _url = null; |
| 328 var _queryParams = new core.Map(); |
| 329 var _uploadMedia = null; |
| 330 var _uploadOptions = null; |
| 331 var _downloadOptions = common.DownloadOptions.Metadata; |
| 332 var _body = null; |
| 333 |
| 334 if (request != null) { |
| 335 _body = convert.JSON.encode((request).toJson()); |
| 336 } |
| 337 |
| 338 |
| 339 _url = 'conversion/updateAvailability'; |
| 340 |
| 341 var _response = _requester.request(_url, |
| 342 "POST", |
| 343 body: _body, |
| 344 queryParams: _queryParams, |
| 345 uploadOptions: _uploadOptions, |
| 346 uploadMedia: _uploadMedia, |
| 347 downloadOptions: _downloadOptions); |
| 348 return _response.then((data) => new UpdateAvailabilityResponse.fromJson(data
)); |
| 349 } |
| 350 |
| 351 } |
| 352 |
| 353 |
| 354 /** Not documented yet. */ |
| 355 class ReportsResourceApi { |
| 356 final common_internal.ApiRequester _requester; |
| 357 |
| 358 ReportsResourceApi(common_internal.ApiRequester client) : |
| 359 _requester = client; |
| 360 |
| 361 /** |
| 362 * Generates and returns a report immediately. |
| 363 * |
| 364 * [request_1] - The metadata request object. |
| 365 * |
| 366 * Request parameters: |
| 367 * |
| 368 * Completes with a [Report]. |
| 369 * |
| 370 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 371 * error. |
| 372 * |
| 373 * If the used [http.Client] completes with an error when making a REST call, |
| 374 * this method will complete with the same error. |
| 375 */ |
| 376 async.Future<Report> generate(ReportRequest request_1) { |
| 377 var _url = null; |
| 378 var _queryParams = new core.Map(); |
| 379 var _uploadMedia = null; |
| 380 var _uploadOptions = null; |
| 381 var _downloadOptions = common.DownloadOptions.Metadata; |
| 382 var _body = null; |
| 383 |
| 384 if (request_1 != null) { |
| 385 _body = convert.JSON.encode((request_1).toJson()); |
| 386 } |
| 387 |
| 388 |
| 389 _url = 'reports/generate'; |
| 390 |
| 391 var _response = _requester.request(_url, |
| 392 "POST", |
| 393 body: _body, |
| 394 queryParams: _queryParams, |
| 395 uploadOptions: _uploadOptions, |
| 396 uploadMedia: _uploadMedia, |
| 397 downloadOptions: _downloadOptions); |
| 398 return _response.then((data) => new Report.fromJson(data)); |
| 399 } |
| 400 |
| 401 /** |
| 402 * Polls for the status of a report request. |
| 403 * |
| 404 * Request parameters: |
| 405 * |
| 406 * [reportId] - ID of the report request being polled. |
| 407 * |
| 408 * Completes with a [Report]. |
| 409 * |
| 410 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 411 * error. |
| 412 * |
| 413 * If the used [http.Client] completes with an error when making a REST call, |
| 414 * this method will complete with the same error. |
| 415 */ |
| 416 async.Future<Report> get(core.String reportId) { |
| 417 var _url = null; |
| 418 var _queryParams = new core.Map(); |
| 419 var _uploadMedia = null; |
| 420 var _uploadOptions = null; |
| 421 var _downloadOptions = common.DownloadOptions.Metadata; |
| 422 var _body = null; |
| 423 |
| 424 if (reportId == null) { |
| 425 throw new core.ArgumentError("Parameter reportId is required."); |
| 426 } |
| 427 |
| 428 |
| 429 _url = 'reports/' + common_internal.Escaper.ecapeVariable('$reportId'); |
| 430 |
| 431 var _response = _requester.request(_url, |
| 432 "GET", |
| 433 body: _body, |
| 434 queryParams: _queryParams, |
| 435 uploadOptions: _uploadOptions, |
| 436 uploadMedia: _uploadMedia, |
| 437 downloadOptions: _downloadOptions); |
| 438 return _response.then((data) => new Report.fromJson(data)); |
| 439 } |
| 440 |
| 441 /** |
| 442 * Downloads a report file. |
| 443 * |
| 444 * Request parameters: |
| 445 * |
| 446 * [reportId] - ID of the report. |
| 447 * |
| 448 * [reportFragment] - The index of the report fragment to download. |
| 449 * |
| 450 * [downloadOptions] - Options for downloading. A download can be either a |
| 451 * Metadata (default) or Media download. Partial Media downloads are possible |
| 452 * as well. |
| 453 * |
| 454 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 455 * error. |
| 456 * |
| 457 * If the used [http.Client] completes with an error when making a REST call, |
| 458 * this method will complete with the same error. |
| 459 */ |
| 460 async.Future getFile(core.String reportId, core.int reportFragment, {common.Do
wnloadOptions downloadOptions: common.DownloadOptions.Metadata}) { |
| 461 var _url = null; |
| 462 var _queryParams = new core.Map(); |
| 463 var _uploadMedia = null; |
| 464 var _uploadOptions = null; |
| 465 var _downloadOptions = common.DownloadOptions.Metadata; |
| 466 var _body = null; |
| 467 |
| 468 if (reportId == null) { |
| 469 throw new core.ArgumentError("Parameter reportId is required."); |
| 470 } |
| 471 if (reportFragment == null) { |
| 472 throw new core.ArgumentError("Parameter reportFragment is required."); |
| 473 } |
| 474 |
| 475 _downloadOptions = downloadOptions; |
| 476 |
| 477 _url = 'reports/' + common_internal.Escaper.ecapeVariable('$reportId') + '/f
iles/' + common_internal.Escaper.ecapeVariable('$reportFragment'); |
| 478 |
| 479 var _response = _requester.request(_url, |
| 480 "GET", |
| 481 body: _body, |
| 482 queryParams: _queryParams, |
| 483 uploadOptions: _uploadOptions, |
| 484 uploadMedia: _uploadMedia, |
| 485 downloadOptions: _downloadOptions); |
| 486 if (_downloadOptions == null || |
| 487 _downloadOptions == common.DownloadOptions.Metadata) { |
| 488 return _response.then((data) => null); |
| 489 } else { |
| 490 return _response; |
| 491 } |
| 492 } |
| 493 |
| 494 /** |
| 495 * Inserts a report request into the reporting system. |
| 496 * |
| 497 * [request_1] - The metadata request object. |
| 498 * |
| 499 * Request parameters: |
| 500 * |
| 501 * Completes with a [Report]. |
| 502 * |
| 503 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 504 * error. |
| 505 * |
| 506 * If the used [http.Client] completes with an error when making a REST call, |
| 507 * this method will complete with the same error. |
| 508 */ |
| 509 async.Future<Report> request(ReportRequest request_1) { |
| 510 var _url = null; |
| 511 var _queryParams = new core.Map(); |
| 512 var _uploadMedia = null; |
| 513 var _uploadOptions = null; |
| 514 var _downloadOptions = common.DownloadOptions.Metadata; |
| 515 var _body = null; |
| 516 |
| 517 if (request_1 != null) { |
| 518 _body = convert.JSON.encode((request_1).toJson()); |
| 519 } |
| 520 |
| 521 |
| 522 _url = 'reports'; |
| 523 |
| 524 var _response = _requester.request(_url, |
| 525 "POST", |
| 526 body: _body, |
| 527 queryParams: _queryParams, |
| 528 uploadOptions: _uploadOptions, |
| 529 uploadMedia: _uploadMedia, |
| 530 downloadOptions: _downloadOptions); |
| 531 return _response.then((data) => new Report.fromJson(data)); |
| 532 } |
| 533 |
| 534 } |
| 535 |
| 536 |
| 537 /** Not documented yet. */ |
| 538 class SavedColumnsResourceApi { |
| 539 final common_internal.ApiRequester _requester; |
| 540 |
| 541 SavedColumnsResourceApi(common_internal.ApiRequester client) : |
| 542 _requester = client; |
| 543 |
| 544 /** |
| 545 * Retrieve the list of saved columns for a specified advertiser. |
| 546 * |
| 547 * Request parameters: |
| 548 * |
| 549 * [agencyId] - DS ID of the agency. |
| 550 * |
| 551 * [advertiserId] - DS ID of the advertiser. |
| 552 * |
| 553 * Completes with a [SavedColumnList]. |
| 554 * |
| 555 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 556 * error. |
| 557 * |
| 558 * If the used [http.Client] completes with an error when making a REST call, |
| 559 * this method will complete with the same error. |
| 560 */ |
| 561 async.Future<SavedColumnList> list(core.String agencyId, core.String advertise
rId) { |
| 562 var _url = null; |
| 563 var _queryParams = new core.Map(); |
| 564 var _uploadMedia = null; |
| 565 var _uploadOptions = null; |
| 566 var _downloadOptions = common.DownloadOptions.Metadata; |
| 567 var _body = null; |
| 568 |
| 569 if (agencyId == null) { |
| 570 throw new core.ArgumentError("Parameter agencyId is required."); |
| 571 } |
| 572 if (advertiserId == null) { |
| 573 throw new core.ArgumentError("Parameter advertiserId is required."); |
| 574 } |
| 575 |
| 576 |
| 577 _url = 'agency/' + common_internal.Escaper.ecapeVariable('$agencyId') + '/ad
vertiser/' + common_internal.Escaper.ecapeVariable('$advertiserId') + '/savedcol
umns'; |
| 578 |
| 579 var _response = _requester.request(_url, |
| 580 "GET", |
| 581 body: _body, |
| 582 queryParams: _queryParams, |
| 583 uploadOptions: _uploadOptions, |
| 584 uploadMedia: _uploadMedia, |
| 585 downloadOptions: _downloadOptions); |
| 586 return _response.then((data) => new SavedColumnList.fromJson(data)); |
| 587 } |
| 588 |
| 589 } |
| 590 |
| 591 |
| 592 |
| 593 /** A message containing availability data relevant to DoubleClick Search. */ |
| 594 class Availability { |
| 595 /** DS advertiser ID. */ |
| 596 core.String advertiserId; |
| 597 |
| 598 /** DS agency ID. */ |
| 599 core.String agencyId; |
| 600 |
| 601 /** |
| 602 * The time by which all conversions have been uploaded, in epoch millis UTC. |
| 603 */ |
| 604 core.String availabilityTimestamp; |
| 605 |
| 606 /** |
| 607 * The numeric segmentation identifier (for example, DoubleClick Search |
| 608 * Floodlight activity ID). |
| 609 */ |
| 610 core.String segmentationId; |
| 611 |
| 612 /** |
| 613 * The friendly segmentation identifier (for example, DoubleClick Search |
| 614 * Floodlight activity name). |
| 615 */ |
| 616 core.String segmentationName; |
| 617 |
| 618 /** |
| 619 * The segmentation type that this availability is for (its default value is |
| 620 * FLOODLIGHT). |
| 621 */ |
| 622 core.String segmentationType; |
| 623 |
| 624 |
| 625 Availability(); |
| 626 |
| 627 Availability.fromJson(core.Map _json) { |
| 628 if (_json.containsKey("advertiserId")) { |
| 629 advertiserId = _json["advertiserId"]; |
| 630 } |
| 631 if (_json.containsKey("agencyId")) { |
| 632 agencyId = _json["agencyId"]; |
| 633 } |
| 634 if (_json.containsKey("availabilityTimestamp")) { |
| 635 availabilityTimestamp = _json["availabilityTimestamp"]; |
| 636 } |
| 637 if (_json.containsKey("segmentationId")) { |
| 638 segmentationId = _json["segmentationId"]; |
| 639 } |
| 640 if (_json.containsKey("segmentationName")) { |
| 641 segmentationName = _json["segmentationName"]; |
| 642 } |
| 643 if (_json.containsKey("segmentationType")) { |
| 644 segmentationType = _json["segmentationType"]; |
| 645 } |
| 646 } |
| 647 |
| 648 core.Map toJson() { |
| 649 var _json = new core.Map(); |
| 650 if (advertiserId != null) { |
| 651 _json["advertiserId"] = advertiserId; |
| 652 } |
| 653 if (agencyId != null) { |
| 654 _json["agencyId"] = agencyId; |
| 655 } |
| 656 if (availabilityTimestamp != null) { |
| 657 _json["availabilityTimestamp"] = availabilityTimestamp; |
| 658 } |
| 659 if (segmentationId != null) { |
| 660 _json["segmentationId"] = segmentationId; |
| 661 } |
| 662 if (segmentationName != null) { |
| 663 _json["segmentationName"] = segmentationName; |
| 664 } |
| 665 if (segmentationType != null) { |
| 666 _json["segmentationType"] = segmentationType; |
| 667 } |
| 668 return _json; |
| 669 } |
| 670 } |
| 671 |
| 672 |
| 673 /** A conversion containing data relevant to DoubleClick Search. */ |
| 674 class Conversion { |
| 675 /** DS ad group ID. */ |
| 676 core.String adGroupId; |
| 677 |
| 678 /** DS ad ID. */ |
| 679 core.String adId; |
| 680 |
| 681 /** DS advertiser ID. */ |
| 682 core.String advertiserId; |
| 683 |
| 684 /** DS agency ID. */ |
| 685 core.String agencyId; |
| 686 |
| 687 /** DS campaign ID. */ |
| 688 core.String campaignId; |
| 689 |
| 690 /** DS click ID for the conversion. */ |
| 691 core.String clickId; |
| 692 |
| 693 /** Advertiser-provided ID for the conversion, also known as the order ID. */ |
| 694 core.String conversionId; |
| 695 |
| 696 /** |
| 697 * The time at which the conversion was last modified, in epoch millis UTC. |
| 698 */ |
| 699 core.String conversionModifiedTimestamp; |
| 700 |
| 701 /** The time at which the conversion took place, in epoch millis UTC. */ |
| 702 core.String conversionTimestamp; |
| 703 |
| 704 /** DS criterion (keyword) ID. */ |
| 705 core.String criterionId; |
| 706 |
| 707 /** |
| 708 * The currency code for the conversion's revenue. Should be in ISO 4217 |
| 709 * alphabetic (3-char) format. |
| 710 */ |
| 711 core.String currencyCode; |
| 712 |
| 713 /** |
| 714 * Custom dimensions for the conversion, which can be used to filter data in a |
| 715 * report. |
| 716 */ |
| 717 core.List<CustomDimension> customDimension; |
| 718 |
| 719 /** Custom metrics for the conversion. */ |
| 720 core.List<CustomMetric> customMetric; |
| 721 |
| 722 /** DS conversion ID. */ |
| 723 core.String dsConversionId; |
| 724 |
| 725 /** DS engine account ID. */ |
| 726 core.String engineAccountId; |
| 727 |
| 728 /** The advertiser-provided order id for the conversion. */ |
| 729 core.String floodlightOrderId; |
| 730 |
| 731 /** The quantity of this conversion, in millis. */ |
| 732 core.String quantityMillis; |
| 733 |
| 734 /** The revenue amount of this TRANSACTION conversion, in micros. */ |
| 735 core.String revenueMicros; |
| 736 |
| 737 /** |
| 738 * The numeric segmentation identifier (for example, DoubleClick Search |
| 739 * Floodlight activity ID). |
| 740 */ |
| 741 core.String segmentationId; |
| 742 |
| 743 /** |
| 744 * The friendly segmentation identifier (for example, DoubleClick Search |
| 745 * Floodlight activity name). |
| 746 */ |
| 747 core.String segmentationName; |
| 748 |
| 749 /** The segmentation type of this conversion (for example, FLOODLIGHT). */ |
| 750 core.String segmentationType; |
| 751 |
| 752 /** The state of the conversion, that is, either ACTIVE or DELETED. */ |
| 753 core.String state; |
| 754 |
| 755 /** |
| 756 * The type of the conversion, that is, either ACTION or TRANSACTION. An |
| 757 * ACTION conversion is an action by the user that has no monetarily |
| 758 * quantifiable value, while a TRANSACTION conversion is an action that does |
| 759 * have a monetarily quantifiable value. Examples are email list signups |
| 760 * (ACTION) versus ecommerce purchases (TRANSACTION). |
| 761 */ |
| 762 core.String type; |
| 763 |
| 764 |
| 765 Conversion(); |
| 766 |
| 767 Conversion.fromJson(core.Map _json) { |
| 768 if (_json.containsKey("adGroupId")) { |
| 769 adGroupId = _json["adGroupId"]; |
| 770 } |
| 771 if (_json.containsKey("adId")) { |
| 772 adId = _json["adId"]; |
| 773 } |
| 774 if (_json.containsKey("advertiserId")) { |
| 775 advertiserId = _json["advertiserId"]; |
| 776 } |
| 777 if (_json.containsKey("agencyId")) { |
| 778 agencyId = _json["agencyId"]; |
| 779 } |
| 780 if (_json.containsKey("campaignId")) { |
| 781 campaignId = _json["campaignId"]; |
| 782 } |
| 783 if (_json.containsKey("clickId")) { |
| 784 clickId = _json["clickId"]; |
| 785 } |
| 786 if (_json.containsKey("conversionId")) { |
| 787 conversionId = _json["conversionId"]; |
| 788 } |
| 789 if (_json.containsKey("conversionModifiedTimestamp")) { |
| 790 conversionModifiedTimestamp = _json["conversionModifiedTimestamp"]; |
| 791 } |
| 792 if (_json.containsKey("conversionTimestamp")) { |
| 793 conversionTimestamp = _json["conversionTimestamp"]; |
| 794 } |
| 795 if (_json.containsKey("criterionId")) { |
| 796 criterionId = _json["criterionId"]; |
| 797 } |
| 798 if (_json.containsKey("currencyCode")) { |
| 799 currencyCode = _json["currencyCode"]; |
| 800 } |
| 801 if (_json.containsKey("customDimension")) { |
| 802 customDimension = _json["customDimension"].map((value) => new CustomDimens
ion.fromJson(value)).toList(); |
| 803 } |
| 804 if (_json.containsKey("customMetric")) { |
| 805 customMetric = _json["customMetric"].map((value) => new CustomMetric.fromJ
son(value)).toList(); |
| 806 } |
| 807 if (_json.containsKey("dsConversionId")) { |
| 808 dsConversionId = _json["dsConversionId"]; |
| 809 } |
| 810 if (_json.containsKey("engineAccountId")) { |
| 811 engineAccountId = _json["engineAccountId"]; |
| 812 } |
| 813 if (_json.containsKey("floodlightOrderId")) { |
| 814 floodlightOrderId = _json["floodlightOrderId"]; |
| 815 } |
| 816 if (_json.containsKey("quantityMillis")) { |
| 817 quantityMillis = _json["quantityMillis"]; |
| 818 } |
| 819 if (_json.containsKey("revenueMicros")) { |
| 820 revenueMicros = _json["revenueMicros"]; |
| 821 } |
| 822 if (_json.containsKey("segmentationId")) { |
| 823 segmentationId = _json["segmentationId"]; |
| 824 } |
| 825 if (_json.containsKey("segmentationName")) { |
| 826 segmentationName = _json["segmentationName"]; |
| 827 } |
| 828 if (_json.containsKey("segmentationType")) { |
| 829 segmentationType = _json["segmentationType"]; |
| 830 } |
| 831 if (_json.containsKey("state")) { |
| 832 state = _json["state"]; |
| 833 } |
| 834 if (_json.containsKey("type")) { |
| 835 type = _json["type"]; |
| 836 } |
| 837 } |
| 838 |
| 839 core.Map toJson() { |
| 840 var _json = new core.Map(); |
| 841 if (adGroupId != null) { |
| 842 _json["adGroupId"] = adGroupId; |
| 843 } |
| 844 if (adId != null) { |
| 845 _json["adId"] = adId; |
| 846 } |
| 847 if (advertiserId != null) { |
| 848 _json["advertiserId"] = advertiserId; |
| 849 } |
| 850 if (agencyId != null) { |
| 851 _json["agencyId"] = agencyId; |
| 852 } |
| 853 if (campaignId != null) { |
| 854 _json["campaignId"] = campaignId; |
| 855 } |
| 856 if (clickId != null) { |
| 857 _json["clickId"] = clickId; |
| 858 } |
| 859 if (conversionId != null) { |
| 860 _json["conversionId"] = conversionId; |
| 861 } |
| 862 if (conversionModifiedTimestamp != null) { |
| 863 _json["conversionModifiedTimestamp"] = conversionModifiedTimestamp; |
| 864 } |
| 865 if (conversionTimestamp != null) { |
| 866 _json["conversionTimestamp"] = conversionTimestamp; |
| 867 } |
| 868 if (criterionId != null) { |
| 869 _json["criterionId"] = criterionId; |
| 870 } |
| 871 if (currencyCode != null) { |
| 872 _json["currencyCode"] = currencyCode; |
| 873 } |
| 874 if (customDimension != null) { |
| 875 _json["customDimension"] = customDimension.map((value) => (value).toJson()
).toList(); |
| 876 } |
| 877 if (customMetric != null) { |
| 878 _json["customMetric"] = customMetric.map((value) => (value).toJson()).toLi
st(); |
| 879 } |
| 880 if (dsConversionId != null) { |
| 881 _json["dsConversionId"] = dsConversionId; |
| 882 } |
| 883 if (engineAccountId != null) { |
| 884 _json["engineAccountId"] = engineAccountId; |
| 885 } |
| 886 if (floodlightOrderId != null) { |
| 887 _json["floodlightOrderId"] = floodlightOrderId; |
| 888 } |
| 889 if (quantityMillis != null) { |
| 890 _json["quantityMillis"] = quantityMillis; |
| 891 } |
| 892 if (revenueMicros != null) { |
| 893 _json["revenueMicros"] = revenueMicros; |
| 894 } |
| 895 if (segmentationId != null) { |
| 896 _json["segmentationId"] = segmentationId; |
| 897 } |
| 898 if (segmentationName != null) { |
| 899 _json["segmentationName"] = segmentationName; |
| 900 } |
| 901 if (segmentationType != null) { |
| 902 _json["segmentationType"] = segmentationType; |
| 903 } |
| 904 if (state != null) { |
| 905 _json["state"] = state; |
| 906 } |
| 907 if (type != null) { |
| 908 _json["type"] = type; |
| 909 } |
| 910 return _json; |
| 911 } |
| 912 } |
| 913 |
| 914 |
| 915 /** A list of conversions. */ |
| 916 class ConversionList { |
| 917 /** The conversions being requested. */ |
| 918 core.List<Conversion> conversion; |
| 919 |
| 920 /** |
| 921 * Identifies this as a ConversionList resource. Value: the fixed string |
| 922 * doubleclicksearch#conversionList. |
| 923 */ |
| 924 core.String kind; |
| 925 |
| 926 |
| 927 ConversionList(); |
| 928 |
| 929 ConversionList.fromJson(core.Map _json) { |
| 930 if (_json.containsKey("conversion")) { |
| 931 conversion = _json["conversion"].map((value) => new Conversion.fromJson(va
lue)).toList(); |
| 932 } |
| 933 if (_json.containsKey("kind")) { |
| 934 kind = _json["kind"]; |
| 935 } |
| 936 } |
| 937 |
| 938 core.Map toJson() { |
| 939 var _json = new core.Map(); |
| 940 if (conversion != null) { |
| 941 _json["conversion"] = conversion.map((value) => (value).toJson()).toList()
; |
| 942 } |
| 943 if (kind != null) { |
| 944 _json["kind"] = kind; |
| 945 } |
| 946 return _json; |
| 947 } |
| 948 } |
| 949 |
| 950 |
| 951 /** A message containing the custome dimension. */ |
| 952 class CustomDimension { |
| 953 /** Custom dimension name. */ |
| 954 core.String name; |
| 955 |
| 956 /** Custom dimension value. */ |
| 957 core.String value; |
| 958 |
| 959 |
| 960 CustomDimension(); |
| 961 |
| 962 CustomDimension.fromJson(core.Map _json) { |
| 963 if (_json.containsKey("name")) { |
| 964 name = _json["name"]; |
| 965 } |
| 966 if (_json.containsKey("value")) { |
| 967 value = _json["value"]; |
| 968 } |
| 969 } |
| 970 |
| 971 core.Map toJson() { |
| 972 var _json = new core.Map(); |
| 973 if (name != null) { |
| 974 _json["name"] = name; |
| 975 } |
| 976 if (value != null) { |
| 977 _json["value"] = value; |
| 978 } |
| 979 return _json; |
| 980 } |
| 981 } |
| 982 |
| 983 |
| 984 /** A message containing the custome metric. */ |
| 985 class CustomMetric { |
| 986 /** Custom metric name. */ |
| 987 core.String name; |
| 988 |
| 989 /** Custom metric numeric value. */ |
| 990 core.double value; |
| 991 |
| 992 |
| 993 CustomMetric(); |
| 994 |
| 995 CustomMetric.fromJson(core.Map _json) { |
| 996 if (_json.containsKey("name")) { |
| 997 name = _json["name"]; |
| 998 } |
| 999 if (_json.containsKey("value")) { |
| 1000 value = _json["value"]; |
| 1001 } |
| 1002 } |
| 1003 |
| 1004 core.Map toJson() { |
| 1005 var _json = new core.Map(); |
| 1006 if (name != null) { |
| 1007 _json["name"] = name; |
| 1008 } |
| 1009 if (value != null) { |
| 1010 _json["value"] = value; |
| 1011 } |
| 1012 return _json; |
| 1013 } |
| 1014 } |
| 1015 |
| 1016 |
| 1017 /** Not documented yet. */ |
| 1018 class ReportFiles { |
| 1019 /** The size of this report file in bytes. */ |
| 1020 core.String byteCount; |
| 1021 |
| 1022 /** Use this url to download the report file. */ |
| 1023 core.String url; |
| 1024 |
| 1025 |
| 1026 ReportFiles(); |
| 1027 |
| 1028 ReportFiles.fromJson(core.Map _json) { |
| 1029 if (_json.containsKey("byteCount")) { |
| 1030 byteCount = _json["byteCount"]; |
| 1031 } |
| 1032 if (_json.containsKey("url")) { |
| 1033 url = _json["url"]; |
| 1034 } |
| 1035 } |
| 1036 |
| 1037 core.Map toJson() { |
| 1038 var _json = new core.Map(); |
| 1039 if (byteCount != null) { |
| 1040 _json["byteCount"] = byteCount; |
| 1041 } |
| 1042 if (url != null) { |
| 1043 _json["url"] = url; |
| 1044 } |
| 1045 return _json; |
| 1046 } |
| 1047 } |
| 1048 |
| 1049 |
| 1050 /** |
| 1051 * A DoubleClick Search report. This object contains the report request, some |
| 1052 * report metadata such as currency code, and the generated report rows or |
| 1053 * report files. |
| 1054 */ |
| 1055 class Report { |
| 1056 /** |
| 1057 * Asynchronous report only. Contains a list of generated report files once |
| 1058 * the report has succesfully completed. |
| 1059 */ |
| 1060 core.List<ReportFiles> files; |
| 1061 |
| 1062 /** Asynchronous report only. Id of the report. */ |
| 1063 core.String id; |
| 1064 |
| 1065 /** |
| 1066 * Asynchronous report only. True if and only if the report has completed |
| 1067 * successfully and the report files are ready to be downloaded. |
| 1068 */ |
| 1069 core.bool isReportReady; |
| 1070 |
| 1071 /** |
| 1072 * Identifies this as a Report resource. Value: the fixed string |
| 1073 * doubleclicksearch#report. |
| 1074 */ |
| 1075 core.String kind; |
| 1076 |
| 1077 /** |
| 1078 * The request that created the report. Optional fields not specified in the |
| 1079 * original request are filled with default values. |
| 1080 */ |
| 1081 ReportRequest request; |
| 1082 |
| 1083 /** |
| 1084 * The number of report rows generated by the report, not including headers. |
| 1085 */ |
| 1086 core.int rowCount; |
| 1087 |
| 1088 /** Synchronous report only. Generated report rows. */ |
| 1089 core.List<ReportRow> rows; |
| 1090 |
| 1091 /** |
| 1092 * The currency code of all monetary values produced in the report, including |
| 1093 * values that are set by users (e.g., keyword bid settings) and metrics |
| 1094 * (e.g., cost and revenue). The currency code of a report is determined by |
| 1095 * the statisticsCurrency field of the report request. |
| 1096 */ |
| 1097 core.String statisticsCurrencyCode; |
| 1098 |
| 1099 /** |
| 1100 * If all statistics of the report are sourced from the same time zone, this |
| 1101 * would be it. Otherwise the field is unset. |
| 1102 */ |
| 1103 core.String statisticsTimeZone; |
| 1104 |
| 1105 |
| 1106 Report(); |
| 1107 |
| 1108 Report.fromJson(core.Map _json) { |
| 1109 if (_json.containsKey("files")) { |
| 1110 files = _json["files"].map((value) => new ReportFiles.fromJson(value)).toL
ist(); |
| 1111 } |
| 1112 if (_json.containsKey("id")) { |
| 1113 id = _json["id"]; |
| 1114 } |
| 1115 if (_json.containsKey("isReportReady")) { |
| 1116 isReportReady = _json["isReportReady"]; |
| 1117 } |
| 1118 if (_json.containsKey("kind")) { |
| 1119 kind = _json["kind"]; |
| 1120 } |
| 1121 if (_json.containsKey("request")) { |
| 1122 request = new ReportRequest.fromJson(_json["request"]); |
| 1123 } |
| 1124 if (_json.containsKey("rowCount")) { |
| 1125 rowCount = _json["rowCount"]; |
| 1126 } |
| 1127 if (_json.containsKey("rows")) { |
| 1128 rows = _json["rows"].map((value) => new ReportRow.fromJson(value)).toList(
); |
| 1129 } |
| 1130 if (_json.containsKey("statisticsCurrencyCode")) { |
| 1131 statisticsCurrencyCode = _json["statisticsCurrencyCode"]; |
| 1132 } |
| 1133 if (_json.containsKey("statisticsTimeZone")) { |
| 1134 statisticsTimeZone = _json["statisticsTimeZone"]; |
| 1135 } |
| 1136 } |
| 1137 |
| 1138 core.Map toJson() { |
| 1139 var _json = new core.Map(); |
| 1140 if (files != null) { |
| 1141 _json["files"] = files.map((value) => (value).toJson()).toList(); |
| 1142 } |
| 1143 if (id != null) { |
| 1144 _json["id"] = id; |
| 1145 } |
| 1146 if (isReportReady != null) { |
| 1147 _json["isReportReady"] = isReportReady; |
| 1148 } |
| 1149 if (kind != null) { |
| 1150 _json["kind"] = kind; |
| 1151 } |
| 1152 if (request != null) { |
| 1153 _json["request"] = (request).toJson(); |
| 1154 } |
| 1155 if (rowCount != null) { |
| 1156 _json["rowCount"] = rowCount; |
| 1157 } |
| 1158 if (rows != null) { |
| 1159 _json["rows"] = rows; |
| 1160 } |
| 1161 if (statisticsCurrencyCode != null) { |
| 1162 _json["statisticsCurrencyCode"] = statisticsCurrencyCode; |
| 1163 } |
| 1164 if (statisticsTimeZone != null) { |
| 1165 _json["statisticsTimeZone"] = statisticsTimeZone; |
| 1166 } |
| 1167 return _json; |
| 1168 } |
| 1169 } |
| 1170 |
| 1171 |
| 1172 /** A request object used to create a DoubleClick Search report. */ |
| 1173 class ReportApiColumnSpec { |
| 1174 /** Name of a DoubleClick Search column to include in the report. */ |
| 1175 core.String columnName; |
| 1176 |
| 1177 /** |
| 1178 * Segments a report by a custom dimension. The report must be scoped to an |
| 1179 * advertiser or lower, and the custom dimension must already be set up in |
| 1180 * DoubleClick Search. The custom dimension name, which appears in DoubleClick |
| 1181 * Search, is case sensitive. |
| 1182 */ |
| 1183 core.String customDimensionName; |
| 1184 |
| 1185 /** |
| 1186 * Inclusive day in YYYY-MM-DD format. When provided, this overrides the |
| 1187 * overall time range of the report for this column only. Must be provided |
| 1188 * together with startDate. |
| 1189 */ |
| 1190 core.String endDate; |
| 1191 |
| 1192 /** |
| 1193 * Synchronous report only. Set to true to group by this column. Defaults to |
| 1194 * false. |
| 1195 */ |
| 1196 core.bool groupByColumn; |
| 1197 |
| 1198 /** |
| 1199 * Text used to identify this column in the report output; defaults to |
| 1200 * columnName or savedColumnName when not specified. This can be used to |
| 1201 * prevent collisions between DoubleClick Search columns and saved columns |
| 1202 * with the same name. |
| 1203 */ |
| 1204 core.String headerText; |
| 1205 |
| 1206 /** |
| 1207 * The platform that is used to provide data for the custom dimension. |
| 1208 * Acceptable values are "Floodlight". |
| 1209 */ |
| 1210 core.String platformSource; |
| 1211 |
| 1212 /** |
| 1213 * Name of a saved column to include in the report. The report must be scoped |
| 1214 * at advertiser or lower, and this saved column must already be created in |
| 1215 * the DoubleClick Search UI. |
| 1216 */ |
| 1217 core.String savedColumnName; |
| 1218 |
| 1219 /** |
| 1220 * Inclusive date in YYYY-MM-DD format. When provided, this overrides the |
| 1221 * overall time range of the report for this column only. Must be provided |
| 1222 * together with endDate. |
| 1223 */ |
| 1224 core.String startDate; |
| 1225 |
| 1226 |
| 1227 ReportApiColumnSpec(); |
| 1228 |
| 1229 ReportApiColumnSpec.fromJson(core.Map _json) { |
| 1230 if (_json.containsKey("columnName")) { |
| 1231 columnName = _json["columnName"]; |
| 1232 } |
| 1233 if (_json.containsKey("customDimensionName")) { |
| 1234 customDimensionName = _json["customDimensionName"]; |
| 1235 } |
| 1236 if (_json.containsKey("endDate")) { |
| 1237 endDate = _json["endDate"]; |
| 1238 } |
| 1239 if (_json.containsKey("groupByColumn")) { |
| 1240 groupByColumn = _json["groupByColumn"]; |
| 1241 } |
| 1242 if (_json.containsKey("headerText")) { |
| 1243 headerText = _json["headerText"]; |
| 1244 } |
| 1245 if (_json.containsKey("platformSource")) { |
| 1246 platformSource = _json["platformSource"]; |
| 1247 } |
| 1248 if (_json.containsKey("savedColumnName")) { |
| 1249 savedColumnName = _json["savedColumnName"]; |
| 1250 } |
| 1251 if (_json.containsKey("startDate")) { |
| 1252 startDate = _json["startDate"]; |
| 1253 } |
| 1254 } |
| 1255 |
| 1256 core.Map toJson() { |
| 1257 var _json = new core.Map(); |
| 1258 if (columnName != null) { |
| 1259 _json["columnName"] = columnName; |
| 1260 } |
| 1261 if (customDimensionName != null) { |
| 1262 _json["customDimensionName"] = customDimensionName; |
| 1263 } |
| 1264 if (endDate != null) { |
| 1265 _json["endDate"] = endDate; |
| 1266 } |
| 1267 if (groupByColumn != null) { |
| 1268 _json["groupByColumn"] = groupByColumn; |
| 1269 } |
| 1270 if (headerText != null) { |
| 1271 _json["headerText"] = headerText; |
| 1272 } |
| 1273 if (platformSource != null) { |
| 1274 _json["platformSource"] = platformSource; |
| 1275 } |
| 1276 if (savedColumnName != null) { |
| 1277 _json["savedColumnName"] = savedColumnName; |
| 1278 } |
| 1279 if (startDate != null) { |
| 1280 _json["startDate"] = startDate; |
| 1281 } |
| 1282 return _json; |
| 1283 } |
| 1284 } |
| 1285 |
| 1286 |
| 1287 /** Not documented yet. */ |
| 1288 class ReportRequestFilters { |
| 1289 /** |
| 1290 * Column to perform the filter on. This can be a DoubleClick Search column or |
| 1291 * a saved column. |
| 1292 */ |
| 1293 ReportApiColumnSpec column; |
| 1294 |
| 1295 /** |
| 1296 * Operator to use in the filter. See the filter reference for a list of |
| 1297 * available operators. |
| 1298 */ |
| 1299 core.String operator; |
| 1300 |
| 1301 /** |
| 1302 * A list of values to filter the column value against. |
| 1303 * |
| 1304 * The values for Object must be JSON objects. It can consist of `num`, |
| 1305 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 1306 */ |
| 1307 core.List<core.Object> values; |
| 1308 |
| 1309 |
| 1310 ReportRequestFilters(); |
| 1311 |
| 1312 ReportRequestFilters.fromJson(core.Map _json) { |
| 1313 if (_json.containsKey("column")) { |
| 1314 column = new ReportApiColumnSpec.fromJson(_json["column"]); |
| 1315 } |
| 1316 if (_json.containsKey("operator")) { |
| 1317 operator = _json["operator"]; |
| 1318 } |
| 1319 if (_json.containsKey("values")) { |
| 1320 values = _json["values"]; |
| 1321 } |
| 1322 } |
| 1323 |
| 1324 core.Map toJson() { |
| 1325 var _json = new core.Map(); |
| 1326 if (column != null) { |
| 1327 _json["column"] = (column).toJson(); |
| 1328 } |
| 1329 if (operator != null) { |
| 1330 _json["operator"] = operator; |
| 1331 } |
| 1332 if (values != null) { |
| 1333 _json["values"] = values; |
| 1334 } |
| 1335 return _json; |
| 1336 } |
| 1337 } |
| 1338 |
| 1339 |
| 1340 /** Not documented yet. */ |
| 1341 class ReportRequestOrderBy { |
| 1342 /** |
| 1343 * Column to perform the sort on. This can be a DoubleClick Search-defined |
| 1344 * column or a saved column. |
| 1345 */ |
| 1346 ReportApiColumnSpec column; |
| 1347 |
| 1348 /** The sort direction, which is either ascending or descending. */ |
| 1349 core.String sortOrder; |
| 1350 |
| 1351 |
| 1352 ReportRequestOrderBy(); |
| 1353 |
| 1354 ReportRequestOrderBy.fromJson(core.Map _json) { |
| 1355 if (_json.containsKey("column")) { |
| 1356 column = new ReportApiColumnSpec.fromJson(_json["column"]); |
| 1357 } |
| 1358 if (_json.containsKey("sortOrder")) { |
| 1359 sortOrder = _json["sortOrder"]; |
| 1360 } |
| 1361 } |
| 1362 |
| 1363 core.Map toJson() { |
| 1364 var _json = new core.Map(); |
| 1365 if (column != null) { |
| 1366 _json["column"] = (column).toJson(); |
| 1367 } |
| 1368 if (sortOrder != null) { |
| 1369 _json["sortOrder"] = sortOrder; |
| 1370 } |
| 1371 return _json; |
| 1372 } |
| 1373 } |
| 1374 |
| 1375 |
| 1376 /** |
| 1377 * The reportScope is a set of IDs that are used to determine which subset of |
| 1378 * entities will be returned in the report. The full lineage of IDs from the |
| 1379 * lowest scoped level desired up through agency is required. |
| 1380 */ |
| 1381 class ReportRequestReportScope { |
| 1382 /** DS ad group ID. */ |
| 1383 core.String adGroupId; |
| 1384 |
| 1385 /** DS ad ID. */ |
| 1386 core.String adId; |
| 1387 |
| 1388 /** DS advertiser ID. */ |
| 1389 core.String advertiserId; |
| 1390 |
| 1391 /** DS agency ID. */ |
| 1392 core.String agencyId; |
| 1393 |
| 1394 /** DS campaign ID. */ |
| 1395 core.String campaignId; |
| 1396 |
| 1397 /** DS engine account ID. */ |
| 1398 core.String engineAccountId; |
| 1399 |
| 1400 /** DS keyword ID. */ |
| 1401 core.String keywordId; |
| 1402 |
| 1403 |
| 1404 ReportRequestReportScope(); |
| 1405 |
| 1406 ReportRequestReportScope.fromJson(core.Map _json) { |
| 1407 if (_json.containsKey("adGroupId")) { |
| 1408 adGroupId = _json["adGroupId"]; |
| 1409 } |
| 1410 if (_json.containsKey("adId")) { |
| 1411 adId = _json["adId"]; |
| 1412 } |
| 1413 if (_json.containsKey("advertiserId")) { |
| 1414 advertiserId = _json["advertiserId"]; |
| 1415 } |
| 1416 if (_json.containsKey("agencyId")) { |
| 1417 agencyId = _json["agencyId"]; |
| 1418 } |
| 1419 if (_json.containsKey("campaignId")) { |
| 1420 campaignId = _json["campaignId"]; |
| 1421 } |
| 1422 if (_json.containsKey("engineAccountId")) { |
| 1423 engineAccountId = _json["engineAccountId"]; |
| 1424 } |
| 1425 if (_json.containsKey("keywordId")) { |
| 1426 keywordId = _json["keywordId"]; |
| 1427 } |
| 1428 } |
| 1429 |
| 1430 core.Map toJson() { |
| 1431 var _json = new core.Map(); |
| 1432 if (adGroupId != null) { |
| 1433 _json["adGroupId"] = adGroupId; |
| 1434 } |
| 1435 if (adId != null) { |
| 1436 _json["adId"] = adId; |
| 1437 } |
| 1438 if (advertiserId != null) { |
| 1439 _json["advertiserId"] = advertiserId; |
| 1440 } |
| 1441 if (agencyId != null) { |
| 1442 _json["agencyId"] = agencyId; |
| 1443 } |
| 1444 if (campaignId != null) { |
| 1445 _json["campaignId"] = campaignId; |
| 1446 } |
| 1447 if (engineAccountId != null) { |
| 1448 _json["engineAccountId"] = engineAccountId; |
| 1449 } |
| 1450 if (keywordId != null) { |
| 1451 _json["keywordId"] = keywordId; |
| 1452 } |
| 1453 return _json; |
| 1454 } |
| 1455 } |
| 1456 |
| 1457 |
| 1458 /** |
| 1459 * If metrics are requested in a report, this argument will be used to restrict |
| 1460 * the metrics to a specific time range. |
| 1461 */ |
| 1462 class ReportRequestTimeRange { |
| 1463 /** |
| 1464 * Inclusive UTC timestamp in RFC format, e.g., 2013-07-16T10:16:23.555Z. See |
| 1465 * additional references on how changed attribute reports work. |
| 1466 */ |
| 1467 core.DateTime changedAttributesSinceTimestamp; |
| 1468 |
| 1469 /** |
| 1470 * Inclusive UTC timestamp in RFC format, e.g., 2013-07-16T10:16:23.555Z. See |
| 1471 * additional references on how changed metrics reports work. |
| 1472 */ |
| 1473 core.DateTime changedMetricsSinceTimestamp; |
| 1474 |
| 1475 /** Inclusive date in YYYY-MM-DD format. */ |
| 1476 core.String endDate; |
| 1477 |
| 1478 /** Inclusive date in YYYY-MM-DD format. */ |
| 1479 core.String startDate; |
| 1480 |
| 1481 |
| 1482 ReportRequestTimeRange(); |
| 1483 |
| 1484 ReportRequestTimeRange.fromJson(core.Map _json) { |
| 1485 if (_json.containsKey("changedAttributesSinceTimestamp")) { |
| 1486 changedAttributesSinceTimestamp = core.DateTime.parse(_json["changedAttrib
utesSinceTimestamp"]); |
| 1487 } |
| 1488 if (_json.containsKey("changedMetricsSinceTimestamp")) { |
| 1489 changedMetricsSinceTimestamp = core.DateTime.parse(_json["changedMetricsSi
nceTimestamp"]); |
| 1490 } |
| 1491 if (_json.containsKey("endDate")) { |
| 1492 endDate = _json["endDate"]; |
| 1493 } |
| 1494 if (_json.containsKey("startDate")) { |
| 1495 startDate = _json["startDate"]; |
| 1496 } |
| 1497 } |
| 1498 |
| 1499 core.Map toJson() { |
| 1500 var _json = new core.Map(); |
| 1501 if (changedAttributesSinceTimestamp != null) { |
| 1502 _json["changedAttributesSinceTimestamp"] = (changedAttributesSinceTimestam
p).toIso8601String(); |
| 1503 } |
| 1504 if (changedMetricsSinceTimestamp != null) { |
| 1505 _json["changedMetricsSinceTimestamp"] = (changedMetricsSinceTimestamp).toI
so8601String(); |
| 1506 } |
| 1507 if (endDate != null) { |
| 1508 _json["endDate"] = endDate; |
| 1509 } |
| 1510 if (startDate != null) { |
| 1511 _json["startDate"] = startDate; |
| 1512 } |
| 1513 return _json; |
| 1514 } |
| 1515 } |
| 1516 |
| 1517 |
| 1518 /** A request object used to create a DoubleClick Search report. */ |
| 1519 class ReportRequest { |
| 1520 /** |
| 1521 * The columns to include in the report. This includes both DoubleClick Search |
| 1522 * columns and saved columns. For DoubleClick Search columns, only the |
| 1523 * columnName parameter is required. For saved columns only the |
| 1524 * savedColumnName parameter is required. Both columnName and savedColumnName |
| 1525 * cannot be set in the same stanza. |
| 1526 */ |
| 1527 core.List<ReportApiColumnSpec> columns; |
| 1528 |
| 1529 /** |
| 1530 * Format that the report should be returned in. Currently csv or tsv is |
| 1531 * supported. |
| 1532 */ |
| 1533 core.String downloadFormat; |
| 1534 |
| 1535 /** A list of filters to be applied to the report. */ |
| 1536 core.List<ReportRequestFilters> filters; |
| 1537 |
| 1538 /** |
| 1539 * Determines if removed entities should be included in the report. Defaults |
| 1540 * to false. Deprecated, please use includeRemovedEntities instead. |
| 1541 */ |
| 1542 core.bool includeDeletedEntities; |
| 1543 |
| 1544 /** |
| 1545 * Determines if removed entities should be included in the report. Defaults |
| 1546 * to false. |
| 1547 */ |
| 1548 core.bool includeRemovedEntities; |
| 1549 |
| 1550 /** |
| 1551 * Asynchronous report only. The maximum number of rows per report file. A |
| 1552 * large report is split into many files based on this field. Acceptable |
| 1553 * values are 1000000 to 100000000, inclusive. |
| 1554 */ |
| 1555 core.int maxRowsPerFile; |
| 1556 |
| 1557 /** |
| 1558 * Synchronous report only. A list of columns and directions defining sorting |
| 1559 * to be performed on the report rows. |
| 1560 */ |
| 1561 core.List<ReportRequestOrderBy> orderBy; |
| 1562 |
| 1563 /** |
| 1564 * The reportScope is a set of IDs that are used to determine which subset of |
| 1565 * entities will be returned in the report. The full lineage of IDs from the |
| 1566 * lowest scoped level desired up through agency is required. |
| 1567 */ |
| 1568 ReportRequestReportScope reportScope; |
| 1569 |
| 1570 /** |
| 1571 * Determines the type of rows that are returned in the report. For example, |
| 1572 * if you specify reportType: keyword, each row in the report will contain |
| 1573 * data about a keyword. See the Types of Reports reference for the columns |
| 1574 * that are available for each type. |
| 1575 */ |
| 1576 core.String reportType; |
| 1577 |
| 1578 /** |
| 1579 * Synchronous report only. The maxinum number of rows to return; additional |
| 1580 * rows are dropped. Acceptable values are 0 to 10000, inclusive. Defaults to |
| 1581 * 10000. |
| 1582 */ |
| 1583 core.int rowCount; |
| 1584 |
| 1585 /** |
| 1586 * Synchronous report only. Zero-based index of the first row to return. |
| 1587 * Acceptable values are 0 to 50000, inclusive. Defaults to 0. |
| 1588 */ |
| 1589 core.int startRow; |
| 1590 |
| 1591 /** |
| 1592 * Specifies the currency in which monetary will be returned. Possible values |
| 1593 * are: usd, agency (valid if the report is scoped to agency or lower), |
| 1594 * advertiser (valid if the report is scoped to * advertiser or lower), or |
| 1595 * account (valid if the report is scoped to engine account or lower). |
| 1596 */ |
| 1597 core.String statisticsCurrency; |
| 1598 |
| 1599 /** |
| 1600 * If metrics are requested in a report, this argument will be used to |
| 1601 * restrict the metrics to a specific time range. |
| 1602 */ |
| 1603 ReportRequestTimeRange timeRange; |
| 1604 |
| 1605 /** |
| 1606 * If true, the report would only be created if all the requested stat data |
| 1607 * are sourced from a single timezone. Defaults to false. |
| 1608 */ |
| 1609 core.bool verifySingleTimeZone; |
| 1610 |
| 1611 |
| 1612 ReportRequest(); |
| 1613 |
| 1614 ReportRequest.fromJson(core.Map _json) { |
| 1615 if (_json.containsKey("columns")) { |
| 1616 columns = _json["columns"].map((value) => new ReportApiColumnSpec.fromJson
(value)).toList(); |
| 1617 } |
| 1618 if (_json.containsKey("downloadFormat")) { |
| 1619 downloadFormat = _json["downloadFormat"]; |
| 1620 } |
| 1621 if (_json.containsKey("filters")) { |
| 1622 filters = _json["filters"].map((value) => new ReportRequestFilters.fromJso
n(value)).toList(); |
| 1623 } |
| 1624 if (_json.containsKey("includeDeletedEntities")) { |
| 1625 includeDeletedEntities = _json["includeDeletedEntities"]; |
| 1626 } |
| 1627 if (_json.containsKey("includeRemovedEntities")) { |
| 1628 includeRemovedEntities = _json["includeRemovedEntities"]; |
| 1629 } |
| 1630 if (_json.containsKey("maxRowsPerFile")) { |
| 1631 maxRowsPerFile = _json["maxRowsPerFile"]; |
| 1632 } |
| 1633 if (_json.containsKey("orderBy")) { |
| 1634 orderBy = _json["orderBy"].map((value) => new ReportRequestOrderBy.fromJso
n(value)).toList(); |
| 1635 } |
| 1636 if (_json.containsKey("reportScope")) { |
| 1637 reportScope = new ReportRequestReportScope.fromJson(_json["reportScope"]); |
| 1638 } |
| 1639 if (_json.containsKey("reportType")) { |
| 1640 reportType = _json["reportType"]; |
| 1641 } |
| 1642 if (_json.containsKey("rowCount")) { |
| 1643 rowCount = _json["rowCount"]; |
| 1644 } |
| 1645 if (_json.containsKey("startRow")) { |
| 1646 startRow = _json["startRow"]; |
| 1647 } |
| 1648 if (_json.containsKey("statisticsCurrency")) { |
| 1649 statisticsCurrency = _json["statisticsCurrency"]; |
| 1650 } |
| 1651 if (_json.containsKey("timeRange")) { |
| 1652 timeRange = new ReportRequestTimeRange.fromJson(_json["timeRange"]); |
| 1653 } |
| 1654 if (_json.containsKey("verifySingleTimeZone")) { |
| 1655 verifySingleTimeZone = _json["verifySingleTimeZone"]; |
| 1656 } |
| 1657 } |
| 1658 |
| 1659 core.Map toJson() { |
| 1660 var _json = new core.Map(); |
| 1661 if (columns != null) { |
| 1662 _json["columns"] = columns.map((value) => (value).toJson()).toList(); |
| 1663 } |
| 1664 if (downloadFormat != null) { |
| 1665 _json["downloadFormat"] = downloadFormat; |
| 1666 } |
| 1667 if (filters != null) { |
| 1668 _json["filters"] = filters.map((value) => (value).toJson()).toList(); |
| 1669 } |
| 1670 if (includeDeletedEntities != null) { |
| 1671 _json["includeDeletedEntities"] = includeDeletedEntities; |
| 1672 } |
| 1673 if (includeRemovedEntities != null) { |
| 1674 _json["includeRemovedEntities"] = includeRemovedEntities; |
| 1675 } |
| 1676 if (maxRowsPerFile != null) { |
| 1677 _json["maxRowsPerFile"] = maxRowsPerFile; |
| 1678 } |
| 1679 if (orderBy != null) { |
| 1680 _json["orderBy"] = orderBy.map((value) => (value).toJson()).toList(); |
| 1681 } |
| 1682 if (reportScope != null) { |
| 1683 _json["reportScope"] = (reportScope).toJson(); |
| 1684 } |
| 1685 if (reportType != null) { |
| 1686 _json["reportType"] = reportType; |
| 1687 } |
| 1688 if (rowCount != null) { |
| 1689 _json["rowCount"] = rowCount; |
| 1690 } |
| 1691 if (startRow != null) { |
| 1692 _json["startRow"] = startRow; |
| 1693 } |
| 1694 if (statisticsCurrency != null) { |
| 1695 _json["statisticsCurrency"] = statisticsCurrency; |
| 1696 } |
| 1697 if (timeRange != null) { |
| 1698 _json["timeRange"] = (timeRange).toJson(); |
| 1699 } |
| 1700 if (verifySingleTimeZone != null) { |
| 1701 _json["verifySingleTimeZone"] = verifySingleTimeZone; |
| 1702 } |
| 1703 return _json; |
| 1704 } |
| 1705 } |
| 1706 |
| 1707 |
| 1708 /** |
| 1709 * A row in a DoubleClick Search report. |
| 1710 * |
| 1711 * Indicates the columns that are represented in this row. That is, each key |
| 1712 * corresponds to a column with a non-empty cell in this row. |
| 1713 */ |
| 1714 class ReportRow |
| 1715 extends collection.MapBase<core.String, core.Object> { |
| 1716 final core.Map _innerMap = {}; |
| 1717 |
| 1718 ReportRow(); |
| 1719 |
| 1720 ReportRow.fromJson(core.Map _json) { |
| 1721 _json.forEach((core.String key, value) { |
| 1722 this[key] = value; |
| 1723 }); |
| 1724 } |
| 1725 |
| 1726 core.Map toJson() { |
| 1727 var _json = {}; |
| 1728 this.forEach((core.String key, value) { |
| 1729 _json[key] = value; |
| 1730 }); |
| 1731 return _json; |
| 1732 } |
| 1733 |
| 1734 core.Object operator [](core.Object key) |
| 1735 => _innerMap[key]; |
| 1736 |
| 1737 operator []=(core.String key, core.Object value) { |
| 1738 _innerMap[key] = value; |
| 1739 } |
| 1740 |
| 1741 void clear() { |
| 1742 _innerMap.clear(); |
| 1743 } |
| 1744 |
| 1745 core.Iterable<core.String> get keys => _innerMap.keys; |
| 1746 |
| 1747 core.Object remove(core.Object key) => _innerMap.remove(key); |
| 1748 } |
| 1749 |
| 1750 |
| 1751 /** A saved column */ |
| 1752 class SavedColumn { |
| 1753 /** |
| 1754 * Identifies this as a SavedColumn resource. Value: the fixed string |
| 1755 * doubleclicksearch#savedColumn. |
| 1756 */ |
| 1757 core.String kind; |
| 1758 |
| 1759 /** The name of the saved column. */ |
| 1760 core.String savedColumnName; |
| 1761 |
| 1762 /** The type of data this saved column will produce. */ |
| 1763 core.String type; |
| 1764 |
| 1765 |
| 1766 SavedColumn(); |
| 1767 |
| 1768 SavedColumn.fromJson(core.Map _json) { |
| 1769 if (_json.containsKey("kind")) { |
| 1770 kind = _json["kind"]; |
| 1771 } |
| 1772 if (_json.containsKey("savedColumnName")) { |
| 1773 savedColumnName = _json["savedColumnName"]; |
| 1774 } |
| 1775 if (_json.containsKey("type")) { |
| 1776 type = _json["type"]; |
| 1777 } |
| 1778 } |
| 1779 |
| 1780 core.Map toJson() { |
| 1781 var _json = new core.Map(); |
| 1782 if (kind != null) { |
| 1783 _json["kind"] = kind; |
| 1784 } |
| 1785 if (savedColumnName != null) { |
| 1786 _json["savedColumnName"] = savedColumnName; |
| 1787 } |
| 1788 if (type != null) { |
| 1789 _json["type"] = type; |
| 1790 } |
| 1791 return _json; |
| 1792 } |
| 1793 } |
| 1794 |
| 1795 |
| 1796 /** |
| 1797 * A list of saved columns. Advertisers create saved columns to report on |
| 1798 * Floodlight activities, Google Analytics goals, or custom KPIs. To request |
| 1799 * reports with saved columns, you'll need the saved column names that are |
| 1800 * available from this list. |
| 1801 */ |
| 1802 class SavedColumnList { |
| 1803 /** The saved columns being requested. */ |
| 1804 core.List<SavedColumn> items; |
| 1805 |
| 1806 /** |
| 1807 * Identifies this as a SavedColumnList resource. Value: the fixed string |
| 1808 * doubleclicksearch#savedColumnList. |
| 1809 */ |
| 1810 core.String kind; |
| 1811 |
| 1812 |
| 1813 SavedColumnList(); |
| 1814 |
| 1815 SavedColumnList.fromJson(core.Map _json) { |
| 1816 if (_json.containsKey("items")) { |
| 1817 items = _json["items"].map((value) => new SavedColumn.fromJson(value)).toL
ist(); |
| 1818 } |
| 1819 if (_json.containsKey("kind")) { |
| 1820 kind = _json["kind"]; |
| 1821 } |
| 1822 } |
| 1823 |
| 1824 core.Map toJson() { |
| 1825 var _json = new core.Map(); |
| 1826 if (items != null) { |
| 1827 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 1828 } |
| 1829 if (kind != null) { |
| 1830 _json["kind"] = kind; |
| 1831 } |
| 1832 return _json; |
| 1833 } |
| 1834 } |
| 1835 |
| 1836 |
| 1837 /** The request to update availability. */ |
| 1838 class UpdateAvailabilityRequest { |
| 1839 /** The availabilities being requested. */ |
| 1840 core.List<Availability> availabilities; |
| 1841 |
| 1842 |
| 1843 UpdateAvailabilityRequest(); |
| 1844 |
| 1845 UpdateAvailabilityRequest.fromJson(core.Map _json) { |
| 1846 if (_json.containsKey("availabilities")) { |
| 1847 availabilities = _json["availabilities"].map((value) => new Availability.f
romJson(value)).toList(); |
| 1848 } |
| 1849 } |
| 1850 |
| 1851 core.Map toJson() { |
| 1852 var _json = new core.Map(); |
| 1853 if (availabilities != null) { |
| 1854 _json["availabilities"] = availabilities.map((value) => (value).toJson()).
toList(); |
| 1855 } |
| 1856 return _json; |
| 1857 } |
| 1858 } |
| 1859 |
| 1860 |
| 1861 /** The response to a update availability request. */ |
| 1862 class UpdateAvailabilityResponse { |
| 1863 /** The availabilities being returned. */ |
| 1864 core.List<Availability> availabilities; |
| 1865 |
| 1866 |
| 1867 UpdateAvailabilityResponse(); |
| 1868 |
| 1869 UpdateAvailabilityResponse.fromJson(core.Map _json) { |
| 1870 if (_json.containsKey("availabilities")) { |
| 1871 availabilities = _json["availabilities"].map((value) => new Availability.f
romJson(value)).toList(); |
| 1872 } |
| 1873 } |
| 1874 |
| 1875 core.Map toJson() { |
| 1876 var _json = new core.Map(); |
| 1877 if (availabilities != null) { |
| 1878 _json["availabilities"] = availabilities.map((value) => (value).toJson()).
toList(); |
| 1879 } |
| 1880 return _json; |
| 1881 } |
| 1882 } |
| 1883 |
| 1884 |
OLD | NEW |