OLD | NEW |
(Empty) | |
| 1 library googleapis.bigquery.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 /** A data platform for customers to create, manage, share and query data. */ |
| 17 class BigqueryApi { |
| 18 /** View and manage your data in Google BigQuery */ |
| 19 static const BigqueryScope = "https://www.googleapis.com/auth/bigquery"; |
| 20 |
| 21 /** Insert data into Google BigQuery */ |
| 22 static const BigqueryInsertdataScope = "https://www.googleapis.com/auth/bigque
ry.insertdata"; |
| 23 |
| 24 /** View and manage your data across Google Cloud Platform services */ |
| 25 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf
orm"; |
| 26 |
| 27 /** Manage your data and permissions in Google Cloud Storage */ |
| 28 static const DevstorageFullControlScope = "https://www.googleapis.com/auth/dev
storage.full_control"; |
| 29 |
| 30 /** View your data in Google Cloud Storage */ |
| 31 static const DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devsto
rage.read_only"; |
| 32 |
| 33 /** Manage your data in Google Cloud Storage */ |
| 34 static const DevstorageReadWriteScope = "https://www.googleapis.com/auth/devst
orage.read_write"; |
| 35 |
| 36 |
| 37 final common_internal.ApiRequester _requester; |
| 38 |
| 39 DatasetsResourceApi get datasets => new DatasetsResourceApi(_requester); |
| 40 JobsResourceApi get jobs => new JobsResourceApi(_requester); |
| 41 ProjectsResourceApi get projects => new ProjectsResourceApi(_requester); |
| 42 TabledataResourceApi get tabledata => new TabledataResourceApi(_requester); |
| 43 TablesResourceApi get tables => new TablesResourceApi(_requester); |
| 44 |
| 45 BigqueryApi(http.Client client) : |
| 46 _requester = new common_internal.ApiRequester(client, "https://www.googlea
pis.com/", "/bigquery/v2/"); |
| 47 } |
| 48 |
| 49 |
| 50 /** Not documented yet. */ |
| 51 class DatasetsResourceApi { |
| 52 final common_internal.ApiRequester _requester; |
| 53 |
| 54 DatasetsResourceApi(common_internal.ApiRequester client) : |
| 55 _requester = client; |
| 56 |
| 57 /** |
| 58 * Deletes the dataset specified by the datasetId value. Before you can delete |
| 59 * a dataset, you must delete all its tables, either manually or by specifying |
| 60 * deleteContents. Immediately after deletion, you can create another dataset |
| 61 * with the same name. |
| 62 * |
| 63 * Request parameters: |
| 64 * |
| 65 * [projectId] - Project ID of the dataset being deleted |
| 66 * |
| 67 * [datasetId] - Dataset ID of dataset being deleted |
| 68 * |
| 69 * [deleteContents] - If True, delete all the tables in the dataset. If False |
| 70 * and the dataset contains tables, the request will fail. Default is False |
| 71 * |
| 72 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 73 * error. |
| 74 * |
| 75 * If the used [http.Client] completes with an error when making a REST call, |
| 76 * this method will complete with the same error. |
| 77 */ |
| 78 async.Future delete(core.String projectId, core.String datasetId, {core.bool d
eleteContents}) { |
| 79 var _url = null; |
| 80 var _queryParams = new core.Map(); |
| 81 var _uploadMedia = null; |
| 82 var _uploadOptions = null; |
| 83 var _downloadOptions = common.DownloadOptions.Metadata; |
| 84 var _body = null; |
| 85 |
| 86 if (projectId == null) { |
| 87 throw new core.ArgumentError("Parameter projectId is required."); |
| 88 } |
| 89 if (datasetId == null) { |
| 90 throw new core.ArgumentError("Parameter datasetId is required."); |
| 91 } |
| 92 if (deleteContents != null) { |
| 93 _queryParams["deleteContents"] = ["${deleteContents}"]; |
| 94 } |
| 95 |
| 96 _downloadOptions = null; |
| 97 |
| 98 _url = 'projects/' + common_internal.Escaper.ecapeVariable('$projectId') + '
/datasets/' + common_internal.Escaper.ecapeVariable('$datasetId'); |
| 99 |
| 100 var _response = _requester.request(_url, |
| 101 "DELETE", |
| 102 body: _body, |
| 103 queryParams: _queryParams, |
| 104 uploadOptions: _uploadOptions, |
| 105 uploadMedia: _uploadMedia, |
| 106 downloadOptions: _downloadOptions); |
| 107 return _response.then((data) => null); |
| 108 } |
| 109 |
| 110 /** |
| 111 * Returns the dataset specified by datasetID. |
| 112 * |
| 113 * Request parameters: |
| 114 * |
| 115 * [projectId] - Project ID of the requested dataset |
| 116 * |
| 117 * [datasetId] - Dataset ID of the requested dataset |
| 118 * |
| 119 * Completes with a [Dataset]. |
| 120 * |
| 121 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 122 * error. |
| 123 * |
| 124 * If the used [http.Client] completes with an error when making a REST call, |
| 125 * this method will complete with the same error. |
| 126 */ |
| 127 async.Future<Dataset> get(core.String projectId, core.String datasetId) { |
| 128 var _url = null; |
| 129 var _queryParams = new core.Map(); |
| 130 var _uploadMedia = null; |
| 131 var _uploadOptions = null; |
| 132 var _downloadOptions = common.DownloadOptions.Metadata; |
| 133 var _body = null; |
| 134 |
| 135 if (projectId == null) { |
| 136 throw new core.ArgumentError("Parameter projectId is required."); |
| 137 } |
| 138 if (datasetId == null) { |
| 139 throw new core.ArgumentError("Parameter datasetId is required."); |
| 140 } |
| 141 |
| 142 |
| 143 _url = 'projects/' + common_internal.Escaper.ecapeVariable('$projectId') + '
/datasets/' + common_internal.Escaper.ecapeVariable('$datasetId'); |
| 144 |
| 145 var _response = _requester.request(_url, |
| 146 "GET", |
| 147 body: _body, |
| 148 queryParams: _queryParams, |
| 149 uploadOptions: _uploadOptions, |
| 150 uploadMedia: _uploadMedia, |
| 151 downloadOptions: _downloadOptions); |
| 152 return _response.then((data) => new Dataset.fromJson(data)); |
| 153 } |
| 154 |
| 155 /** |
| 156 * Creates a new empty dataset. |
| 157 * |
| 158 * [request] - The metadata request object. |
| 159 * |
| 160 * Request parameters: |
| 161 * |
| 162 * [projectId] - Project ID of the new dataset |
| 163 * |
| 164 * Completes with a [Dataset]. |
| 165 * |
| 166 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 167 * error. |
| 168 * |
| 169 * If the used [http.Client] completes with an error when making a REST call, |
| 170 * this method will complete with the same error. |
| 171 */ |
| 172 async.Future<Dataset> insert(Dataset request, core.String projectId) { |
| 173 var _url = null; |
| 174 var _queryParams = new core.Map(); |
| 175 var _uploadMedia = null; |
| 176 var _uploadOptions = null; |
| 177 var _downloadOptions = common.DownloadOptions.Metadata; |
| 178 var _body = null; |
| 179 |
| 180 if (request != null) { |
| 181 _body = convert.JSON.encode((request).toJson()); |
| 182 } |
| 183 if (projectId == null) { |
| 184 throw new core.ArgumentError("Parameter projectId is required."); |
| 185 } |
| 186 |
| 187 |
| 188 _url = 'projects/' + common_internal.Escaper.ecapeVariable('$projectId') + '
/datasets'; |
| 189 |
| 190 var _response = _requester.request(_url, |
| 191 "POST", |
| 192 body: _body, |
| 193 queryParams: _queryParams, |
| 194 uploadOptions: _uploadOptions, |
| 195 uploadMedia: _uploadMedia, |
| 196 downloadOptions: _downloadOptions); |
| 197 return _response.then((data) => new Dataset.fromJson(data)); |
| 198 } |
| 199 |
| 200 /** |
| 201 * Lists all the datasets in the specified project to which the caller has |
| 202 * read access; however, a project owner can list (but not necessarily get) |
| 203 * all datasets in his project. |
| 204 * |
| 205 * Request parameters: |
| 206 * |
| 207 * [projectId] - Project ID of the datasets to be listed |
| 208 * |
| 209 * [all] - Whether to list all datasets, including hidden ones |
| 210 * |
| 211 * [maxResults] - The maximum number of results to return |
| 212 * |
| 213 * [pageToken] - Page token, returned by a previous call, to request the next |
| 214 * page of results |
| 215 * |
| 216 * Completes with a [DatasetList]. |
| 217 * |
| 218 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 219 * error. |
| 220 * |
| 221 * If the used [http.Client] completes with an error when making a REST call, |
| 222 * this method will complete with the same error. |
| 223 */ |
| 224 async.Future<DatasetList> list(core.String projectId, {core.bool all, core.int
maxResults, core.String pageToken}) { |
| 225 var _url = null; |
| 226 var _queryParams = new core.Map(); |
| 227 var _uploadMedia = null; |
| 228 var _uploadOptions = null; |
| 229 var _downloadOptions = common.DownloadOptions.Metadata; |
| 230 var _body = null; |
| 231 |
| 232 if (projectId == null) { |
| 233 throw new core.ArgumentError("Parameter projectId is required."); |
| 234 } |
| 235 if (all != null) { |
| 236 _queryParams["all"] = ["${all}"]; |
| 237 } |
| 238 if (maxResults != null) { |
| 239 _queryParams["maxResults"] = ["${maxResults}"]; |
| 240 } |
| 241 if (pageToken != null) { |
| 242 _queryParams["pageToken"] = [pageToken]; |
| 243 } |
| 244 |
| 245 |
| 246 _url = 'projects/' + common_internal.Escaper.ecapeVariable('$projectId') + '
/datasets'; |
| 247 |
| 248 var _response = _requester.request(_url, |
| 249 "GET", |
| 250 body: _body, |
| 251 queryParams: _queryParams, |
| 252 uploadOptions: _uploadOptions, |
| 253 uploadMedia: _uploadMedia, |
| 254 downloadOptions: _downloadOptions); |
| 255 return _response.then((data) => new DatasetList.fromJson(data)); |
| 256 } |
| 257 |
| 258 /** |
| 259 * Updates information in an existing dataset. The update method replaces the |
| 260 * entire dataset resource, whereas the patch method only replaces fields that |
| 261 * are provided in the submitted dataset resource. This method supports patch |
| 262 * semantics. |
| 263 * |
| 264 * [request] - The metadata request object. |
| 265 * |
| 266 * Request parameters: |
| 267 * |
| 268 * [projectId] - Project ID of the dataset being updated |
| 269 * |
| 270 * [datasetId] - Dataset ID of the dataset being updated |
| 271 * |
| 272 * Completes with a [Dataset]. |
| 273 * |
| 274 * Completes with a [common.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. |
| 279 */ |
| 280 async.Future<Dataset> patch(Dataset request, core.String projectId, core.Strin
g datasetId) { |
| 281 var _url = null; |
| 282 var _queryParams = new core.Map(); |
| 283 var _uploadMedia = null; |
| 284 var _uploadOptions = null; |
| 285 var _downloadOptions = common.DownloadOptions.Metadata; |
| 286 var _body = null; |
| 287 |
| 288 if (request != null) { |
| 289 _body = convert.JSON.encode((request).toJson()); |
| 290 } |
| 291 if (projectId == null) { |
| 292 throw new core.ArgumentError("Parameter projectId is required."); |
| 293 } |
| 294 if (datasetId == null) { |
| 295 throw new core.ArgumentError("Parameter datasetId is required."); |
| 296 } |
| 297 |
| 298 |
| 299 _url = 'projects/' + common_internal.Escaper.ecapeVariable('$projectId') + '
/datasets/' + common_internal.Escaper.ecapeVariable('$datasetId'); |
| 300 |
| 301 var _response = _requester.request(_url, |
| 302 "PATCH", |
| 303 body: _body, |
| 304 queryParams: _queryParams, |
| 305 uploadOptions: _uploadOptions, |
| 306 uploadMedia: _uploadMedia, |
| 307 downloadOptions: _downloadOptions); |
| 308 return _response.then((data) => new Dataset.fromJson(data)); |
| 309 } |
| 310 |
| 311 /** |
| 312 * Updates information in an existing dataset. The update method replaces the |
| 313 * entire dataset resource, whereas the patch method only replaces fields that |
| 314 * are provided in the submitted dataset resource. |
| 315 * |
| 316 * [request] - The metadata request object. |
| 317 * |
| 318 * Request parameters: |
| 319 * |
| 320 * [projectId] - Project ID of the dataset being updated |
| 321 * |
| 322 * [datasetId] - Dataset ID of the dataset being updated |
| 323 * |
| 324 * Completes with a [Dataset]. |
| 325 * |
| 326 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 327 * error. |
| 328 * |
| 329 * If the used [http.Client] completes with an error when making a REST call, |
| 330 * this method will complete with the same error. |
| 331 */ |
| 332 async.Future<Dataset> update(Dataset request, core.String projectId, core.Stri
ng datasetId) { |
| 333 var _url = null; |
| 334 var _queryParams = new core.Map(); |
| 335 var _uploadMedia = null; |
| 336 var _uploadOptions = null; |
| 337 var _downloadOptions = common.DownloadOptions.Metadata; |
| 338 var _body = null; |
| 339 |
| 340 if (request != null) { |
| 341 _body = convert.JSON.encode((request).toJson()); |
| 342 } |
| 343 if (projectId == null) { |
| 344 throw new core.ArgumentError("Parameter projectId is required."); |
| 345 } |
| 346 if (datasetId == null) { |
| 347 throw new core.ArgumentError("Parameter datasetId is required."); |
| 348 } |
| 349 |
| 350 |
| 351 _url = 'projects/' + common_internal.Escaper.ecapeVariable('$projectId') + '
/datasets/' + common_internal.Escaper.ecapeVariable('$datasetId'); |
| 352 |
| 353 var _response = _requester.request(_url, |
| 354 "PUT", |
| 355 body: _body, |
| 356 queryParams: _queryParams, |
| 357 uploadOptions: _uploadOptions, |
| 358 uploadMedia: _uploadMedia, |
| 359 downloadOptions: _downloadOptions); |
| 360 return _response.then((data) => new Dataset.fromJson(data)); |
| 361 } |
| 362 |
| 363 } |
| 364 |
| 365 |
| 366 /** Not documented yet. */ |
| 367 class JobsResourceApi { |
| 368 final common_internal.ApiRequester _requester; |
| 369 |
| 370 JobsResourceApi(common_internal.ApiRequester client) : |
| 371 _requester = client; |
| 372 |
| 373 /** |
| 374 * Retrieves the specified job by ID. |
| 375 * |
| 376 * Request parameters: |
| 377 * |
| 378 * [projectId] - Project ID of the requested job |
| 379 * |
| 380 * [jobId] - Job ID of the requested job |
| 381 * |
| 382 * Completes with a [Job]. |
| 383 * |
| 384 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 385 * error. |
| 386 * |
| 387 * If the used [http.Client] completes with an error when making a REST call, |
| 388 * this method will complete with the same error. |
| 389 */ |
| 390 async.Future<Job> get(core.String projectId, core.String jobId) { |
| 391 var _url = null; |
| 392 var _queryParams = new core.Map(); |
| 393 var _uploadMedia = null; |
| 394 var _uploadOptions = null; |
| 395 var _downloadOptions = common.DownloadOptions.Metadata; |
| 396 var _body = null; |
| 397 |
| 398 if (projectId == null) { |
| 399 throw new core.ArgumentError("Parameter projectId is required."); |
| 400 } |
| 401 if (jobId == null) { |
| 402 throw new core.ArgumentError("Parameter jobId is required."); |
| 403 } |
| 404 |
| 405 |
| 406 _url = 'projects/' + common_internal.Escaper.ecapeVariable('$projectId') + '
/jobs/' + common_internal.Escaper.ecapeVariable('$jobId'); |
| 407 |
| 408 var _response = _requester.request(_url, |
| 409 "GET", |
| 410 body: _body, |
| 411 queryParams: _queryParams, |
| 412 uploadOptions: _uploadOptions, |
| 413 uploadMedia: _uploadMedia, |
| 414 downloadOptions: _downloadOptions); |
| 415 return _response.then((data) => new Job.fromJson(data)); |
| 416 } |
| 417 |
| 418 /** |
| 419 * Retrieves the results of a query job. |
| 420 * |
| 421 * Request parameters: |
| 422 * |
| 423 * [projectId] - Project ID of the query job |
| 424 * |
| 425 * [jobId] - Job ID of the query job |
| 426 * |
| 427 * [maxResults] - Maximum number of results to read |
| 428 * |
| 429 * [pageToken] - Page token, returned by a previous call, to request the next |
| 430 * page of results |
| 431 * |
| 432 * [startIndex] - Zero-based index of the starting row |
| 433 * |
| 434 * [timeoutMs] - How long to wait for the query to complete, in milliseconds, |
| 435 * before returning. Default is to return immediately. If the timeout passes |
| 436 * before the job completes, the request will fail with a TIMEOUT error |
| 437 * |
| 438 * Completes with a [GetQueryResultsResponse]. |
| 439 * |
| 440 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 441 * error. |
| 442 * |
| 443 * If the used [http.Client] completes with an error when making a REST call, |
| 444 * this method will complete with the same error. |
| 445 */ |
| 446 async.Future<GetQueryResultsResponse> getQueryResults(core.String projectId, c
ore.String jobId, {core.int maxResults, core.String pageToken, core.String start
Index, core.int timeoutMs}) { |
| 447 var _url = null; |
| 448 var _queryParams = new core.Map(); |
| 449 var _uploadMedia = null; |
| 450 var _uploadOptions = null; |
| 451 var _downloadOptions = common.DownloadOptions.Metadata; |
| 452 var _body = null; |
| 453 |
| 454 if (projectId == null) { |
| 455 throw new core.ArgumentError("Parameter projectId is required."); |
| 456 } |
| 457 if (jobId == null) { |
| 458 throw new core.ArgumentError("Parameter jobId is required."); |
| 459 } |
| 460 if (maxResults != null) { |
| 461 _queryParams["maxResults"] = ["${maxResults}"]; |
| 462 } |
| 463 if (pageToken != null) { |
| 464 _queryParams["pageToken"] = [pageToken]; |
| 465 } |
| 466 if (startIndex != null) { |
| 467 _queryParams["startIndex"] = [startIndex]; |
| 468 } |
| 469 if (timeoutMs != null) { |
| 470 _queryParams["timeoutMs"] = ["${timeoutMs}"]; |
| 471 } |
| 472 |
| 473 |
| 474 _url = 'projects/' + common_internal.Escaper.ecapeVariable('$projectId') + '
/queries/' + common_internal.Escaper.ecapeVariable('$jobId'); |
| 475 |
| 476 var _response = _requester.request(_url, |
| 477 "GET", |
| 478 body: _body, |
| 479 queryParams: _queryParams, |
| 480 uploadOptions: _uploadOptions, |
| 481 uploadMedia: _uploadMedia, |
| 482 downloadOptions: _downloadOptions); |
| 483 return _response.then((data) => new GetQueryResultsResponse.fromJson(data)); |
| 484 } |
| 485 |
| 486 /** |
| 487 * Starts a new asynchronous job. |
| 488 * |
| 489 * [request] - The metadata request object. |
| 490 * |
| 491 * Request parameters: |
| 492 * |
| 493 * [projectId] - Project ID of the project that will be billed for the job |
| 494 * |
| 495 * [uploadMedia] - The media to upload. |
| 496 * |
| 497 * [uploadOptions] - Options for the media upload. Streaming Media without the |
| 498 * length being known ahead of time is only supported via resumable uploads. |
| 499 * |
| 500 * Completes with a [Job]. |
| 501 * |
| 502 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 503 * error. |
| 504 * |
| 505 * If the used [http.Client] completes with an error when making a REST call, |
| 506 * this method will complete with the same error. |
| 507 */ |
| 508 async.Future<Job> insert(Job request, core.String projectId, {common.UploadOpt
ions uploadOptions : common.UploadOptions.Default, common.Media uploadMedia}) { |
| 509 var _url = null; |
| 510 var _queryParams = new core.Map(); |
| 511 var _uploadMedia = null; |
| 512 var _uploadOptions = null; |
| 513 var _downloadOptions = common.DownloadOptions.Metadata; |
| 514 var _body = null; |
| 515 |
| 516 if (request != null) { |
| 517 _body = convert.JSON.encode((request).toJson()); |
| 518 } |
| 519 if (projectId == null) { |
| 520 throw new core.ArgumentError("Parameter projectId is required."); |
| 521 } |
| 522 |
| 523 _uploadMedia = uploadMedia; |
| 524 _uploadOptions = uploadOptions; |
| 525 |
| 526 if (_uploadMedia == null) { |
| 527 _url = 'projects/' + common_internal.Escaper.ecapeVariable('$projectId') +
'/jobs'; |
| 528 } else if (_uploadOptions is common.ResumableUploadOptions) { |
| 529 _url = '/resumable/upload/bigquery/v2/projects/' + common_internal.Escaper
.ecapeVariable('$projectId') + '/jobs'; |
| 530 } else { |
| 531 _url = '/upload/bigquery/v2/projects/' + common_internal.Escaper.ecapeVari
able('$projectId') + '/jobs'; |
| 532 } |
| 533 |
| 534 |
| 535 var _response = _requester.request(_url, |
| 536 "POST", |
| 537 body: _body, |
| 538 queryParams: _queryParams, |
| 539 uploadOptions: _uploadOptions, |
| 540 uploadMedia: _uploadMedia, |
| 541 downloadOptions: _downloadOptions); |
| 542 return _response.then((data) => new Job.fromJson(data)); |
| 543 } |
| 544 |
| 545 /** |
| 546 * Lists all the Jobs in the specified project that were started by the user. |
| 547 * The job list returns in reverse chronological order of when the jobs were |
| 548 * created, starting with the most recent job created. |
| 549 * |
| 550 * Request parameters: |
| 551 * |
| 552 * [projectId] - Project ID of the jobs to list |
| 553 * |
| 554 * [allUsers] - Whether to display jobs owned by all users in the project. |
| 555 * Default false |
| 556 * |
| 557 * [maxResults] - Maximum number of results to return |
| 558 * |
| 559 * [pageToken] - Page token, returned by a previous call, to request the next |
| 560 * page of results |
| 561 * |
| 562 * [projection] - Restrict information returned to a set of selected fields |
| 563 * Possible string values are: |
| 564 * - "full" : Includes all job data |
| 565 * - "minimal" : Does not include the job configuration |
| 566 * |
| 567 * [stateFilter] - Filter for job state |
| 568 * |
| 569 * Completes with a [JobList]. |
| 570 * |
| 571 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 572 * error. |
| 573 * |
| 574 * If the used [http.Client] completes with an error when making a REST call, |
| 575 * this method will complete with the same error. |
| 576 */ |
| 577 async.Future<JobList> list(core.String projectId, {core.bool allUsers, core.in
t maxResults, core.String pageToken, core.String projection, core.List<core.Stri
ng> stateFilter}) { |
| 578 var _url = null; |
| 579 var _queryParams = new core.Map(); |
| 580 var _uploadMedia = null; |
| 581 var _uploadOptions = null; |
| 582 var _downloadOptions = common.DownloadOptions.Metadata; |
| 583 var _body = null; |
| 584 |
| 585 if (projectId == null) { |
| 586 throw new core.ArgumentError("Parameter projectId is required."); |
| 587 } |
| 588 if (allUsers != null) { |
| 589 _queryParams["allUsers"] = ["${allUsers}"]; |
| 590 } |
| 591 if (maxResults != null) { |
| 592 _queryParams["maxResults"] = ["${maxResults}"]; |
| 593 } |
| 594 if (pageToken != null) { |
| 595 _queryParams["pageToken"] = [pageToken]; |
| 596 } |
| 597 if (projection != null) { |
| 598 _queryParams["projection"] = [projection]; |
| 599 } |
| 600 if (stateFilter != null) { |
| 601 _queryParams["stateFilter"] = stateFilter; |
| 602 } |
| 603 |
| 604 |
| 605 _url = 'projects/' + common_internal.Escaper.ecapeVariable('$projectId') + '
/jobs'; |
| 606 |
| 607 var _response = _requester.request(_url, |
| 608 "GET", |
| 609 body: _body, |
| 610 queryParams: _queryParams, |
| 611 uploadOptions: _uploadOptions, |
| 612 uploadMedia: _uploadMedia, |
| 613 downloadOptions: _downloadOptions); |
| 614 return _response.then((data) => new JobList.fromJson(data)); |
| 615 } |
| 616 |
| 617 /** |
| 618 * Runs a BigQuery SQL query synchronously and returns query results if the |
| 619 * query completes within a specified timeout. |
| 620 * |
| 621 * [request] - The metadata request object. |
| 622 * |
| 623 * Request parameters: |
| 624 * |
| 625 * [projectId] - Project ID of the project billed for the query |
| 626 * |
| 627 * Completes with a [QueryResponse]. |
| 628 * |
| 629 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 630 * error. |
| 631 * |
| 632 * If the used [http.Client] completes with an error when making a REST call, |
| 633 * this method will complete with the same error. |
| 634 */ |
| 635 async.Future<QueryResponse> query(QueryRequest request, core.String projectId)
{ |
| 636 var _url = null; |
| 637 var _queryParams = new core.Map(); |
| 638 var _uploadMedia = null; |
| 639 var _uploadOptions = null; |
| 640 var _downloadOptions = common.DownloadOptions.Metadata; |
| 641 var _body = null; |
| 642 |
| 643 if (request != null) { |
| 644 _body = convert.JSON.encode((request).toJson()); |
| 645 } |
| 646 if (projectId == null) { |
| 647 throw new core.ArgumentError("Parameter projectId is required."); |
| 648 } |
| 649 |
| 650 |
| 651 _url = 'projects/' + common_internal.Escaper.ecapeVariable('$projectId') + '
/queries'; |
| 652 |
| 653 var _response = _requester.request(_url, |
| 654 "POST", |
| 655 body: _body, |
| 656 queryParams: _queryParams, |
| 657 uploadOptions: _uploadOptions, |
| 658 uploadMedia: _uploadMedia, |
| 659 downloadOptions: _downloadOptions); |
| 660 return _response.then((data) => new QueryResponse.fromJson(data)); |
| 661 } |
| 662 |
| 663 } |
| 664 |
| 665 |
| 666 /** Not documented yet. */ |
| 667 class ProjectsResourceApi { |
| 668 final common_internal.ApiRequester _requester; |
| 669 |
| 670 ProjectsResourceApi(common_internal.ApiRequester client) : |
| 671 _requester = client; |
| 672 |
| 673 /** |
| 674 * Lists the projects to which you have at least read access. |
| 675 * |
| 676 * Request parameters: |
| 677 * |
| 678 * [maxResults] - Maximum number of results to return |
| 679 * |
| 680 * [pageToken] - Page token, returned by a previous call, to request the next |
| 681 * page of results |
| 682 * |
| 683 * Completes with a [ProjectList]. |
| 684 * |
| 685 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 686 * error. |
| 687 * |
| 688 * If the used [http.Client] completes with an error when making a REST call, |
| 689 * this method will complete with the same error. |
| 690 */ |
| 691 async.Future<ProjectList> list({core.int maxResults, core.String pageToken}) { |
| 692 var _url = null; |
| 693 var _queryParams = new core.Map(); |
| 694 var _uploadMedia = null; |
| 695 var _uploadOptions = null; |
| 696 var _downloadOptions = common.DownloadOptions.Metadata; |
| 697 var _body = null; |
| 698 |
| 699 if (maxResults != null) { |
| 700 _queryParams["maxResults"] = ["${maxResults}"]; |
| 701 } |
| 702 if (pageToken != null) { |
| 703 _queryParams["pageToken"] = [pageToken]; |
| 704 } |
| 705 |
| 706 |
| 707 _url = 'projects'; |
| 708 |
| 709 var _response = _requester.request(_url, |
| 710 "GET", |
| 711 body: _body, |
| 712 queryParams: _queryParams, |
| 713 uploadOptions: _uploadOptions, |
| 714 uploadMedia: _uploadMedia, |
| 715 downloadOptions: _downloadOptions); |
| 716 return _response.then((data) => new ProjectList.fromJson(data)); |
| 717 } |
| 718 |
| 719 } |
| 720 |
| 721 |
| 722 /** Not documented yet. */ |
| 723 class TabledataResourceApi { |
| 724 final common_internal.ApiRequester _requester; |
| 725 |
| 726 TabledataResourceApi(common_internal.ApiRequester client) : |
| 727 _requester = client; |
| 728 |
| 729 /** |
| 730 * Streams data into BigQuery one record at a time without needing to run a |
| 731 * load job. |
| 732 * |
| 733 * [request] - The metadata request object. |
| 734 * |
| 735 * Request parameters: |
| 736 * |
| 737 * [projectId] - Project ID of the destination table. |
| 738 * |
| 739 * [datasetId] - Dataset ID of the destination table. |
| 740 * |
| 741 * [tableId] - Table ID of the destination table. |
| 742 * |
| 743 * Completes with a [TableDataInsertAllResponse]. |
| 744 * |
| 745 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 746 * error. |
| 747 * |
| 748 * If the used [http.Client] completes with an error when making a REST call, |
| 749 * this method will complete with the same error. |
| 750 */ |
| 751 async.Future<TableDataInsertAllResponse> insertAll(TableDataInsertAllRequest r
equest, core.String projectId, core.String datasetId, core.String tableId) { |
| 752 var _url = null; |
| 753 var _queryParams = new core.Map(); |
| 754 var _uploadMedia = null; |
| 755 var _uploadOptions = null; |
| 756 var _downloadOptions = common.DownloadOptions.Metadata; |
| 757 var _body = null; |
| 758 |
| 759 if (request != null) { |
| 760 _body = convert.JSON.encode((request).toJson()); |
| 761 } |
| 762 if (projectId == null) { |
| 763 throw new core.ArgumentError("Parameter projectId is required."); |
| 764 } |
| 765 if (datasetId == null) { |
| 766 throw new core.ArgumentError("Parameter datasetId is required."); |
| 767 } |
| 768 if (tableId == null) { |
| 769 throw new core.ArgumentError("Parameter tableId is required."); |
| 770 } |
| 771 |
| 772 |
| 773 _url = 'projects/' + common_internal.Escaper.ecapeVariable('$projectId') + '
/datasets/' + common_internal.Escaper.ecapeVariable('$datasetId') + '/tables/' +
common_internal.Escaper.ecapeVariable('$tableId') + '/insertAll'; |
| 774 |
| 775 var _response = _requester.request(_url, |
| 776 "POST", |
| 777 body: _body, |
| 778 queryParams: _queryParams, |
| 779 uploadOptions: _uploadOptions, |
| 780 uploadMedia: _uploadMedia, |
| 781 downloadOptions: _downloadOptions); |
| 782 return _response.then((data) => new TableDataInsertAllResponse.fromJson(data
)); |
| 783 } |
| 784 |
| 785 /** |
| 786 * Retrieves table data from a specified set of rows. |
| 787 * |
| 788 * Request parameters: |
| 789 * |
| 790 * [projectId] - Project ID of the table to read |
| 791 * |
| 792 * [datasetId] - Dataset ID of the table to read |
| 793 * |
| 794 * [tableId] - Table ID of the table to read |
| 795 * |
| 796 * [maxResults] - Maximum number of results to return |
| 797 * |
| 798 * [pageToken] - Page token, returned by a previous call, identifying the |
| 799 * result set |
| 800 * |
| 801 * [startIndex] - Zero-based index of the starting row to read |
| 802 * |
| 803 * Completes with a [TableDataList]. |
| 804 * |
| 805 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 806 * error. |
| 807 * |
| 808 * If the used [http.Client] completes with an error when making a REST call, |
| 809 * this method will complete with the same error. |
| 810 */ |
| 811 async.Future<TableDataList> list(core.String projectId, core.String datasetId,
core.String tableId, {core.int maxResults, core.String pageToken, core.String s
tartIndex}) { |
| 812 var _url = null; |
| 813 var _queryParams = new core.Map(); |
| 814 var _uploadMedia = null; |
| 815 var _uploadOptions = null; |
| 816 var _downloadOptions = common.DownloadOptions.Metadata; |
| 817 var _body = null; |
| 818 |
| 819 if (projectId == null) { |
| 820 throw new core.ArgumentError("Parameter projectId is required."); |
| 821 } |
| 822 if (datasetId == null) { |
| 823 throw new core.ArgumentError("Parameter datasetId is required."); |
| 824 } |
| 825 if (tableId == null) { |
| 826 throw new core.ArgumentError("Parameter tableId is required."); |
| 827 } |
| 828 if (maxResults != null) { |
| 829 _queryParams["maxResults"] = ["${maxResults}"]; |
| 830 } |
| 831 if (pageToken != null) { |
| 832 _queryParams["pageToken"] = [pageToken]; |
| 833 } |
| 834 if (startIndex != null) { |
| 835 _queryParams["startIndex"] = [startIndex]; |
| 836 } |
| 837 |
| 838 |
| 839 _url = 'projects/' + common_internal.Escaper.ecapeVariable('$projectId') + '
/datasets/' + common_internal.Escaper.ecapeVariable('$datasetId') + '/tables/' +
common_internal.Escaper.ecapeVariable('$tableId') + '/data'; |
| 840 |
| 841 var _response = _requester.request(_url, |
| 842 "GET", |
| 843 body: _body, |
| 844 queryParams: _queryParams, |
| 845 uploadOptions: _uploadOptions, |
| 846 uploadMedia: _uploadMedia, |
| 847 downloadOptions: _downloadOptions); |
| 848 return _response.then((data) => new TableDataList.fromJson(data)); |
| 849 } |
| 850 |
| 851 } |
| 852 |
| 853 |
| 854 /** Not documented yet. */ |
| 855 class TablesResourceApi { |
| 856 final common_internal.ApiRequester _requester; |
| 857 |
| 858 TablesResourceApi(common_internal.ApiRequester client) : |
| 859 _requester = client; |
| 860 |
| 861 /** |
| 862 * Deletes the table specified by tableId from the dataset. If the table |
| 863 * contains data, all the data will be deleted. |
| 864 * |
| 865 * Request parameters: |
| 866 * |
| 867 * [projectId] - Project ID of the table to delete |
| 868 * |
| 869 * [datasetId] - Dataset ID of the table to delete |
| 870 * |
| 871 * [tableId] - Table ID of the table to delete |
| 872 * |
| 873 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 874 * error. |
| 875 * |
| 876 * If the used [http.Client] completes with an error when making a REST call, |
| 877 * this method will complete with the same error. |
| 878 */ |
| 879 async.Future delete(core.String projectId, core.String datasetId, core.String
tableId) { |
| 880 var _url = null; |
| 881 var _queryParams = new core.Map(); |
| 882 var _uploadMedia = null; |
| 883 var _uploadOptions = null; |
| 884 var _downloadOptions = common.DownloadOptions.Metadata; |
| 885 var _body = null; |
| 886 |
| 887 if (projectId == null) { |
| 888 throw new core.ArgumentError("Parameter projectId is required."); |
| 889 } |
| 890 if (datasetId == null) { |
| 891 throw new core.ArgumentError("Parameter datasetId is required."); |
| 892 } |
| 893 if (tableId == null) { |
| 894 throw new core.ArgumentError("Parameter tableId is required."); |
| 895 } |
| 896 |
| 897 _downloadOptions = null; |
| 898 |
| 899 _url = 'projects/' + common_internal.Escaper.ecapeVariable('$projectId') + '
/datasets/' + common_internal.Escaper.ecapeVariable('$datasetId') + '/tables/' +
common_internal.Escaper.ecapeVariable('$tableId'); |
| 900 |
| 901 var _response = _requester.request(_url, |
| 902 "DELETE", |
| 903 body: _body, |
| 904 queryParams: _queryParams, |
| 905 uploadOptions: _uploadOptions, |
| 906 uploadMedia: _uploadMedia, |
| 907 downloadOptions: _downloadOptions); |
| 908 return _response.then((data) => null); |
| 909 } |
| 910 |
| 911 /** |
| 912 * Gets the specified table resource by table ID. This method does not return |
| 913 * the data in the table, it only returns the table resource, which describes |
| 914 * the structure of this table. |
| 915 * |
| 916 * Request parameters: |
| 917 * |
| 918 * [projectId] - Project ID of the requested table |
| 919 * |
| 920 * [datasetId] - Dataset ID of the requested table |
| 921 * |
| 922 * [tableId] - Table ID of the requested table |
| 923 * |
| 924 * Completes with a [Table]. |
| 925 * |
| 926 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 927 * error. |
| 928 * |
| 929 * If the used [http.Client] completes with an error when making a REST call, |
| 930 * this method will complete with the same error. |
| 931 */ |
| 932 async.Future<Table> get(core.String projectId, core.String datasetId, core.Str
ing tableId) { |
| 933 var _url = null; |
| 934 var _queryParams = new core.Map(); |
| 935 var _uploadMedia = null; |
| 936 var _uploadOptions = null; |
| 937 var _downloadOptions = common.DownloadOptions.Metadata; |
| 938 var _body = null; |
| 939 |
| 940 if (projectId == null) { |
| 941 throw new core.ArgumentError("Parameter projectId is required."); |
| 942 } |
| 943 if (datasetId == null) { |
| 944 throw new core.ArgumentError("Parameter datasetId is required."); |
| 945 } |
| 946 if (tableId == null) { |
| 947 throw new core.ArgumentError("Parameter tableId is required."); |
| 948 } |
| 949 |
| 950 |
| 951 _url = 'projects/' + common_internal.Escaper.ecapeVariable('$projectId') + '
/datasets/' + common_internal.Escaper.ecapeVariable('$datasetId') + '/tables/' +
common_internal.Escaper.ecapeVariable('$tableId'); |
| 952 |
| 953 var _response = _requester.request(_url, |
| 954 "GET", |
| 955 body: _body, |
| 956 queryParams: _queryParams, |
| 957 uploadOptions: _uploadOptions, |
| 958 uploadMedia: _uploadMedia, |
| 959 downloadOptions: _downloadOptions); |
| 960 return _response.then((data) => new Table.fromJson(data)); |
| 961 } |
| 962 |
| 963 /** |
| 964 * Creates a new, empty table in the dataset. |
| 965 * |
| 966 * [request] - The metadata request object. |
| 967 * |
| 968 * Request parameters: |
| 969 * |
| 970 * [projectId] - Project ID of the new table |
| 971 * |
| 972 * [datasetId] - Dataset ID of the new table |
| 973 * |
| 974 * Completes with a [Table]. |
| 975 * |
| 976 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 977 * error. |
| 978 * |
| 979 * If the used [http.Client] completes with an error when making a REST call, |
| 980 * this method will complete with the same error. |
| 981 */ |
| 982 async.Future<Table> insert(Table request, core.String projectId, core.String d
atasetId) { |
| 983 var _url = null; |
| 984 var _queryParams = new core.Map(); |
| 985 var _uploadMedia = null; |
| 986 var _uploadOptions = null; |
| 987 var _downloadOptions = common.DownloadOptions.Metadata; |
| 988 var _body = null; |
| 989 |
| 990 if (request != null) { |
| 991 _body = convert.JSON.encode((request).toJson()); |
| 992 } |
| 993 if (projectId == null) { |
| 994 throw new core.ArgumentError("Parameter projectId is required."); |
| 995 } |
| 996 if (datasetId == null) { |
| 997 throw new core.ArgumentError("Parameter datasetId is required."); |
| 998 } |
| 999 |
| 1000 |
| 1001 _url = 'projects/' + common_internal.Escaper.ecapeVariable('$projectId') + '
/datasets/' + common_internal.Escaper.ecapeVariable('$datasetId') + '/tables'; |
| 1002 |
| 1003 var _response = _requester.request(_url, |
| 1004 "POST", |
| 1005 body: _body, |
| 1006 queryParams: _queryParams, |
| 1007 uploadOptions: _uploadOptions, |
| 1008 uploadMedia: _uploadMedia, |
| 1009 downloadOptions: _downloadOptions); |
| 1010 return _response.then((data) => new Table.fromJson(data)); |
| 1011 } |
| 1012 |
| 1013 /** |
| 1014 * Lists all tables in the specified dataset. |
| 1015 * |
| 1016 * Request parameters: |
| 1017 * |
| 1018 * [projectId] - Project ID of the tables to list |
| 1019 * |
| 1020 * [datasetId] - Dataset ID of the tables to list |
| 1021 * |
| 1022 * [maxResults] - Maximum number of results to return |
| 1023 * |
| 1024 * [pageToken] - Page token, returned by a previous call, to request the next |
| 1025 * page of results |
| 1026 * |
| 1027 * Completes with a [TableList]. |
| 1028 * |
| 1029 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1030 * error. |
| 1031 * |
| 1032 * If the used [http.Client] completes with an error when making a REST call, |
| 1033 * this method will complete with the same error. |
| 1034 */ |
| 1035 async.Future<TableList> list(core.String projectId, core.String datasetId, {co
re.int maxResults, core.String pageToken}) { |
| 1036 var _url = null; |
| 1037 var _queryParams = new core.Map(); |
| 1038 var _uploadMedia = null; |
| 1039 var _uploadOptions = null; |
| 1040 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1041 var _body = null; |
| 1042 |
| 1043 if (projectId == null) { |
| 1044 throw new core.ArgumentError("Parameter projectId is required."); |
| 1045 } |
| 1046 if (datasetId == null) { |
| 1047 throw new core.ArgumentError("Parameter datasetId is required."); |
| 1048 } |
| 1049 if (maxResults != null) { |
| 1050 _queryParams["maxResults"] = ["${maxResults}"]; |
| 1051 } |
| 1052 if (pageToken != null) { |
| 1053 _queryParams["pageToken"] = [pageToken]; |
| 1054 } |
| 1055 |
| 1056 |
| 1057 _url = 'projects/' + common_internal.Escaper.ecapeVariable('$projectId') + '
/datasets/' + common_internal.Escaper.ecapeVariable('$datasetId') + '/tables'; |
| 1058 |
| 1059 var _response = _requester.request(_url, |
| 1060 "GET", |
| 1061 body: _body, |
| 1062 queryParams: _queryParams, |
| 1063 uploadOptions: _uploadOptions, |
| 1064 uploadMedia: _uploadMedia, |
| 1065 downloadOptions: _downloadOptions); |
| 1066 return _response.then((data) => new TableList.fromJson(data)); |
| 1067 } |
| 1068 |
| 1069 /** |
| 1070 * Updates information in an existing table. The update method replaces the |
| 1071 * entire table resource, whereas the patch method only replaces fields that |
| 1072 * are provided in the submitted table resource. This method supports patch |
| 1073 * semantics. |
| 1074 * |
| 1075 * [request] - The metadata request object. |
| 1076 * |
| 1077 * Request parameters: |
| 1078 * |
| 1079 * [projectId] - Project ID of the table to update |
| 1080 * |
| 1081 * [datasetId] - Dataset ID of the table to update |
| 1082 * |
| 1083 * [tableId] - Table ID of the table to update |
| 1084 * |
| 1085 * Completes with a [Table]. |
| 1086 * |
| 1087 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1088 * error. |
| 1089 * |
| 1090 * If the used [http.Client] completes with an error when making a REST call, |
| 1091 * this method will complete with the same error. |
| 1092 */ |
| 1093 async.Future<Table> patch(Table request, core.String projectId, core.String da
tasetId, core.String tableId) { |
| 1094 var _url = null; |
| 1095 var _queryParams = new core.Map(); |
| 1096 var _uploadMedia = null; |
| 1097 var _uploadOptions = null; |
| 1098 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1099 var _body = null; |
| 1100 |
| 1101 if (request != null) { |
| 1102 _body = convert.JSON.encode((request).toJson()); |
| 1103 } |
| 1104 if (projectId == null) { |
| 1105 throw new core.ArgumentError("Parameter projectId is required."); |
| 1106 } |
| 1107 if (datasetId == null) { |
| 1108 throw new core.ArgumentError("Parameter datasetId is required."); |
| 1109 } |
| 1110 if (tableId == null) { |
| 1111 throw new core.ArgumentError("Parameter tableId is required."); |
| 1112 } |
| 1113 |
| 1114 |
| 1115 _url = 'projects/' + common_internal.Escaper.ecapeVariable('$projectId') + '
/datasets/' + common_internal.Escaper.ecapeVariable('$datasetId') + '/tables/' +
common_internal.Escaper.ecapeVariable('$tableId'); |
| 1116 |
| 1117 var _response = _requester.request(_url, |
| 1118 "PATCH", |
| 1119 body: _body, |
| 1120 queryParams: _queryParams, |
| 1121 uploadOptions: _uploadOptions, |
| 1122 uploadMedia: _uploadMedia, |
| 1123 downloadOptions: _downloadOptions); |
| 1124 return _response.then((data) => new Table.fromJson(data)); |
| 1125 } |
| 1126 |
| 1127 /** |
| 1128 * Updates information in an existing table. The update method replaces the |
| 1129 * entire table resource, whereas the patch method only replaces fields that |
| 1130 * are provided in the submitted table resource. |
| 1131 * |
| 1132 * [request] - The metadata request object. |
| 1133 * |
| 1134 * Request parameters: |
| 1135 * |
| 1136 * [projectId] - Project ID of the table to update |
| 1137 * |
| 1138 * [datasetId] - Dataset ID of the table to update |
| 1139 * |
| 1140 * [tableId] - Table ID of the table to update |
| 1141 * |
| 1142 * Completes with a [Table]. |
| 1143 * |
| 1144 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1145 * error. |
| 1146 * |
| 1147 * If the used [http.Client] completes with an error when making a REST call, |
| 1148 * this method will complete with the same error. |
| 1149 */ |
| 1150 async.Future<Table> update(Table request, core.String projectId, core.String d
atasetId, core.String tableId) { |
| 1151 var _url = null; |
| 1152 var _queryParams = new core.Map(); |
| 1153 var _uploadMedia = null; |
| 1154 var _uploadOptions = null; |
| 1155 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1156 var _body = null; |
| 1157 |
| 1158 if (request != null) { |
| 1159 _body = convert.JSON.encode((request).toJson()); |
| 1160 } |
| 1161 if (projectId == null) { |
| 1162 throw new core.ArgumentError("Parameter projectId is required."); |
| 1163 } |
| 1164 if (datasetId == null) { |
| 1165 throw new core.ArgumentError("Parameter datasetId is required."); |
| 1166 } |
| 1167 if (tableId == null) { |
| 1168 throw new core.ArgumentError("Parameter tableId is required."); |
| 1169 } |
| 1170 |
| 1171 |
| 1172 _url = 'projects/' + common_internal.Escaper.ecapeVariable('$projectId') + '
/datasets/' + common_internal.Escaper.ecapeVariable('$datasetId') + '/tables/' +
common_internal.Escaper.ecapeVariable('$tableId'); |
| 1173 |
| 1174 var _response = _requester.request(_url, |
| 1175 "PUT", |
| 1176 body: _body, |
| 1177 queryParams: _queryParams, |
| 1178 uploadOptions: _uploadOptions, |
| 1179 uploadMedia: _uploadMedia, |
| 1180 downloadOptions: _downloadOptions); |
| 1181 return _response.then((data) => new Table.fromJson(data)); |
| 1182 } |
| 1183 |
| 1184 } |
| 1185 |
| 1186 |
| 1187 |
| 1188 /** Not documented yet. */ |
| 1189 class DatasetAccess { |
| 1190 /** |
| 1191 * [Pick one] A domain to grant access to. Any users signed in with the domain |
| 1192 * specified will be granted the specified access. Example: "example.com". |
| 1193 */ |
| 1194 core.String domain; |
| 1195 |
| 1196 /** [Pick one] An email address of a Google Group to grant access to. */ |
| 1197 core.String groupByEmail; |
| 1198 |
| 1199 /** |
| 1200 * [Required] Describes the rights granted to the user specified by the other |
| 1201 * member of the access object. The following string values are supported: |
| 1202 * READER, WRITER, OWNER. |
| 1203 */ |
| 1204 core.String role; |
| 1205 |
| 1206 /** |
| 1207 * [Pick one] A special group to grant access to. Possible values include: |
| 1208 * projectOwners: Owners of the enclosing project. projectReaders: Readers of |
| 1209 * the enclosing project. projectWriters: Writers of the enclosing project. |
| 1210 * allAuthenticatedUsers: All authenticated BigQuery users. |
| 1211 */ |
| 1212 core.String specialGroup; |
| 1213 |
| 1214 /** |
| 1215 * [Pick one] An email address of a user to grant access to. For example: |
| 1216 * fred@example.com. |
| 1217 */ |
| 1218 core.String userByEmail; |
| 1219 |
| 1220 /** |
| 1221 * [Pick one] A view from a different dataset to grant access to. Queries |
| 1222 * executed against that view will have read access to tables in this dataset. |
| 1223 * The role field is not required when this field is set. If that view is |
| 1224 * updated by any user, access to the view needs to be granted again via an |
| 1225 * update operation. |
| 1226 */ |
| 1227 TableReference view; |
| 1228 |
| 1229 |
| 1230 DatasetAccess(); |
| 1231 |
| 1232 DatasetAccess.fromJson(core.Map _json) { |
| 1233 if (_json.containsKey("domain")) { |
| 1234 domain = _json["domain"]; |
| 1235 } |
| 1236 if (_json.containsKey("groupByEmail")) { |
| 1237 groupByEmail = _json["groupByEmail"]; |
| 1238 } |
| 1239 if (_json.containsKey("role")) { |
| 1240 role = _json["role"]; |
| 1241 } |
| 1242 if (_json.containsKey("specialGroup")) { |
| 1243 specialGroup = _json["specialGroup"]; |
| 1244 } |
| 1245 if (_json.containsKey("userByEmail")) { |
| 1246 userByEmail = _json["userByEmail"]; |
| 1247 } |
| 1248 if (_json.containsKey("view")) { |
| 1249 view = new TableReference.fromJson(_json["view"]); |
| 1250 } |
| 1251 } |
| 1252 |
| 1253 core.Map toJson() { |
| 1254 var _json = new core.Map(); |
| 1255 if (domain != null) { |
| 1256 _json["domain"] = domain; |
| 1257 } |
| 1258 if (groupByEmail != null) { |
| 1259 _json["groupByEmail"] = groupByEmail; |
| 1260 } |
| 1261 if (role != null) { |
| 1262 _json["role"] = role; |
| 1263 } |
| 1264 if (specialGroup != null) { |
| 1265 _json["specialGroup"] = specialGroup; |
| 1266 } |
| 1267 if (userByEmail != null) { |
| 1268 _json["userByEmail"] = userByEmail; |
| 1269 } |
| 1270 if (view != null) { |
| 1271 _json["view"] = (view).toJson(); |
| 1272 } |
| 1273 return _json; |
| 1274 } |
| 1275 } |
| 1276 |
| 1277 |
| 1278 /** Not documented yet. */ |
| 1279 class Dataset { |
| 1280 /** |
| 1281 * [Optional] An array of objects that define dataset access for one or more |
| 1282 * entities. You can set this property when inserting or updating a dataset in |
| 1283 * order to control who is allowed to access the data. If unspecified at |
| 1284 * dataset creation time, BigQuery adds default dataset access for the |
| 1285 * following entities: access.specialGroup: projectReaders; access.role: |
| 1286 * READER; access.specialGroup: projectWriters; access.role: WRITER; |
| 1287 * access.specialGroup: projectOwners; access.role: OWNER; access.userByEmail: |
| 1288 * [dataset creator email]; access.role: OWNER; |
| 1289 */ |
| 1290 core.List<DatasetAccess> access; |
| 1291 |
| 1292 /** |
| 1293 * [Output-only] The time when this dataset was created, in milliseconds since |
| 1294 * the epoch. |
| 1295 */ |
| 1296 core.String creationTime; |
| 1297 |
| 1298 /** [Required] A reference that identifies the dataset. */ |
| 1299 DatasetReference datasetReference; |
| 1300 |
| 1301 /** [Optional] A user-friendly description of the dataset. */ |
| 1302 core.String description; |
| 1303 |
| 1304 /** [Output-only] A hash of the resource. */ |
| 1305 core.String etag; |
| 1306 |
| 1307 /** [Optional] A descriptive name for the dataset. */ |
| 1308 core.String friendlyName; |
| 1309 |
| 1310 /** |
| 1311 * [Output-only] The fully-qualified unique name of the dataset in the format |
| 1312 * projectId:datasetId. The dataset name without the project name is given in |
| 1313 * the datasetId field. When creating a new dataset, leave this field blank, |
| 1314 * and instead specify the datasetId field. |
| 1315 */ |
| 1316 core.String id; |
| 1317 |
| 1318 /** [Output-only] The resource type. */ |
| 1319 core.String kind; |
| 1320 |
| 1321 /** |
| 1322 * [Output-only] The date when this dataset or any of its tables was last |
| 1323 * modified, in milliseconds since the epoch. |
| 1324 */ |
| 1325 core.String lastModifiedTime; |
| 1326 |
| 1327 /** |
| 1328 * [Output-only] A URL that can be used to access the resource again. You can |
| 1329 * use this URL in Get or Update requests to the resource. |
| 1330 */ |
| 1331 core.String selfLink; |
| 1332 |
| 1333 |
| 1334 Dataset(); |
| 1335 |
| 1336 Dataset.fromJson(core.Map _json) { |
| 1337 if (_json.containsKey("access")) { |
| 1338 access = _json["access"].map((value) => new DatasetAccess.fromJson(value))
.toList(); |
| 1339 } |
| 1340 if (_json.containsKey("creationTime")) { |
| 1341 creationTime = _json["creationTime"]; |
| 1342 } |
| 1343 if (_json.containsKey("datasetReference")) { |
| 1344 datasetReference = new DatasetReference.fromJson(_json["datasetReference"]
); |
| 1345 } |
| 1346 if (_json.containsKey("description")) { |
| 1347 description = _json["description"]; |
| 1348 } |
| 1349 if (_json.containsKey("etag")) { |
| 1350 etag = _json["etag"]; |
| 1351 } |
| 1352 if (_json.containsKey("friendlyName")) { |
| 1353 friendlyName = _json["friendlyName"]; |
| 1354 } |
| 1355 if (_json.containsKey("id")) { |
| 1356 id = _json["id"]; |
| 1357 } |
| 1358 if (_json.containsKey("kind")) { |
| 1359 kind = _json["kind"]; |
| 1360 } |
| 1361 if (_json.containsKey("lastModifiedTime")) { |
| 1362 lastModifiedTime = _json["lastModifiedTime"]; |
| 1363 } |
| 1364 if (_json.containsKey("selfLink")) { |
| 1365 selfLink = _json["selfLink"]; |
| 1366 } |
| 1367 } |
| 1368 |
| 1369 core.Map toJson() { |
| 1370 var _json = new core.Map(); |
| 1371 if (access != null) { |
| 1372 _json["access"] = access.map((value) => (value).toJson()).toList(); |
| 1373 } |
| 1374 if (creationTime != null) { |
| 1375 _json["creationTime"] = creationTime; |
| 1376 } |
| 1377 if (datasetReference != null) { |
| 1378 _json["datasetReference"] = (datasetReference).toJson(); |
| 1379 } |
| 1380 if (description != null) { |
| 1381 _json["description"] = description; |
| 1382 } |
| 1383 if (etag != null) { |
| 1384 _json["etag"] = etag; |
| 1385 } |
| 1386 if (friendlyName != null) { |
| 1387 _json["friendlyName"] = friendlyName; |
| 1388 } |
| 1389 if (id != null) { |
| 1390 _json["id"] = id; |
| 1391 } |
| 1392 if (kind != null) { |
| 1393 _json["kind"] = kind; |
| 1394 } |
| 1395 if (lastModifiedTime != null) { |
| 1396 _json["lastModifiedTime"] = lastModifiedTime; |
| 1397 } |
| 1398 if (selfLink != null) { |
| 1399 _json["selfLink"] = selfLink; |
| 1400 } |
| 1401 return _json; |
| 1402 } |
| 1403 } |
| 1404 |
| 1405 |
| 1406 /** Not documented yet. */ |
| 1407 class DatasetListDatasets { |
| 1408 /** |
| 1409 * The dataset reference. Use this property to access specific parts of the |
| 1410 * dataset's ID, such as project ID or dataset ID. |
| 1411 */ |
| 1412 DatasetReference datasetReference; |
| 1413 |
| 1414 /** A descriptive name for the dataset, if one exists. */ |
| 1415 core.String friendlyName; |
| 1416 |
| 1417 /** The fully-qualified, unique, opaque ID of the dataset. */ |
| 1418 core.String id; |
| 1419 |
| 1420 /** |
| 1421 * The resource type. This property always returns the value |
| 1422 * "bigquery#dataset". |
| 1423 */ |
| 1424 core.String kind; |
| 1425 |
| 1426 |
| 1427 DatasetListDatasets(); |
| 1428 |
| 1429 DatasetListDatasets.fromJson(core.Map _json) { |
| 1430 if (_json.containsKey("datasetReference")) { |
| 1431 datasetReference = new DatasetReference.fromJson(_json["datasetReference"]
); |
| 1432 } |
| 1433 if (_json.containsKey("friendlyName")) { |
| 1434 friendlyName = _json["friendlyName"]; |
| 1435 } |
| 1436 if (_json.containsKey("id")) { |
| 1437 id = _json["id"]; |
| 1438 } |
| 1439 if (_json.containsKey("kind")) { |
| 1440 kind = _json["kind"]; |
| 1441 } |
| 1442 } |
| 1443 |
| 1444 core.Map toJson() { |
| 1445 var _json = new core.Map(); |
| 1446 if (datasetReference != null) { |
| 1447 _json["datasetReference"] = (datasetReference).toJson(); |
| 1448 } |
| 1449 if (friendlyName != null) { |
| 1450 _json["friendlyName"] = friendlyName; |
| 1451 } |
| 1452 if (id != null) { |
| 1453 _json["id"] = id; |
| 1454 } |
| 1455 if (kind != null) { |
| 1456 _json["kind"] = kind; |
| 1457 } |
| 1458 return _json; |
| 1459 } |
| 1460 } |
| 1461 |
| 1462 |
| 1463 /** Not documented yet. */ |
| 1464 class DatasetList { |
| 1465 /** |
| 1466 * An array of the dataset resources in the project. Each resource contains |
| 1467 * basic information. For full information about a particular dataset |
| 1468 * resource, use the Datasets: get method. This property is omitted when there |
| 1469 * are no datasets in the project. |
| 1470 */ |
| 1471 core.List<DatasetListDatasets> datasets; |
| 1472 |
| 1473 /** |
| 1474 * A hash value of the results page. You can use this property to determine if |
| 1475 * the page has changed since the last request. |
| 1476 */ |
| 1477 core.String etag; |
| 1478 |
| 1479 /** |
| 1480 * The list type. This property always returns the value |
| 1481 * "bigquery#datasetList". |
| 1482 */ |
| 1483 core.String kind; |
| 1484 |
| 1485 /** |
| 1486 * A token that can be used to request the next results page. This property is |
| 1487 * omitted on the final results page. |
| 1488 */ |
| 1489 core.String nextPageToken; |
| 1490 |
| 1491 |
| 1492 DatasetList(); |
| 1493 |
| 1494 DatasetList.fromJson(core.Map _json) { |
| 1495 if (_json.containsKey("datasets")) { |
| 1496 datasets = _json["datasets"].map((value) => new DatasetListDatasets.fromJs
on(value)).toList(); |
| 1497 } |
| 1498 if (_json.containsKey("etag")) { |
| 1499 etag = _json["etag"]; |
| 1500 } |
| 1501 if (_json.containsKey("kind")) { |
| 1502 kind = _json["kind"]; |
| 1503 } |
| 1504 if (_json.containsKey("nextPageToken")) { |
| 1505 nextPageToken = _json["nextPageToken"]; |
| 1506 } |
| 1507 } |
| 1508 |
| 1509 core.Map toJson() { |
| 1510 var _json = new core.Map(); |
| 1511 if (datasets != null) { |
| 1512 _json["datasets"] = datasets.map((value) => (value).toJson()).toList(); |
| 1513 } |
| 1514 if (etag != null) { |
| 1515 _json["etag"] = etag; |
| 1516 } |
| 1517 if (kind != null) { |
| 1518 _json["kind"] = kind; |
| 1519 } |
| 1520 if (nextPageToken != null) { |
| 1521 _json["nextPageToken"] = nextPageToken; |
| 1522 } |
| 1523 return _json; |
| 1524 } |
| 1525 } |
| 1526 |
| 1527 |
| 1528 /** Not documented yet. */ |
| 1529 class DatasetReference { |
| 1530 /** [Required] A unique ID for this dataset, without the project name. */ |
| 1531 core.String datasetId; |
| 1532 |
| 1533 /** [Optional] The ID of the container project. */ |
| 1534 core.String projectId; |
| 1535 |
| 1536 |
| 1537 DatasetReference(); |
| 1538 |
| 1539 DatasetReference.fromJson(core.Map _json) { |
| 1540 if (_json.containsKey("datasetId")) { |
| 1541 datasetId = _json["datasetId"]; |
| 1542 } |
| 1543 if (_json.containsKey("projectId")) { |
| 1544 projectId = _json["projectId"]; |
| 1545 } |
| 1546 } |
| 1547 |
| 1548 core.Map toJson() { |
| 1549 var _json = new core.Map(); |
| 1550 if (datasetId != null) { |
| 1551 _json["datasetId"] = datasetId; |
| 1552 } |
| 1553 if (projectId != null) { |
| 1554 _json["projectId"] = projectId; |
| 1555 } |
| 1556 return _json; |
| 1557 } |
| 1558 } |
| 1559 |
| 1560 |
| 1561 /** Not documented yet. */ |
| 1562 class ErrorProto { |
| 1563 /** |
| 1564 * Debugging information. This property is internal to Google and should not |
| 1565 * be used. |
| 1566 */ |
| 1567 core.String debugInfo; |
| 1568 |
| 1569 /** Specifies where the error occurred, if present. */ |
| 1570 core.String location; |
| 1571 |
| 1572 /** A human-readable description of the error. */ |
| 1573 core.String message; |
| 1574 |
| 1575 /** A short error code that summarizes the error. */ |
| 1576 core.String reason; |
| 1577 |
| 1578 |
| 1579 ErrorProto(); |
| 1580 |
| 1581 ErrorProto.fromJson(core.Map _json) { |
| 1582 if (_json.containsKey("debugInfo")) { |
| 1583 debugInfo = _json["debugInfo"]; |
| 1584 } |
| 1585 if (_json.containsKey("location")) { |
| 1586 location = _json["location"]; |
| 1587 } |
| 1588 if (_json.containsKey("message")) { |
| 1589 message = _json["message"]; |
| 1590 } |
| 1591 if (_json.containsKey("reason")) { |
| 1592 reason = _json["reason"]; |
| 1593 } |
| 1594 } |
| 1595 |
| 1596 core.Map toJson() { |
| 1597 var _json = new core.Map(); |
| 1598 if (debugInfo != null) { |
| 1599 _json["debugInfo"] = debugInfo; |
| 1600 } |
| 1601 if (location != null) { |
| 1602 _json["location"] = location; |
| 1603 } |
| 1604 if (message != null) { |
| 1605 _json["message"] = message; |
| 1606 } |
| 1607 if (reason != null) { |
| 1608 _json["reason"] = reason; |
| 1609 } |
| 1610 return _json; |
| 1611 } |
| 1612 } |
| 1613 |
| 1614 |
| 1615 /** Not documented yet. */ |
| 1616 class GetQueryResultsResponse { |
| 1617 /** Whether the query result was fetched from the query cache. */ |
| 1618 core.bool cacheHit; |
| 1619 |
| 1620 /** A hash of this response. */ |
| 1621 core.String etag; |
| 1622 |
| 1623 /** |
| 1624 * Whether the query has completed or not. If rows or totalRows are present, |
| 1625 * this will always be true. If this is false, totalRows will not be |
| 1626 * available. |
| 1627 */ |
| 1628 core.bool jobComplete; |
| 1629 |
| 1630 /** |
| 1631 * Reference to the BigQuery Job that was created to run the query. This field |
| 1632 * will be present even if the original request timed out, in which case |
| 1633 * GetQueryResults can be used to read the results once the query has |
| 1634 * completed. Since this API only returns the first page of results, |
| 1635 * subsequent pages can be fetched via the same mechanism (GetQueryResults). |
| 1636 */ |
| 1637 JobReference jobReference; |
| 1638 |
| 1639 /** The resource type of the response. */ |
| 1640 core.String kind; |
| 1641 |
| 1642 /** A token used for paging results. */ |
| 1643 core.String pageToken; |
| 1644 |
| 1645 /** |
| 1646 * An object with as many results as can be contained within the maximum |
| 1647 * permitted reply size. To get any additional rows, you can call |
| 1648 * GetQueryResults and specify the jobReference returned above. Present only |
| 1649 * when the query completes successfully. |
| 1650 */ |
| 1651 core.List<TableRow> rows; |
| 1652 |
| 1653 /** |
| 1654 * The schema of the results. Present only when the query completes |
| 1655 * successfully. |
| 1656 */ |
| 1657 TableSchema schema; |
| 1658 |
| 1659 /** |
| 1660 * The total number of rows in the complete query result set, which can be |
| 1661 * more than the number of rows in this single page of results. Present only |
| 1662 * when the query completes successfully. |
| 1663 */ |
| 1664 core.String totalRows; |
| 1665 |
| 1666 |
| 1667 GetQueryResultsResponse(); |
| 1668 |
| 1669 GetQueryResultsResponse.fromJson(core.Map _json) { |
| 1670 if (_json.containsKey("cacheHit")) { |
| 1671 cacheHit = _json["cacheHit"]; |
| 1672 } |
| 1673 if (_json.containsKey("etag")) { |
| 1674 etag = _json["etag"]; |
| 1675 } |
| 1676 if (_json.containsKey("jobComplete")) { |
| 1677 jobComplete = _json["jobComplete"]; |
| 1678 } |
| 1679 if (_json.containsKey("jobReference")) { |
| 1680 jobReference = new JobReference.fromJson(_json["jobReference"]); |
| 1681 } |
| 1682 if (_json.containsKey("kind")) { |
| 1683 kind = _json["kind"]; |
| 1684 } |
| 1685 if (_json.containsKey("pageToken")) { |
| 1686 pageToken = _json["pageToken"]; |
| 1687 } |
| 1688 if (_json.containsKey("rows")) { |
| 1689 rows = _json["rows"].map((value) => new TableRow.fromJson(value)).toList()
; |
| 1690 } |
| 1691 if (_json.containsKey("schema")) { |
| 1692 schema = new TableSchema.fromJson(_json["schema"]); |
| 1693 } |
| 1694 if (_json.containsKey("totalRows")) { |
| 1695 totalRows = _json["totalRows"]; |
| 1696 } |
| 1697 } |
| 1698 |
| 1699 core.Map toJson() { |
| 1700 var _json = new core.Map(); |
| 1701 if (cacheHit != null) { |
| 1702 _json["cacheHit"] = cacheHit; |
| 1703 } |
| 1704 if (etag != null) { |
| 1705 _json["etag"] = etag; |
| 1706 } |
| 1707 if (jobComplete != null) { |
| 1708 _json["jobComplete"] = jobComplete; |
| 1709 } |
| 1710 if (jobReference != null) { |
| 1711 _json["jobReference"] = (jobReference).toJson(); |
| 1712 } |
| 1713 if (kind != null) { |
| 1714 _json["kind"] = kind; |
| 1715 } |
| 1716 if (pageToken != null) { |
| 1717 _json["pageToken"] = pageToken; |
| 1718 } |
| 1719 if (rows != null) { |
| 1720 _json["rows"] = rows.map((value) => (value).toJson()).toList(); |
| 1721 } |
| 1722 if (schema != null) { |
| 1723 _json["schema"] = (schema).toJson(); |
| 1724 } |
| 1725 if (totalRows != null) { |
| 1726 _json["totalRows"] = totalRows; |
| 1727 } |
| 1728 return _json; |
| 1729 } |
| 1730 } |
| 1731 |
| 1732 |
| 1733 /** Not documented yet. */ |
| 1734 class Job { |
| 1735 /** [Required] Describes the job configuration. */ |
| 1736 JobConfiguration configuration; |
| 1737 |
| 1738 /** [Output-only] A hash of this resource. */ |
| 1739 core.String etag; |
| 1740 |
| 1741 /** [Output-only] Opaque ID field of the job */ |
| 1742 core.String id; |
| 1743 |
| 1744 /** [Optional] Reference describing the unique-per-user name of the job. */ |
| 1745 JobReference jobReference; |
| 1746 |
| 1747 /** [Output-only] The type of the resource. */ |
| 1748 core.String kind; |
| 1749 |
| 1750 /** [Output-only] A URL that can be used to access this resource again. */ |
| 1751 core.String selfLink; |
| 1752 |
| 1753 /** |
| 1754 * [Output-only] Information about the job, including starting time and ending |
| 1755 * time of the job. |
| 1756 */ |
| 1757 JobStatistics statistics; |
| 1758 |
| 1759 /** |
| 1760 * [Output-only] The status of this job. Examine this value when polling an |
| 1761 * asynchronous job to see if the job is complete. |
| 1762 */ |
| 1763 JobStatus status; |
| 1764 |
| 1765 |
| 1766 Job(); |
| 1767 |
| 1768 Job.fromJson(core.Map _json) { |
| 1769 if (_json.containsKey("configuration")) { |
| 1770 configuration = new JobConfiguration.fromJson(_json["configuration"]); |
| 1771 } |
| 1772 if (_json.containsKey("etag")) { |
| 1773 etag = _json["etag"]; |
| 1774 } |
| 1775 if (_json.containsKey("id")) { |
| 1776 id = _json["id"]; |
| 1777 } |
| 1778 if (_json.containsKey("jobReference")) { |
| 1779 jobReference = new JobReference.fromJson(_json["jobReference"]); |
| 1780 } |
| 1781 if (_json.containsKey("kind")) { |
| 1782 kind = _json["kind"]; |
| 1783 } |
| 1784 if (_json.containsKey("selfLink")) { |
| 1785 selfLink = _json["selfLink"]; |
| 1786 } |
| 1787 if (_json.containsKey("statistics")) { |
| 1788 statistics = new JobStatistics.fromJson(_json["statistics"]); |
| 1789 } |
| 1790 if (_json.containsKey("status")) { |
| 1791 status = new JobStatus.fromJson(_json["status"]); |
| 1792 } |
| 1793 } |
| 1794 |
| 1795 core.Map toJson() { |
| 1796 var _json = new core.Map(); |
| 1797 if (configuration != null) { |
| 1798 _json["configuration"] = (configuration).toJson(); |
| 1799 } |
| 1800 if (etag != null) { |
| 1801 _json["etag"] = etag; |
| 1802 } |
| 1803 if (id != null) { |
| 1804 _json["id"] = id; |
| 1805 } |
| 1806 if (jobReference != null) { |
| 1807 _json["jobReference"] = (jobReference).toJson(); |
| 1808 } |
| 1809 if (kind != null) { |
| 1810 _json["kind"] = kind; |
| 1811 } |
| 1812 if (selfLink != null) { |
| 1813 _json["selfLink"] = selfLink; |
| 1814 } |
| 1815 if (statistics != null) { |
| 1816 _json["statistics"] = (statistics).toJson(); |
| 1817 } |
| 1818 if (status != null) { |
| 1819 _json["status"] = (status).toJson(); |
| 1820 } |
| 1821 return _json; |
| 1822 } |
| 1823 } |
| 1824 |
| 1825 |
| 1826 /** Not documented yet. */ |
| 1827 class JobConfiguration { |
| 1828 /** [Pick one] Copies a table. */ |
| 1829 JobConfigurationTableCopy copy; |
| 1830 |
| 1831 /** |
| 1832 * [Optional] If set, don't actually run this job. A valid query will return a |
| 1833 * mostly empty response with some processing statistics, while an invalid |
| 1834 * query will return the same error it would if it wasn't a dry run. Behavior |
| 1835 * of non-query jobs is undefined. |
| 1836 */ |
| 1837 core.bool dryRun; |
| 1838 |
| 1839 /** [Pick one] Configures an extract job. */ |
| 1840 JobConfigurationExtract extract; |
| 1841 |
| 1842 /** [Pick one] Configures a link job. */ |
| 1843 JobConfigurationLink link; |
| 1844 |
| 1845 /** [Pick one] Configures a load job. */ |
| 1846 JobConfigurationLoad load; |
| 1847 |
| 1848 /** [Pick one] Configures a query job. */ |
| 1849 JobConfigurationQuery query; |
| 1850 |
| 1851 |
| 1852 JobConfiguration(); |
| 1853 |
| 1854 JobConfiguration.fromJson(core.Map _json) { |
| 1855 if (_json.containsKey("copy")) { |
| 1856 copy = new JobConfigurationTableCopy.fromJson(_json["copy"]); |
| 1857 } |
| 1858 if (_json.containsKey("dryRun")) { |
| 1859 dryRun = _json["dryRun"]; |
| 1860 } |
| 1861 if (_json.containsKey("extract")) { |
| 1862 extract = new JobConfigurationExtract.fromJson(_json["extract"]); |
| 1863 } |
| 1864 if (_json.containsKey("link")) { |
| 1865 link = new JobConfigurationLink.fromJson(_json["link"]); |
| 1866 } |
| 1867 if (_json.containsKey("load")) { |
| 1868 load = new JobConfigurationLoad.fromJson(_json["load"]); |
| 1869 } |
| 1870 if (_json.containsKey("query")) { |
| 1871 query = new JobConfigurationQuery.fromJson(_json["query"]); |
| 1872 } |
| 1873 } |
| 1874 |
| 1875 core.Map toJson() { |
| 1876 var _json = new core.Map(); |
| 1877 if (copy != null) { |
| 1878 _json["copy"] = (copy).toJson(); |
| 1879 } |
| 1880 if (dryRun != null) { |
| 1881 _json["dryRun"] = dryRun; |
| 1882 } |
| 1883 if (extract != null) { |
| 1884 _json["extract"] = (extract).toJson(); |
| 1885 } |
| 1886 if (link != null) { |
| 1887 _json["link"] = (link).toJson(); |
| 1888 } |
| 1889 if (load != null) { |
| 1890 _json["load"] = (load).toJson(); |
| 1891 } |
| 1892 if (query != null) { |
| 1893 _json["query"] = (query).toJson(); |
| 1894 } |
| 1895 return _json; |
| 1896 } |
| 1897 } |
| 1898 |
| 1899 |
| 1900 /** Not documented yet. */ |
| 1901 class JobConfigurationExtract { |
| 1902 /** |
| 1903 * [Optional] The compression type to use for exported files. Possible values |
| 1904 * include GZIP and NONE. The default value is NONE. |
| 1905 */ |
| 1906 core.String compression; |
| 1907 |
| 1908 /** |
| 1909 * [Optional] The exported file format. Possible values include CSV, |
| 1910 * NEWLINE_DELIMITED_JSON and AVRO. The default value is CSV. Tables with |
| 1911 * nested or repeated fields cannot be exported as CSV. |
| 1912 */ |
| 1913 core.String destinationFormat; |
| 1914 |
| 1915 /** |
| 1916 * [Pick one] DEPRECATED: Use destinationUris instead, passing only one URI as |
| 1917 * necessary. The fully-qualified Google Cloud Storage URI where the extracted |
| 1918 * table should be written. |
| 1919 */ |
| 1920 core.String destinationUri; |
| 1921 |
| 1922 /** |
| 1923 * [Pick one] A list of fully-qualified Google Cloud Storage URIs where the |
| 1924 * extracted table should be written. |
| 1925 */ |
| 1926 core.List<core.String> destinationUris; |
| 1927 |
| 1928 /** |
| 1929 * [Optional] Delimiter to use between fields in the exported data. Default is |
| 1930 * ',' |
| 1931 */ |
| 1932 core.String fieldDelimiter; |
| 1933 |
| 1934 /** |
| 1935 * [Optional] Whether to print out a header row in the results. Default is |
| 1936 * true. |
| 1937 */ |
| 1938 core.bool printHeader; |
| 1939 |
| 1940 /** [Required] A reference to the table being exported. */ |
| 1941 TableReference sourceTable; |
| 1942 |
| 1943 |
| 1944 JobConfigurationExtract(); |
| 1945 |
| 1946 JobConfigurationExtract.fromJson(core.Map _json) { |
| 1947 if (_json.containsKey("compression")) { |
| 1948 compression = _json["compression"]; |
| 1949 } |
| 1950 if (_json.containsKey("destinationFormat")) { |
| 1951 destinationFormat = _json["destinationFormat"]; |
| 1952 } |
| 1953 if (_json.containsKey("destinationUri")) { |
| 1954 destinationUri = _json["destinationUri"]; |
| 1955 } |
| 1956 if (_json.containsKey("destinationUris")) { |
| 1957 destinationUris = _json["destinationUris"]; |
| 1958 } |
| 1959 if (_json.containsKey("fieldDelimiter")) { |
| 1960 fieldDelimiter = _json["fieldDelimiter"]; |
| 1961 } |
| 1962 if (_json.containsKey("printHeader")) { |
| 1963 printHeader = _json["printHeader"]; |
| 1964 } |
| 1965 if (_json.containsKey("sourceTable")) { |
| 1966 sourceTable = new TableReference.fromJson(_json["sourceTable"]); |
| 1967 } |
| 1968 } |
| 1969 |
| 1970 core.Map toJson() { |
| 1971 var _json = new core.Map(); |
| 1972 if (compression != null) { |
| 1973 _json["compression"] = compression; |
| 1974 } |
| 1975 if (destinationFormat != null) { |
| 1976 _json["destinationFormat"] = destinationFormat; |
| 1977 } |
| 1978 if (destinationUri != null) { |
| 1979 _json["destinationUri"] = destinationUri; |
| 1980 } |
| 1981 if (destinationUris != null) { |
| 1982 _json["destinationUris"] = destinationUris; |
| 1983 } |
| 1984 if (fieldDelimiter != null) { |
| 1985 _json["fieldDelimiter"] = fieldDelimiter; |
| 1986 } |
| 1987 if (printHeader != null) { |
| 1988 _json["printHeader"] = printHeader; |
| 1989 } |
| 1990 if (sourceTable != null) { |
| 1991 _json["sourceTable"] = (sourceTable).toJson(); |
| 1992 } |
| 1993 return _json; |
| 1994 } |
| 1995 } |
| 1996 |
| 1997 |
| 1998 /** Not documented yet. */ |
| 1999 class JobConfigurationLink { |
| 2000 /** |
| 2001 * [Optional] Specifies whether the job is allowed to create new tables. The |
| 2002 * following values are supported: CREATE_IF_NEEDED: If the table does not |
| 2003 * exist, BigQuery creates the table. CREATE_NEVER: The table must already |
| 2004 * exist. If it does not, a 'notFound' error is returned in the job result. |
| 2005 * The default value is CREATE_IF_NEEDED. Creation, truncation and append |
| 2006 * actions occur as one atomic update upon job completion. |
| 2007 */ |
| 2008 core.String createDisposition; |
| 2009 |
| 2010 /** [Required] The destination table of the link job. */ |
| 2011 TableReference destinationTable; |
| 2012 |
| 2013 /** [Required] URI of source table to link. */ |
| 2014 core.List<core.String> sourceUri; |
| 2015 |
| 2016 /** |
| 2017 * [Optional] Specifies the action that occurs if the destination table |
| 2018 * already exists. The following values are supported: WRITE_TRUNCATE: If the |
| 2019 * table already exists, BigQuery overwrites the table data. WRITE_APPEND: If |
| 2020 * the table already exists, BigQuery appends the data to the table. |
| 2021 * WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' |
| 2022 * error is returned in the job result. The default value is WRITE_EMPTY. Each |
| 2023 * action is atomic and only occurs if BigQuery is able to complete the job |
| 2024 * successfully. Creation, truncation and append actions occur as one atomic |
| 2025 * update upon job completion. |
| 2026 */ |
| 2027 core.String writeDisposition; |
| 2028 |
| 2029 |
| 2030 JobConfigurationLink(); |
| 2031 |
| 2032 JobConfigurationLink.fromJson(core.Map _json) { |
| 2033 if (_json.containsKey("createDisposition")) { |
| 2034 createDisposition = _json["createDisposition"]; |
| 2035 } |
| 2036 if (_json.containsKey("destinationTable")) { |
| 2037 destinationTable = new TableReference.fromJson(_json["destinationTable"]); |
| 2038 } |
| 2039 if (_json.containsKey("sourceUri")) { |
| 2040 sourceUri = _json["sourceUri"]; |
| 2041 } |
| 2042 if (_json.containsKey("writeDisposition")) { |
| 2043 writeDisposition = _json["writeDisposition"]; |
| 2044 } |
| 2045 } |
| 2046 |
| 2047 core.Map toJson() { |
| 2048 var _json = new core.Map(); |
| 2049 if (createDisposition != null) { |
| 2050 _json["createDisposition"] = createDisposition; |
| 2051 } |
| 2052 if (destinationTable != null) { |
| 2053 _json["destinationTable"] = (destinationTable).toJson(); |
| 2054 } |
| 2055 if (sourceUri != null) { |
| 2056 _json["sourceUri"] = sourceUri; |
| 2057 } |
| 2058 if (writeDisposition != null) { |
| 2059 _json["writeDisposition"] = writeDisposition; |
| 2060 } |
| 2061 return _json; |
| 2062 } |
| 2063 } |
| 2064 |
| 2065 |
| 2066 /** Not documented yet. */ |
| 2067 class JobConfigurationLoad { |
| 2068 /** |
| 2069 * [Optional] Accept rows that are missing trailing optional columns. The |
| 2070 * missing values are treated as nulls. Default is false which treats short |
| 2071 * rows as errors. Only applicable to CSV, ignored for other formats. |
| 2072 */ |
| 2073 core.bool allowJaggedRows; |
| 2074 |
| 2075 /** |
| 2076 * Indicates if BigQuery should allow quoted data sections that contain |
| 2077 * newline characters in a CSV file. The default value is false. |
| 2078 */ |
| 2079 core.bool allowQuotedNewlines; |
| 2080 |
| 2081 /** |
| 2082 * [Optional] Specifies whether the job is allowed to create new tables. The |
| 2083 * following values are supported: CREATE_IF_NEEDED: If the table does not |
| 2084 * exist, BigQuery creates the table. CREATE_NEVER: The table must already |
| 2085 * exist. If it does not, a 'notFound' error is returned in the job result. |
| 2086 * The default value is CREATE_IF_NEEDED. Creation, truncation and append |
| 2087 * actions occur as one atomic update upon job completion. |
| 2088 */ |
| 2089 core.String createDisposition; |
| 2090 |
| 2091 /** [Required] The destination table to load the data into. */ |
| 2092 TableReference destinationTable; |
| 2093 |
| 2094 /** |
| 2095 * [Optional] The character encoding of the data. The supported values are |
| 2096 * UTF-8 or ISO-8859-1. The default value is UTF-8. BigQuery decodes the data |
| 2097 * after the raw, binary data has been split using the values of the quote and |
| 2098 * fieldDelimiter properties. |
| 2099 */ |
| 2100 core.String encoding; |
| 2101 |
| 2102 /** |
| 2103 * [Optional] The separator for fields in a CSV file. BigQuery converts the |
| 2104 * string to ISO-8859-1 encoding, and then uses the first byte of the encoded |
| 2105 * string to split the data in its raw, binary state. BigQuery also supports |
| 2106 * the escape sequence "\t" to specify a tab separator. The default value is a |
| 2107 * comma (','). |
| 2108 */ |
| 2109 core.String fieldDelimiter; |
| 2110 |
| 2111 /** |
| 2112 * [Optional] Accept rows that contain values that do not match the schema. |
| 2113 * The unknown values are ignored. Default is false which treats unknown |
| 2114 * values as errors. For CSV this ignores extra values at the end of a line. |
| 2115 * For JSON this ignores named values that do not match any column name. |
| 2116 */ |
| 2117 core.bool ignoreUnknownValues; |
| 2118 |
| 2119 /** |
| 2120 * [Optional] The maximum number of bad records that BigQuery can ignore when |
| 2121 * running the job. If the number of bad records exceeds this value, an |
| 2122 * 'invalid' error is returned in the job result and the job fails. The |
| 2123 * default value is 0, which requires that all records are valid. |
| 2124 */ |
| 2125 core.int maxBadRecords; |
| 2126 |
| 2127 /** |
| 2128 * [Optional] The value that is used to quote data sections in a CSV file. |
| 2129 * BigQuery converts the string to ISO-8859-1 encoding, and then uses the |
| 2130 * first byte of the encoded string to split the data in its raw, binary |
| 2131 * state. The default value is a double-quote ('"'). If your data does not |
| 2132 * contain quoted sections, set the property value to an empty string. If your |
| 2133 * data contains quoted newline characters, you must also set the |
| 2134 * allowQuotedNewlines property to true. |
| 2135 */ |
| 2136 core.String quote; |
| 2137 |
| 2138 /** |
| 2139 * [Optional] The schema for the destination table. The schema can be omitted |
| 2140 * if the destination table already exists or if the schema can be inferred |
| 2141 * from the loaded data. |
| 2142 */ |
| 2143 TableSchema schema; |
| 2144 |
| 2145 /** |
| 2146 * [Deprecated] The inline schema. For CSV schemas, specify as |
| 2147 * "Field1:Type1[,Field2:Type2]*". For example, "foo:STRING, bar:INTEGER, |
| 2148 * baz:FLOAT". |
| 2149 */ |
| 2150 core.String schemaInline; |
| 2151 |
| 2152 /** [Deprecated] The format of the schemaInline property. */ |
| 2153 core.String schemaInlineFormat; |
| 2154 |
| 2155 /** |
| 2156 * [Optional] The number of rows at the top of a CSV file that BigQuery will |
| 2157 * skip when loading the data. The default value is 0. This property is useful |
| 2158 * if you have header rows in the file that should be skipped. |
| 2159 */ |
| 2160 core.int skipLeadingRows; |
| 2161 |
| 2162 /** |
| 2163 * [Optional] The format of the data files. For CSV files, specify "CSV". For |
| 2164 * datastore backups, specify "DATASTORE_BACKUP". For newline-delimited JSON, |
| 2165 * specify "NEWLINE_DELIMITED_JSON". The default value is CSV. |
| 2166 */ |
| 2167 core.String sourceFormat; |
| 2168 |
| 2169 /** |
| 2170 * [Required] The fully-qualified URIs that point to your data on Google Cloud |
| 2171 * Storage. |
| 2172 */ |
| 2173 core.List<core.String> sourceUris; |
| 2174 |
| 2175 /** |
| 2176 * [Optional] Specifies the action that occurs if the destination table |
| 2177 * already exists. The following values are supported: WRITE_TRUNCATE: If the |
| 2178 * table already exists, BigQuery overwrites the table data. WRITE_APPEND: If |
| 2179 * the table already exists, BigQuery appends the data to the table. |
| 2180 * WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' |
| 2181 * error is returned in the job result. The default value is WRITE_EMPTY. Each |
| 2182 * action is atomic and only occurs if BigQuery is able to complete the job |
| 2183 * successfully. Creation, truncation and append actions occur as one atomic |
| 2184 * update upon job completion. |
| 2185 */ |
| 2186 core.String writeDisposition; |
| 2187 |
| 2188 |
| 2189 JobConfigurationLoad(); |
| 2190 |
| 2191 JobConfigurationLoad.fromJson(core.Map _json) { |
| 2192 if (_json.containsKey("allowJaggedRows")) { |
| 2193 allowJaggedRows = _json["allowJaggedRows"]; |
| 2194 } |
| 2195 if (_json.containsKey("allowQuotedNewlines")) { |
| 2196 allowQuotedNewlines = _json["allowQuotedNewlines"]; |
| 2197 } |
| 2198 if (_json.containsKey("createDisposition")) { |
| 2199 createDisposition = _json["createDisposition"]; |
| 2200 } |
| 2201 if (_json.containsKey("destinationTable")) { |
| 2202 destinationTable = new TableReference.fromJson(_json["destinationTable"]); |
| 2203 } |
| 2204 if (_json.containsKey("encoding")) { |
| 2205 encoding = _json["encoding"]; |
| 2206 } |
| 2207 if (_json.containsKey("fieldDelimiter")) { |
| 2208 fieldDelimiter = _json["fieldDelimiter"]; |
| 2209 } |
| 2210 if (_json.containsKey("ignoreUnknownValues")) { |
| 2211 ignoreUnknownValues = _json["ignoreUnknownValues"]; |
| 2212 } |
| 2213 if (_json.containsKey("maxBadRecords")) { |
| 2214 maxBadRecords = _json["maxBadRecords"]; |
| 2215 } |
| 2216 if (_json.containsKey("quote")) { |
| 2217 quote = _json["quote"]; |
| 2218 } |
| 2219 if (_json.containsKey("schema")) { |
| 2220 schema = new TableSchema.fromJson(_json["schema"]); |
| 2221 } |
| 2222 if (_json.containsKey("schemaInline")) { |
| 2223 schemaInline = _json["schemaInline"]; |
| 2224 } |
| 2225 if (_json.containsKey("schemaInlineFormat")) { |
| 2226 schemaInlineFormat = _json["schemaInlineFormat"]; |
| 2227 } |
| 2228 if (_json.containsKey("skipLeadingRows")) { |
| 2229 skipLeadingRows = _json["skipLeadingRows"]; |
| 2230 } |
| 2231 if (_json.containsKey("sourceFormat")) { |
| 2232 sourceFormat = _json["sourceFormat"]; |
| 2233 } |
| 2234 if (_json.containsKey("sourceUris")) { |
| 2235 sourceUris = _json["sourceUris"]; |
| 2236 } |
| 2237 if (_json.containsKey("writeDisposition")) { |
| 2238 writeDisposition = _json["writeDisposition"]; |
| 2239 } |
| 2240 } |
| 2241 |
| 2242 core.Map toJson() { |
| 2243 var _json = new core.Map(); |
| 2244 if (allowJaggedRows != null) { |
| 2245 _json["allowJaggedRows"] = allowJaggedRows; |
| 2246 } |
| 2247 if (allowQuotedNewlines != null) { |
| 2248 _json["allowQuotedNewlines"] = allowQuotedNewlines; |
| 2249 } |
| 2250 if (createDisposition != null) { |
| 2251 _json["createDisposition"] = createDisposition; |
| 2252 } |
| 2253 if (destinationTable != null) { |
| 2254 _json["destinationTable"] = (destinationTable).toJson(); |
| 2255 } |
| 2256 if (encoding != null) { |
| 2257 _json["encoding"] = encoding; |
| 2258 } |
| 2259 if (fieldDelimiter != null) { |
| 2260 _json["fieldDelimiter"] = fieldDelimiter; |
| 2261 } |
| 2262 if (ignoreUnknownValues != null) { |
| 2263 _json["ignoreUnknownValues"] = ignoreUnknownValues; |
| 2264 } |
| 2265 if (maxBadRecords != null) { |
| 2266 _json["maxBadRecords"] = maxBadRecords; |
| 2267 } |
| 2268 if (quote != null) { |
| 2269 _json["quote"] = quote; |
| 2270 } |
| 2271 if (schema != null) { |
| 2272 _json["schema"] = (schema).toJson(); |
| 2273 } |
| 2274 if (schemaInline != null) { |
| 2275 _json["schemaInline"] = schemaInline; |
| 2276 } |
| 2277 if (schemaInlineFormat != null) { |
| 2278 _json["schemaInlineFormat"] = schemaInlineFormat; |
| 2279 } |
| 2280 if (skipLeadingRows != null) { |
| 2281 _json["skipLeadingRows"] = skipLeadingRows; |
| 2282 } |
| 2283 if (sourceFormat != null) { |
| 2284 _json["sourceFormat"] = sourceFormat; |
| 2285 } |
| 2286 if (sourceUris != null) { |
| 2287 _json["sourceUris"] = sourceUris; |
| 2288 } |
| 2289 if (writeDisposition != null) { |
| 2290 _json["writeDisposition"] = writeDisposition; |
| 2291 } |
| 2292 return _json; |
| 2293 } |
| 2294 } |
| 2295 |
| 2296 |
| 2297 /** Not documented yet. */ |
| 2298 class JobConfigurationQuery { |
| 2299 /** |
| 2300 * If true, allows the query to produce arbitrarily large result tables at a |
| 2301 * slight cost in performance. Requires destinationTable to be set. |
| 2302 */ |
| 2303 core.bool allowLargeResults; |
| 2304 |
| 2305 /** |
| 2306 * [Optional] Specifies whether the job is allowed to create new tables. The |
| 2307 * following values are supported: CREATE_IF_NEEDED: If the table does not |
| 2308 * exist, BigQuery creates the table. CREATE_NEVER: The table must already |
| 2309 * exist. If it does not, a 'notFound' error is returned in the job result. |
| 2310 * The default value is CREATE_IF_NEEDED. Creation, truncation and append |
| 2311 * actions occur as one atomic update upon job completion. |
| 2312 */ |
| 2313 core.String createDisposition; |
| 2314 |
| 2315 /** |
| 2316 * [Optional] Specifies the default dataset to use for unqualified table names |
| 2317 * in the query. |
| 2318 */ |
| 2319 DatasetReference defaultDataset; |
| 2320 |
| 2321 /** |
| 2322 * [Optional] Describes the table where the query results should be stored. If |
| 2323 * not present, a new table will be created to store the results. |
| 2324 */ |
| 2325 TableReference destinationTable; |
| 2326 |
| 2327 /** |
| 2328 * [Experimental] Flattens all nested and repeated fields in the query |
| 2329 * results. The default value is true. allowLargeResults must be true if this |
| 2330 * is set to false. |
| 2331 */ |
| 2332 core.bool flattenResults; |
| 2333 |
| 2334 /** [Deprecated] This property is deprecated. */ |
| 2335 core.bool preserveNulls; |
| 2336 |
| 2337 /** |
| 2338 * [Optional] Specifies a priority for the query. Possible values include |
| 2339 * INTERACTIVE and BATCH. The default value is INTERACTIVE. |
| 2340 */ |
| 2341 core.String priority; |
| 2342 |
| 2343 /** [Required] BigQuery SQL query to execute. */ |
| 2344 core.String query; |
| 2345 |
| 2346 /** |
| 2347 * [Optional] Whether to look for the result in the query cache. The query |
| 2348 * cache is a best-effort cache that will be flushed whenever tables in the |
| 2349 * query are modified. Moreover, the query cache is only available when a |
| 2350 * query does not have a destination table specified. |
| 2351 */ |
| 2352 core.bool useQueryCache; |
| 2353 |
| 2354 /** |
| 2355 * [Optional] Specifies the action that occurs if the destination table |
| 2356 * already exists. The following values are supported: WRITE_TRUNCATE: If the |
| 2357 * table already exists, BigQuery overwrites the table data. WRITE_APPEND: If |
| 2358 * the table already exists, BigQuery appends the data to the table. |
| 2359 * WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' |
| 2360 * error is returned in the job result. The default value is WRITE_EMPTY. Each |
| 2361 * action is atomic and only occurs if BigQuery is able to complete the job |
| 2362 * successfully. Creation, truncation and append actions occur as one atomic |
| 2363 * update upon job completion. |
| 2364 */ |
| 2365 core.String writeDisposition; |
| 2366 |
| 2367 |
| 2368 JobConfigurationQuery(); |
| 2369 |
| 2370 JobConfigurationQuery.fromJson(core.Map _json) { |
| 2371 if (_json.containsKey("allowLargeResults")) { |
| 2372 allowLargeResults = _json["allowLargeResults"]; |
| 2373 } |
| 2374 if (_json.containsKey("createDisposition")) { |
| 2375 createDisposition = _json["createDisposition"]; |
| 2376 } |
| 2377 if (_json.containsKey("defaultDataset")) { |
| 2378 defaultDataset = new DatasetReference.fromJson(_json["defaultDataset"]); |
| 2379 } |
| 2380 if (_json.containsKey("destinationTable")) { |
| 2381 destinationTable = new TableReference.fromJson(_json["destinationTable"]); |
| 2382 } |
| 2383 if (_json.containsKey("flattenResults")) { |
| 2384 flattenResults = _json["flattenResults"]; |
| 2385 } |
| 2386 if (_json.containsKey("preserveNulls")) { |
| 2387 preserveNulls = _json["preserveNulls"]; |
| 2388 } |
| 2389 if (_json.containsKey("priority")) { |
| 2390 priority = _json["priority"]; |
| 2391 } |
| 2392 if (_json.containsKey("query")) { |
| 2393 query = _json["query"]; |
| 2394 } |
| 2395 if (_json.containsKey("useQueryCache")) { |
| 2396 useQueryCache = _json["useQueryCache"]; |
| 2397 } |
| 2398 if (_json.containsKey("writeDisposition")) { |
| 2399 writeDisposition = _json["writeDisposition"]; |
| 2400 } |
| 2401 } |
| 2402 |
| 2403 core.Map toJson() { |
| 2404 var _json = new core.Map(); |
| 2405 if (allowLargeResults != null) { |
| 2406 _json["allowLargeResults"] = allowLargeResults; |
| 2407 } |
| 2408 if (createDisposition != null) { |
| 2409 _json["createDisposition"] = createDisposition; |
| 2410 } |
| 2411 if (defaultDataset != null) { |
| 2412 _json["defaultDataset"] = (defaultDataset).toJson(); |
| 2413 } |
| 2414 if (destinationTable != null) { |
| 2415 _json["destinationTable"] = (destinationTable).toJson(); |
| 2416 } |
| 2417 if (flattenResults != null) { |
| 2418 _json["flattenResults"] = flattenResults; |
| 2419 } |
| 2420 if (preserveNulls != null) { |
| 2421 _json["preserveNulls"] = preserveNulls; |
| 2422 } |
| 2423 if (priority != null) { |
| 2424 _json["priority"] = priority; |
| 2425 } |
| 2426 if (query != null) { |
| 2427 _json["query"] = query; |
| 2428 } |
| 2429 if (useQueryCache != null) { |
| 2430 _json["useQueryCache"] = useQueryCache; |
| 2431 } |
| 2432 if (writeDisposition != null) { |
| 2433 _json["writeDisposition"] = writeDisposition; |
| 2434 } |
| 2435 return _json; |
| 2436 } |
| 2437 } |
| 2438 |
| 2439 |
| 2440 /** Not documented yet. */ |
| 2441 class JobConfigurationTableCopy { |
| 2442 /** |
| 2443 * [Optional] Specifies whether the job is allowed to create new tables. The |
| 2444 * following values are supported: CREATE_IF_NEEDED: If the table does not |
| 2445 * exist, BigQuery creates the table. CREATE_NEVER: The table must already |
| 2446 * exist. If it does not, a 'notFound' error is returned in the job result. |
| 2447 * The default value is CREATE_IF_NEEDED. Creation, truncation and append |
| 2448 * actions occur as one atomic update upon job completion. |
| 2449 */ |
| 2450 core.String createDisposition; |
| 2451 |
| 2452 /** [Required] The destination table */ |
| 2453 TableReference destinationTable; |
| 2454 |
| 2455 /** [Pick one] Source table to copy. */ |
| 2456 TableReference sourceTable; |
| 2457 |
| 2458 /** [Pick one] Source tables to copy. */ |
| 2459 core.List<TableReference> sourceTables; |
| 2460 |
| 2461 /** |
| 2462 * [Optional] Specifies the action that occurs if the destination table |
| 2463 * already exists. The following values are supported: WRITE_TRUNCATE: If the |
| 2464 * table already exists, BigQuery overwrites the table data. WRITE_APPEND: If |
| 2465 * the table already exists, BigQuery appends the data to the table. |
| 2466 * WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' |
| 2467 * error is returned in the job result. The default value is WRITE_EMPTY. Each |
| 2468 * action is atomic and only occurs if BigQuery is able to complete the job |
| 2469 * successfully. Creation, truncation and append actions occur as one atomic |
| 2470 * update upon job completion. |
| 2471 */ |
| 2472 core.String writeDisposition; |
| 2473 |
| 2474 |
| 2475 JobConfigurationTableCopy(); |
| 2476 |
| 2477 JobConfigurationTableCopy.fromJson(core.Map _json) { |
| 2478 if (_json.containsKey("createDisposition")) { |
| 2479 createDisposition = _json["createDisposition"]; |
| 2480 } |
| 2481 if (_json.containsKey("destinationTable")) { |
| 2482 destinationTable = new TableReference.fromJson(_json["destinationTable"]); |
| 2483 } |
| 2484 if (_json.containsKey("sourceTable")) { |
| 2485 sourceTable = new TableReference.fromJson(_json["sourceTable"]); |
| 2486 } |
| 2487 if (_json.containsKey("sourceTables")) { |
| 2488 sourceTables = _json["sourceTables"].map((value) => new TableReference.fro
mJson(value)).toList(); |
| 2489 } |
| 2490 if (_json.containsKey("writeDisposition")) { |
| 2491 writeDisposition = _json["writeDisposition"]; |
| 2492 } |
| 2493 } |
| 2494 |
| 2495 core.Map toJson() { |
| 2496 var _json = new core.Map(); |
| 2497 if (createDisposition != null) { |
| 2498 _json["createDisposition"] = createDisposition; |
| 2499 } |
| 2500 if (destinationTable != null) { |
| 2501 _json["destinationTable"] = (destinationTable).toJson(); |
| 2502 } |
| 2503 if (sourceTable != null) { |
| 2504 _json["sourceTable"] = (sourceTable).toJson(); |
| 2505 } |
| 2506 if (sourceTables != null) { |
| 2507 _json["sourceTables"] = sourceTables.map((value) => (value).toJson()).toLi
st(); |
| 2508 } |
| 2509 if (writeDisposition != null) { |
| 2510 _json["writeDisposition"] = writeDisposition; |
| 2511 } |
| 2512 return _json; |
| 2513 } |
| 2514 } |
| 2515 |
| 2516 |
| 2517 /** Not documented yet. */ |
| 2518 class JobListJobs { |
| 2519 /** [Full-projection-only] Specifies the job configuration. */ |
| 2520 JobConfiguration configuration; |
| 2521 |
| 2522 /** A result object that will be present only if the job has failed. */ |
| 2523 ErrorProto errorResult; |
| 2524 |
| 2525 /** Unique opaque ID of the job. */ |
| 2526 core.String id; |
| 2527 |
| 2528 /** Job reference uniquely identifying the job. */ |
| 2529 JobReference jobReference; |
| 2530 |
| 2531 /** The resource type. */ |
| 2532 core.String kind; |
| 2533 |
| 2534 /** |
| 2535 * Running state of the job. When the state is DONE, errorResult can be |
| 2536 * checked to determine whether the job succeeded or failed. |
| 2537 */ |
| 2538 core.String state; |
| 2539 |
| 2540 /** |
| 2541 * [Output-only] Information about the job, including starting time and ending |
| 2542 * time of the job. |
| 2543 */ |
| 2544 JobStatistics statistics; |
| 2545 |
| 2546 /** [Full-projection-only] Describes the state of the job. */ |
| 2547 JobStatus status; |
| 2548 |
| 2549 /** [Full-projection-only] User who ran the job. */ |
| 2550 core.String userEmail; |
| 2551 |
| 2552 |
| 2553 JobListJobs(); |
| 2554 |
| 2555 JobListJobs.fromJson(core.Map _json) { |
| 2556 if (_json.containsKey("configuration")) { |
| 2557 configuration = new JobConfiguration.fromJson(_json["configuration"]); |
| 2558 } |
| 2559 if (_json.containsKey("errorResult")) { |
| 2560 errorResult = new ErrorProto.fromJson(_json["errorResult"]); |
| 2561 } |
| 2562 if (_json.containsKey("id")) { |
| 2563 id = _json["id"]; |
| 2564 } |
| 2565 if (_json.containsKey("jobReference")) { |
| 2566 jobReference = new JobReference.fromJson(_json["jobReference"]); |
| 2567 } |
| 2568 if (_json.containsKey("kind")) { |
| 2569 kind = _json["kind"]; |
| 2570 } |
| 2571 if (_json.containsKey("state")) { |
| 2572 state = _json["state"]; |
| 2573 } |
| 2574 if (_json.containsKey("statistics")) { |
| 2575 statistics = new JobStatistics.fromJson(_json["statistics"]); |
| 2576 } |
| 2577 if (_json.containsKey("status")) { |
| 2578 status = new JobStatus.fromJson(_json["status"]); |
| 2579 } |
| 2580 if (_json.containsKey("user_email")) { |
| 2581 userEmail = _json["user_email"]; |
| 2582 } |
| 2583 } |
| 2584 |
| 2585 core.Map toJson() { |
| 2586 var _json = new core.Map(); |
| 2587 if (configuration != null) { |
| 2588 _json["configuration"] = (configuration).toJson(); |
| 2589 } |
| 2590 if (errorResult != null) { |
| 2591 _json["errorResult"] = (errorResult).toJson(); |
| 2592 } |
| 2593 if (id != null) { |
| 2594 _json["id"] = id; |
| 2595 } |
| 2596 if (jobReference != null) { |
| 2597 _json["jobReference"] = (jobReference).toJson(); |
| 2598 } |
| 2599 if (kind != null) { |
| 2600 _json["kind"] = kind; |
| 2601 } |
| 2602 if (state != null) { |
| 2603 _json["state"] = state; |
| 2604 } |
| 2605 if (statistics != null) { |
| 2606 _json["statistics"] = (statistics).toJson(); |
| 2607 } |
| 2608 if (status != null) { |
| 2609 _json["status"] = (status).toJson(); |
| 2610 } |
| 2611 if (userEmail != null) { |
| 2612 _json["user_email"] = userEmail; |
| 2613 } |
| 2614 return _json; |
| 2615 } |
| 2616 } |
| 2617 |
| 2618 |
| 2619 /** Not documented yet. */ |
| 2620 class JobList { |
| 2621 /** A hash of this page of results. */ |
| 2622 core.String etag; |
| 2623 |
| 2624 /** List of jobs that were requested. */ |
| 2625 core.List<JobListJobs> jobs; |
| 2626 |
| 2627 /** The resource type of the response. */ |
| 2628 core.String kind; |
| 2629 |
| 2630 /** A token to request the next page of results. */ |
| 2631 core.String nextPageToken; |
| 2632 |
| 2633 /** Total number of jobs in this collection. */ |
| 2634 core.int totalItems; |
| 2635 |
| 2636 |
| 2637 JobList(); |
| 2638 |
| 2639 JobList.fromJson(core.Map _json) { |
| 2640 if (_json.containsKey("etag")) { |
| 2641 etag = _json["etag"]; |
| 2642 } |
| 2643 if (_json.containsKey("jobs")) { |
| 2644 jobs = _json["jobs"].map((value) => new JobListJobs.fromJson(value)).toLis
t(); |
| 2645 } |
| 2646 if (_json.containsKey("kind")) { |
| 2647 kind = _json["kind"]; |
| 2648 } |
| 2649 if (_json.containsKey("nextPageToken")) { |
| 2650 nextPageToken = _json["nextPageToken"]; |
| 2651 } |
| 2652 if (_json.containsKey("totalItems")) { |
| 2653 totalItems = _json["totalItems"]; |
| 2654 } |
| 2655 } |
| 2656 |
| 2657 core.Map toJson() { |
| 2658 var _json = new core.Map(); |
| 2659 if (etag != null) { |
| 2660 _json["etag"] = etag; |
| 2661 } |
| 2662 if (jobs != null) { |
| 2663 _json["jobs"] = jobs.map((value) => (value).toJson()).toList(); |
| 2664 } |
| 2665 if (kind != null) { |
| 2666 _json["kind"] = kind; |
| 2667 } |
| 2668 if (nextPageToken != null) { |
| 2669 _json["nextPageToken"] = nextPageToken; |
| 2670 } |
| 2671 if (totalItems != null) { |
| 2672 _json["totalItems"] = totalItems; |
| 2673 } |
| 2674 return _json; |
| 2675 } |
| 2676 } |
| 2677 |
| 2678 |
| 2679 /** Not documented yet. */ |
| 2680 class JobReference { |
| 2681 /** [Required] ID of the job. */ |
| 2682 core.String jobId; |
| 2683 |
| 2684 /** [Required] Project ID being billed for the job. */ |
| 2685 core.String projectId; |
| 2686 |
| 2687 |
| 2688 JobReference(); |
| 2689 |
| 2690 JobReference.fromJson(core.Map _json) { |
| 2691 if (_json.containsKey("jobId")) { |
| 2692 jobId = _json["jobId"]; |
| 2693 } |
| 2694 if (_json.containsKey("projectId")) { |
| 2695 projectId = _json["projectId"]; |
| 2696 } |
| 2697 } |
| 2698 |
| 2699 core.Map toJson() { |
| 2700 var _json = new core.Map(); |
| 2701 if (jobId != null) { |
| 2702 _json["jobId"] = jobId; |
| 2703 } |
| 2704 if (projectId != null) { |
| 2705 _json["projectId"] = projectId; |
| 2706 } |
| 2707 return _json; |
| 2708 } |
| 2709 } |
| 2710 |
| 2711 |
| 2712 /** Not documented yet. */ |
| 2713 class JobStatistics { |
| 2714 /** |
| 2715 * [Output-only] Creation time of this job, in milliseconds since the epoch. |
| 2716 * This field will be present on all jobs. |
| 2717 */ |
| 2718 core.String creationTime; |
| 2719 |
| 2720 /** |
| 2721 * [Output-only] End time of this job, in milliseconds since the epoch. This |
| 2722 * field will be present whenever a job is in the DONE state. |
| 2723 */ |
| 2724 core.String endTime; |
| 2725 |
| 2726 /** [Output-only] Statistics for a load job. */ |
| 2727 JobStatistics3 load; |
| 2728 |
| 2729 /** [Output-only] Statistics for a query job. */ |
| 2730 JobStatistics2 query; |
| 2731 |
| 2732 /** |
| 2733 * [Output-only] Start time of this job, in milliseconds since the epoch. This |
| 2734 * field will be present when the job transitions from the PENDING state to |
| 2735 * either RUNNING or DONE. |
| 2736 */ |
| 2737 core.String startTime; |
| 2738 |
| 2739 /** |
| 2740 * [Output-only] [Deprecated] Use the bytes processed in the query statistics |
| 2741 * instead. |
| 2742 */ |
| 2743 core.String totalBytesProcessed; |
| 2744 |
| 2745 |
| 2746 JobStatistics(); |
| 2747 |
| 2748 JobStatistics.fromJson(core.Map _json) { |
| 2749 if (_json.containsKey("creationTime")) { |
| 2750 creationTime = _json["creationTime"]; |
| 2751 } |
| 2752 if (_json.containsKey("endTime")) { |
| 2753 endTime = _json["endTime"]; |
| 2754 } |
| 2755 if (_json.containsKey("load")) { |
| 2756 load = new JobStatistics3.fromJson(_json["load"]); |
| 2757 } |
| 2758 if (_json.containsKey("query")) { |
| 2759 query = new JobStatistics2.fromJson(_json["query"]); |
| 2760 } |
| 2761 if (_json.containsKey("startTime")) { |
| 2762 startTime = _json["startTime"]; |
| 2763 } |
| 2764 if (_json.containsKey("totalBytesProcessed")) { |
| 2765 totalBytesProcessed = _json["totalBytesProcessed"]; |
| 2766 } |
| 2767 } |
| 2768 |
| 2769 core.Map toJson() { |
| 2770 var _json = new core.Map(); |
| 2771 if (creationTime != null) { |
| 2772 _json["creationTime"] = creationTime; |
| 2773 } |
| 2774 if (endTime != null) { |
| 2775 _json["endTime"] = endTime; |
| 2776 } |
| 2777 if (load != null) { |
| 2778 _json["load"] = (load).toJson(); |
| 2779 } |
| 2780 if (query != null) { |
| 2781 _json["query"] = (query).toJson(); |
| 2782 } |
| 2783 if (startTime != null) { |
| 2784 _json["startTime"] = startTime; |
| 2785 } |
| 2786 if (totalBytesProcessed != null) { |
| 2787 _json["totalBytesProcessed"] = totalBytesProcessed; |
| 2788 } |
| 2789 return _json; |
| 2790 } |
| 2791 } |
| 2792 |
| 2793 |
| 2794 /** Not documented yet. */ |
| 2795 class JobStatistics2 { |
| 2796 /** |
| 2797 * [Output-only] Whether the query result was fetched from the query cache. |
| 2798 */ |
| 2799 core.bool cacheHit; |
| 2800 |
| 2801 /** [Output-only] Total bytes processed for this job. */ |
| 2802 core.String totalBytesProcessed; |
| 2803 |
| 2804 |
| 2805 JobStatistics2(); |
| 2806 |
| 2807 JobStatistics2.fromJson(core.Map _json) { |
| 2808 if (_json.containsKey("cacheHit")) { |
| 2809 cacheHit = _json["cacheHit"]; |
| 2810 } |
| 2811 if (_json.containsKey("totalBytesProcessed")) { |
| 2812 totalBytesProcessed = _json["totalBytesProcessed"]; |
| 2813 } |
| 2814 } |
| 2815 |
| 2816 core.Map toJson() { |
| 2817 var _json = new core.Map(); |
| 2818 if (cacheHit != null) { |
| 2819 _json["cacheHit"] = cacheHit; |
| 2820 } |
| 2821 if (totalBytesProcessed != null) { |
| 2822 _json["totalBytesProcessed"] = totalBytesProcessed; |
| 2823 } |
| 2824 return _json; |
| 2825 } |
| 2826 } |
| 2827 |
| 2828 |
| 2829 /** Not documented yet. */ |
| 2830 class JobStatistics3 { |
| 2831 /** [Output-only] Number of bytes of source data in a joad job. */ |
| 2832 core.String inputFileBytes; |
| 2833 |
| 2834 /** [Output-only] Number of source files in a load job. */ |
| 2835 core.String inputFiles; |
| 2836 |
| 2837 /** |
| 2838 * [Output-only] Size of the loaded data in bytes. Note that while an import |
| 2839 * job is in the running state, this value may change. |
| 2840 */ |
| 2841 core.String outputBytes; |
| 2842 |
| 2843 /** |
| 2844 * [Output-only] Number of rows imported in a load job. Note that while an |
| 2845 * import job is in the running state, this value may change. |
| 2846 */ |
| 2847 core.String outputRows; |
| 2848 |
| 2849 |
| 2850 JobStatistics3(); |
| 2851 |
| 2852 JobStatistics3.fromJson(core.Map _json) { |
| 2853 if (_json.containsKey("inputFileBytes")) { |
| 2854 inputFileBytes = _json["inputFileBytes"]; |
| 2855 } |
| 2856 if (_json.containsKey("inputFiles")) { |
| 2857 inputFiles = _json["inputFiles"]; |
| 2858 } |
| 2859 if (_json.containsKey("outputBytes")) { |
| 2860 outputBytes = _json["outputBytes"]; |
| 2861 } |
| 2862 if (_json.containsKey("outputRows")) { |
| 2863 outputRows = _json["outputRows"]; |
| 2864 } |
| 2865 } |
| 2866 |
| 2867 core.Map toJson() { |
| 2868 var _json = new core.Map(); |
| 2869 if (inputFileBytes != null) { |
| 2870 _json["inputFileBytes"] = inputFileBytes; |
| 2871 } |
| 2872 if (inputFiles != null) { |
| 2873 _json["inputFiles"] = inputFiles; |
| 2874 } |
| 2875 if (outputBytes != null) { |
| 2876 _json["outputBytes"] = outputBytes; |
| 2877 } |
| 2878 if (outputRows != null) { |
| 2879 _json["outputRows"] = outputRows; |
| 2880 } |
| 2881 return _json; |
| 2882 } |
| 2883 } |
| 2884 |
| 2885 |
| 2886 /** Not documented yet. */ |
| 2887 class JobStatus { |
| 2888 /** |
| 2889 * [Output-only] Final error result of the job. If present, indicates that the |
| 2890 * job has completed and was unsuccessful. |
| 2891 */ |
| 2892 ErrorProto errorResult; |
| 2893 |
| 2894 /** |
| 2895 * [Output-only] All errors encountered during the running of the job. Errors |
| 2896 * here do not necessarily mean that the job has completed or was |
| 2897 * unsuccessful. |
| 2898 */ |
| 2899 core.List<ErrorProto> errors; |
| 2900 |
| 2901 /** [Output-only] Running state of the job. */ |
| 2902 core.String state; |
| 2903 |
| 2904 |
| 2905 JobStatus(); |
| 2906 |
| 2907 JobStatus.fromJson(core.Map _json) { |
| 2908 if (_json.containsKey("errorResult")) { |
| 2909 errorResult = new ErrorProto.fromJson(_json["errorResult"]); |
| 2910 } |
| 2911 if (_json.containsKey("errors")) { |
| 2912 errors = _json["errors"].map((value) => new ErrorProto.fromJson(value)).to
List(); |
| 2913 } |
| 2914 if (_json.containsKey("state")) { |
| 2915 state = _json["state"]; |
| 2916 } |
| 2917 } |
| 2918 |
| 2919 core.Map toJson() { |
| 2920 var _json = new core.Map(); |
| 2921 if (errorResult != null) { |
| 2922 _json["errorResult"] = (errorResult).toJson(); |
| 2923 } |
| 2924 if (errors != null) { |
| 2925 _json["errors"] = errors.map((value) => (value).toJson()).toList(); |
| 2926 } |
| 2927 if (state != null) { |
| 2928 _json["state"] = state; |
| 2929 } |
| 2930 return _json; |
| 2931 } |
| 2932 } |
| 2933 |
| 2934 |
| 2935 /** Represents a single JSON object. */ |
| 2936 class JsonObject |
| 2937 extends collection.MapBase<core.String, core.Object> { |
| 2938 final core.Map _innerMap = {}; |
| 2939 |
| 2940 JsonObject(); |
| 2941 |
| 2942 JsonObject.fromJson(core.Map _json) { |
| 2943 _json.forEach((core.String key, value) { |
| 2944 this[key] = value; |
| 2945 }); |
| 2946 } |
| 2947 |
| 2948 core.Map toJson() { |
| 2949 var _json = {}; |
| 2950 this.forEach((core.String key, value) { |
| 2951 _json[key] = value; |
| 2952 }); |
| 2953 return _json; |
| 2954 } |
| 2955 |
| 2956 core.Object operator [](core.Object key) |
| 2957 => _innerMap[key]; |
| 2958 |
| 2959 operator []=(core.String key, core.Object value) { |
| 2960 _innerMap[key] = value; |
| 2961 } |
| 2962 |
| 2963 void clear() { |
| 2964 _innerMap.clear(); |
| 2965 } |
| 2966 |
| 2967 core.Iterable<core.String> get keys => _innerMap.keys; |
| 2968 |
| 2969 core.Object remove(core.Object key) => _innerMap.remove(key); |
| 2970 } |
| 2971 |
| 2972 |
| 2973 /** Not documented yet. */ |
| 2974 class ProjectListProjects { |
| 2975 /** A descriptive name for this project. */ |
| 2976 core.String friendlyName; |
| 2977 |
| 2978 /** An opaque ID of this project. */ |
| 2979 core.String id; |
| 2980 |
| 2981 /** The resource type. */ |
| 2982 core.String kind; |
| 2983 |
| 2984 /** The numeric ID of this project. */ |
| 2985 core.String numericId; |
| 2986 |
| 2987 /** A unique reference to this project. */ |
| 2988 ProjectReference projectReference; |
| 2989 |
| 2990 |
| 2991 ProjectListProjects(); |
| 2992 |
| 2993 ProjectListProjects.fromJson(core.Map _json) { |
| 2994 if (_json.containsKey("friendlyName")) { |
| 2995 friendlyName = _json["friendlyName"]; |
| 2996 } |
| 2997 if (_json.containsKey("id")) { |
| 2998 id = _json["id"]; |
| 2999 } |
| 3000 if (_json.containsKey("kind")) { |
| 3001 kind = _json["kind"]; |
| 3002 } |
| 3003 if (_json.containsKey("numericId")) { |
| 3004 numericId = _json["numericId"]; |
| 3005 } |
| 3006 if (_json.containsKey("projectReference")) { |
| 3007 projectReference = new ProjectReference.fromJson(_json["projectReference"]
); |
| 3008 } |
| 3009 } |
| 3010 |
| 3011 core.Map toJson() { |
| 3012 var _json = new core.Map(); |
| 3013 if (friendlyName != null) { |
| 3014 _json["friendlyName"] = friendlyName; |
| 3015 } |
| 3016 if (id != null) { |
| 3017 _json["id"] = id; |
| 3018 } |
| 3019 if (kind != null) { |
| 3020 _json["kind"] = kind; |
| 3021 } |
| 3022 if (numericId != null) { |
| 3023 _json["numericId"] = numericId; |
| 3024 } |
| 3025 if (projectReference != null) { |
| 3026 _json["projectReference"] = (projectReference).toJson(); |
| 3027 } |
| 3028 return _json; |
| 3029 } |
| 3030 } |
| 3031 |
| 3032 |
| 3033 /** Not documented yet. */ |
| 3034 class ProjectList { |
| 3035 /** A hash of the page of results */ |
| 3036 core.String etag; |
| 3037 |
| 3038 /** The type of list. */ |
| 3039 core.String kind; |
| 3040 |
| 3041 /** A token to request the next page of results. */ |
| 3042 core.String nextPageToken; |
| 3043 |
| 3044 /** Projects to which you have at least READ access. */ |
| 3045 core.List<ProjectListProjects> projects; |
| 3046 |
| 3047 /** The total number of projects in the list. */ |
| 3048 core.int totalItems; |
| 3049 |
| 3050 |
| 3051 ProjectList(); |
| 3052 |
| 3053 ProjectList.fromJson(core.Map _json) { |
| 3054 if (_json.containsKey("etag")) { |
| 3055 etag = _json["etag"]; |
| 3056 } |
| 3057 if (_json.containsKey("kind")) { |
| 3058 kind = _json["kind"]; |
| 3059 } |
| 3060 if (_json.containsKey("nextPageToken")) { |
| 3061 nextPageToken = _json["nextPageToken"]; |
| 3062 } |
| 3063 if (_json.containsKey("projects")) { |
| 3064 projects = _json["projects"].map((value) => new ProjectListProjects.fromJs
on(value)).toList(); |
| 3065 } |
| 3066 if (_json.containsKey("totalItems")) { |
| 3067 totalItems = _json["totalItems"]; |
| 3068 } |
| 3069 } |
| 3070 |
| 3071 core.Map toJson() { |
| 3072 var _json = new core.Map(); |
| 3073 if (etag != null) { |
| 3074 _json["etag"] = etag; |
| 3075 } |
| 3076 if (kind != null) { |
| 3077 _json["kind"] = kind; |
| 3078 } |
| 3079 if (nextPageToken != null) { |
| 3080 _json["nextPageToken"] = nextPageToken; |
| 3081 } |
| 3082 if (projects != null) { |
| 3083 _json["projects"] = projects.map((value) => (value).toJson()).toList(); |
| 3084 } |
| 3085 if (totalItems != null) { |
| 3086 _json["totalItems"] = totalItems; |
| 3087 } |
| 3088 return _json; |
| 3089 } |
| 3090 } |
| 3091 |
| 3092 |
| 3093 /** Not documented yet. */ |
| 3094 class ProjectReference { |
| 3095 /** |
| 3096 * [Required] ID of the project. Can be either the numeric ID or the assigned |
| 3097 * ID of the project. |
| 3098 */ |
| 3099 core.String projectId; |
| 3100 |
| 3101 |
| 3102 ProjectReference(); |
| 3103 |
| 3104 ProjectReference.fromJson(core.Map _json) { |
| 3105 if (_json.containsKey("projectId")) { |
| 3106 projectId = _json["projectId"]; |
| 3107 } |
| 3108 } |
| 3109 |
| 3110 core.Map toJson() { |
| 3111 var _json = new core.Map(); |
| 3112 if (projectId != null) { |
| 3113 _json["projectId"] = projectId; |
| 3114 } |
| 3115 return _json; |
| 3116 } |
| 3117 } |
| 3118 |
| 3119 |
| 3120 /** Not documented yet. */ |
| 3121 class QueryRequest { |
| 3122 /** |
| 3123 * [Optional] Specifies the default datasetId and projectId to assume for any |
| 3124 * unqualified table names in the query. If not set, all table names in the |
| 3125 * query string must be qualified in the format 'datasetId.tableId'. |
| 3126 */ |
| 3127 DatasetReference defaultDataset; |
| 3128 |
| 3129 /** |
| 3130 * [Optional] If set, don't actually run the query. A valid query will return |
| 3131 * an empty response, while an invalid query will return the same error it |
| 3132 * would if it wasn't a dry run. The default value is false. |
| 3133 */ |
| 3134 core.bool dryRun; |
| 3135 |
| 3136 /** The resource type of the request. */ |
| 3137 core.String kind; |
| 3138 |
| 3139 /** |
| 3140 * [Optional] The maximum number of rows of data to return per page of |
| 3141 * results. Setting this flag to a small value such as 1000 and then paging |
| 3142 * through results might improve reliability when the query result set is |
| 3143 * large. In addition to this limit, responses are also limited to 10 MB. By |
| 3144 * default, there is no maximum row count, and only the byte limit applies. |
| 3145 */ |
| 3146 core.int maxResults; |
| 3147 |
| 3148 /** [Deprecated] This property is deprecated. */ |
| 3149 core.bool preserveNulls; |
| 3150 |
| 3151 /** |
| 3152 * [Required] A query string, following the BigQuery query syntax, of the |
| 3153 * query to execute. Example: "SELECT count(f1) FROM |
| 3154 * [myProjectId:myDatasetId.myTableId]". |
| 3155 */ |
| 3156 core.String query; |
| 3157 |
| 3158 /** |
| 3159 * [Optional] How long to wait for the query to complete, in milliseconds, |
| 3160 * before the request times out and returns. Note that this is only a timeout |
| 3161 * for the request, not the query. If the query takes longer to run than the |
| 3162 * timeout value, the call returns without any results and with the |
| 3163 * 'jobComplete' flag set to false. You can call GetQueryResults() to wait for |
| 3164 * the query to complete and read the results. The default value is 10000 |
| 3165 * milliseconds (10 seconds). |
| 3166 */ |
| 3167 core.int timeoutMs; |
| 3168 |
| 3169 /** |
| 3170 * [Optional] Whether to look for the result in the query cache. The query |
| 3171 * cache is a best-effort cache that will be flushed whenever tables in the |
| 3172 * query are modified. The default value is true. |
| 3173 */ |
| 3174 core.bool useQueryCache; |
| 3175 |
| 3176 |
| 3177 QueryRequest(); |
| 3178 |
| 3179 QueryRequest.fromJson(core.Map _json) { |
| 3180 if (_json.containsKey("defaultDataset")) { |
| 3181 defaultDataset = new DatasetReference.fromJson(_json["defaultDataset"]); |
| 3182 } |
| 3183 if (_json.containsKey("dryRun")) { |
| 3184 dryRun = _json["dryRun"]; |
| 3185 } |
| 3186 if (_json.containsKey("kind")) { |
| 3187 kind = _json["kind"]; |
| 3188 } |
| 3189 if (_json.containsKey("maxResults")) { |
| 3190 maxResults = _json["maxResults"]; |
| 3191 } |
| 3192 if (_json.containsKey("preserveNulls")) { |
| 3193 preserveNulls = _json["preserveNulls"]; |
| 3194 } |
| 3195 if (_json.containsKey("query")) { |
| 3196 query = _json["query"]; |
| 3197 } |
| 3198 if (_json.containsKey("timeoutMs")) { |
| 3199 timeoutMs = _json["timeoutMs"]; |
| 3200 } |
| 3201 if (_json.containsKey("useQueryCache")) { |
| 3202 useQueryCache = _json["useQueryCache"]; |
| 3203 } |
| 3204 } |
| 3205 |
| 3206 core.Map toJson() { |
| 3207 var _json = new core.Map(); |
| 3208 if (defaultDataset != null) { |
| 3209 _json["defaultDataset"] = (defaultDataset).toJson(); |
| 3210 } |
| 3211 if (dryRun != null) { |
| 3212 _json["dryRun"] = dryRun; |
| 3213 } |
| 3214 if (kind != null) { |
| 3215 _json["kind"] = kind; |
| 3216 } |
| 3217 if (maxResults != null) { |
| 3218 _json["maxResults"] = maxResults; |
| 3219 } |
| 3220 if (preserveNulls != null) { |
| 3221 _json["preserveNulls"] = preserveNulls; |
| 3222 } |
| 3223 if (query != null) { |
| 3224 _json["query"] = query; |
| 3225 } |
| 3226 if (timeoutMs != null) { |
| 3227 _json["timeoutMs"] = timeoutMs; |
| 3228 } |
| 3229 if (useQueryCache != null) { |
| 3230 _json["useQueryCache"] = useQueryCache; |
| 3231 } |
| 3232 return _json; |
| 3233 } |
| 3234 } |
| 3235 |
| 3236 |
| 3237 /** Not documented yet. */ |
| 3238 class QueryResponse { |
| 3239 /** Whether the query result was fetched from the query cache. */ |
| 3240 core.bool cacheHit; |
| 3241 |
| 3242 /** |
| 3243 * Whether the query has completed or not. If rows or totalRows are present, |
| 3244 * this will always be true. If this is false, totalRows will not be |
| 3245 * available. |
| 3246 */ |
| 3247 core.bool jobComplete; |
| 3248 |
| 3249 /** |
| 3250 * Reference to the Job that was created to run the query. This field will be |
| 3251 * present even if the original request timed out, in which case |
| 3252 * GetQueryResults can be used to read the results once the query has |
| 3253 * completed. Since this API only returns the first page of results, |
| 3254 * subsequent pages can be fetched via the same mechanism (GetQueryResults). |
| 3255 */ |
| 3256 JobReference jobReference; |
| 3257 |
| 3258 /** The resource type. */ |
| 3259 core.String kind; |
| 3260 |
| 3261 /** A token used for paging results. */ |
| 3262 core.String pageToken; |
| 3263 |
| 3264 /** |
| 3265 * An object with as many results as can be contained within the maximum |
| 3266 * permitted reply size. To get any additional rows, you can call |
| 3267 * GetQueryResults and specify the jobReference returned above. |
| 3268 */ |
| 3269 core.List<TableRow> rows; |
| 3270 |
| 3271 /** |
| 3272 * The schema of the results. Present only when the query completes |
| 3273 * successfully. |
| 3274 */ |
| 3275 TableSchema schema; |
| 3276 |
| 3277 /** |
| 3278 * The total number of bytes processed for this query. If this query was a dry |
| 3279 * run, this is the number of bytes that would be processed if the query were |
| 3280 * run. |
| 3281 */ |
| 3282 core.String totalBytesProcessed; |
| 3283 |
| 3284 /** |
| 3285 * The total number of rows in the complete query result set, which can be |
| 3286 * more than the number of rows in this single page of results. |
| 3287 */ |
| 3288 core.String totalRows; |
| 3289 |
| 3290 |
| 3291 QueryResponse(); |
| 3292 |
| 3293 QueryResponse.fromJson(core.Map _json) { |
| 3294 if (_json.containsKey("cacheHit")) { |
| 3295 cacheHit = _json["cacheHit"]; |
| 3296 } |
| 3297 if (_json.containsKey("jobComplete")) { |
| 3298 jobComplete = _json["jobComplete"]; |
| 3299 } |
| 3300 if (_json.containsKey("jobReference")) { |
| 3301 jobReference = new JobReference.fromJson(_json["jobReference"]); |
| 3302 } |
| 3303 if (_json.containsKey("kind")) { |
| 3304 kind = _json["kind"]; |
| 3305 } |
| 3306 if (_json.containsKey("pageToken")) { |
| 3307 pageToken = _json["pageToken"]; |
| 3308 } |
| 3309 if (_json.containsKey("rows")) { |
| 3310 rows = _json["rows"].map((value) => new TableRow.fromJson(value)).toList()
; |
| 3311 } |
| 3312 if (_json.containsKey("schema")) { |
| 3313 schema = new TableSchema.fromJson(_json["schema"]); |
| 3314 } |
| 3315 if (_json.containsKey("totalBytesProcessed")) { |
| 3316 totalBytesProcessed = _json["totalBytesProcessed"]; |
| 3317 } |
| 3318 if (_json.containsKey("totalRows")) { |
| 3319 totalRows = _json["totalRows"]; |
| 3320 } |
| 3321 } |
| 3322 |
| 3323 core.Map toJson() { |
| 3324 var _json = new core.Map(); |
| 3325 if (cacheHit != null) { |
| 3326 _json["cacheHit"] = cacheHit; |
| 3327 } |
| 3328 if (jobComplete != null) { |
| 3329 _json["jobComplete"] = jobComplete; |
| 3330 } |
| 3331 if (jobReference != null) { |
| 3332 _json["jobReference"] = (jobReference).toJson(); |
| 3333 } |
| 3334 if (kind != null) { |
| 3335 _json["kind"] = kind; |
| 3336 } |
| 3337 if (pageToken != null) { |
| 3338 _json["pageToken"] = pageToken; |
| 3339 } |
| 3340 if (rows != null) { |
| 3341 _json["rows"] = rows.map((value) => (value).toJson()).toList(); |
| 3342 } |
| 3343 if (schema != null) { |
| 3344 _json["schema"] = (schema).toJson(); |
| 3345 } |
| 3346 if (totalBytesProcessed != null) { |
| 3347 _json["totalBytesProcessed"] = totalBytesProcessed; |
| 3348 } |
| 3349 if (totalRows != null) { |
| 3350 _json["totalRows"] = totalRows; |
| 3351 } |
| 3352 return _json; |
| 3353 } |
| 3354 } |
| 3355 |
| 3356 |
| 3357 /** Not documented yet. */ |
| 3358 class Table { |
| 3359 /** |
| 3360 * [Output-only] The time when this table was created, in milliseconds since |
| 3361 * the epoch. |
| 3362 */ |
| 3363 core.String creationTime; |
| 3364 |
| 3365 /** [Optional] A user-friendly description of this table. */ |
| 3366 core.String description; |
| 3367 |
| 3368 /** [Output-only] A hash of this resource. */ |
| 3369 core.String etag; |
| 3370 |
| 3371 /** |
| 3372 * [Optional] The time when this table expires, in milliseconds since the |
| 3373 * epoch. If not present, the table will persist indefinitely. Expired tables |
| 3374 * will be deleted and their storage reclaimed. |
| 3375 */ |
| 3376 core.String expirationTime; |
| 3377 |
| 3378 /** [Optional] A descriptive name for this table. */ |
| 3379 core.String friendlyName; |
| 3380 |
| 3381 /** [Output-only] An opaque ID uniquely identifying the table. */ |
| 3382 core.String id; |
| 3383 |
| 3384 /** [Output-only] The type of the resource. */ |
| 3385 core.String kind; |
| 3386 |
| 3387 /** |
| 3388 * [Output-only] The time when this table was last modified, in milliseconds |
| 3389 * since the epoch. |
| 3390 */ |
| 3391 core.String lastModifiedTime; |
| 3392 |
| 3393 /** [Output-only] The size of the table in bytes. */ |
| 3394 core.String numBytes; |
| 3395 |
| 3396 /** [Output-only] The number of rows of data in this table. */ |
| 3397 core.String numRows; |
| 3398 |
| 3399 /** [Optional] Describes the schema of this table. */ |
| 3400 TableSchema schema; |
| 3401 |
| 3402 /** [Output-only] A URL that can be used to access this resource again. */ |
| 3403 core.String selfLink; |
| 3404 |
| 3405 /** [Required] Reference describing the ID of this table. */ |
| 3406 TableReference tableReference; |
| 3407 |
| 3408 /** |
| 3409 * [Output-only] Describes the table type. The following values are supported: |
| 3410 * TABLE: A normal BigQuery table. VIEW: A virtual table defined by a SQL |
| 3411 * query. The default value is TABLE. |
| 3412 */ |
| 3413 core.String type; |
| 3414 |
| 3415 /** [Optional] The view definition. */ |
| 3416 ViewDefinition view; |
| 3417 |
| 3418 |
| 3419 Table(); |
| 3420 |
| 3421 Table.fromJson(core.Map _json) { |
| 3422 if (_json.containsKey("creationTime")) { |
| 3423 creationTime = _json["creationTime"]; |
| 3424 } |
| 3425 if (_json.containsKey("description")) { |
| 3426 description = _json["description"]; |
| 3427 } |
| 3428 if (_json.containsKey("etag")) { |
| 3429 etag = _json["etag"]; |
| 3430 } |
| 3431 if (_json.containsKey("expirationTime")) { |
| 3432 expirationTime = _json["expirationTime"]; |
| 3433 } |
| 3434 if (_json.containsKey("friendlyName")) { |
| 3435 friendlyName = _json["friendlyName"]; |
| 3436 } |
| 3437 if (_json.containsKey("id")) { |
| 3438 id = _json["id"]; |
| 3439 } |
| 3440 if (_json.containsKey("kind")) { |
| 3441 kind = _json["kind"]; |
| 3442 } |
| 3443 if (_json.containsKey("lastModifiedTime")) { |
| 3444 lastModifiedTime = _json["lastModifiedTime"]; |
| 3445 } |
| 3446 if (_json.containsKey("numBytes")) { |
| 3447 numBytes = _json["numBytes"]; |
| 3448 } |
| 3449 if (_json.containsKey("numRows")) { |
| 3450 numRows = _json["numRows"]; |
| 3451 } |
| 3452 if (_json.containsKey("schema")) { |
| 3453 schema = new TableSchema.fromJson(_json["schema"]); |
| 3454 } |
| 3455 if (_json.containsKey("selfLink")) { |
| 3456 selfLink = _json["selfLink"]; |
| 3457 } |
| 3458 if (_json.containsKey("tableReference")) { |
| 3459 tableReference = new TableReference.fromJson(_json["tableReference"]); |
| 3460 } |
| 3461 if (_json.containsKey("type")) { |
| 3462 type = _json["type"]; |
| 3463 } |
| 3464 if (_json.containsKey("view")) { |
| 3465 view = new ViewDefinition.fromJson(_json["view"]); |
| 3466 } |
| 3467 } |
| 3468 |
| 3469 core.Map toJson() { |
| 3470 var _json = new core.Map(); |
| 3471 if (creationTime != null) { |
| 3472 _json["creationTime"] = creationTime; |
| 3473 } |
| 3474 if (description != null) { |
| 3475 _json["description"] = description; |
| 3476 } |
| 3477 if (etag != null) { |
| 3478 _json["etag"] = etag; |
| 3479 } |
| 3480 if (expirationTime != null) { |
| 3481 _json["expirationTime"] = expirationTime; |
| 3482 } |
| 3483 if (friendlyName != null) { |
| 3484 _json["friendlyName"] = friendlyName; |
| 3485 } |
| 3486 if (id != null) { |
| 3487 _json["id"] = id; |
| 3488 } |
| 3489 if (kind != null) { |
| 3490 _json["kind"] = kind; |
| 3491 } |
| 3492 if (lastModifiedTime != null) { |
| 3493 _json["lastModifiedTime"] = lastModifiedTime; |
| 3494 } |
| 3495 if (numBytes != null) { |
| 3496 _json["numBytes"] = numBytes; |
| 3497 } |
| 3498 if (numRows != null) { |
| 3499 _json["numRows"] = numRows; |
| 3500 } |
| 3501 if (schema != null) { |
| 3502 _json["schema"] = (schema).toJson(); |
| 3503 } |
| 3504 if (selfLink != null) { |
| 3505 _json["selfLink"] = selfLink; |
| 3506 } |
| 3507 if (tableReference != null) { |
| 3508 _json["tableReference"] = (tableReference).toJson(); |
| 3509 } |
| 3510 if (type != null) { |
| 3511 _json["type"] = type; |
| 3512 } |
| 3513 if (view != null) { |
| 3514 _json["view"] = (view).toJson(); |
| 3515 } |
| 3516 return _json; |
| 3517 } |
| 3518 } |
| 3519 |
| 3520 |
| 3521 /** |
| 3522 * Represents a single cell in the result set. Users of the java client can |
| 3523 * detect whether their value result is null by calling |
| 3524 * 'com.google.api.client.util.Data.isNull(cell.getV())'. |
| 3525 */ |
| 3526 class TableCell { |
| 3527 /** |
| 3528 * Not documented yet. |
| 3529 * |
| 3530 * The values for Object must be JSON objects. It can consist of `num`, |
| 3531 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 3532 */ |
| 3533 core.Object v; |
| 3534 |
| 3535 |
| 3536 TableCell(); |
| 3537 |
| 3538 TableCell.fromJson(core.Map _json) { |
| 3539 if (_json.containsKey("v")) { |
| 3540 v = _json["v"]; |
| 3541 } |
| 3542 } |
| 3543 |
| 3544 core.Map toJson() { |
| 3545 var _json = new core.Map(); |
| 3546 if (v != null) { |
| 3547 _json["v"] = v; |
| 3548 } |
| 3549 return _json; |
| 3550 } |
| 3551 } |
| 3552 |
| 3553 |
| 3554 /** Not documented yet. */ |
| 3555 class TableDataInsertAllRequestRows { |
| 3556 /** |
| 3557 * [Optional] A unique ID for each row. BigQuery uses this property to detect |
| 3558 * duplicate insertion requests on a best-effort basis. |
| 3559 */ |
| 3560 core.String insertId; |
| 3561 |
| 3562 /** |
| 3563 * [Required] A JSON object that contains a row of data. The object's |
| 3564 * properties and values must match the destination table's schema. |
| 3565 */ |
| 3566 JsonObject json; |
| 3567 |
| 3568 |
| 3569 TableDataInsertAllRequestRows(); |
| 3570 |
| 3571 TableDataInsertAllRequestRows.fromJson(core.Map _json) { |
| 3572 if (_json.containsKey("insertId")) { |
| 3573 insertId = _json["insertId"]; |
| 3574 } |
| 3575 if (_json.containsKey("json")) { |
| 3576 json = new JsonObject.fromJson(_json["json"]); |
| 3577 } |
| 3578 } |
| 3579 |
| 3580 core.Map toJson() { |
| 3581 var _json = new core.Map(); |
| 3582 if (insertId != null) { |
| 3583 _json["insertId"] = insertId; |
| 3584 } |
| 3585 if (json != null) { |
| 3586 _json["json"] = json; |
| 3587 } |
| 3588 return _json; |
| 3589 } |
| 3590 } |
| 3591 |
| 3592 |
| 3593 /** Not documented yet. */ |
| 3594 class TableDataInsertAllRequest { |
| 3595 /** The resource type of the response. */ |
| 3596 core.String kind; |
| 3597 |
| 3598 /** The rows to insert. */ |
| 3599 core.List<TableDataInsertAllRequestRows> rows; |
| 3600 |
| 3601 |
| 3602 TableDataInsertAllRequest(); |
| 3603 |
| 3604 TableDataInsertAllRequest.fromJson(core.Map _json) { |
| 3605 if (_json.containsKey("kind")) { |
| 3606 kind = _json["kind"]; |
| 3607 } |
| 3608 if (_json.containsKey("rows")) { |
| 3609 rows = _json["rows"].map((value) => new TableDataInsertAllRequestRows.from
Json(value)).toList(); |
| 3610 } |
| 3611 } |
| 3612 |
| 3613 core.Map toJson() { |
| 3614 var _json = new core.Map(); |
| 3615 if (kind != null) { |
| 3616 _json["kind"] = kind; |
| 3617 } |
| 3618 if (rows != null) { |
| 3619 _json["rows"] = rows.map((value) => (value).toJson()).toList(); |
| 3620 } |
| 3621 return _json; |
| 3622 } |
| 3623 } |
| 3624 |
| 3625 |
| 3626 /** Not documented yet. */ |
| 3627 class TableDataInsertAllResponseInsertErrors { |
| 3628 /** Error information for the row indicated by the index property. */ |
| 3629 core.List<ErrorProto> errors; |
| 3630 |
| 3631 /** The index of the row that error applies to. */ |
| 3632 core.int index; |
| 3633 |
| 3634 |
| 3635 TableDataInsertAllResponseInsertErrors(); |
| 3636 |
| 3637 TableDataInsertAllResponseInsertErrors.fromJson(core.Map _json) { |
| 3638 if (_json.containsKey("errors")) { |
| 3639 errors = _json["errors"].map((value) => new ErrorProto.fromJson(value)).to
List(); |
| 3640 } |
| 3641 if (_json.containsKey("index")) { |
| 3642 index = _json["index"]; |
| 3643 } |
| 3644 } |
| 3645 |
| 3646 core.Map toJson() { |
| 3647 var _json = new core.Map(); |
| 3648 if (errors != null) { |
| 3649 _json["errors"] = errors.map((value) => (value).toJson()).toList(); |
| 3650 } |
| 3651 if (index != null) { |
| 3652 _json["index"] = index; |
| 3653 } |
| 3654 return _json; |
| 3655 } |
| 3656 } |
| 3657 |
| 3658 |
| 3659 /** Not documented yet. */ |
| 3660 class TableDataInsertAllResponse { |
| 3661 /** An array of errors for rows that were not inserted. */ |
| 3662 core.List<TableDataInsertAllResponseInsertErrors> insertErrors; |
| 3663 |
| 3664 /** The resource type of the response. */ |
| 3665 core.String kind; |
| 3666 |
| 3667 |
| 3668 TableDataInsertAllResponse(); |
| 3669 |
| 3670 TableDataInsertAllResponse.fromJson(core.Map _json) { |
| 3671 if (_json.containsKey("insertErrors")) { |
| 3672 insertErrors = _json["insertErrors"].map((value) => new TableDataInsertAll
ResponseInsertErrors.fromJson(value)).toList(); |
| 3673 } |
| 3674 if (_json.containsKey("kind")) { |
| 3675 kind = _json["kind"]; |
| 3676 } |
| 3677 } |
| 3678 |
| 3679 core.Map toJson() { |
| 3680 var _json = new core.Map(); |
| 3681 if (insertErrors != null) { |
| 3682 _json["insertErrors"] = insertErrors.map((value) => (value).toJson()).toLi
st(); |
| 3683 } |
| 3684 if (kind != null) { |
| 3685 _json["kind"] = kind; |
| 3686 } |
| 3687 return _json; |
| 3688 } |
| 3689 } |
| 3690 |
| 3691 |
| 3692 /** Not documented yet. */ |
| 3693 class TableDataList { |
| 3694 /** A hash of this page of results. */ |
| 3695 core.String etag; |
| 3696 |
| 3697 /** The resource type of the response. */ |
| 3698 core.String kind; |
| 3699 |
| 3700 /** |
| 3701 * A token used for paging results. Providing this token instead of the |
| 3702 * startIndex parameter can help you retrieve stable results when an |
| 3703 * underlying table is changing. |
| 3704 */ |
| 3705 core.String pageToken; |
| 3706 |
| 3707 /** Rows of results. */ |
| 3708 core.List<TableRow> rows; |
| 3709 |
| 3710 /** The total number of rows in the complete table. */ |
| 3711 core.String totalRows; |
| 3712 |
| 3713 |
| 3714 TableDataList(); |
| 3715 |
| 3716 TableDataList.fromJson(core.Map _json) { |
| 3717 if (_json.containsKey("etag")) { |
| 3718 etag = _json["etag"]; |
| 3719 } |
| 3720 if (_json.containsKey("kind")) { |
| 3721 kind = _json["kind"]; |
| 3722 } |
| 3723 if (_json.containsKey("pageToken")) { |
| 3724 pageToken = _json["pageToken"]; |
| 3725 } |
| 3726 if (_json.containsKey("rows")) { |
| 3727 rows = _json["rows"].map((value) => new TableRow.fromJson(value)).toList()
; |
| 3728 } |
| 3729 if (_json.containsKey("totalRows")) { |
| 3730 totalRows = _json["totalRows"]; |
| 3731 } |
| 3732 } |
| 3733 |
| 3734 core.Map toJson() { |
| 3735 var _json = new core.Map(); |
| 3736 if (etag != null) { |
| 3737 _json["etag"] = etag; |
| 3738 } |
| 3739 if (kind != null) { |
| 3740 _json["kind"] = kind; |
| 3741 } |
| 3742 if (pageToken != null) { |
| 3743 _json["pageToken"] = pageToken; |
| 3744 } |
| 3745 if (rows != null) { |
| 3746 _json["rows"] = rows.map((value) => (value).toJson()).toList(); |
| 3747 } |
| 3748 if (totalRows != null) { |
| 3749 _json["totalRows"] = totalRows; |
| 3750 } |
| 3751 return _json; |
| 3752 } |
| 3753 } |
| 3754 |
| 3755 |
| 3756 /** Not documented yet. */ |
| 3757 class TableFieldSchema { |
| 3758 /** [Optional] The field description. */ |
| 3759 core.String description; |
| 3760 |
| 3761 /** |
| 3762 * [Optional] Describes the nested schema fields if the type property is set |
| 3763 * to RECORD. |
| 3764 */ |
| 3765 core.List<TableFieldSchema> fields; |
| 3766 |
| 3767 /** |
| 3768 * [Optional] The field mode. Possible values include NULLABLE, REQUIRED and |
| 3769 * REPEATED. The default value is NULLABLE. |
| 3770 */ |
| 3771 core.String mode; |
| 3772 |
| 3773 /** [Required] The field name. */ |
| 3774 core.String name; |
| 3775 |
| 3776 /** |
| 3777 * [Required] The field data type. Possible values include STRING, INTEGER, |
| 3778 * FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field |
| 3779 * contains a nested schema). |
| 3780 */ |
| 3781 core.String type; |
| 3782 |
| 3783 |
| 3784 TableFieldSchema(); |
| 3785 |
| 3786 TableFieldSchema.fromJson(core.Map _json) { |
| 3787 if (_json.containsKey("description")) { |
| 3788 description = _json["description"]; |
| 3789 } |
| 3790 if (_json.containsKey("fields")) { |
| 3791 fields = _json["fields"].map((value) => new TableFieldSchema.fromJson(valu
e)).toList(); |
| 3792 } |
| 3793 if (_json.containsKey("mode")) { |
| 3794 mode = _json["mode"]; |
| 3795 } |
| 3796 if (_json.containsKey("name")) { |
| 3797 name = _json["name"]; |
| 3798 } |
| 3799 if (_json.containsKey("type")) { |
| 3800 type = _json["type"]; |
| 3801 } |
| 3802 } |
| 3803 |
| 3804 core.Map toJson() { |
| 3805 var _json = new core.Map(); |
| 3806 if (description != null) { |
| 3807 _json["description"] = description; |
| 3808 } |
| 3809 if (fields != null) { |
| 3810 _json["fields"] = fields.map((value) => (value).toJson()).toList(); |
| 3811 } |
| 3812 if (mode != null) { |
| 3813 _json["mode"] = mode; |
| 3814 } |
| 3815 if (name != null) { |
| 3816 _json["name"] = name; |
| 3817 } |
| 3818 if (type != null) { |
| 3819 _json["type"] = type; |
| 3820 } |
| 3821 return _json; |
| 3822 } |
| 3823 } |
| 3824 |
| 3825 |
| 3826 /** Not documented yet. */ |
| 3827 class TableListTables { |
| 3828 /** The user-friendly name for this table. */ |
| 3829 core.String friendlyName; |
| 3830 |
| 3831 /** An opaque ID of the table */ |
| 3832 core.String id; |
| 3833 |
| 3834 /** The resource type. */ |
| 3835 core.String kind; |
| 3836 |
| 3837 /** A reference uniquely identifying the table. */ |
| 3838 TableReference tableReference; |
| 3839 |
| 3840 /** The type of table. Possible values are: TABLE, VIEW. */ |
| 3841 core.String type; |
| 3842 |
| 3843 |
| 3844 TableListTables(); |
| 3845 |
| 3846 TableListTables.fromJson(core.Map _json) { |
| 3847 if (_json.containsKey("friendlyName")) { |
| 3848 friendlyName = _json["friendlyName"]; |
| 3849 } |
| 3850 if (_json.containsKey("id")) { |
| 3851 id = _json["id"]; |
| 3852 } |
| 3853 if (_json.containsKey("kind")) { |
| 3854 kind = _json["kind"]; |
| 3855 } |
| 3856 if (_json.containsKey("tableReference")) { |
| 3857 tableReference = new TableReference.fromJson(_json["tableReference"]); |
| 3858 } |
| 3859 if (_json.containsKey("type")) { |
| 3860 type = _json["type"]; |
| 3861 } |
| 3862 } |
| 3863 |
| 3864 core.Map toJson() { |
| 3865 var _json = new core.Map(); |
| 3866 if (friendlyName != null) { |
| 3867 _json["friendlyName"] = friendlyName; |
| 3868 } |
| 3869 if (id != null) { |
| 3870 _json["id"] = id; |
| 3871 } |
| 3872 if (kind != null) { |
| 3873 _json["kind"] = kind; |
| 3874 } |
| 3875 if (tableReference != null) { |
| 3876 _json["tableReference"] = (tableReference).toJson(); |
| 3877 } |
| 3878 if (type != null) { |
| 3879 _json["type"] = type; |
| 3880 } |
| 3881 return _json; |
| 3882 } |
| 3883 } |
| 3884 |
| 3885 |
| 3886 /** Not documented yet. */ |
| 3887 class TableList { |
| 3888 /** A hash of this page of results. */ |
| 3889 core.String etag; |
| 3890 |
| 3891 /** The type of list. */ |
| 3892 core.String kind; |
| 3893 |
| 3894 /** A token to request the next page of results. */ |
| 3895 core.String nextPageToken; |
| 3896 |
| 3897 /** Tables in the requested dataset. */ |
| 3898 core.List<TableListTables> tables; |
| 3899 |
| 3900 /** The total number of tables in the dataset. */ |
| 3901 core.int totalItems; |
| 3902 |
| 3903 |
| 3904 TableList(); |
| 3905 |
| 3906 TableList.fromJson(core.Map _json) { |
| 3907 if (_json.containsKey("etag")) { |
| 3908 etag = _json["etag"]; |
| 3909 } |
| 3910 if (_json.containsKey("kind")) { |
| 3911 kind = _json["kind"]; |
| 3912 } |
| 3913 if (_json.containsKey("nextPageToken")) { |
| 3914 nextPageToken = _json["nextPageToken"]; |
| 3915 } |
| 3916 if (_json.containsKey("tables")) { |
| 3917 tables = _json["tables"].map((value) => new TableListTables.fromJson(value
)).toList(); |
| 3918 } |
| 3919 if (_json.containsKey("totalItems")) { |
| 3920 totalItems = _json["totalItems"]; |
| 3921 } |
| 3922 } |
| 3923 |
| 3924 core.Map toJson() { |
| 3925 var _json = new core.Map(); |
| 3926 if (etag != null) { |
| 3927 _json["etag"] = etag; |
| 3928 } |
| 3929 if (kind != null) { |
| 3930 _json["kind"] = kind; |
| 3931 } |
| 3932 if (nextPageToken != null) { |
| 3933 _json["nextPageToken"] = nextPageToken; |
| 3934 } |
| 3935 if (tables != null) { |
| 3936 _json["tables"] = tables.map((value) => (value).toJson()).toList(); |
| 3937 } |
| 3938 if (totalItems != null) { |
| 3939 _json["totalItems"] = totalItems; |
| 3940 } |
| 3941 return _json; |
| 3942 } |
| 3943 } |
| 3944 |
| 3945 |
| 3946 /** Not documented yet. */ |
| 3947 class TableReference { |
| 3948 /** [Required] ID of the dataset containing the table. */ |
| 3949 core.String datasetId; |
| 3950 |
| 3951 /** [Required] ID of the project billed for storage of the table. */ |
| 3952 core.String projectId; |
| 3953 |
| 3954 /** [Required] ID of the table. */ |
| 3955 core.String tableId; |
| 3956 |
| 3957 |
| 3958 TableReference(); |
| 3959 |
| 3960 TableReference.fromJson(core.Map _json) { |
| 3961 if (_json.containsKey("datasetId")) { |
| 3962 datasetId = _json["datasetId"]; |
| 3963 } |
| 3964 if (_json.containsKey("projectId")) { |
| 3965 projectId = _json["projectId"]; |
| 3966 } |
| 3967 if (_json.containsKey("tableId")) { |
| 3968 tableId = _json["tableId"]; |
| 3969 } |
| 3970 } |
| 3971 |
| 3972 core.Map toJson() { |
| 3973 var _json = new core.Map(); |
| 3974 if (datasetId != null) { |
| 3975 _json["datasetId"] = datasetId; |
| 3976 } |
| 3977 if (projectId != null) { |
| 3978 _json["projectId"] = projectId; |
| 3979 } |
| 3980 if (tableId != null) { |
| 3981 _json["tableId"] = tableId; |
| 3982 } |
| 3983 return _json; |
| 3984 } |
| 3985 } |
| 3986 |
| 3987 |
| 3988 /** |
| 3989 * Represents a single row in the result set, consisting of one or more fields. |
| 3990 */ |
| 3991 class TableRow { |
| 3992 /** Not documented yet. */ |
| 3993 core.List<TableCell> f; |
| 3994 |
| 3995 |
| 3996 TableRow(); |
| 3997 |
| 3998 TableRow.fromJson(core.Map _json) { |
| 3999 if (_json.containsKey("f")) { |
| 4000 f = _json["f"].map((value) => new TableCell.fromJson(value)).toList(); |
| 4001 } |
| 4002 } |
| 4003 |
| 4004 core.Map toJson() { |
| 4005 var _json = new core.Map(); |
| 4006 if (f != null) { |
| 4007 _json["f"] = f.map((value) => (value).toJson()).toList(); |
| 4008 } |
| 4009 return _json; |
| 4010 } |
| 4011 } |
| 4012 |
| 4013 |
| 4014 /** Not documented yet. */ |
| 4015 class TableSchema { |
| 4016 /** Describes the fields in a table. */ |
| 4017 core.List<TableFieldSchema> fields; |
| 4018 |
| 4019 |
| 4020 TableSchema(); |
| 4021 |
| 4022 TableSchema.fromJson(core.Map _json) { |
| 4023 if (_json.containsKey("fields")) { |
| 4024 fields = _json["fields"].map((value) => new TableFieldSchema.fromJson(valu
e)).toList(); |
| 4025 } |
| 4026 } |
| 4027 |
| 4028 core.Map toJson() { |
| 4029 var _json = new core.Map(); |
| 4030 if (fields != null) { |
| 4031 _json["fields"] = fields.map((value) => (value).toJson()).toList(); |
| 4032 } |
| 4033 return _json; |
| 4034 } |
| 4035 } |
| 4036 |
| 4037 |
| 4038 /** Not documented yet. */ |
| 4039 class ViewDefinition { |
| 4040 /** [Required] A query that BigQuery executes when the view is referenced. */ |
| 4041 core.String query; |
| 4042 |
| 4043 |
| 4044 ViewDefinition(); |
| 4045 |
| 4046 ViewDefinition.fromJson(core.Map _json) { |
| 4047 if (_json.containsKey("query")) { |
| 4048 query = _json["query"]; |
| 4049 } |
| 4050 } |
| 4051 |
| 4052 core.Map toJson() { |
| 4053 var _json = new core.Map(); |
| 4054 if (query != null) { |
| 4055 _json["query"] = query; |
| 4056 } |
| 4057 return _json; |
| 4058 } |
| 4059 } |
| 4060 |
| 4061 |
OLD | NEW |