OLD | NEW |
(Empty) | |
| 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 |
| 3 library googleapis.logging.v2; |
| 4 |
| 5 import 'dart:core' as core; |
| 6 import 'dart:async' as async; |
| 7 import 'dart:convert' as convert; |
| 8 |
| 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
| 10 import 'package:http/http.dart' as http; |
| 11 |
| 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show |
| 13 ApiRequestError, DetailedApiRequestError; |
| 14 |
| 15 const core.String USER_AGENT = 'dart-api-client logging/v2'; |
| 16 |
| 17 /** Writes log entries and manages your Stackdriver Logging configuration. */ |
| 18 class LoggingApi { |
| 19 /** View and manage your data across Google Cloud Platform services */ |
| 20 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf
orm"; |
| 21 |
| 22 /** View your data across Google Cloud Platform services */ |
| 23 static const CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/clo
ud-platform.read-only"; |
| 24 |
| 25 /** Administrate log data for your projects */ |
| 26 static const LoggingAdminScope = "https://www.googleapis.com/auth/logging.admi
n"; |
| 27 |
| 28 /** View log data for your projects */ |
| 29 static const LoggingReadScope = "https://www.googleapis.com/auth/logging.read"
; |
| 30 |
| 31 /** Submit log data for your projects */ |
| 32 static const LoggingWriteScope = "https://www.googleapis.com/auth/logging.writ
e"; |
| 33 |
| 34 |
| 35 final commons.ApiRequester _requester; |
| 36 |
| 37 BillingAccountsResourceApi get billingAccounts => new BillingAccountsResourceA
pi(_requester); |
| 38 EntriesResourceApi get entries => new EntriesResourceApi(_requester); |
| 39 MonitoredResourceDescriptorsResourceApi get monitoredResourceDescriptors => ne
w MonitoredResourceDescriptorsResourceApi(_requester); |
| 40 OrganizationsResourceApi get organizations => new OrganizationsResourceApi(_re
quester); |
| 41 ProjectsResourceApi get projects => new ProjectsResourceApi(_requester); |
| 42 |
| 43 LoggingApi(http.Client client, {core.String rootUrl: "https://logging.googleap
is.com/", core.String servicePath: ""}) : |
| 44 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
| 45 } |
| 46 |
| 47 |
| 48 class BillingAccountsResourceApi { |
| 49 final commons.ApiRequester _requester; |
| 50 |
| 51 BillingAccountsLogsResourceApi get logs => new BillingAccountsLogsResourceApi(
_requester); |
| 52 BillingAccountsSinksResourceApi get sinks => new BillingAccountsSinksResourceA
pi(_requester); |
| 53 |
| 54 BillingAccountsResourceApi(commons.ApiRequester client) : |
| 55 _requester = client; |
| 56 } |
| 57 |
| 58 |
| 59 class BillingAccountsLogsResourceApi { |
| 60 final commons.ApiRequester _requester; |
| 61 |
| 62 BillingAccountsLogsResourceApi(commons.ApiRequester client) : |
| 63 _requester = client; |
| 64 |
| 65 /** |
| 66 * Deletes a log and all its log entries. |
| 67 * The log will reappear if it receives new entries. |
| 68 * |
| 69 * Request parameters: |
| 70 * |
| 71 * [logName] - Required. The resource name of the log to delete. Example: |
| 72 * `"projects/my-project/logs/syslog"`. |
| 73 * Value must have pattern "^billingAccounts/[^/]+/logs/[^/]+$". |
| 74 * |
| 75 * Completes with a [Empty]. |
| 76 * |
| 77 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 78 * error. |
| 79 * |
| 80 * If the used [http.Client] completes with an error when making a REST call, |
| 81 * this method will complete with the same error. |
| 82 */ |
| 83 async.Future<Empty> delete(core.String logName) { |
| 84 var _url = null; |
| 85 var _queryParams = new core.Map(); |
| 86 var _uploadMedia = null; |
| 87 var _uploadOptions = null; |
| 88 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 89 var _body = null; |
| 90 |
| 91 if (logName == null) { |
| 92 throw new core.ArgumentError("Parameter logName is required."); |
| 93 } |
| 94 |
| 95 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$logName'); |
| 96 |
| 97 var _response = _requester.request(_url, |
| 98 "DELETE", |
| 99 body: _body, |
| 100 queryParams: _queryParams, |
| 101 uploadOptions: _uploadOptions, |
| 102 uploadMedia: _uploadMedia, |
| 103 downloadOptions: _downloadOptions); |
| 104 return _response.then((data) => new Empty.fromJson(data)); |
| 105 } |
| 106 |
| 107 } |
| 108 |
| 109 |
| 110 class BillingAccountsSinksResourceApi { |
| 111 final commons.ApiRequester _requester; |
| 112 |
| 113 BillingAccountsSinksResourceApi(commons.ApiRequester client) : |
| 114 _requester = client; |
| 115 |
| 116 /** |
| 117 * Creates a sink. |
| 118 * |
| 119 * [request] - The metadata request object. |
| 120 * |
| 121 * Request parameters: |
| 122 * |
| 123 * [parent] - Required. The resource in which to create the sink. |
| 124 * Example: `"projects/my-project-id"`. |
| 125 * The new sink must be provided in the request. |
| 126 * Value must have pattern "^billingAccounts/[^/]+$". |
| 127 * |
| 128 * [uniqueWriterIdentity] - Optional. Whether the sink will have a dedicated |
| 129 * service account returned |
| 130 * in the sink's writer_identity. Set this field to be true to export |
| 131 * logs from one project to a different project. This field is ignored for |
| 132 * non-project sinks (e.g. organization sinks) because those sinks are |
| 133 * required to have dedicated service accounts. |
| 134 * |
| 135 * Completes with a [LogSink]. |
| 136 * |
| 137 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 138 * error. |
| 139 * |
| 140 * If the used [http.Client] completes with an error when making a REST call, |
| 141 * this method will complete with the same error. |
| 142 */ |
| 143 async.Future<LogSink> create(LogSink request, core.String parent, {core.bool u
niqueWriterIdentity}) { |
| 144 var _url = null; |
| 145 var _queryParams = new core.Map(); |
| 146 var _uploadMedia = null; |
| 147 var _uploadOptions = null; |
| 148 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 149 var _body = null; |
| 150 |
| 151 if (request != null) { |
| 152 _body = convert.JSON.encode((request).toJson()); |
| 153 } |
| 154 if (parent == null) { |
| 155 throw new core.ArgumentError("Parameter parent is required."); |
| 156 } |
| 157 if (uniqueWriterIdentity != null) { |
| 158 _queryParams["uniqueWriterIdentity"] = ["${uniqueWriterIdentity}"]; |
| 159 } |
| 160 |
| 161 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$parent') + '/sinks'; |
| 162 |
| 163 var _response = _requester.request(_url, |
| 164 "POST", |
| 165 body: _body, |
| 166 queryParams: _queryParams, |
| 167 uploadOptions: _uploadOptions, |
| 168 uploadMedia: _uploadMedia, |
| 169 downloadOptions: _downloadOptions); |
| 170 return _response.then((data) => new LogSink.fromJson(data)); |
| 171 } |
| 172 |
| 173 /** |
| 174 * Deletes a sink. |
| 175 * |
| 176 * Request parameters: |
| 177 * |
| 178 * [sinkName] - Required. The resource name of the sink to delete, including |
| 179 * the parent |
| 180 * resource and the sink identifier. Example: |
| 181 * `"projects/my-project-id/sinks/my-sink-id"`. It is an error if the sink |
| 182 * does not exist. |
| 183 * Value must have pattern "^billingAccounts/[^/]+/sinks/[^/]+$". |
| 184 * |
| 185 * Completes with a [Empty]. |
| 186 * |
| 187 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 188 * error. |
| 189 * |
| 190 * If the used [http.Client] completes with an error when making a REST call, |
| 191 * this method will complete with the same error. |
| 192 */ |
| 193 async.Future<Empty> delete(core.String sinkName) { |
| 194 var _url = null; |
| 195 var _queryParams = new core.Map(); |
| 196 var _uploadMedia = null; |
| 197 var _uploadOptions = null; |
| 198 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 199 var _body = null; |
| 200 |
| 201 if (sinkName == null) { |
| 202 throw new core.ArgumentError("Parameter sinkName is required."); |
| 203 } |
| 204 |
| 205 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$sinkName'); |
| 206 |
| 207 var _response = _requester.request(_url, |
| 208 "DELETE", |
| 209 body: _body, |
| 210 queryParams: _queryParams, |
| 211 uploadOptions: _uploadOptions, |
| 212 uploadMedia: _uploadMedia, |
| 213 downloadOptions: _downloadOptions); |
| 214 return _response.then((data) => new Empty.fromJson(data)); |
| 215 } |
| 216 |
| 217 /** |
| 218 * Gets a sink. |
| 219 * |
| 220 * Request parameters: |
| 221 * |
| 222 * [sinkName] - Required. The resource name of the sink to return. |
| 223 * Example: `"projects/my-project-id/sinks/my-sink-id"`. |
| 224 * Value must have pattern "^billingAccounts/[^/]+/sinks/[^/]+$". |
| 225 * |
| 226 * Completes with a [LogSink]. |
| 227 * |
| 228 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 229 * error. |
| 230 * |
| 231 * If the used [http.Client] completes with an error when making a REST call, |
| 232 * this method will complete with the same error. |
| 233 */ |
| 234 async.Future<LogSink> get(core.String sinkName) { |
| 235 var _url = null; |
| 236 var _queryParams = new core.Map(); |
| 237 var _uploadMedia = null; |
| 238 var _uploadOptions = null; |
| 239 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 240 var _body = null; |
| 241 |
| 242 if (sinkName == null) { |
| 243 throw new core.ArgumentError("Parameter sinkName is required."); |
| 244 } |
| 245 |
| 246 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$sinkName'); |
| 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 LogSink.fromJson(data)); |
| 256 } |
| 257 |
| 258 /** |
| 259 * Lists sinks. |
| 260 * |
| 261 * Request parameters: |
| 262 * |
| 263 * [parent] - Required. The resource name where this sink was created. |
| 264 * Example: `"projects/my-logging-project"`. |
| 265 * Value must have pattern "^billingAccounts/[^/]+$". |
| 266 * |
| 267 * [pageSize] - Optional. The maximum number of results to return from this |
| 268 * request. |
| 269 * Non-positive values are ignored. The presence of `nextPageToken` in the |
| 270 * response indicates that more results might be available. |
| 271 * |
| 272 * [pageToken] - Optional. If present, then retrieve the next batch of results |
| 273 * from the |
| 274 * preceding call to this method. `pageToken` must be the value of |
| 275 * `nextPageToken` from the previous response. The values of other method |
| 276 * parameters should be identical to those in the previous call. |
| 277 * |
| 278 * Completes with a [ListSinksResponse]. |
| 279 * |
| 280 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 281 * error. |
| 282 * |
| 283 * If the used [http.Client] completes with an error when making a REST call, |
| 284 * this method will complete with the same error. |
| 285 */ |
| 286 async.Future<ListSinksResponse> list(core.String parent, {core.int pageSize, c
ore.String pageToken}) { |
| 287 var _url = null; |
| 288 var _queryParams = new core.Map(); |
| 289 var _uploadMedia = null; |
| 290 var _uploadOptions = null; |
| 291 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 292 var _body = null; |
| 293 |
| 294 if (parent == null) { |
| 295 throw new core.ArgumentError("Parameter parent is required."); |
| 296 } |
| 297 if (pageSize != null) { |
| 298 _queryParams["pageSize"] = ["${pageSize}"]; |
| 299 } |
| 300 if (pageToken != null) { |
| 301 _queryParams["pageToken"] = [pageToken]; |
| 302 } |
| 303 |
| 304 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$parent') + '/sinks'; |
| 305 |
| 306 var _response = _requester.request(_url, |
| 307 "GET", |
| 308 body: _body, |
| 309 queryParams: _queryParams, |
| 310 uploadOptions: _uploadOptions, |
| 311 uploadMedia: _uploadMedia, |
| 312 downloadOptions: _downloadOptions); |
| 313 return _response.then((data) => new ListSinksResponse.fromJson(data)); |
| 314 } |
| 315 |
| 316 /** |
| 317 * Updates or creates a sink. |
| 318 * |
| 319 * [request] - The metadata request object. |
| 320 * |
| 321 * Request parameters: |
| 322 * |
| 323 * [sinkName] - Required. The resource name of the sink to update, including |
| 324 * the parent |
| 325 * resource and the sink identifier. If the sink does not exist, this method |
| 326 * creates the sink. Example: `"projects/my-project-id/sinks/my-sink-id"`. |
| 327 * Value must have pattern "^billingAccounts/[^/]+/sinks/[^/]+$". |
| 328 * |
| 329 * [uniqueWriterIdentity] - Optional. Whether the sink will have a dedicated |
| 330 * service account returned |
| 331 * in the sink's writer_identity. Set this field to be true to export |
| 332 * logs from one project to a different project. This field is ignored for |
| 333 * non-project sinks (e.g. organization sinks) because those sinks are |
| 334 * required to have dedicated service accounts. |
| 335 * |
| 336 * Completes with a [LogSink]. |
| 337 * |
| 338 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 339 * error. |
| 340 * |
| 341 * If the used [http.Client] completes with an error when making a REST call, |
| 342 * this method will complete with the same error. |
| 343 */ |
| 344 async.Future<LogSink> update(LogSink request, core.String sinkName, {core.bool
uniqueWriterIdentity}) { |
| 345 var _url = null; |
| 346 var _queryParams = new core.Map(); |
| 347 var _uploadMedia = null; |
| 348 var _uploadOptions = null; |
| 349 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 350 var _body = null; |
| 351 |
| 352 if (request != null) { |
| 353 _body = convert.JSON.encode((request).toJson()); |
| 354 } |
| 355 if (sinkName == null) { |
| 356 throw new core.ArgumentError("Parameter sinkName is required."); |
| 357 } |
| 358 if (uniqueWriterIdentity != null) { |
| 359 _queryParams["uniqueWriterIdentity"] = ["${uniqueWriterIdentity}"]; |
| 360 } |
| 361 |
| 362 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$sinkName'); |
| 363 |
| 364 var _response = _requester.request(_url, |
| 365 "PUT", |
| 366 body: _body, |
| 367 queryParams: _queryParams, |
| 368 uploadOptions: _uploadOptions, |
| 369 uploadMedia: _uploadMedia, |
| 370 downloadOptions: _downloadOptions); |
| 371 return _response.then((data) => new LogSink.fromJson(data)); |
| 372 } |
| 373 |
| 374 } |
| 375 |
| 376 |
| 377 class EntriesResourceApi { |
| 378 final commons.ApiRequester _requester; |
| 379 |
| 380 EntriesResourceApi(commons.ApiRequester client) : |
| 381 _requester = client; |
| 382 |
| 383 /** |
| 384 * Lists log entries. Use this method to retrieve log entries from Cloud |
| 385 * Logging. For ways to export log entries, see |
| 386 * [Exporting Logs](/logging/docs/export). |
| 387 * |
| 388 * [request] - The metadata request object. |
| 389 * |
| 390 * Request parameters: |
| 391 * |
| 392 * Completes with a [ListLogEntriesResponse]. |
| 393 * |
| 394 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 395 * error. |
| 396 * |
| 397 * If the used [http.Client] completes with an error when making a REST call, |
| 398 * this method will complete with the same error. |
| 399 */ |
| 400 async.Future<ListLogEntriesResponse> list(ListLogEntriesRequest request) { |
| 401 var _url = null; |
| 402 var _queryParams = new core.Map(); |
| 403 var _uploadMedia = null; |
| 404 var _uploadOptions = null; |
| 405 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 406 var _body = null; |
| 407 |
| 408 if (request != null) { |
| 409 _body = convert.JSON.encode((request).toJson()); |
| 410 } |
| 411 |
| 412 _url = 'v2/entries:list'; |
| 413 |
| 414 var _response = _requester.request(_url, |
| 415 "POST", |
| 416 body: _body, |
| 417 queryParams: _queryParams, |
| 418 uploadOptions: _uploadOptions, |
| 419 uploadMedia: _uploadMedia, |
| 420 downloadOptions: _downloadOptions); |
| 421 return _response.then((data) => new ListLogEntriesResponse.fromJson(data)); |
| 422 } |
| 423 |
| 424 /** |
| 425 * Writes log entries to Stackdriver Logging. All log entries are |
| 426 * written by this method. |
| 427 * |
| 428 * [request] - The metadata request object. |
| 429 * |
| 430 * Request parameters: |
| 431 * |
| 432 * Completes with a [WriteLogEntriesResponse]. |
| 433 * |
| 434 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 435 * error. |
| 436 * |
| 437 * If the used [http.Client] completes with an error when making a REST call, |
| 438 * this method will complete with the same error. |
| 439 */ |
| 440 async.Future<WriteLogEntriesResponse> write(WriteLogEntriesRequest request) { |
| 441 var _url = null; |
| 442 var _queryParams = new core.Map(); |
| 443 var _uploadMedia = null; |
| 444 var _uploadOptions = null; |
| 445 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 446 var _body = null; |
| 447 |
| 448 if (request != null) { |
| 449 _body = convert.JSON.encode((request).toJson()); |
| 450 } |
| 451 |
| 452 _url = 'v2/entries:write'; |
| 453 |
| 454 var _response = _requester.request(_url, |
| 455 "POST", |
| 456 body: _body, |
| 457 queryParams: _queryParams, |
| 458 uploadOptions: _uploadOptions, |
| 459 uploadMedia: _uploadMedia, |
| 460 downloadOptions: _downloadOptions); |
| 461 return _response.then((data) => new WriteLogEntriesResponse.fromJson(data)); |
| 462 } |
| 463 |
| 464 } |
| 465 |
| 466 |
| 467 class MonitoredResourceDescriptorsResourceApi { |
| 468 final commons.ApiRequester _requester; |
| 469 |
| 470 MonitoredResourceDescriptorsResourceApi(commons.ApiRequester client) : |
| 471 _requester = client; |
| 472 |
| 473 /** |
| 474 * Lists the monitored resource descriptors used by Stackdriver Logging. |
| 475 * |
| 476 * Request parameters: |
| 477 * |
| 478 * [pageSize] - Optional. The maximum number of results to return from this |
| 479 * request. |
| 480 * Non-positive values are ignored. The presence of `nextPageToken` in the |
| 481 * response indicates that more results might be available. |
| 482 * |
| 483 * [pageToken] - Optional. If present, then retrieve the next batch of results |
| 484 * from the |
| 485 * preceding call to this method. `pageToken` must be the value of |
| 486 * `nextPageToken` from the previous response. The values of other method |
| 487 * parameters should be identical to those in the previous call. |
| 488 * |
| 489 * Completes with a [ListMonitoredResourceDescriptorsResponse]. |
| 490 * |
| 491 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 492 * error. |
| 493 * |
| 494 * If the used [http.Client] completes with an error when making a REST call, |
| 495 * this method will complete with the same error. |
| 496 */ |
| 497 async.Future<ListMonitoredResourceDescriptorsResponse> list({core.int pageSize
, core.String pageToken}) { |
| 498 var _url = null; |
| 499 var _queryParams = new core.Map(); |
| 500 var _uploadMedia = null; |
| 501 var _uploadOptions = null; |
| 502 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 503 var _body = null; |
| 504 |
| 505 if (pageSize != null) { |
| 506 _queryParams["pageSize"] = ["${pageSize}"]; |
| 507 } |
| 508 if (pageToken != null) { |
| 509 _queryParams["pageToken"] = [pageToken]; |
| 510 } |
| 511 |
| 512 _url = 'v2/monitoredResourceDescriptors'; |
| 513 |
| 514 var _response = _requester.request(_url, |
| 515 "GET", |
| 516 body: _body, |
| 517 queryParams: _queryParams, |
| 518 uploadOptions: _uploadOptions, |
| 519 uploadMedia: _uploadMedia, |
| 520 downloadOptions: _downloadOptions); |
| 521 return _response.then((data) => new ListMonitoredResourceDescriptorsResponse
.fromJson(data)); |
| 522 } |
| 523 |
| 524 } |
| 525 |
| 526 |
| 527 class OrganizationsResourceApi { |
| 528 final commons.ApiRequester _requester; |
| 529 |
| 530 OrganizationsLogsResourceApi get logs => new OrganizationsLogsResourceApi(_req
uester); |
| 531 OrganizationsSinksResourceApi get sinks => new OrganizationsSinksResourceApi(_
requester); |
| 532 |
| 533 OrganizationsResourceApi(commons.ApiRequester client) : |
| 534 _requester = client; |
| 535 } |
| 536 |
| 537 |
| 538 class OrganizationsLogsResourceApi { |
| 539 final commons.ApiRequester _requester; |
| 540 |
| 541 OrganizationsLogsResourceApi(commons.ApiRequester client) : |
| 542 _requester = client; |
| 543 |
| 544 /** |
| 545 * Deletes a log and all its log entries. |
| 546 * The log will reappear if it receives new entries. |
| 547 * |
| 548 * Request parameters: |
| 549 * |
| 550 * [logName] - Required. The resource name of the log to delete. Example: |
| 551 * `"projects/my-project/logs/syslog"`. |
| 552 * Value must have pattern "^organizations/[^/]+/logs/[^/]+$". |
| 553 * |
| 554 * Completes with a [Empty]. |
| 555 * |
| 556 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 557 * error. |
| 558 * |
| 559 * If the used [http.Client] completes with an error when making a REST call, |
| 560 * this method will complete with the same error. |
| 561 */ |
| 562 async.Future<Empty> delete(core.String logName) { |
| 563 var _url = null; |
| 564 var _queryParams = new core.Map(); |
| 565 var _uploadMedia = null; |
| 566 var _uploadOptions = null; |
| 567 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 568 var _body = null; |
| 569 |
| 570 if (logName == null) { |
| 571 throw new core.ArgumentError("Parameter logName is required."); |
| 572 } |
| 573 |
| 574 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$logName'); |
| 575 |
| 576 var _response = _requester.request(_url, |
| 577 "DELETE", |
| 578 body: _body, |
| 579 queryParams: _queryParams, |
| 580 uploadOptions: _uploadOptions, |
| 581 uploadMedia: _uploadMedia, |
| 582 downloadOptions: _downloadOptions); |
| 583 return _response.then((data) => new Empty.fromJson(data)); |
| 584 } |
| 585 |
| 586 } |
| 587 |
| 588 |
| 589 class OrganizationsSinksResourceApi { |
| 590 final commons.ApiRequester _requester; |
| 591 |
| 592 OrganizationsSinksResourceApi(commons.ApiRequester client) : |
| 593 _requester = client; |
| 594 |
| 595 /** |
| 596 * Creates a sink. |
| 597 * |
| 598 * [request] - The metadata request object. |
| 599 * |
| 600 * Request parameters: |
| 601 * |
| 602 * [parent] - Required. The resource in which to create the sink. |
| 603 * Example: `"projects/my-project-id"`. |
| 604 * The new sink must be provided in the request. |
| 605 * Value must have pattern "^organizations/[^/]+$". |
| 606 * |
| 607 * [uniqueWriterIdentity] - Optional. Whether the sink will have a dedicated |
| 608 * service account returned |
| 609 * in the sink's writer_identity. Set this field to be true to export |
| 610 * logs from one project to a different project. This field is ignored for |
| 611 * non-project sinks (e.g. organization sinks) because those sinks are |
| 612 * required to have dedicated service accounts. |
| 613 * |
| 614 * Completes with a [LogSink]. |
| 615 * |
| 616 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 617 * error. |
| 618 * |
| 619 * If the used [http.Client] completes with an error when making a REST call, |
| 620 * this method will complete with the same error. |
| 621 */ |
| 622 async.Future<LogSink> create(LogSink request, core.String parent, {core.bool u
niqueWriterIdentity}) { |
| 623 var _url = null; |
| 624 var _queryParams = new core.Map(); |
| 625 var _uploadMedia = null; |
| 626 var _uploadOptions = null; |
| 627 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 628 var _body = null; |
| 629 |
| 630 if (request != null) { |
| 631 _body = convert.JSON.encode((request).toJson()); |
| 632 } |
| 633 if (parent == null) { |
| 634 throw new core.ArgumentError("Parameter parent is required."); |
| 635 } |
| 636 if (uniqueWriterIdentity != null) { |
| 637 _queryParams["uniqueWriterIdentity"] = ["${uniqueWriterIdentity}"]; |
| 638 } |
| 639 |
| 640 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$parent') + '/sinks'; |
| 641 |
| 642 var _response = _requester.request(_url, |
| 643 "POST", |
| 644 body: _body, |
| 645 queryParams: _queryParams, |
| 646 uploadOptions: _uploadOptions, |
| 647 uploadMedia: _uploadMedia, |
| 648 downloadOptions: _downloadOptions); |
| 649 return _response.then((data) => new LogSink.fromJson(data)); |
| 650 } |
| 651 |
| 652 /** |
| 653 * Deletes a sink. |
| 654 * |
| 655 * Request parameters: |
| 656 * |
| 657 * [sinkName] - Required. The resource name of the sink to delete, including |
| 658 * the parent |
| 659 * resource and the sink identifier. Example: |
| 660 * `"projects/my-project-id/sinks/my-sink-id"`. It is an error if the sink |
| 661 * does not exist. |
| 662 * Value must have pattern "^organizations/[^/]+/sinks/[^/]+$". |
| 663 * |
| 664 * Completes with a [Empty]. |
| 665 * |
| 666 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 667 * error. |
| 668 * |
| 669 * If the used [http.Client] completes with an error when making a REST call, |
| 670 * this method will complete with the same error. |
| 671 */ |
| 672 async.Future<Empty> delete(core.String sinkName) { |
| 673 var _url = null; |
| 674 var _queryParams = new core.Map(); |
| 675 var _uploadMedia = null; |
| 676 var _uploadOptions = null; |
| 677 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 678 var _body = null; |
| 679 |
| 680 if (sinkName == null) { |
| 681 throw new core.ArgumentError("Parameter sinkName is required."); |
| 682 } |
| 683 |
| 684 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$sinkName'); |
| 685 |
| 686 var _response = _requester.request(_url, |
| 687 "DELETE", |
| 688 body: _body, |
| 689 queryParams: _queryParams, |
| 690 uploadOptions: _uploadOptions, |
| 691 uploadMedia: _uploadMedia, |
| 692 downloadOptions: _downloadOptions); |
| 693 return _response.then((data) => new Empty.fromJson(data)); |
| 694 } |
| 695 |
| 696 /** |
| 697 * Gets a sink. |
| 698 * |
| 699 * Request parameters: |
| 700 * |
| 701 * [sinkName] - Required. The resource name of the sink to return. |
| 702 * Example: `"projects/my-project-id/sinks/my-sink-id"`. |
| 703 * Value must have pattern "^organizations/[^/]+/sinks/[^/]+$". |
| 704 * |
| 705 * Completes with a [LogSink]. |
| 706 * |
| 707 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 708 * error. |
| 709 * |
| 710 * If the used [http.Client] completes with an error when making a REST call, |
| 711 * this method will complete with the same error. |
| 712 */ |
| 713 async.Future<LogSink> get(core.String sinkName) { |
| 714 var _url = null; |
| 715 var _queryParams = new core.Map(); |
| 716 var _uploadMedia = null; |
| 717 var _uploadOptions = null; |
| 718 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 719 var _body = null; |
| 720 |
| 721 if (sinkName == null) { |
| 722 throw new core.ArgumentError("Parameter sinkName is required."); |
| 723 } |
| 724 |
| 725 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$sinkName'); |
| 726 |
| 727 var _response = _requester.request(_url, |
| 728 "GET", |
| 729 body: _body, |
| 730 queryParams: _queryParams, |
| 731 uploadOptions: _uploadOptions, |
| 732 uploadMedia: _uploadMedia, |
| 733 downloadOptions: _downloadOptions); |
| 734 return _response.then((data) => new LogSink.fromJson(data)); |
| 735 } |
| 736 |
| 737 /** |
| 738 * Lists sinks. |
| 739 * |
| 740 * Request parameters: |
| 741 * |
| 742 * [parent] - Required. The resource name where this sink was created. |
| 743 * Example: `"projects/my-logging-project"`. |
| 744 * Value must have pattern "^organizations/[^/]+$". |
| 745 * |
| 746 * [pageSize] - Optional. The maximum number of results to return from this |
| 747 * request. |
| 748 * Non-positive values are ignored. The presence of `nextPageToken` in the |
| 749 * response indicates that more results might be available. |
| 750 * |
| 751 * [pageToken] - Optional. If present, then retrieve the next batch of results |
| 752 * from the |
| 753 * preceding call to this method. `pageToken` must be the value of |
| 754 * `nextPageToken` from the previous response. The values of other method |
| 755 * parameters should be identical to those in the previous call. |
| 756 * |
| 757 * Completes with a [ListSinksResponse]. |
| 758 * |
| 759 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 760 * error. |
| 761 * |
| 762 * If the used [http.Client] completes with an error when making a REST call, |
| 763 * this method will complete with the same error. |
| 764 */ |
| 765 async.Future<ListSinksResponse> list(core.String parent, {core.int pageSize, c
ore.String pageToken}) { |
| 766 var _url = null; |
| 767 var _queryParams = new core.Map(); |
| 768 var _uploadMedia = null; |
| 769 var _uploadOptions = null; |
| 770 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 771 var _body = null; |
| 772 |
| 773 if (parent == null) { |
| 774 throw new core.ArgumentError("Parameter parent is required."); |
| 775 } |
| 776 if (pageSize != null) { |
| 777 _queryParams["pageSize"] = ["${pageSize}"]; |
| 778 } |
| 779 if (pageToken != null) { |
| 780 _queryParams["pageToken"] = [pageToken]; |
| 781 } |
| 782 |
| 783 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$parent') + '/sinks'; |
| 784 |
| 785 var _response = _requester.request(_url, |
| 786 "GET", |
| 787 body: _body, |
| 788 queryParams: _queryParams, |
| 789 uploadOptions: _uploadOptions, |
| 790 uploadMedia: _uploadMedia, |
| 791 downloadOptions: _downloadOptions); |
| 792 return _response.then((data) => new ListSinksResponse.fromJson(data)); |
| 793 } |
| 794 |
| 795 /** |
| 796 * Updates or creates a sink. |
| 797 * |
| 798 * [request] - The metadata request object. |
| 799 * |
| 800 * Request parameters: |
| 801 * |
| 802 * [sinkName] - Required. The resource name of the sink to update, including |
| 803 * the parent |
| 804 * resource and the sink identifier. If the sink does not exist, this method |
| 805 * creates the sink. Example: `"projects/my-project-id/sinks/my-sink-id"`. |
| 806 * Value must have pattern "^organizations/[^/]+/sinks/[^/]+$". |
| 807 * |
| 808 * [uniqueWriterIdentity] - Optional. Whether the sink will have a dedicated |
| 809 * service account returned |
| 810 * in the sink's writer_identity. Set this field to be true to export |
| 811 * logs from one project to a different project. This field is ignored for |
| 812 * non-project sinks (e.g. organization sinks) because those sinks are |
| 813 * required to have dedicated service accounts. |
| 814 * |
| 815 * Completes with a [LogSink]. |
| 816 * |
| 817 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 818 * error. |
| 819 * |
| 820 * If the used [http.Client] completes with an error when making a REST call, |
| 821 * this method will complete with the same error. |
| 822 */ |
| 823 async.Future<LogSink> update(LogSink request, core.String sinkName, {core.bool
uniqueWriterIdentity}) { |
| 824 var _url = null; |
| 825 var _queryParams = new core.Map(); |
| 826 var _uploadMedia = null; |
| 827 var _uploadOptions = null; |
| 828 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 829 var _body = null; |
| 830 |
| 831 if (request != null) { |
| 832 _body = convert.JSON.encode((request).toJson()); |
| 833 } |
| 834 if (sinkName == null) { |
| 835 throw new core.ArgumentError("Parameter sinkName is required."); |
| 836 } |
| 837 if (uniqueWriterIdentity != null) { |
| 838 _queryParams["uniqueWriterIdentity"] = ["${uniqueWriterIdentity}"]; |
| 839 } |
| 840 |
| 841 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$sinkName'); |
| 842 |
| 843 var _response = _requester.request(_url, |
| 844 "PUT", |
| 845 body: _body, |
| 846 queryParams: _queryParams, |
| 847 uploadOptions: _uploadOptions, |
| 848 uploadMedia: _uploadMedia, |
| 849 downloadOptions: _downloadOptions); |
| 850 return _response.then((data) => new LogSink.fromJson(data)); |
| 851 } |
| 852 |
| 853 } |
| 854 |
| 855 |
| 856 class ProjectsResourceApi { |
| 857 final commons.ApiRequester _requester; |
| 858 |
| 859 ProjectsLogsResourceApi get logs => new ProjectsLogsResourceApi(_requester); |
| 860 ProjectsMetricsResourceApi get metrics => new ProjectsMetricsResourceApi(_requ
ester); |
| 861 ProjectsSinksResourceApi get sinks => new ProjectsSinksResourceApi(_requester)
; |
| 862 |
| 863 ProjectsResourceApi(commons.ApiRequester client) : |
| 864 _requester = client; |
| 865 } |
| 866 |
| 867 |
| 868 class ProjectsLogsResourceApi { |
| 869 final commons.ApiRequester _requester; |
| 870 |
| 871 ProjectsLogsResourceApi(commons.ApiRequester client) : |
| 872 _requester = client; |
| 873 |
| 874 /** |
| 875 * Deletes a log and all its log entries. |
| 876 * The log will reappear if it receives new entries. |
| 877 * |
| 878 * Request parameters: |
| 879 * |
| 880 * [logName] - Required. The resource name of the log to delete. Example: |
| 881 * `"projects/my-project/logs/syslog"`. |
| 882 * Value must have pattern "^projects/[^/]+/logs/[^/]+$". |
| 883 * |
| 884 * Completes with a [Empty]. |
| 885 * |
| 886 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 887 * error. |
| 888 * |
| 889 * If the used [http.Client] completes with an error when making a REST call, |
| 890 * this method will complete with the same error. |
| 891 */ |
| 892 async.Future<Empty> delete(core.String logName) { |
| 893 var _url = null; |
| 894 var _queryParams = new core.Map(); |
| 895 var _uploadMedia = null; |
| 896 var _uploadOptions = null; |
| 897 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 898 var _body = null; |
| 899 |
| 900 if (logName == null) { |
| 901 throw new core.ArgumentError("Parameter logName is required."); |
| 902 } |
| 903 |
| 904 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$logName'); |
| 905 |
| 906 var _response = _requester.request(_url, |
| 907 "DELETE", |
| 908 body: _body, |
| 909 queryParams: _queryParams, |
| 910 uploadOptions: _uploadOptions, |
| 911 uploadMedia: _uploadMedia, |
| 912 downloadOptions: _downloadOptions); |
| 913 return _response.then((data) => new Empty.fromJson(data)); |
| 914 } |
| 915 |
| 916 } |
| 917 |
| 918 |
| 919 class ProjectsMetricsResourceApi { |
| 920 final commons.ApiRequester _requester; |
| 921 |
| 922 ProjectsMetricsResourceApi(commons.ApiRequester client) : |
| 923 _requester = client; |
| 924 |
| 925 /** |
| 926 * Creates a logs-based metric. |
| 927 * |
| 928 * [request] - The metadata request object. |
| 929 * |
| 930 * Request parameters: |
| 931 * |
| 932 * [parent] - The resource name of the project in which to create the metric. |
| 933 * Example: `"projects/my-project-id"`. |
| 934 * |
| 935 * The new metric must be provided in the request. |
| 936 * Value must have pattern "^projects/[^/]+$". |
| 937 * |
| 938 * Completes with a [LogMetric]. |
| 939 * |
| 940 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 941 * error. |
| 942 * |
| 943 * If the used [http.Client] completes with an error when making a REST call, |
| 944 * this method will complete with the same error. |
| 945 */ |
| 946 async.Future<LogMetric> create(LogMetric request, core.String parent) { |
| 947 var _url = null; |
| 948 var _queryParams = new core.Map(); |
| 949 var _uploadMedia = null; |
| 950 var _uploadOptions = null; |
| 951 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 952 var _body = null; |
| 953 |
| 954 if (request != null) { |
| 955 _body = convert.JSON.encode((request).toJson()); |
| 956 } |
| 957 if (parent == null) { |
| 958 throw new core.ArgumentError("Parameter parent is required."); |
| 959 } |
| 960 |
| 961 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$parent') + '/metrics'
; |
| 962 |
| 963 var _response = _requester.request(_url, |
| 964 "POST", |
| 965 body: _body, |
| 966 queryParams: _queryParams, |
| 967 uploadOptions: _uploadOptions, |
| 968 uploadMedia: _uploadMedia, |
| 969 downloadOptions: _downloadOptions); |
| 970 return _response.then((data) => new LogMetric.fromJson(data)); |
| 971 } |
| 972 |
| 973 /** |
| 974 * Deletes a logs-based metric. |
| 975 * |
| 976 * Request parameters: |
| 977 * |
| 978 * [metricName] - The resource name of the metric to delete. |
| 979 * Example: `"projects/my-project-id/metrics/my-metric-id"`. |
| 980 * Value must have pattern "^projects/[^/]+/metrics/[^/]+$". |
| 981 * |
| 982 * Completes with a [Empty]. |
| 983 * |
| 984 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 985 * error. |
| 986 * |
| 987 * If the used [http.Client] completes with an error when making a REST call, |
| 988 * this method will complete with the same error. |
| 989 */ |
| 990 async.Future<Empty> delete(core.String metricName) { |
| 991 var _url = null; |
| 992 var _queryParams = new core.Map(); |
| 993 var _uploadMedia = null; |
| 994 var _uploadOptions = null; |
| 995 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 996 var _body = null; |
| 997 |
| 998 if (metricName == null) { |
| 999 throw new core.ArgumentError("Parameter metricName is required."); |
| 1000 } |
| 1001 |
| 1002 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$metricName'); |
| 1003 |
| 1004 var _response = _requester.request(_url, |
| 1005 "DELETE", |
| 1006 body: _body, |
| 1007 queryParams: _queryParams, |
| 1008 uploadOptions: _uploadOptions, |
| 1009 uploadMedia: _uploadMedia, |
| 1010 downloadOptions: _downloadOptions); |
| 1011 return _response.then((data) => new Empty.fromJson(data)); |
| 1012 } |
| 1013 |
| 1014 /** |
| 1015 * Gets a logs-based metric. |
| 1016 * |
| 1017 * Request parameters: |
| 1018 * |
| 1019 * [metricName] - The resource name of the desired metric. |
| 1020 * Example: `"projects/my-project-id/metrics/my-metric-id"`. |
| 1021 * Value must have pattern "^projects/[^/]+/metrics/[^/]+$". |
| 1022 * |
| 1023 * Completes with a [LogMetric]. |
| 1024 * |
| 1025 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1026 * error. |
| 1027 * |
| 1028 * If the used [http.Client] completes with an error when making a REST call, |
| 1029 * this method will complete with the same error. |
| 1030 */ |
| 1031 async.Future<LogMetric> get(core.String metricName) { |
| 1032 var _url = null; |
| 1033 var _queryParams = new core.Map(); |
| 1034 var _uploadMedia = null; |
| 1035 var _uploadOptions = null; |
| 1036 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1037 var _body = null; |
| 1038 |
| 1039 if (metricName == null) { |
| 1040 throw new core.ArgumentError("Parameter metricName is required."); |
| 1041 } |
| 1042 |
| 1043 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$metricName'); |
| 1044 |
| 1045 var _response = _requester.request(_url, |
| 1046 "GET", |
| 1047 body: _body, |
| 1048 queryParams: _queryParams, |
| 1049 uploadOptions: _uploadOptions, |
| 1050 uploadMedia: _uploadMedia, |
| 1051 downloadOptions: _downloadOptions); |
| 1052 return _response.then((data) => new LogMetric.fromJson(data)); |
| 1053 } |
| 1054 |
| 1055 /** |
| 1056 * Lists logs-based metrics. |
| 1057 * |
| 1058 * Request parameters: |
| 1059 * |
| 1060 * [parent] - Required. The resource name containing the metrics. |
| 1061 * Example: `"projects/my-project-id"`. |
| 1062 * Value must have pattern "^projects/[^/]+$". |
| 1063 * |
| 1064 * [pageSize] - Optional. The maximum number of results to return from this |
| 1065 * request. |
| 1066 * Non-positive values are ignored. The presence of `nextPageToken` in the |
| 1067 * response indicates that more results might be available. |
| 1068 * |
| 1069 * [pageToken] - Optional. If present, then retrieve the next batch of results |
| 1070 * from the |
| 1071 * preceding call to this method. `pageToken` must be the value of |
| 1072 * `nextPageToken` from the previous response. The values of other method |
| 1073 * parameters should be identical to those in the previous call. |
| 1074 * |
| 1075 * Completes with a [ListLogMetricsResponse]. |
| 1076 * |
| 1077 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1078 * error. |
| 1079 * |
| 1080 * If the used [http.Client] completes with an error when making a REST call, |
| 1081 * this method will complete with the same error. |
| 1082 */ |
| 1083 async.Future<ListLogMetricsResponse> list(core.String parent, {core.int pageSi
ze, core.String pageToken}) { |
| 1084 var _url = null; |
| 1085 var _queryParams = new core.Map(); |
| 1086 var _uploadMedia = null; |
| 1087 var _uploadOptions = null; |
| 1088 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1089 var _body = null; |
| 1090 |
| 1091 if (parent == null) { |
| 1092 throw new core.ArgumentError("Parameter parent is required."); |
| 1093 } |
| 1094 if (pageSize != null) { |
| 1095 _queryParams["pageSize"] = ["${pageSize}"]; |
| 1096 } |
| 1097 if (pageToken != null) { |
| 1098 _queryParams["pageToken"] = [pageToken]; |
| 1099 } |
| 1100 |
| 1101 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$parent') + '/metrics'
; |
| 1102 |
| 1103 var _response = _requester.request(_url, |
| 1104 "GET", |
| 1105 body: _body, |
| 1106 queryParams: _queryParams, |
| 1107 uploadOptions: _uploadOptions, |
| 1108 uploadMedia: _uploadMedia, |
| 1109 downloadOptions: _downloadOptions); |
| 1110 return _response.then((data) => new ListLogMetricsResponse.fromJson(data)); |
| 1111 } |
| 1112 |
| 1113 /** |
| 1114 * Creates or updates a logs-based metric. |
| 1115 * |
| 1116 * [request] - The metadata request object. |
| 1117 * |
| 1118 * Request parameters: |
| 1119 * |
| 1120 * [metricName] - The resource name of the metric to update. |
| 1121 * Example: `"projects/my-project-id/metrics/my-metric-id"`. |
| 1122 * |
| 1123 * The updated metric must be provided in the request and have the |
| 1124 * same identifier that is specified in `metricName`. |
| 1125 * If the metric does not exist, it is created. |
| 1126 * Value must have pattern "^projects/[^/]+/metrics/[^/]+$". |
| 1127 * |
| 1128 * Completes with a [LogMetric]. |
| 1129 * |
| 1130 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1131 * error. |
| 1132 * |
| 1133 * If the used [http.Client] completes with an error when making a REST call, |
| 1134 * this method will complete with the same error. |
| 1135 */ |
| 1136 async.Future<LogMetric> update(LogMetric request, core.String metricName) { |
| 1137 var _url = null; |
| 1138 var _queryParams = new core.Map(); |
| 1139 var _uploadMedia = null; |
| 1140 var _uploadOptions = null; |
| 1141 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1142 var _body = null; |
| 1143 |
| 1144 if (request != null) { |
| 1145 _body = convert.JSON.encode((request).toJson()); |
| 1146 } |
| 1147 if (metricName == null) { |
| 1148 throw new core.ArgumentError("Parameter metricName is required."); |
| 1149 } |
| 1150 |
| 1151 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$metricName'); |
| 1152 |
| 1153 var _response = _requester.request(_url, |
| 1154 "PUT", |
| 1155 body: _body, |
| 1156 queryParams: _queryParams, |
| 1157 uploadOptions: _uploadOptions, |
| 1158 uploadMedia: _uploadMedia, |
| 1159 downloadOptions: _downloadOptions); |
| 1160 return _response.then((data) => new LogMetric.fromJson(data)); |
| 1161 } |
| 1162 |
| 1163 } |
| 1164 |
| 1165 |
| 1166 class ProjectsSinksResourceApi { |
| 1167 final commons.ApiRequester _requester; |
| 1168 |
| 1169 ProjectsSinksResourceApi(commons.ApiRequester client) : |
| 1170 _requester = client; |
| 1171 |
| 1172 /** |
| 1173 * Creates a sink. |
| 1174 * |
| 1175 * [request] - The metadata request object. |
| 1176 * |
| 1177 * Request parameters: |
| 1178 * |
| 1179 * [parent] - Required. The resource in which to create the sink. |
| 1180 * Example: `"projects/my-project-id"`. |
| 1181 * The new sink must be provided in the request. |
| 1182 * Value must have pattern "^projects/[^/]+$". |
| 1183 * |
| 1184 * [uniqueWriterIdentity] - Optional. Whether the sink will have a dedicated |
| 1185 * service account returned |
| 1186 * in the sink's writer_identity. Set this field to be true to export |
| 1187 * logs from one project to a different project. This field is ignored for |
| 1188 * non-project sinks (e.g. organization sinks) because those sinks are |
| 1189 * required to have dedicated service accounts. |
| 1190 * |
| 1191 * Completes with a [LogSink]. |
| 1192 * |
| 1193 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1194 * error. |
| 1195 * |
| 1196 * If the used [http.Client] completes with an error when making a REST call, |
| 1197 * this method will complete with the same error. |
| 1198 */ |
| 1199 async.Future<LogSink> create(LogSink request, core.String parent, {core.bool u
niqueWriterIdentity}) { |
| 1200 var _url = null; |
| 1201 var _queryParams = new core.Map(); |
| 1202 var _uploadMedia = null; |
| 1203 var _uploadOptions = null; |
| 1204 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1205 var _body = null; |
| 1206 |
| 1207 if (request != null) { |
| 1208 _body = convert.JSON.encode((request).toJson()); |
| 1209 } |
| 1210 if (parent == null) { |
| 1211 throw new core.ArgumentError("Parameter parent is required."); |
| 1212 } |
| 1213 if (uniqueWriterIdentity != null) { |
| 1214 _queryParams["uniqueWriterIdentity"] = ["${uniqueWriterIdentity}"]; |
| 1215 } |
| 1216 |
| 1217 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$parent') + '/sinks'; |
| 1218 |
| 1219 var _response = _requester.request(_url, |
| 1220 "POST", |
| 1221 body: _body, |
| 1222 queryParams: _queryParams, |
| 1223 uploadOptions: _uploadOptions, |
| 1224 uploadMedia: _uploadMedia, |
| 1225 downloadOptions: _downloadOptions); |
| 1226 return _response.then((data) => new LogSink.fromJson(data)); |
| 1227 } |
| 1228 |
| 1229 /** |
| 1230 * Deletes a sink. |
| 1231 * |
| 1232 * Request parameters: |
| 1233 * |
| 1234 * [sinkName] - Required. The resource name of the sink to delete, including |
| 1235 * the parent |
| 1236 * resource and the sink identifier. Example: |
| 1237 * `"projects/my-project-id/sinks/my-sink-id"`. It is an error if the sink |
| 1238 * does not exist. |
| 1239 * Value must have pattern "^projects/[^/]+/sinks/[^/]+$". |
| 1240 * |
| 1241 * Completes with a [Empty]. |
| 1242 * |
| 1243 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1244 * error. |
| 1245 * |
| 1246 * If the used [http.Client] completes with an error when making a REST call, |
| 1247 * this method will complete with the same error. |
| 1248 */ |
| 1249 async.Future<Empty> delete(core.String sinkName) { |
| 1250 var _url = null; |
| 1251 var _queryParams = new core.Map(); |
| 1252 var _uploadMedia = null; |
| 1253 var _uploadOptions = null; |
| 1254 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1255 var _body = null; |
| 1256 |
| 1257 if (sinkName == null) { |
| 1258 throw new core.ArgumentError("Parameter sinkName is required."); |
| 1259 } |
| 1260 |
| 1261 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$sinkName'); |
| 1262 |
| 1263 var _response = _requester.request(_url, |
| 1264 "DELETE", |
| 1265 body: _body, |
| 1266 queryParams: _queryParams, |
| 1267 uploadOptions: _uploadOptions, |
| 1268 uploadMedia: _uploadMedia, |
| 1269 downloadOptions: _downloadOptions); |
| 1270 return _response.then((data) => new Empty.fromJson(data)); |
| 1271 } |
| 1272 |
| 1273 /** |
| 1274 * Gets a sink. |
| 1275 * |
| 1276 * Request parameters: |
| 1277 * |
| 1278 * [sinkName] - Required. The resource name of the sink to return. |
| 1279 * Example: `"projects/my-project-id/sinks/my-sink-id"`. |
| 1280 * Value must have pattern "^projects/[^/]+/sinks/[^/]+$". |
| 1281 * |
| 1282 * Completes with a [LogSink]. |
| 1283 * |
| 1284 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1285 * error. |
| 1286 * |
| 1287 * If the used [http.Client] completes with an error when making a REST call, |
| 1288 * this method will complete with the same error. |
| 1289 */ |
| 1290 async.Future<LogSink> get(core.String sinkName) { |
| 1291 var _url = null; |
| 1292 var _queryParams = new core.Map(); |
| 1293 var _uploadMedia = null; |
| 1294 var _uploadOptions = null; |
| 1295 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1296 var _body = null; |
| 1297 |
| 1298 if (sinkName == null) { |
| 1299 throw new core.ArgumentError("Parameter sinkName is required."); |
| 1300 } |
| 1301 |
| 1302 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$sinkName'); |
| 1303 |
| 1304 var _response = _requester.request(_url, |
| 1305 "GET", |
| 1306 body: _body, |
| 1307 queryParams: _queryParams, |
| 1308 uploadOptions: _uploadOptions, |
| 1309 uploadMedia: _uploadMedia, |
| 1310 downloadOptions: _downloadOptions); |
| 1311 return _response.then((data) => new LogSink.fromJson(data)); |
| 1312 } |
| 1313 |
| 1314 /** |
| 1315 * Lists sinks. |
| 1316 * |
| 1317 * Request parameters: |
| 1318 * |
| 1319 * [parent] - Required. The resource name where this sink was created. |
| 1320 * Example: `"projects/my-logging-project"`. |
| 1321 * Value must have pattern "^projects/[^/]+$". |
| 1322 * |
| 1323 * [pageSize] - Optional. The maximum number of results to return from this |
| 1324 * request. |
| 1325 * Non-positive values are ignored. The presence of `nextPageToken` in the |
| 1326 * response indicates that more results might be available. |
| 1327 * |
| 1328 * [pageToken] - Optional. If present, then retrieve the next batch of results |
| 1329 * from the |
| 1330 * preceding call to this method. `pageToken` must be the value of |
| 1331 * `nextPageToken` from the previous response. The values of other method |
| 1332 * parameters should be identical to those in the previous call. |
| 1333 * |
| 1334 * Completes with a [ListSinksResponse]. |
| 1335 * |
| 1336 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1337 * error. |
| 1338 * |
| 1339 * If the used [http.Client] completes with an error when making a REST call, |
| 1340 * this method will complete with the same error. |
| 1341 */ |
| 1342 async.Future<ListSinksResponse> list(core.String parent, {core.int pageSize, c
ore.String pageToken}) { |
| 1343 var _url = null; |
| 1344 var _queryParams = new core.Map(); |
| 1345 var _uploadMedia = null; |
| 1346 var _uploadOptions = null; |
| 1347 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1348 var _body = null; |
| 1349 |
| 1350 if (parent == null) { |
| 1351 throw new core.ArgumentError("Parameter parent is required."); |
| 1352 } |
| 1353 if (pageSize != null) { |
| 1354 _queryParams["pageSize"] = ["${pageSize}"]; |
| 1355 } |
| 1356 if (pageToken != null) { |
| 1357 _queryParams["pageToken"] = [pageToken]; |
| 1358 } |
| 1359 |
| 1360 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$parent') + '/sinks'; |
| 1361 |
| 1362 var _response = _requester.request(_url, |
| 1363 "GET", |
| 1364 body: _body, |
| 1365 queryParams: _queryParams, |
| 1366 uploadOptions: _uploadOptions, |
| 1367 uploadMedia: _uploadMedia, |
| 1368 downloadOptions: _downloadOptions); |
| 1369 return _response.then((data) => new ListSinksResponse.fromJson(data)); |
| 1370 } |
| 1371 |
| 1372 /** |
| 1373 * Updates or creates a sink. |
| 1374 * |
| 1375 * [request] - The metadata request object. |
| 1376 * |
| 1377 * Request parameters: |
| 1378 * |
| 1379 * [sinkName] - Required. The resource name of the sink to update, including |
| 1380 * the parent |
| 1381 * resource and the sink identifier. If the sink does not exist, this method |
| 1382 * creates the sink. Example: `"projects/my-project-id/sinks/my-sink-id"`. |
| 1383 * Value must have pattern "^projects/[^/]+/sinks/[^/]+$". |
| 1384 * |
| 1385 * [uniqueWriterIdentity] - Optional. Whether the sink will have a dedicated |
| 1386 * service account returned |
| 1387 * in the sink's writer_identity. Set this field to be true to export |
| 1388 * logs from one project to a different project. This field is ignored for |
| 1389 * non-project sinks (e.g. organization sinks) because those sinks are |
| 1390 * required to have dedicated service accounts. |
| 1391 * |
| 1392 * Completes with a [LogSink]. |
| 1393 * |
| 1394 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1395 * error. |
| 1396 * |
| 1397 * If the used [http.Client] completes with an error when making a REST call, |
| 1398 * this method will complete with the same error. |
| 1399 */ |
| 1400 async.Future<LogSink> update(LogSink request, core.String sinkName, {core.bool
uniqueWriterIdentity}) { |
| 1401 var _url = null; |
| 1402 var _queryParams = new core.Map(); |
| 1403 var _uploadMedia = null; |
| 1404 var _uploadOptions = null; |
| 1405 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1406 var _body = null; |
| 1407 |
| 1408 if (request != null) { |
| 1409 _body = convert.JSON.encode((request).toJson()); |
| 1410 } |
| 1411 if (sinkName == null) { |
| 1412 throw new core.ArgumentError("Parameter sinkName is required."); |
| 1413 } |
| 1414 if (uniqueWriterIdentity != null) { |
| 1415 _queryParams["uniqueWriterIdentity"] = ["${uniqueWriterIdentity}"]; |
| 1416 } |
| 1417 |
| 1418 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$sinkName'); |
| 1419 |
| 1420 var _response = _requester.request(_url, |
| 1421 "PUT", |
| 1422 body: _body, |
| 1423 queryParams: _queryParams, |
| 1424 uploadOptions: _uploadOptions, |
| 1425 uploadMedia: _uploadMedia, |
| 1426 downloadOptions: _downloadOptions); |
| 1427 return _response.then((data) => new LogSink.fromJson(data)); |
| 1428 } |
| 1429 |
| 1430 } |
| 1431 |
| 1432 |
| 1433 |
| 1434 /** |
| 1435 * A generic empty message that you can re-use to avoid defining duplicated |
| 1436 * empty messages in your APIs. A typical example is to use it as the request |
| 1437 * or the response type of an API method. For instance: |
| 1438 * |
| 1439 * service Foo { |
| 1440 * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 1441 * } |
| 1442 * |
| 1443 * The JSON representation for `Empty` is empty JSON object `{}`. |
| 1444 */ |
| 1445 class Empty { |
| 1446 |
| 1447 Empty(); |
| 1448 |
| 1449 Empty.fromJson(core.Map _json) { |
| 1450 } |
| 1451 |
| 1452 core.Map toJson() { |
| 1453 var _json = new core.Map(); |
| 1454 return _json; |
| 1455 } |
| 1456 } |
| 1457 |
| 1458 /** |
| 1459 * A common proto for logging HTTP requests. Only contains semantics |
| 1460 * defined by the HTTP specification. Product-specific logging |
| 1461 * information MUST be defined in a separate message. |
| 1462 */ |
| 1463 class HttpRequest { |
| 1464 /** |
| 1465 * The number of HTTP response bytes inserted into cache. Set only when a |
| 1466 * cache fill was attempted. |
| 1467 */ |
| 1468 core.String cacheFillBytes; |
| 1469 /** |
| 1470 * Whether or not an entity was served from cache |
| 1471 * (with or without validation). |
| 1472 */ |
| 1473 core.bool cacheHit; |
| 1474 /** Whether or not a cache lookup was attempted. */ |
| 1475 core.bool cacheLookup; |
| 1476 /** |
| 1477 * Whether or not the response was validated with the origin server before |
| 1478 * being served from cache. This field is only meaningful if `cache_hit` is |
| 1479 * True. |
| 1480 */ |
| 1481 core.bool cacheValidatedWithOriginServer; |
| 1482 /** |
| 1483 * The request processing latency on the server, from the time the request was |
| 1484 * received until the response was sent. |
| 1485 */ |
| 1486 core.String latency; |
| 1487 /** |
| 1488 * The referer URL of the request, as defined in |
| 1489 * [HTTP/1.1 Header Field |
| 1490 * Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). |
| 1491 */ |
| 1492 core.String referer; |
| 1493 /** |
| 1494 * The IP address (IPv4 or IPv6) of the client that issued the HTTP |
| 1495 * request. Examples: `"192.168.1.1"`, `"FE80::0202:B3FF:FE1E:8329"`. |
| 1496 */ |
| 1497 core.String remoteIp; |
| 1498 /** The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`. */ |
| 1499 core.String requestMethod; |
| 1500 /** |
| 1501 * The size of the HTTP request message in bytes, including the request |
| 1502 * headers and the request body. |
| 1503 */ |
| 1504 core.String requestSize; |
| 1505 /** |
| 1506 * The scheme (http, https), the host name, the path and the query |
| 1507 * portion of the URL that was requested. |
| 1508 * Example: `"http://example.com/some/info?color=red"`. |
| 1509 */ |
| 1510 core.String requestUrl; |
| 1511 /** |
| 1512 * The size of the HTTP response message sent back to the client, in bytes, |
| 1513 * including the response headers and the response body. |
| 1514 */ |
| 1515 core.String responseSize; |
| 1516 /** |
| 1517 * The IP address (IPv4 or IPv6) of the origin server that the request was |
| 1518 * sent to. |
| 1519 */ |
| 1520 core.String serverIp; |
| 1521 /** |
| 1522 * The response code indicating the status of response. |
| 1523 * Examples: 200, 404. |
| 1524 */ |
| 1525 core.int status; |
| 1526 /** |
| 1527 * The user agent sent by the client. Example: |
| 1528 * `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR |
| 1529 * 1.0.3705)"`. |
| 1530 */ |
| 1531 core.String userAgent; |
| 1532 |
| 1533 HttpRequest(); |
| 1534 |
| 1535 HttpRequest.fromJson(core.Map _json) { |
| 1536 if (_json.containsKey("cacheFillBytes")) { |
| 1537 cacheFillBytes = _json["cacheFillBytes"]; |
| 1538 } |
| 1539 if (_json.containsKey("cacheHit")) { |
| 1540 cacheHit = _json["cacheHit"]; |
| 1541 } |
| 1542 if (_json.containsKey("cacheLookup")) { |
| 1543 cacheLookup = _json["cacheLookup"]; |
| 1544 } |
| 1545 if (_json.containsKey("cacheValidatedWithOriginServer")) { |
| 1546 cacheValidatedWithOriginServer = _json["cacheValidatedWithOriginServer"]; |
| 1547 } |
| 1548 if (_json.containsKey("latency")) { |
| 1549 latency = _json["latency"]; |
| 1550 } |
| 1551 if (_json.containsKey("referer")) { |
| 1552 referer = _json["referer"]; |
| 1553 } |
| 1554 if (_json.containsKey("remoteIp")) { |
| 1555 remoteIp = _json["remoteIp"]; |
| 1556 } |
| 1557 if (_json.containsKey("requestMethod")) { |
| 1558 requestMethod = _json["requestMethod"]; |
| 1559 } |
| 1560 if (_json.containsKey("requestSize")) { |
| 1561 requestSize = _json["requestSize"]; |
| 1562 } |
| 1563 if (_json.containsKey("requestUrl")) { |
| 1564 requestUrl = _json["requestUrl"]; |
| 1565 } |
| 1566 if (_json.containsKey("responseSize")) { |
| 1567 responseSize = _json["responseSize"]; |
| 1568 } |
| 1569 if (_json.containsKey("serverIp")) { |
| 1570 serverIp = _json["serverIp"]; |
| 1571 } |
| 1572 if (_json.containsKey("status")) { |
| 1573 status = _json["status"]; |
| 1574 } |
| 1575 if (_json.containsKey("userAgent")) { |
| 1576 userAgent = _json["userAgent"]; |
| 1577 } |
| 1578 } |
| 1579 |
| 1580 core.Map toJson() { |
| 1581 var _json = new core.Map(); |
| 1582 if (cacheFillBytes != null) { |
| 1583 _json["cacheFillBytes"] = cacheFillBytes; |
| 1584 } |
| 1585 if (cacheHit != null) { |
| 1586 _json["cacheHit"] = cacheHit; |
| 1587 } |
| 1588 if (cacheLookup != null) { |
| 1589 _json["cacheLookup"] = cacheLookup; |
| 1590 } |
| 1591 if (cacheValidatedWithOriginServer != null) { |
| 1592 _json["cacheValidatedWithOriginServer"] = cacheValidatedWithOriginServer; |
| 1593 } |
| 1594 if (latency != null) { |
| 1595 _json["latency"] = latency; |
| 1596 } |
| 1597 if (referer != null) { |
| 1598 _json["referer"] = referer; |
| 1599 } |
| 1600 if (remoteIp != null) { |
| 1601 _json["remoteIp"] = remoteIp; |
| 1602 } |
| 1603 if (requestMethod != null) { |
| 1604 _json["requestMethod"] = requestMethod; |
| 1605 } |
| 1606 if (requestSize != null) { |
| 1607 _json["requestSize"] = requestSize; |
| 1608 } |
| 1609 if (requestUrl != null) { |
| 1610 _json["requestUrl"] = requestUrl; |
| 1611 } |
| 1612 if (responseSize != null) { |
| 1613 _json["responseSize"] = responseSize; |
| 1614 } |
| 1615 if (serverIp != null) { |
| 1616 _json["serverIp"] = serverIp; |
| 1617 } |
| 1618 if (status != null) { |
| 1619 _json["status"] = status; |
| 1620 } |
| 1621 if (userAgent != null) { |
| 1622 _json["userAgent"] = userAgent; |
| 1623 } |
| 1624 return _json; |
| 1625 } |
| 1626 } |
| 1627 |
| 1628 /** A description of a label. */ |
| 1629 class LabelDescriptor { |
| 1630 /** A human-readable description for the label. */ |
| 1631 core.String description; |
| 1632 /** The label key. */ |
| 1633 core.String key; |
| 1634 /** |
| 1635 * The type of data that can be assigned to the label. |
| 1636 * Possible string values are: |
| 1637 * - "STRING" : A variable-length string. This is the default. |
| 1638 * - "BOOL" : Boolean; true or false. |
| 1639 * - "INT64" : A 64-bit signed integer. |
| 1640 */ |
| 1641 core.String valueType; |
| 1642 |
| 1643 LabelDescriptor(); |
| 1644 |
| 1645 LabelDescriptor.fromJson(core.Map _json) { |
| 1646 if (_json.containsKey("description")) { |
| 1647 description = _json["description"]; |
| 1648 } |
| 1649 if (_json.containsKey("key")) { |
| 1650 key = _json["key"]; |
| 1651 } |
| 1652 if (_json.containsKey("valueType")) { |
| 1653 valueType = _json["valueType"]; |
| 1654 } |
| 1655 } |
| 1656 |
| 1657 core.Map toJson() { |
| 1658 var _json = new core.Map(); |
| 1659 if (description != null) { |
| 1660 _json["description"] = description; |
| 1661 } |
| 1662 if (key != null) { |
| 1663 _json["key"] = key; |
| 1664 } |
| 1665 if (valueType != null) { |
| 1666 _json["valueType"] = valueType; |
| 1667 } |
| 1668 return _json; |
| 1669 } |
| 1670 } |
| 1671 |
| 1672 /** The parameters to `ListLogEntries`. */ |
| 1673 class ListLogEntriesRequest { |
| 1674 /** |
| 1675 * Optional. A filter that chooses which log entries to return. See [Advanced |
| 1676 * Logs Filters](/logging/docs/view/advanced_filters). Only log entries that |
| 1677 * match the filter are returned. An empty filter matches all log entries. |
| 1678 */ |
| 1679 core.String filter; |
| 1680 /** |
| 1681 * Optional. How the results should be sorted. Presently, the only permitted |
| 1682 * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first |
| 1683 * option returns entries in order of increasing values of |
| 1684 * `LogEntry.timestamp` (oldest first), and the second option returns entries |
| 1685 * in order of decreasing timestamps (newest first). Entries with equal |
| 1686 * timestamps are returned in order of `LogEntry.insertId`. |
| 1687 */ |
| 1688 core.String orderBy; |
| 1689 /** |
| 1690 * Optional. The maximum number of results to return from this request. |
| 1691 * Non-positive values are ignored. The presence of `nextPageToken` in the |
| 1692 * response indicates that more results might be available. |
| 1693 */ |
| 1694 core.int pageSize; |
| 1695 /** |
| 1696 * Optional. If present, then retrieve the next batch of results from the |
| 1697 * preceding call to this method. `pageToken` must be the value of |
| 1698 * `nextPageToken` from the previous response. The values of other method |
| 1699 * parameters should be identical to those in the previous call. |
| 1700 */ |
| 1701 core.String pageToken; |
| 1702 /** |
| 1703 * Deprecated. One or more project identifiers or project numbers from which |
| 1704 * to retrieve log entries. Examples: `"my-project-1A"`, `"1234567890"`. If |
| 1705 * present, these project identifiers are converted to resource format and |
| 1706 * added to the list of resources in `resourceNames`. Callers should use |
| 1707 * `resourceNames` rather than this parameter. |
| 1708 */ |
| 1709 core.List<core.String> projectIds; |
| 1710 /** |
| 1711 * Required. One or more cloud resources from which to retrieve log entries. |
| 1712 * Example: `"projects/my-project-1A"`, `"projects/1234567890"`. Projects |
| 1713 * listed in `projectIds` are added to this list. |
| 1714 */ |
| 1715 core.List<core.String> resourceNames; |
| 1716 |
| 1717 ListLogEntriesRequest(); |
| 1718 |
| 1719 ListLogEntriesRequest.fromJson(core.Map _json) { |
| 1720 if (_json.containsKey("filter")) { |
| 1721 filter = _json["filter"]; |
| 1722 } |
| 1723 if (_json.containsKey("orderBy")) { |
| 1724 orderBy = _json["orderBy"]; |
| 1725 } |
| 1726 if (_json.containsKey("pageSize")) { |
| 1727 pageSize = _json["pageSize"]; |
| 1728 } |
| 1729 if (_json.containsKey("pageToken")) { |
| 1730 pageToken = _json["pageToken"]; |
| 1731 } |
| 1732 if (_json.containsKey("projectIds")) { |
| 1733 projectIds = _json["projectIds"]; |
| 1734 } |
| 1735 if (_json.containsKey("resourceNames")) { |
| 1736 resourceNames = _json["resourceNames"]; |
| 1737 } |
| 1738 } |
| 1739 |
| 1740 core.Map toJson() { |
| 1741 var _json = new core.Map(); |
| 1742 if (filter != null) { |
| 1743 _json["filter"] = filter; |
| 1744 } |
| 1745 if (orderBy != null) { |
| 1746 _json["orderBy"] = orderBy; |
| 1747 } |
| 1748 if (pageSize != null) { |
| 1749 _json["pageSize"] = pageSize; |
| 1750 } |
| 1751 if (pageToken != null) { |
| 1752 _json["pageToken"] = pageToken; |
| 1753 } |
| 1754 if (projectIds != null) { |
| 1755 _json["projectIds"] = projectIds; |
| 1756 } |
| 1757 if (resourceNames != null) { |
| 1758 _json["resourceNames"] = resourceNames; |
| 1759 } |
| 1760 return _json; |
| 1761 } |
| 1762 } |
| 1763 |
| 1764 /** Result returned from `ListLogEntries`. */ |
| 1765 class ListLogEntriesResponse { |
| 1766 /** A list of log entries. */ |
| 1767 core.List<LogEntry> entries; |
| 1768 /** |
| 1769 * If there might be more results than appear in this response, then |
| 1770 * `nextPageToken` is included. To get the next set of results, call this |
| 1771 * method again using the value of `nextPageToken` as `pageToken`. |
| 1772 */ |
| 1773 core.String nextPageToken; |
| 1774 |
| 1775 ListLogEntriesResponse(); |
| 1776 |
| 1777 ListLogEntriesResponse.fromJson(core.Map _json) { |
| 1778 if (_json.containsKey("entries")) { |
| 1779 entries = _json["entries"].map((value) => new LogEntry.fromJson(value)).to
List(); |
| 1780 } |
| 1781 if (_json.containsKey("nextPageToken")) { |
| 1782 nextPageToken = _json["nextPageToken"]; |
| 1783 } |
| 1784 } |
| 1785 |
| 1786 core.Map toJson() { |
| 1787 var _json = new core.Map(); |
| 1788 if (entries != null) { |
| 1789 _json["entries"] = entries.map((value) => (value).toJson()).toList(); |
| 1790 } |
| 1791 if (nextPageToken != null) { |
| 1792 _json["nextPageToken"] = nextPageToken; |
| 1793 } |
| 1794 return _json; |
| 1795 } |
| 1796 } |
| 1797 |
| 1798 /** Result returned from ListLogMetrics. */ |
| 1799 class ListLogMetricsResponse { |
| 1800 /** A list of logs-based metrics. */ |
| 1801 core.List<LogMetric> metrics; |
| 1802 /** |
| 1803 * If there might be more results than appear in this response, then |
| 1804 * `nextPageToken` is included. To get the next set of results, call this |
| 1805 * method again using the value of `nextPageToken` as `pageToken`. |
| 1806 */ |
| 1807 core.String nextPageToken; |
| 1808 |
| 1809 ListLogMetricsResponse(); |
| 1810 |
| 1811 ListLogMetricsResponse.fromJson(core.Map _json) { |
| 1812 if (_json.containsKey("metrics")) { |
| 1813 metrics = _json["metrics"].map((value) => new LogMetric.fromJson(value)).t
oList(); |
| 1814 } |
| 1815 if (_json.containsKey("nextPageToken")) { |
| 1816 nextPageToken = _json["nextPageToken"]; |
| 1817 } |
| 1818 } |
| 1819 |
| 1820 core.Map toJson() { |
| 1821 var _json = new core.Map(); |
| 1822 if (metrics != null) { |
| 1823 _json["metrics"] = metrics.map((value) => (value).toJson()).toList(); |
| 1824 } |
| 1825 if (nextPageToken != null) { |
| 1826 _json["nextPageToken"] = nextPageToken; |
| 1827 } |
| 1828 return _json; |
| 1829 } |
| 1830 } |
| 1831 |
| 1832 /** Result returned from ListMonitoredResourceDescriptors. */ |
| 1833 class ListMonitoredResourceDescriptorsResponse { |
| 1834 /** |
| 1835 * If there might be more results than appear in this response, then |
| 1836 * `nextPageToken` is included. To get the next set of results, call this |
| 1837 * method again using the value of `nextPageToken` as `pageToken`. |
| 1838 */ |
| 1839 core.String nextPageToken; |
| 1840 /** A list of resource descriptors. */ |
| 1841 core.List<MonitoredResourceDescriptor> resourceDescriptors; |
| 1842 |
| 1843 ListMonitoredResourceDescriptorsResponse(); |
| 1844 |
| 1845 ListMonitoredResourceDescriptorsResponse.fromJson(core.Map _json) { |
| 1846 if (_json.containsKey("nextPageToken")) { |
| 1847 nextPageToken = _json["nextPageToken"]; |
| 1848 } |
| 1849 if (_json.containsKey("resourceDescriptors")) { |
| 1850 resourceDescriptors = _json["resourceDescriptors"].map((value) => new Moni
toredResourceDescriptor.fromJson(value)).toList(); |
| 1851 } |
| 1852 } |
| 1853 |
| 1854 core.Map toJson() { |
| 1855 var _json = new core.Map(); |
| 1856 if (nextPageToken != null) { |
| 1857 _json["nextPageToken"] = nextPageToken; |
| 1858 } |
| 1859 if (resourceDescriptors != null) { |
| 1860 _json["resourceDescriptors"] = resourceDescriptors.map((value) => (value).
toJson()).toList(); |
| 1861 } |
| 1862 return _json; |
| 1863 } |
| 1864 } |
| 1865 |
| 1866 /** Result returned from `ListSinks`. */ |
| 1867 class ListSinksResponse { |
| 1868 /** |
| 1869 * If there might be more results than appear in this response, then |
| 1870 * `nextPageToken` is included. To get the next set of results, call the same |
| 1871 * method again using the value of `nextPageToken` as `pageToken`. |
| 1872 */ |
| 1873 core.String nextPageToken; |
| 1874 /** A list of sinks. */ |
| 1875 core.List<LogSink> sinks; |
| 1876 |
| 1877 ListSinksResponse(); |
| 1878 |
| 1879 ListSinksResponse.fromJson(core.Map _json) { |
| 1880 if (_json.containsKey("nextPageToken")) { |
| 1881 nextPageToken = _json["nextPageToken"]; |
| 1882 } |
| 1883 if (_json.containsKey("sinks")) { |
| 1884 sinks = _json["sinks"].map((value) => new LogSink.fromJson(value)).toList(
); |
| 1885 } |
| 1886 } |
| 1887 |
| 1888 core.Map toJson() { |
| 1889 var _json = new core.Map(); |
| 1890 if (nextPageToken != null) { |
| 1891 _json["nextPageToken"] = nextPageToken; |
| 1892 } |
| 1893 if (sinks != null) { |
| 1894 _json["sinks"] = sinks.map((value) => (value).toJson()).toList(); |
| 1895 } |
| 1896 return _json; |
| 1897 } |
| 1898 } |
| 1899 |
| 1900 /** An individual entry in a log. */ |
| 1901 class LogEntry { |
| 1902 /** |
| 1903 * Optional. Information about the HTTP request associated with this |
| 1904 * log entry, if applicable. |
| 1905 */ |
| 1906 HttpRequest httpRequest; |
| 1907 /** |
| 1908 * Optional. A unique ID for the log entry. If you provide this |
| 1909 * field, the logging service considers other log entries in the |
| 1910 * same project with the same ID as duplicates which can be removed. If |
| 1911 * omitted, Stackdriver Logging will generate a unique ID for this |
| 1912 * log entry. |
| 1913 */ |
| 1914 core.String insertId; |
| 1915 /** |
| 1916 * The log entry payload, represented as a structure that |
| 1917 * is expressed as a JSON object. |
| 1918 * |
| 1919 * The values for Object must be JSON objects. It can consist of `num`, |
| 1920 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 1921 */ |
| 1922 core.Map<core.String, core.Object> jsonPayload; |
| 1923 /** |
| 1924 * Optional. A set of user-defined (key, value) data that provides additional |
| 1925 * information about the log entry. |
| 1926 */ |
| 1927 core.Map<core.String, core.String> labels; |
| 1928 /** |
| 1929 * Required. The resource name of the log to which this log entry |
| 1930 * belongs. The format of the name is |
| 1931 * `"projects/<project-id>/logs/<log-id>"`. Examples: |
| 1932 * `"projects/my-projectid/logs/syslog"`, |
| 1933 * `"projects/my-projectid/logs/library.googleapis.com%2Fbook_log"`. |
| 1934 * |
| 1935 * The log ID part of resource name must be less than 512 characters |
| 1936 * long and can only include the following characters: upper and |
| 1937 * lower case alphanumeric characters: [A-Za-z0-9]; and punctuation |
| 1938 * characters: forward-slash, underscore, hyphen, and period. |
| 1939 * Forward-slash (`/`) characters in the log ID must be URL-encoded. |
| 1940 */ |
| 1941 core.String logName; |
| 1942 /** |
| 1943 * Optional. Information about an operation associated with the log entry, if |
| 1944 * applicable. |
| 1945 */ |
| 1946 LogEntryOperation operation; |
| 1947 /** |
| 1948 * The log entry payload, represented as a protocol buffer. Some |
| 1949 * Google Cloud Platform services use this field for their log |
| 1950 * entry payloads. |
| 1951 * |
| 1952 * The values for Object must be JSON objects. It can consist of `num`, |
| 1953 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 1954 */ |
| 1955 core.Map<core.String, core.Object> protoPayload; |
| 1956 /** |
| 1957 * Required. The monitored resource associated with this log entry. |
| 1958 * Example: a log entry that reports a database error would be |
| 1959 * associated with the monitored resource designating the particular |
| 1960 * database that reported the error. |
| 1961 */ |
| 1962 MonitoredResource resource; |
| 1963 /** |
| 1964 * Optional. The severity of the log entry. The default value is |
| 1965 * `LogSeverity.DEFAULT`. |
| 1966 * Possible string values are: |
| 1967 * - "DEFAULT" : (0) The log entry has no assigned severity level. |
| 1968 * - "DEBUG" : (100) Debug or trace information. |
| 1969 * - "INFO" : (200) Routine information, such as ongoing status or |
| 1970 * performance. |
| 1971 * - "NOTICE" : (300) Normal but significant events, such as start up, shut |
| 1972 * down, or |
| 1973 * a configuration change. |
| 1974 * - "WARNING" : (400) Warning events might cause problems. |
| 1975 * - "ERROR" : (500) Error events are likely to cause problems. |
| 1976 * - "CRITICAL" : (600) Critical events cause more severe problems or outages. |
| 1977 * - "ALERT" : (700) A person must take an action immediately. |
| 1978 * - "EMERGENCY" : (800) One or more systems are unusable. |
| 1979 */ |
| 1980 core.String severity; |
| 1981 /** The log entry payload, represented as a Unicode string (UTF-8). */ |
| 1982 core.String textPayload; |
| 1983 /** |
| 1984 * Optional. The time the event described by the log entry occurred. If |
| 1985 * omitted, Stackdriver Logging will use the time the log entry is received. |
| 1986 */ |
| 1987 core.String timestamp; |
| 1988 |
| 1989 LogEntry(); |
| 1990 |
| 1991 LogEntry.fromJson(core.Map _json) { |
| 1992 if (_json.containsKey("httpRequest")) { |
| 1993 httpRequest = new HttpRequest.fromJson(_json["httpRequest"]); |
| 1994 } |
| 1995 if (_json.containsKey("insertId")) { |
| 1996 insertId = _json["insertId"]; |
| 1997 } |
| 1998 if (_json.containsKey("jsonPayload")) { |
| 1999 jsonPayload = _json["jsonPayload"]; |
| 2000 } |
| 2001 if (_json.containsKey("labels")) { |
| 2002 labels = _json["labels"]; |
| 2003 } |
| 2004 if (_json.containsKey("logName")) { |
| 2005 logName = _json["logName"]; |
| 2006 } |
| 2007 if (_json.containsKey("operation")) { |
| 2008 operation = new LogEntryOperation.fromJson(_json["operation"]); |
| 2009 } |
| 2010 if (_json.containsKey("protoPayload")) { |
| 2011 protoPayload = _json["protoPayload"]; |
| 2012 } |
| 2013 if (_json.containsKey("resource")) { |
| 2014 resource = new MonitoredResource.fromJson(_json["resource"]); |
| 2015 } |
| 2016 if (_json.containsKey("severity")) { |
| 2017 severity = _json["severity"]; |
| 2018 } |
| 2019 if (_json.containsKey("textPayload")) { |
| 2020 textPayload = _json["textPayload"]; |
| 2021 } |
| 2022 if (_json.containsKey("timestamp")) { |
| 2023 timestamp = _json["timestamp"]; |
| 2024 } |
| 2025 } |
| 2026 |
| 2027 core.Map toJson() { |
| 2028 var _json = new core.Map(); |
| 2029 if (httpRequest != null) { |
| 2030 _json["httpRequest"] = (httpRequest).toJson(); |
| 2031 } |
| 2032 if (insertId != null) { |
| 2033 _json["insertId"] = insertId; |
| 2034 } |
| 2035 if (jsonPayload != null) { |
| 2036 _json["jsonPayload"] = jsonPayload; |
| 2037 } |
| 2038 if (labels != null) { |
| 2039 _json["labels"] = labels; |
| 2040 } |
| 2041 if (logName != null) { |
| 2042 _json["logName"] = logName; |
| 2043 } |
| 2044 if (operation != null) { |
| 2045 _json["operation"] = (operation).toJson(); |
| 2046 } |
| 2047 if (protoPayload != null) { |
| 2048 _json["protoPayload"] = protoPayload; |
| 2049 } |
| 2050 if (resource != null) { |
| 2051 _json["resource"] = (resource).toJson(); |
| 2052 } |
| 2053 if (severity != null) { |
| 2054 _json["severity"] = severity; |
| 2055 } |
| 2056 if (textPayload != null) { |
| 2057 _json["textPayload"] = textPayload; |
| 2058 } |
| 2059 if (timestamp != null) { |
| 2060 _json["timestamp"] = timestamp; |
| 2061 } |
| 2062 return _json; |
| 2063 } |
| 2064 } |
| 2065 |
| 2066 /** |
| 2067 * Additional information about a potentially long-running operation with which |
| 2068 * a log entry is associated. |
| 2069 */ |
| 2070 class LogEntryOperation { |
| 2071 /** |
| 2072 * Optional. Set this to True if this is the first log entry in the operation. |
| 2073 */ |
| 2074 core.bool first; |
| 2075 /** |
| 2076 * Optional. An arbitrary operation identifier. Log entries with the |
| 2077 * same identifier are assumed to be part of the same operation. |
| 2078 */ |
| 2079 core.String id; |
| 2080 /** |
| 2081 * Optional. Set this to True if this is the last log entry in the operation. |
| 2082 */ |
| 2083 core.bool last; |
| 2084 /** |
| 2085 * Optional. An arbitrary producer identifier. The combination of |
| 2086 * `id` and `producer` must be globally unique. Examples for `producer`: |
| 2087 * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. |
| 2088 */ |
| 2089 core.String producer; |
| 2090 |
| 2091 LogEntryOperation(); |
| 2092 |
| 2093 LogEntryOperation.fromJson(core.Map _json) { |
| 2094 if (_json.containsKey("first")) { |
| 2095 first = _json["first"]; |
| 2096 } |
| 2097 if (_json.containsKey("id")) { |
| 2098 id = _json["id"]; |
| 2099 } |
| 2100 if (_json.containsKey("last")) { |
| 2101 last = _json["last"]; |
| 2102 } |
| 2103 if (_json.containsKey("producer")) { |
| 2104 producer = _json["producer"]; |
| 2105 } |
| 2106 } |
| 2107 |
| 2108 core.Map toJson() { |
| 2109 var _json = new core.Map(); |
| 2110 if (first != null) { |
| 2111 _json["first"] = first; |
| 2112 } |
| 2113 if (id != null) { |
| 2114 _json["id"] = id; |
| 2115 } |
| 2116 if (last != null) { |
| 2117 _json["last"] = last; |
| 2118 } |
| 2119 if (producer != null) { |
| 2120 _json["producer"] = producer; |
| 2121 } |
| 2122 return _json; |
| 2123 } |
| 2124 } |
| 2125 |
| 2126 /** Application log line emitted while processing a request. */ |
| 2127 class LogLine { |
| 2128 /** App-provided log message. */ |
| 2129 core.String logMessage; |
| 2130 /** |
| 2131 * Severity of this log entry. |
| 2132 * Possible string values are: |
| 2133 * - "DEFAULT" : (0) The log entry has no assigned severity level. |
| 2134 * - "DEBUG" : (100) Debug or trace information. |
| 2135 * - "INFO" : (200) Routine information, such as ongoing status or |
| 2136 * performance. |
| 2137 * - "NOTICE" : (300) Normal but significant events, such as start up, shut |
| 2138 * down, or |
| 2139 * a configuration change. |
| 2140 * - "WARNING" : (400) Warning events might cause problems. |
| 2141 * - "ERROR" : (500) Error events are likely to cause problems. |
| 2142 * - "CRITICAL" : (600) Critical events cause more severe problems or outages. |
| 2143 * - "ALERT" : (700) A person must take an action immediately. |
| 2144 * - "EMERGENCY" : (800) One or more systems are unusable. |
| 2145 */ |
| 2146 core.String severity; |
| 2147 /** Where in the source code this log message was written. */ |
| 2148 SourceLocation sourceLocation; |
| 2149 /** Approximate time when this log entry was made. */ |
| 2150 core.String time; |
| 2151 |
| 2152 LogLine(); |
| 2153 |
| 2154 LogLine.fromJson(core.Map _json) { |
| 2155 if (_json.containsKey("logMessage")) { |
| 2156 logMessage = _json["logMessage"]; |
| 2157 } |
| 2158 if (_json.containsKey("severity")) { |
| 2159 severity = _json["severity"]; |
| 2160 } |
| 2161 if (_json.containsKey("sourceLocation")) { |
| 2162 sourceLocation = new SourceLocation.fromJson(_json["sourceLocation"]); |
| 2163 } |
| 2164 if (_json.containsKey("time")) { |
| 2165 time = _json["time"]; |
| 2166 } |
| 2167 } |
| 2168 |
| 2169 core.Map toJson() { |
| 2170 var _json = new core.Map(); |
| 2171 if (logMessage != null) { |
| 2172 _json["logMessage"] = logMessage; |
| 2173 } |
| 2174 if (severity != null) { |
| 2175 _json["severity"] = severity; |
| 2176 } |
| 2177 if (sourceLocation != null) { |
| 2178 _json["sourceLocation"] = (sourceLocation).toJson(); |
| 2179 } |
| 2180 if (time != null) { |
| 2181 _json["time"] = time; |
| 2182 } |
| 2183 return _json; |
| 2184 } |
| 2185 } |
| 2186 |
| 2187 /** |
| 2188 * Describes a logs-based metric. The value of the metric is the |
| 2189 * number of log entries that match a logs filter. |
| 2190 */ |
| 2191 class LogMetric { |
| 2192 /** |
| 2193 * Optional. A description of this metric, which is used in documentation. |
| 2194 */ |
| 2195 core.String description; |
| 2196 /** |
| 2197 * Required. An [advanced logs filter](/logging/docs/view/advanced_filters). |
| 2198 * Example: `"resource.type=gae_app AND severity>=ERROR"`. |
| 2199 */ |
| 2200 core.String filter; |
| 2201 /** |
| 2202 * Required. The client-assigned metric identifier. Example: |
| 2203 * `"severe_errors"`. Metric identifiers are limited to 100 |
| 2204 * characters and can include only the following characters: `A-Z`, |
| 2205 * `a-z`, `0-9`, and the special characters `_-.,+!*',()%/`. The |
| 2206 * forward-slash character (`/`) denotes a hierarchy of name pieces, |
| 2207 * and it cannot be the first character of the name. The '%' character |
| 2208 * is used to URL encode unsafe and reserved characters and must be |
| 2209 * followed by two hexadecimal digits according to RFC 1738. |
| 2210 */ |
| 2211 core.String name; |
| 2212 /** |
| 2213 * Output only. The API version that created or updated this metric. |
| 2214 * The version also dictates the syntax of the filter expression. When a value |
| 2215 * for this field is missing, the default value of V2 should be assumed. |
| 2216 * Possible string values are: |
| 2217 * - "V2" : Stackdriver Logging API v2. |
| 2218 * - "V1" : Stackdriver Logging API v1. |
| 2219 */ |
| 2220 core.String version; |
| 2221 |
| 2222 LogMetric(); |
| 2223 |
| 2224 LogMetric.fromJson(core.Map _json) { |
| 2225 if (_json.containsKey("description")) { |
| 2226 description = _json["description"]; |
| 2227 } |
| 2228 if (_json.containsKey("filter")) { |
| 2229 filter = _json["filter"]; |
| 2230 } |
| 2231 if (_json.containsKey("name")) { |
| 2232 name = _json["name"]; |
| 2233 } |
| 2234 if (_json.containsKey("version")) { |
| 2235 version = _json["version"]; |
| 2236 } |
| 2237 } |
| 2238 |
| 2239 core.Map toJson() { |
| 2240 var _json = new core.Map(); |
| 2241 if (description != null) { |
| 2242 _json["description"] = description; |
| 2243 } |
| 2244 if (filter != null) { |
| 2245 _json["filter"] = filter; |
| 2246 } |
| 2247 if (name != null) { |
| 2248 _json["name"] = name; |
| 2249 } |
| 2250 if (version != null) { |
| 2251 _json["version"] = version; |
| 2252 } |
| 2253 return _json; |
| 2254 } |
| 2255 } |
| 2256 |
| 2257 /** |
| 2258 * Describes a sink used to export log entries outside of Stackdriver Logging. |
| 2259 * A logs filter controls which log entries are exported. Sinks can have a |
| 2260 * start time and an end time; these can be used to place log entries from an |
| 2261 * exact time range into a particular destination. If both `start_time` and |
| 2262 * `end_time` are present, then `start_time` must be less than `end_time`. |
| 2263 */ |
| 2264 class LogSink { |
| 2265 /** |
| 2266 * Required. The export destination. See |
| 2267 * [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs). |
| 2268 * Examples: |
| 2269 * |
| 2270 * "storage.googleapis.com/my-gcs-bucket" |
| 2271 * "bigquery.googleapis.com/projects/my-project-id/datasets/my-dataset" |
| 2272 * "pubsub.googleapis.com/projects/my-project/topics/my-topic" |
| 2273 */ |
| 2274 core.String destination; |
| 2275 /** |
| 2276 * Optional. Time at which this sink will stop exporting log entries. If this |
| 2277 * value is present, then log entries are exported only if `entry.timestamp` < |
| 2278 * `end_time`. |
| 2279 */ |
| 2280 core.String endTime; |
| 2281 /** |
| 2282 * Optional. An [advanced logs filter](/logging/docs/view/advanced_filters). |
| 2283 * Only log entries matching the filter are exported. The filter |
| 2284 * must be consistent with the log entry format specified by the |
| 2285 * `outputVersionFormat` parameter, regardless of the format of the |
| 2286 * log entry that was originally written to Stackdriver Logging. |
| 2287 * Example filter (V2 format): |
| 2288 * |
| 2289 * logName=projects/my-projectid/logs/syslog AND severity>=ERROR |
| 2290 */ |
| 2291 core.String filter; |
| 2292 /** |
| 2293 * Required. The client-assigned sink identifier, unique within the |
| 2294 * project. Example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are |
| 2295 * limited to 1000 characters and can include only the following characters: |
| 2296 * `A-Z`, `a-z`, `0-9`, and the special characters `_-.`. The maximum length |
| 2297 * of the name is 100 characters. |
| 2298 */ |
| 2299 core.String name; |
| 2300 /** |
| 2301 * Optional. The log entry version to use for this sink's exported log |
| 2302 * entries. This version does not have to correspond to the version of the |
| 2303 * log entry that was written to Stackdriver Logging. If omitted, the |
| 2304 * v2 format is used. |
| 2305 * Possible string values are: |
| 2306 * - "VERSION_FORMAT_UNSPECIFIED" : An unspecified version format will default |
| 2307 * to V2. |
| 2308 * - "V2" : `LogEntry` version 2 format. |
| 2309 * - "V1" : `LogEntry` version 1 format. |
| 2310 */ |
| 2311 core.String outputVersionFormat; |
| 2312 /** |
| 2313 * Optional. The time at which this sink will begin exporting log entries. If |
| 2314 * this value is present, then log entries are exported only if `start_time` |
| 2315 * <=`entry.timestamp`. |
| 2316 */ |
| 2317 core.String startTime; |
| 2318 /** |
| 2319 * Output only. An IAM identity—a service account or group—that |
| 2320 * will write exported log entries to the destination on behalf of Stackdriver |
| 2321 * Logging. You must grant this identity write-access to the destination. |
| 2322 * Consult the destination service's documentation to determine the exact role |
| 2323 * that must be granted. |
| 2324 */ |
| 2325 core.String writerIdentity; |
| 2326 |
| 2327 LogSink(); |
| 2328 |
| 2329 LogSink.fromJson(core.Map _json) { |
| 2330 if (_json.containsKey("destination")) { |
| 2331 destination = _json["destination"]; |
| 2332 } |
| 2333 if (_json.containsKey("endTime")) { |
| 2334 endTime = _json["endTime"]; |
| 2335 } |
| 2336 if (_json.containsKey("filter")) { |
| 2337 filter = _json["filter"]; |
| 2338 } |
| 2339 if (_json.containsKey("name")) { |
| 2340 name = _json["name"]; |
| 2341 } |
| 2342 if (_json.containsKey("outputVersionFormat")) { |
| 2343 outputVersionFormat = _json["outputVersionFormat"]; |
| 2344 } |
| 2345 if (_json.containsKey("startTime")) { |
| 2346 startTime = _json["startTime"]; |
| 2347 } |
| 2348 if (_json.containsKey("writerIdentity")) { |
| 2349 writerIdentity = _json["writerIdentity"]; |
| 2350 } |
| 2351 } |
| 2352 |
| 2353 core.Map toJson() { |
| 2354 var _json = new core.Map(); |
| 2355 if (destination != null) { |
| 2356 _json["destination"] = destination; |
| 2357 } |
| 2358 if (endTime != null) { |
| 2359 _json["endTime"] = endTime; |
| 2360 } |
| 2361 if (filter != null) { |
| 2362 _json["filter"] = filter; |
| 2363 } |
| 2364 if (name != null) { |
| 2365 _json["name"] = name; |
| 2366 } |
| 2367 if (outputVersionFormat != null) { |
| 2368 _json["outputVersionFormat"] = outputVersionFormat; |
| 2369 } |
| 2370 if (startTime != null) { |
| 2371 _json["startTime"] = startTime; |
| 2372 } |
| 2373 if (writerIdentity != null) { |
| 2374 _json["writerIdentity"] = writerIdentity; |
| 2375 } |
| 2376 return _json; |
| 2377 } |
| 2378 } |
| 2379 |
| 2380 /** |
| 2381 * An object representing a resource that can be used for monitoring, logging, |
| 2382 * billing, or other purposes. Examples include virtual machine instances, |
| 2383 * databases, and storage devices such as disks. The `type` field identifies a |
| 2384 * MonitoredResourceDescriptor object that describes the resource's |
| 2385 * schema. Information in the `labels` field identifies the actual resource and |
| 2386 * its attributes according to the schema. For example, a particular Compute |
| 2387 * Engine VM instance could be represented by the following object, because the |
| 2388 * MonitoredResourceDescriptor for `"gce_instance"` has labels |
| 2389 * `"instance_id"` and `"zone"`: |
| 2390 * |
| 2391 * { "type": "gce_instance", |
| 2392 * "labels": { "instance_id": "12345678901234", |
| 2393 * "zone": "us-central1-a" }} |
| 2394 */ |
| 2395 class MonitoredResource { |
| 2396 /** |
| 2397 * Required. Values for all of the labels listed in the associated monitored |
| 2398 * resource descriptor. For example, Cloud SQL databases use the labels |
| 2399 * `"database_id"` and `"zone"`. |
| 2400 */ |
| 2401 core.Map<core.String, core.String> labels; |
| 2402 /** |
| 2403 * Required. The monitored resource type. This field must match |
| 2404 * the `type` field of a MonitoredResourceDescriptor object. For |
| 2405 * example, the type of a Cloud SQL database is `"cloudsql_database"`. |
| 2406 */ |
| 2407 core.String type; |
| 2408 |
| 2409 MonitoredResource(); |
| 2410 |
| 2411 MonitoredResource.fromJson(core.Map _json) { |
| 2412 if (_json.containsKey("labels")) { |
| 2413 labels = _json["labels"]; |
| 2414 } |
| 2415 if (_json.containsKey("type")) { |
| 2416 type = _json["type"]; |
| 2417 } |
| 2418 } |
| 2419 |
| 2420 core.Map toJson() { |
| 2421 var _json = new core.Map(); |
| 2422 if (labels != null) { |
| 2423 _json["labels"] = labels; |
| 2424 } |
| 2425 if (type != null) { |
| 2426 _json["type"] = type; |
| 2427 } |
| 2428 return _json; |
| 2429 } |
| 2430 } |
| 2431 |
| 2432 /** |
| 2433 * An object that describes the schema of a MonitoredResource object using a |
| 2434 * type name and a set of labels. For example, the monitored resource |
| 2435 * descriptor for Google Compute Engine VM instances has a type of |
| 2436 * `"gce_instance"` and specifies the use of the labels `"instance_id"` and |
| 2437 * `"zone"` to identify particular VM instances. |
| 2438 * |
| 2439 * Different APIs can support different monitored resource types. APIs generally |
| 2440 * provide a `list` method that returns the monitored resource descriptors used |
| 2441 * by the API. |
| 2442 */ |
| 2443 class MonitoredResourceDescriptor { |
| 2444 /** |
| 2445 * Optional. A detailed description of the monitored resource type that might |
| 2446 * be used in documentation. |
| 2447 */ |
| 2448 core.String description; |
| 2449 /** |
| 2450 * Optional. A concise name for the monitored resource type that might be |
| 2451 * displayed in user interfaces. It should be a Title Cased Noun Phrase, |
| 2452 * without any article or other determiners. For example, |
| 2453 * `"Google Cloud SQL Database"`. |
| 2454 */ |
| 2455 core.String displayName; |
| 2456 /** |
| 2457 * Required. A set of labels used to describe instances of this monitored |
| 2458 * resource type. For example, an individual Google Cloud SQL database is |
| 2459 * identified by values for the labels `"database_id"` and `"zone"`. |
| 2460 */ |
| 2461 core.List<LabelDescriptor> labels; |
| 2462 /** |
| 2463 * Optional. The resource name of the monitored resource descriptor: |
| 2464 * `"projects/{project_id}/monitoredResourceDescriptors/{type}"` where |
| 2465 * {type} is the value of the `type` field in this object and |
| 2466 * {project_id} is a project ID that provides API-specific context for |
| 2467 * accessing the type. APIs that do not use project information can use the |
| 2468 * resource name format `"monitoredResourceDescriptors/{type}"`. |
| 2469 */ |
| 2470 core.String name; |
| 2471 /** |
| 2472 * Required. The monitored resource type. For example, the type |
| 2473 * `"cloudsql_database"` represents databases in Google Cloud SQL. |
| 2474 * The maximum length of this value is 256 characters. |
| 2475 */ |
| 2476 core.String type; |
| 2477 |
| 2478 MonitoredResourceDescriptor(); |
| 2479 |
| 2480 MonitoredResourceDescriptor.fromJson(core.Map _json) { |
| 2481 if (_json.containsKey("description")) { |
| 2482 description = _json["description"]; |
| 2483 } |
| 2484 if (_json.containsKey("displayName")) { |
| 2485 displayName = _json["displayName"]; |
| 2486 } |
| 2487 if (_json.containsKey("labels")) { |
| 2488 labels = _json["labels"].map((value) => new LabelDescriptor.fromJson(value
)).toList(); |
| 2489 } |
| 2490 if (_json.containsKey("name")) { |
| 2491 name = _json["name"]; |
| 2492 } |
| 2493 if (_json.containsKey("type")) { |
| 2494 type = _json["type"]; |
| 2495 } |
| 2496 } |
| 2497 |
| 2498 core.Map toJson() { |
| 2499 var _json = new core.Map(); |
| 2500 if (description != null) { |
| 2501 _json["description"] = description; |
| 2502 } |
| 2503 if (displayName != null) { |
| 2504 _json["displayName"] = displayName; |
| 2505 } |
| 2506 if (labels != null) { |
| 2507 _json["labels"] = labels.map((value) => (value).toJson()).toList(); |
| 2508 } |
| 2509 if (name != null) { |
| 2510 _json["name"] = name; |
| 2511 } |
| 2512 if (type != null) { |
| 2513 _json["type"] = type; |
| 2514 } |
| 2515 return _json; |
| 2516 } |
| 2517 } |
| 2518 |
| 2519 /** |
| 2520 * Complete log information about a single HTTP request to an App Engine |
| 2521 * application. |
| 2522 */ |
| 2523 class RequestLog { |
| 2524 /** App Engine release version. */ |
| 2525 core.String appEngineRelease; |
| 2526 /** Application that handled this request. */ |
| 2527 core.String appId; |
| 2528 /** An indication of the relative cost of serving this request. */ |
| 2529 core.double cost; |
| 2530 /** Time when the request finished. */ |
| 2531 core.String endTime; |
| 2532 /** Whether this request is finished or active. */ |
| 2533 core.bool finished; |
| 2534 /** |
| 2535 * Whether this is the first RequestLog entry for this request. If an active |
| 2536 * request has several RequestLog entries written to Cloud Logging, this field |
| 2537 * will be set for one of them. |
| 2538 */ |
| 2539 core.bool first; |
| 2540 /** Internet host and port number of the resource being requested. */ |
| 2541 core.String host; |
| 2542 /** HTTP version of request. Example: `"HTTP/1.1"`. */ |
| 2543 core.String httpVersion; |
| 2544 /** An identifier for the instance that handled the request. */ |
| 2545 core.String instanceId; |
| 2546 /** |
| 2547 * If the instance processing this request belongs to a manually scaled |
| 2548 * module, then this is the 0-based index of the instance. Otherwise, this |
| 2549 * value is -1. |
| 2550 */ |
| 2551 core.int instanceIndex; |
| 2552 /** Origin IP address. */ |
| 2553 core.String ip; |
| 2554 /** Latency of the request. */ |
| 2555 core.String latency; |
| 2556 /** |
| 2557 * A list of log lines emitted by the application while serving this request. |
| 2558 */ |
| 2559 core.List<LogLine> line; |
| 2560 /** Number of CPU megacycles used to process request. */ |
| 2561 core.String megaCycles; |
| 2562 /** |
| 2563 * Request method. Example: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`, `"DELETE"`. |
| 2564 */ |
| 2565 core.String method; |
| 2566 /** Module of the application that handled this request. */ |
| 2567 core.String moduleId; |
| 2568 /** |
| 2569 * The logged-in user who made the request. |
| 2570 * |
| 2571 * Most likely, this is the part of the user's email before the `@` sign. The |
| 2572 * field value is the same for different requests from the same user, but |
| 2573 * different users can have similar names. This information is also |
| 2574 * available to the application via the App Engine Users API. |
| 2575 * |
| 2576 * This field will be populated starting with App Engine 1.9.21. |
| 2577 */ |
| 2578 core.String nickname; |
| 2579 /** Time this request spent in the pending request queue. */ |
| 2580 core.String pendingTime; |
| 2581 /** Referrer URL of request. */ |
| 2582 core.String referrer; |
| 2583 /** |
| 2584 * Globally unique identifier for a request, which is based on the request |
| 2585 * start time. Request IDs for requests which started later will compare |
| 2586 * greater as strings than those for requests which started earlier. |
| 2587 */ |
| 2588 core.String requestId; |
| 2589 /** |
| 2590 * Contains the path and query portion of the URL that was requested. For |
| 2591 * example, if the URL was "http://example.com/app?name=val", the resource |
| 2592 * would be "/app?name=val". The fragment identifier, which is identified by |
| 2593 * the `#` character, is not included. |
| 2594 */ |
| 2595 core.String resource; |
| 2596 /** Size in bytes sent back to client by request. */ |
| 2597 core.String responseSize; |
| 2598 /** |
| 2599 * Source code for the application that handled this request. There can be |
| 2600 * more than one source reference per deployed application if source code is |
| 2601 * distributed among multiple repositories. |
| 2602 */ |
| 2603 core.List<SourceReference> sourceReference; |
| 2604 /** Time when the request started. */ |
| 2605 core.String startTime; |
| 2606 /** HTTP response status code. Example: 200, 404. */ |
| 2607 core.int status; |
| 2608 /** Task name of the request, in the case of an offline request. */ |
| 2609 core.String taskName; |
| 2610 /** Queue name of the request, in the case of an offline request. */ |
| 2611 core.String taskQueueName; |
| 2612 /** Cloud Trace identifier for this request. */ |
| 2613 core.String traceId; |
| 2614 /** File or class that handled the request. */ |
| 2615 core.String urlMapEntry; |
| 2616 /** User agent that made the request. */ |
| 2617 core.String userAgent; |
| 2618 /** Version of the application that handled this request. */ |
| 2619 core.String versionId; |
| 2620 /** Whether this was a loading request for the instance. */ |
| 2621 core.bool wasLoadingRequest; |
| 2622 |
| 2623 RequestLog(); |
| 2624 |
| 2625 RequestLog.fromJson(core.Map _json) { |
| 2626 if (_json.containsKey("appEngineRelease")) { |
| 2627 appEngineRelease = _json["appEngineRelease"]; |
| 2628 } |
| 2629 if (_json.containsKey("appId")) { |
| 2630 appId = _json["appId"]; |
| 2631 } |
| 2632 if (_json.containsKey("cost")) { |
| 2633 cost = _json["cost"]; |
| 2634 } |
| 2635 if (_json.containsKey("endTime")) { |
| 2636 endTime = _json["endTime"]; |
| 2637 } |
| 2638 if (_json.containsKey("finished")) { |
| 2639 finished = _json["finished"]; |
| 2640 } |
| 2641 if (_json.containsKey("first")) { |
| 2642 first = _json["first"]; |
| 2643 } |
| 2644 if (_json.containsKey("host")) { |
| 2645 host = _json["host"]; |
| 2646 } |
| 2647 if (_json.containsKey("httpVersion")) { |
| 2648 httpVersion = _json["httpVersion"]; |
| 2649 } |
| 2650 if (_json.containsKey("instanceId")) { |
| 2651 instanceId = _json["instanceId"]; |
| 2652 } |
| 2653 if (_json.containsKey("instanceIndex")) { |
| 2654 instanceIndex = _json["instanceIndex"]; |
| 2655 } |
| 2656 if (_json.containsKey("ip")) { |
| 2657 ip = _json["ip"]; |
| 2658 } |
| 2659 if (_json.containsKey("latency")) { |
| 2660 latency = _json["latency"]; |
| 2661 } |
| 2662 if (_json.containsKey("line")) { |
| 2663 line = _json["line"].map((value) => new LogLine.fromJson(value)).toList(); |
| 2664 } |
| 2665 if (_json.containsKey("megaCycles")) { |
| 2666 megaCycles = _json["megaCycles"]; |
| 2667 } |
| 2668 if (_json.containsKey("method")) { |
| 2669 method = _json["method"]; |
| 2670 } |
| 2671 if (_json.containsKey("moduleId")) { |
| 2672 moduleId = _json["moduleId"]; |
| 2673 } |
| 2674 if (_json.containsKey("nickname")) { |
| 2675 nickname = _json["nickname"]; |
| 2676 } |
| 2677 if (_json.containsKey("pendingTime")) { |
| 2678 pendingTime = _json["pendingTime"]; |
| 2679 } |
| 2680 if (_json.containsKey("referrer")) { |
| 2681 referrer = _json["referrer"]; |
| 2682 } |
| 2683 if (_json.containsKey("requestId")) { |
| 2684 requestId = _json["requestId"]; |
| 2685 } |
| 2686 if (_json.containsKey("resource")) { |
| 2687 resource = _json["resource"]; |
| 2688 } |
| 2689 if (_json.containsKey("responseSize")) { |
| 2690 responseSize = _json["responseSize"]; |
| 2691 } |
| 2692 if (_json.containsKey("sourceReference")) { |
| 2693 sourceReference = _json["sourceReference"].map((value) => new SourceRefere
nce.fromJson(value)).toList(); |
| 2694 } |
| 2695 if (_json.containsKey("startTime")) { |
| 2696 startTime = _json["startTime"]; |
| 2697 } |
| 2698 if (_json.containsKey("status")) { |
| 2699 status = _json["status"]; |
| 2700 } |
| 2701 if (_json.containsKey("taskName")) { |
| 2702 taskName = _json["taskName"]; |
| 2703 } |
| 2704 if (_json.containsKey("taskQueueName")) { |
| 2705 taskQueueName = _json["taskQueueName"]; |
| 2706 } |
| 2707 if (_json.containsKey("traceId")) { |
| 2708 traceId = _json["traceId"]; |
| 2709 } |
| 2710 if (_json.containsKey("urlMapEntry")) { |
| 2711 urlMapEntry = _json["urlMapEntry"]; |
| 2712 } |
| 2713 if (_json.containsKey("userAgent")) { |
| 2714 userAgent = _json["userAgent"]; |
| 2715 } |
| 2716 if (_json.containsKey("versionId")) { |
| 2717 versionId = _json["versionId"]; |
| 2718 } |
| 2719 if (_json.containsKey("wasLoadingRequest")) { |
| 2720 wasLoadingRequest = _json["wasLoadingRequest"]; |
| 2721 } |
| 2722 } |
| 2723 |
| 2724 core.Map toJson() { |
| 2725 var _json = new core.Map(); |
| 2726 if (appEngineRelease != null) { |
| 2727 _json["appEngineRelease"] = appEngineRelease; |
| 2728 } |
| 2729 if (appId != null) { |
| 2730 _json["appId"] = appId; |
| 2731 } |
| 2732 if (cost != null) { |
| 2733 _json["cost"] = cost; |
| 2734 } |
| 2735 if (endTime != null) { |
| 2736 _json["endTime"] = endTime; |
| 2737 } |
| 2738 if (finished != null) { |
| 2739 _json["finished"] = finished; |
| 2740 } |
| 2741 if (first != null) { |
| 2742 _json["first"] = first; |
| 2743 } |
| 2744 if (host != null) { |
| 2745 _json["host"] = host; |
| 2746 } |
| 2747 if (httpVersion != null) { |
| 2748 _json["httpVersion"] = httpVersion; |
| 2749 } |
| 2750 if (instanceId != null) { |
| 2751 _json["instanceId"] = instanceId; |
| 2752 } |
| 2753 if (instanceIndex != null) { |
| 2754 _json["instanceIndex"] = instanceIndex; |
| 2755 } |
| 2756 if (ip != null) { |
| 2757 _json["ip"] = ip; |
| 2758 } |
| 2759 if (latency != null) { |
| 2760 _json["latency"] = latency; |
| 2761 } |
| 2762 if (line != null) { |
| 2763 _json["line"] = line.map((value) => (value).toJson()).toList(); |
| 2764 } |
| 2765 if (megaCycles != null) { |
| 2766 _json["megaCycles"] = megaCycles; |
| 2767 } |
| 2768 if (method != null) { |
| 2769 _json["method"] = method; |
| 2770 } |
| 2771 if (moduleId != null) { |
| 2772 _json["moduleId"] = moduleId; |
| 2773 } |
| 2774 if (nickname != null) { |
| 2775 _json["nickname"] = nickname; |
| 2776 } |
| 2777 if (pendingTime != null) { |
| 2778 _json["pendingTime"] = pendingTime; |
| 2779 } |
| 2780 if (referrer != null) { |
| 2781 _json["referrer"] = referrer; |
| 2782 } |
| 2783 if (requestId != null) { |
| 2784 _json["requestId"] = requestId; |
| 2785 } |
| 2786 if (resource != null) { |
| 2787 _json["resource"] = resource; |
| 2788 } |
| 2789 if (responseSize != null) { |
| 2790 _json["responseSize"] = responseSize; |
| 2791 } |
| 2792 if (sourceReference != null) { |
| 2793 _json["sourceReference"] = sourceReference.map((value) => (value).toJson()
).toList(); |
| 2794 } |
| 2795 if (startTime != null) { |
| 2796 _json["startTime"] = startTime; |
| 2797 } |
| 2798 if (status != null) { |
| 2799 _json["status"] = status; |
| 2800 } |
| 2801 if (taskName != null) { |
| 2802 _json["taskName"] = taskName; |
| 2803 } |
| 2804 if (taskQueueName != null) { |
| 2805 _json["taskQueueName"] = taskQueueName; |
| 2806 } |
| 2807 if (traceId != null) { |
| 2808 _json["traceId"] = traceId; |
| 2809 } |
| 2810 if (urlMapEntry != null) { |
| 2811 _json["urlMapEntry"] = urlMapEntry; |
| 2812 } |
| 2813 if (userAgent != null) { |
| 2814 _json["userAgent"] = userAgent; |
| 2815 } |
| 2816 if (versionId != null) { |
| 2817 _json["versionId"] = versionId; |
| 2818 } |
| 2819 if (wasLoadingRequest != null) { |
| 2820 _json["wasLoadingRequest"] = wasLoadingRequest; |
| 2821 } |
| 2822 return _json; |
| 2823 } |
| 2824 } |
| 2825 |
| 2826 /** Specifies a location in a source code file. */ |
| 2827 class SourceLocation { |
| 2828 /** |
| 2829 * Source file name. Depending on the runtime environment, this might be a |
| 2830 * simple name or a fully-qualified name. |
| 2831 */ |
| 2832 core.String file; |
| 2833 /** |
| 2834 * Human-readable name of the function or method being invoked, with optional |
| 2835 * context such as the class or package name. This information is used in |
| 2836 * contexts such as the logs viewer, where a file and line number are less |
| 2837 * meaningful. The format can vary by language. For example: |
| 2838 * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function` |
| 2839 * (Python). |
| 2840 */ |
| 2841 core.String functionName; |
| 2842 /** Line within the source file. */ |
| 2843 core.String line; |
| 2844 |
| 2845 SourceLocation(); |
| 2846 |
| 2847 SourceLocation.fromJson(core.Map _json) { |
| 2848 if (_json.containsKey("file")) { |
| 2849 file = _json["file"]; |
| 2850 } |
| 2851 if (_json.containsKey("functionName")) { |
| 2852 functionName = _json["functionName"]; |
| 2853 } |
| 2854 if (_json.containsKey("line")) { |
| 2855 line = _json["line"]; |
| 2856 } |
| 2857 } |
| 2858 |
| 2859 core.Map toJson() { |
| 2860 var _json = new core.Map(); |
| 2861 if (file != null) { |
| 2862 _json["file"] = file; |
| 2863 } |
| 2864 if (functionName != null) { |
| 2865 _json["functionName"] = functionName; |
| 2866 } |
| 2867 if (line != null) { |
| 2868 _json["line"] = line; |
| 2869 } |
| 2870 return _json; |
| 2871 } |
| 2872 } |
| 2873 |
| 2874 /** |
| 2875 * A reference to a particular snapshot of the source tree used to build and |
| 2876 * deploy an application. |
| 2877 */ |
| 2878 class SourceReference { |
| 2879 /** |
| 2880 * Optional. A URI string identifying the repository. |
| 2881 * Example: "https://github.com/GoogleCloudPlatform/kubernetes.git" |
| 2882 */ |
| 2883 core.String repository; |
| 2884 /** |
| 2885 * The canonical and persistent identifier of the deployed revision. |
| 2886 * Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b" |
| 2887 */ |
| 2888 core.String revisionId; |
| 2889 |
| 2890 SourceReference(); |
| 2891 |
| 2892 SourceReference.fromJson(core.Map _json) { |
| 2893 if (_json.containsKey("repository")) { |
| 2894 repository = _json["repository"]; |
| 2895 } |
| 2896 if (_json.containsKey("revisionId")) { |
| 2897 revisionId = _json["revisionId"]; |
| 2898 } |
| 2899 } |
| 2900 |
| 2901 core.Map toJson() { |
| 2902 var _json = new core.Map(); |
| 2903 if (repository != null) { |
| 2904 _json["repository"] = repository; |
| 2905 } |
| 2906 if (revisionId != null) { |
| 2907 _json["revisionId"] = revisionId; |
| 2908 } |
| 2909 return _json; |
| 2910 } |
| 2911 } |
| 2912 |
| 2913 /** The parameters to WriteLogEntries. */ |
| 2914 class WriteLogEntriesRequest { |
| 2915 /** |
| 2916 * Required. The log entries to write. Values supplied for the fields |
| 2917 * `log_name`, `resource`, and `labels` in this `entries.write` request are |
| 2918 * added to those log entries that do not provide their own values for the |
| 2919 * fields. |
| 2920 * |
| 2921 * To improve throughput and to avoid exceeding the |
| 2922 * [quota limit](/logging/quota-policy) for calls to `entries.write`, |
| 2923 * you should write multiple log entries at once rather than |
| 2924 * calling this method for each individual log entry. |
| 2925 */ |
| 2926 core.List<LogEntry> entries; |
| 2927 /** |
| 2928 * Optional. Default labels that are added to the `labels` field of all log |
| 2929 * entries in `entries`. If a log entry already has a label with the same key |
| 2930 * as a label in this parameter, then the log entry's label is not changed. |
| 2931 * See LogEntry. |
| 2932 */ |
| 2933 core.Map<core.String, core.String> labels; |
| 2934 /** |
| 2935 * Optional. A default log resource name that is assigned to all log entries |
| 2936 * in `entries` that do not specify a value for `log_name`. Example: |
| 2937 * `"projects/my-project/logs/syslog"`. See |
| 2938 * LogEntry. |
| 2939 */ |
| 2940 core.String logName; |
| 2941 /** |
| 2942 * Optional. Whether valid entries should be written even if some other |
| 2943 * entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any |
| 2944 * entry is not written, the response status will be the error associated |
| 2945 * with one of the failed entries and include error details in the form of |
| 2946 * WriteLogEntriesPartialErrors. |
| 2947 */ |
| 2948 core.bool partialSuccess; |
| 2949 /** |
| 2950 * Optional. A default monitored resource object that is assigned to all log |
| 2951 * entries in `entries` that do not specify a value for `resource`. Example: |
| 2952 * |
| 2953 * { "type": "gce_instance", |
| 2954 * "labels": { |
| 2955 * "zone": "us-central1-a", "instance_id": "00000000000000000000" }} |
| 2956 * |
| 2957 * See LogEntry. |
| 2958 */ |
| 2959 MonitoredResource resource; |
| 2960 |
| 2961 WriteLogEntriesRequest(); |
| 2962 |
| 2963 WriteLogEntriesRequest.fromJson(core.Map _json) { |
| 2964 if (_json.containsKey("entries")) { |
| 2965 entries = _json["entries"].map((value) => new LogEntry.fromJson(value)).to
List(); |
| 2966 } |
| 2967 if (_json.containsKey("labels")) { |
| 2968 labels = _json["labels"]; |
| 2969 } |
| 2970 if (_json.containsKey("logName")) { |
| 2971 logName = _json["logName"]; |
| 2972 } |
| 2973 if (_json.containsKey("partialSuccess")) { |
| 2974 partialSuccess = _json["partialSuccess"]; |
| 2975 } |
| 2976 if (_json.containsKey("resource")) { |
| 2977 resource = new MonitoredResource.fromJson(_json["resource"]); |
| 2978 } |
| 2979 } |
| 2980 |
| 2981 core.Map toJson() { |
| 2982 var _json = new core.Map(); |
| 2983 if (entries != null) { |
| 2984 _json["entries"] = entries.map((value) => (value).toJson()).toList(); |
| 2985 } |
| 2986 if (labels != null) { |
| 2987 _json["labels"] = labels; |
| 2988 } |
| 2989 if (logName != null) { |
| 2990 _json["logName"] = logName; |
| 2991 } |
| 2992 if (partialSuccess != null) { |
| 2993 _json["partialSuccess"] = partialSuccess; |
| 2994 } |
| 2995 if (resource != null) { |
| 2996 _json["resource"] = (resource).toJson(); |
| 2997 } |
| 2998 return _json; |
| 2999 } |
| 3000 } |
| 3001 |
| 3002 /** |
| 3003 * Result returned from WriteLogEntries. |
| 3004 * empty |
| 3005 */ |
| 3006 class WriteLogEntriesResponse { |
| 3007 |
| 3008 WriteLogEntriesResponse(); |
| 3009 |
| 3010 WriteLogEntriesResponse.fromJson(core.Map _json) { |
| 3011 } |
| 3012 |
| 3013 core.Map toJson() { |
| 3014 var _json = new core.Map(); |
| 3015 return _json; |
| 3016 } |
| 3017 } |
OLD | NEW |