OLD | NEW |
(Empty) | |
| 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 |
| 3 library googleapis_beta.dlp.v2beta1; |
| 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 dlp/v2beta1'; |
| 16 |
| 17 /** |
| 18 * The Google Data Loss Prevention API provides methods for detection of |
| 19 * privacy-sensitive fragments in text, images, and Google Cloud Platform |
| 20 * storage repositories. |
| 21 */ |
| 22 class DlpApi { |
| 23 /** View and manage your data across Google Cloud Platform services */ |
| 24 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf
orm"; |
| 25 |
| 26 |
| 27 final commons.ApiRequester _requester; |
| 28 |
| 29 ContentResourceApi get content => new ContentResourceApi(_requester); |
| 30 InspectResourceApi get inspect => new InspectResourceApi(_requester); |
| 31 RootCategoriesResourceApi get rootCategories => new RootCategoriesResourceApi(
_requester); |
| 32 |
| 33 DlpApi(http.Client client, {core.String rootUrl: "https://dlp.googleapis.com/"
, core.String servicePath: ""}) : |
| 34 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
| 35 } |
| 36 |
| 37 |
| 38 class ContentResourceApi { |
| 39 final commons.ApiRequester _requester; |
| 40 |
| 41 ContentResourceApi(commons.ApiRequester client) : |
| 42 _requester = client; |
| 43 |
| 44 /** |
| 45 * Find potentially sensitive info in a list of strings. |
| 46 * This method has limits on input size, processing time, and output size. |
| 47 * |
| 48 * [request] - The metadata request object. |
| 49 * |
| 50 * Request parameters: |
| 51 * |
| 52 * Completes with a [InspectContentResponse]. |
| 53 * |
| 54 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 55 * error. |
| 56 * |
| 57 * If the used [http.Client] completes with an error when making a REST call, |
| 58 * this method will complete with the same error. |
| 59 */ |
| 60 async.Future<InspectContentResponse> inspect(InspectContentRequest request) { |
| 61 var _url = null; |
| 62 var _queryParams = new core.Map(); |
| 63 var _uploadMedia = null; |
| 64 var _uploadOptions = null; |
| 65 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 66 var _body = null; |
| 67 |
| 68 if (request != null) { |
| 69 _body = convert.JSON.encode((request).toJson()); |
| 70 } |
| 71 |
| 72 _url = 'v2beta1/content:inspect'; |
| 73 |
| 74 var _response = _requester.request(_url, |
| 75 "POST", |
| 76 body: _body, |
| 77 queryParams: _queryParams, |
| 78 uploadOptions: _uploadOptions, |
| 79 uploadMedia: _uploadMedia, |
| 80 downloadOptions: _downloadOptions); |
| 81 return _response.then((data) => new InspectContentResponse.fromJson(data)); |
| 82 } |
| 83 |
| 84 /** |
| 85 * Redact potentially sensitive info from a list of strings. |
| 86 * This method has limits on input size, processing time, and output size. |
| 87 * |
| 88 * [request] - The metadata request object. |
| 89 * |
| 90 * Request parameters: |
| 91 * |
| 92 * Completes with a [RedactContentResponse]. |
| 93 * |
| 94 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 95 * error. |
| 96 * |
| 97 * If the used [http.Client] completes with an error when making a REST call, |
| 98 * this method will complete with the same error. |
| 99 */ |
| 100 async.Future<RedactContentResponse> redact(RedactContentRequest request) { |
| 101 var _url = null; |
| 102 var _queryParams = new core.Map(); |
| 103 var _uploadMedia = null; |
| 104 var _uploadOptions = null; |
| 105 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 106 var _body = null; |
| 107 |
| 108 if (request != null) { |
| 109 _body = convert.JSON.encode((request).toJson()); |
| 110 } |
| 111 |
| 112 _url = 'v2beta1/content:redact'; |
| 113 |
| 114 var _response = _requester.request(_url, |
| 115 "POST", |
| 116 body: _body, |
| 117 queryParams: _queryParams, |
| 118 uploadOptions: _uploadOptions, |
| 119 uploadMedia: _uploadMedia, |
| 120 downloadOptions: _downloadOptions); |
| 121 return _response.then((data) => new RedactContentResponse.fromJson(data)); |
| 122 } |
| 123 |
| 124 } |
| 125 |
| 126 |
| 127 class InspectResourceApi { |
| 128 final commons.ApiRequester _requester; |
| 129 |
| 130 InspectOperationsResourceApi get operations => new InspectOperationsResourceAp
i(_requester); |
| 131 InspectResultsResourceApi get results => new InspectResultsResourceApi(_reques
ter); |
| 132 |
| 133 InspectResourceApi(commons.ApiRequester client) : |
| 134 _requester = client; |
| 135 } |
| 136 |
| 137 |
| 138 class InspectOperationsResourceApi { |
| 139 final commons.ApiRequester _requester; |
| 140 |
| 141 InspectOperationsResourceApi(commons.ApiRequester client) : |
| 142 _requester = client; |
| 143 |
| 144 /** |
| 145 * Cancels an operation. Use the get method to check whether the cancellation |
| 146 * succeeded or whether the operation completed despite cancellation. |
| 147 * |
| 148 * [request] - The metadata request object. |
| 149 * |
| 150 * Request parameters: |
| 151 * |
| 152 * [name] - The name of the operation resource to be cancelled. |
| 153 * Value must have pattern "^inspect/operations/[^/]+$". |
| 154 * |
| 155 * Completes with a [Empty]. |
| 156 * |
| 157 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 158 * error. |
| 159 * |
| 160 * If the used [http.Client] completes with an error when making a REST call, |
| 161 * this method will complete with the same error. |
| 162 */ |
| 163 async.Future<Empty> cancel(CancelOperationRequest request, core.String name) { |
| 164 var _url = null; |
| 165 var _queryParams = new core.Map(); |
| 166 var _uploadMedia = null; |
| 167 var _uploadOptions = null; |
| 168 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 169 var _body = null; |
| 170 |
| 171 if (request != null) { |
| 172 _body = convert.JSON.encode((request).toJson()); |
| 173 } |
| 174 if (name == null) { |
| 175 throw new core.ArgumentError("Parameter name is required."); |
| 176 } |
| 177 |
| 178 _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':cance
l'; |
| 179 |
| 180 var _response = _requester.request(_url, |
| 181 "POST", |
| 182 body: _body, |
| 183 queryParams: _queryParams, |
| 184 uploadOptions: _uploadOptions, |
| 185 uploadMedia: _uploadMedia, |
| 186 downloadOptions: _downloadOptions); |
| 187 return _response.then((data) => new Empty.fromJson(data)); |
| 188 } |
| 189 |
| 190 /** |
| 191 * Schedule a job scanning content in a Google Cloud Platform data repository. |
| 192 * |
| 193 * [request] - The metadata request object. |
| 194 * |
| 195 * Request parameters: |
| 196 * |
| 197 * Completes with a [Operation]. |
| 198 * |
| 199 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 200 * error. |
| 201 * |
| 202 * If the used [http.Client] completes with an error when making a REST call, |
| 203 * this method will complete with the same error. |
| 204 */ |
| 205 async.Future<Operation> create(CreateInspectOperationRequest request) { |
| 206 var _url = null; |
| 207 var _queryParams = new core.Map(); |
| 208 var _uploadMedia = null; |
| 209 var _uploadOptions = null; |
| 210 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 211 var _body = null; |
| 212 |
| 213 if (request != null) { |
| 214 _body = convert.JSON.encode((request).toJson()); |
| 215 } |
| 216 |
| 217 _url = 'v2beta1/inspect/operations'; |
| 218 |
| 219 var _response = _requester.request(_url, |
| 220 "POST", |
| 221 body: _body, |
| 222 queryParams: _queryParams, |
| 223 uploadOptions: _uploadOptions, |
| 224 uploadMedia: _uploadMedia, |
| 225 downloadOptions: _downloadOptions); |
| 226 return _response.then((data) => new Operation.fromJson(data)); |
| 227 } |
| 228 |
| 229 /** |
| 230 * This method is not supported and the server returns `UNIMPLEMENTED`. |
| 231 * |
| 232 * Request parameters: |
| 233 * |
| 234 * [name] - The name of the operation resource to be deleted. |
| 235 * Value must have pattern "^inspect/operations/[^/]+$". |
| 236 * |
| 237 * Completes with a [Empty]. |
| 238 * |
| 239 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 240 * error. |
| 241 * |
| 242 * If the used [http.Client] completes with an error when making a REST call, |
| 243 * this method will complete with the same error. |
| 244 */ |
| 245 async.Future<Empty> delete(core.String name) { |
| 246 var _url = null; |
| 247 var _queryParams = new core.Map(); |
| 248 var _uploadMedia = null; |
| 249 var _uploadOptions = null; |
| 250 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 251 var _body = null; |
| 252 |
| 253 if (name == null) { |
| 254 throw new core.ArgumentError("Parameter name is required."); |
| 255 } |
| 256 |
| 257 _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); |
| 258 |
| 259 var _response = _requester.request(_url, |
| 260 "DELETE", |
| 261 body: _body, |
| 262 queryParams: _queryParams, |
| 263 uploadOptions: _uploadOptions, |
| 264 uploadMedia: _uploadMedia, |
| 265 downloadOptions: _downloadOptions); |
| 266 return _response.then((data) => new Empty.fromJson(data)); |
| 267 } |
| 268 |
| 269 /** |
| 270 * Gets the latest state of a long-running operation. Clients can use this |
| 271 * method to poll the operation result at intervals as recommended by the API |
| 272 * service. |
| 273 * |
| 274 * Request parameters: |
| 275 * |
| 276 * [name] - The name of the operation resource. |
| 277 * Value must have pattern "^inspect/operations/[^/]+$". |
| 278 * |
| 279 * Completes with a [Operation]. |
| 280 * |
| 281 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 282 * error. |
| 283 * |
| 284 * If the used [http.Client] completes with an error when making a REST call, |
| 285 * this method will complete with the same error. |
| 286 */ |
| 287 async.Future<Operation> get(core.String name) { |
| 288 var _url = null; |
| 289 var _queryParams = new core.Map(); |
| 290 var _uploadMedia = null; |
| 291 var _uploadOptions = null; |
| 292 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 293 var _body = null; |
| 294 |
| 295 if (name == null) { |
| 296 throw new core.ArgumentError("Parameter name is required."); |
| 297 } |
| 298 |
| 299 _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); |
| 300 |
| 301 var _response = _requester.request(_url, |
| 302 "GET", |
| 303 body: _body, |
| 304 queryParams: _queryParams, |
| 305 uploadOptions: _uploadOptions, |
| 306 uploadMedia: _uploadMedia, |
| 307 downloadOptions: _downloadOptions); |
| 308 return _response.then((data) => new Operation.fromJson(data)); |
| 309 } |
| 310 |
| 311 /** |
| 312 * Lists operations that match the specified filter in the request. If the |
| 313 * server doesn't support this method, it returns `UNIMPLEMENTED`. |
| 314 * |
| 315 * NOTE: the `name` binding below allows API services to override the binding |
| 316 * to use different resource name schemes, such as `users / * /operations`. |
| 317 * |
| 318 * Request parameters: |
| 319 * |
| 320 * [name] - The name of the operation collection. |
| 321 * Value must have pattern "^inspect/operations$". |
| 322 * |
| 323 * [pageSize] - The list page size. The max allowed value is 256 and default |
| 324 * is 100. |
| 325 * |
| 326 * [filter] - This parameter supports filtering by done, ie done=true or |
| 327 * done=false. |
| 328 * |
| 329 * [pageToken] - The list page token. |
| 330 * |
| 331 * Completes with a [ListOperationsResponse]. |
| 332 * |
| 333 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 334 * error. |
| 335 * |
| 336 * If the used [http.Client] completes with an error when making a REST call, |
| 337 * this method will complete with the same error. |
| 338 */ |
| 339 async.Future<ListOperationsResponse> list(core.String name, {core.int pageSize
, core.String filter, core.String pageToken}) { |
| 340 var _url = null; |
| 341 var _queryParams = new core.Map(); |
| 342 var _uploadMedia = null; |
| 343 var _uploadOptions = null; |
| 344 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 345 var _body = null; |
| 346 |
| 347 if (name == null) { |
| 348 throw new core.ArgumentError("Parameter name is required."); |
| 349 } |
| 350 if (pageSize != null) { |
| 351 _queryParams["pageSize"] = ["${pageSize}"]; |
| 352 } |
| 353 if (filter != null) { |
| 354 _queryParams["filter"] = [filter]; |
| 355 } |
| 356 if (pageToken != null) { |
| 357 _queryParams["pageToken"] = [pageToken]; |
| 358 } |
| 359 |
| 360 _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); |
| 361 |
| 362 var _response = _requester.request(_url, |
| 363 "GET", |
| 364 body: _body, |
| 365 queryParams: _queryParams, |
| 366 uploadOptions: _uploadOptions, |
| 367 uploadMedia: _uploadMedia, |
| 368 downloadOptions: _downloadOptions); |
| 369 return _response.then((data) => new ListOperationsResponse.fromJson(data)); |
| 370 } |
| 371 |
| 372 } |
| 373 |
| 374 |
| 375 class InspectResultsResourceApi { |
| 376 final commons.ApiRequester _requester; |
| 377 |
| 378 InspectResultsFindingsResourceApi get findings => new InspectResultsFindingsRe
sourceApi(_requester); |
| 379 |
| 380 InspectResultsResourceApi(commons.ApiRequester client) : |
| 381 _requester = client; |
| 382 } |
| 383 |
| 384 |
| 385 class InspectResultsFindingsResourceApi { |
| 386 final commons.ApiRequester _requester; |
| 387 |
| 388 InspectResultsFindingsResourceApi(commons.ApiRequester client) : |
| 389 _requester = client; |
| 390 |
| 391 /** |
| 392 * Returns list of results for given inspect operation result set id. |
| 393 * |
| 394 * Request parameters: |
| 395 * |
| 396 * [name] - Identifier of the results set returned as metadata of |
| 397 * the longrunning operation created by a call to CreateInspectOperation. |
| 398 * Should be in the format of `inspect/results/{id}. |
| 399 * Value must have pattern "^inspect/results/[^/]+$". |
| 400 * |
| 401 * [pageToken] - The value returned by the last `ListInspectFindingsResponse`; |
| 402 * indicates |
| 403 * that this is a continuation of a prior `ListInspectFindings` call, and that |
| 404 * the system should return the next page of data. |
| 405 * |
| 406 * [pageSize] - Maximum number of results to return. |
| 407 * If 0, the implementation will select a reasonable value. |
| 408 * |
| 409 * Completes with a [ListInspectFindingsResponse]. |
| 410 * |
| 411 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 412 * error. |
| 413 * |
| 414 * If the used [http.Client] completes with an error when making a REST call, |
| 415 * this method will complete with the same error. |
| 416 */ |
| 417 async.Future<ListInspectFindingsResponse> list(core.String name, {core.String
pageToken, core.int pageSize}) { |
| 418 var _url = null; |
| 419 var _queryParams = new core.Map(); |
| 420 var _uploadMedia = null; |
| 421 var _uploadOptions = null; |
| 422 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 423 var _body = null; |
| 424 |
| 425 if (name == null) { |
| 426 throw new core.ArgumentError("Parameter name is required."); |
| 427 } |
| 428 if (pageToken != null) { |
| 429 _queryParams["pageToken"] = [pageToken]; |
| 430 } |
| 431 if (pageSize != null) { |
| 432 _queryParams["pageSize"] = ["${pageSize}"]; |
| 433 } |
| 434 |
| 435 _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name') + '/findi
ngs'; |
| 436 |
| 437 var _response = _requester.request(_url, |
| 438 "GET", |
| 439 body: _body, |
| 440 queryParams: _queryParams, |
| 441 uploadOptions: _uploadOptions, |
| 442 uploadMedia: _uploadMedia, |
| 443 downloadOptions: _downloadOptions); |
| 444 return _response.then((data) => new ListInspectFindingsResponse.fromJson(dat
a)); |
| 445 } |
| 446 |
| 447 } |
| 448 |
| 449 |
| 450 class RootCategoriesResourceApi { |
| 451 final commons.ApiRequester _requester; |
| 452 |
| 453 RootCategoriesInfoTypesResourceApi get infoTypes => new RootCategoriesInfoType
sResourceApi(_requester); |
| 454 |
| 455 RootCategoriesResourceApi(commons.ApiRequester client) : |
| 456 _requester = client; |
| 457 |
| 458 /** |
| 459 * Returns the list of root categories of sensitive information. |
| 460 * |
| 461 * Request parameters: |
| 462 * |
| 463 * [languageCode] - Optional language code for localized friendly category |
| 464 * names. |
| 465 * If omitted or if localized strings are not available, |
| 466 * en-US strings will be returned. |
| 467 * |
| 468 * Completes with a [ListRootCategoriesResponse]. |
| 469 * |
| 470 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 471 * error. |
| 472 * |
| 473 * If the used [http.Client] completes with an error when making a REST call, |
| 474 * this method will complete with the same error. |
| 475 */ |
| 476 async.Future<ListRootCategoriesResponse> list({core.String languageCode}) { |
| 477 var _url = null; |
| 478 var _queryParams = new core.Map(); |
| 479 var _uploadMedia = null; |
| 480 var _uploadOptions = null; |
| 481 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 482 var _body = null; |
| 483 |
| 484 if (languageCode != null) { |
| 485 _queryParams["languageCode"] = [languageCode]; |
| 486 } |
| 487 |
| 488 _url = 'v2beta1/rootCategories'; |
| 489 |
| 490 var _response = _requester.request(_url, |
| 491 "GET", |
| 492 body: _body, |
| 493 queryParams: _queryParams, |
| 494 uploadOptions: _uploadOptions, |
| 495 uploadMedia: _uploadMedia, |
| 496 downloadOptions: _downloadOptions); |
| 497 return _response.then((data) => new ListRootCategoriesResponse.fromJson(data
)); |
| 498 } |
| 499 |
| 500 } |
| 501 |
| 502 |
| 503 class RootCategoriesInfoTypesResourceApi { |
| 504 final commons.ApiRequester _requester; |
| 505 |
| 506 RootCategoriesInfoTypesResourceApi(commons.ApiRequester client) : |
| 507 _requester = client; |
| 508 |
| 509 /** |
| 510 * Returns sensitive information types for given category. |
| 511 * |
| 512 * Request parameters: |
| 513 * |
| 514 * [category] - Category name as returned by ListRootCategories. |
| 515 * Value must have pattern "^[^/]+$". |
| 516 * |
| 517 * [languageCode] - Optional BCP-47 language code for localized info type |
| 518 * friendly |
| 519 * names. If omitted, or if localized strings are not available, |
| 520 * en-US strings will be returned. |
| 521 * |
| 522 * Completes with a [ListInfoTypesResponse]. |
| 523 * |
| 524 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 525 * error. |
| 526 * |
| 527 * If the used [http.Client] completes with an error when making a REST call, |
| 528 * this method will complete with the same error. |
| 529 */ |
| 530 async.Future<ListInfoTypesResponse> list(core.String category, {core.String la
nguageCode}) { |
| 531 var _url = null; |
| 532 var _queryParams = new core.Map(); |
| 533 var _uploadMedia = null; |
| 534 var _uploadOptions = null; |
| 535 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 536 var _body = null; |
| 537 |
| 538 if (category == null) { |
| 539 throw new core.ArgumentError("Parameter category is required."); |
| 540 } |
| 541 if (languageCode != null) { |
| 542 _queryParams["languageCode"] = [languageCode]; |
| 543 } |
| 544 |
| 545 _url = 'v2beta1/rootCategories/' + commons.Escaper.ecapeVariableReserved('$c
ategory') + '/infoTypes'; |
| 546 |
| 547 var _response = _requester.request(_url, |
| 548 "GET", |
| 549 body: _body, |
| 550 queryParams: _queryParams, |
| 551 uploadOptions: _uploadOptions, |
| 552 uploadMedia: _uploadMedia, |
| 553 downloadOptions: _downloadOptions); |
| 554 return _response.then((data) => new ListInfoTypesResponse.fromJson(data)); |
| 555 } |
| 556 |
| 557 } |
| 558 |
| 559 |
| 560 |
| 561 /** The request message for Operations.CancelOperation. */ |
| 562 class CancelOperationRequest { |
| 563 |
| 564 CancelOperationRequest(); |
| 565 |
| 566 CancelOperationRequest.fromJson(core.Map _json) { |
| 567 } |
| 568 |
| 569 core.Map toJson() { |
| 570 var _json = new core.Map(); |
| 571 return _json; |
| 572 } |
| 573 } |
| 574 |
| 575 /** Info Type Category description. */ |
| 576 class CategoryDescription { |
| 577 /** Human readable form of the category name. */ |
| 578 core.String displayName; |
| 579 /** Internal name of the category. */ |
| 580 core.String name; |
| 581 |
| 582 CategoryDescription(); |
| 583 |
| 584 CategoryDescription.fromJson(core.Map _json) { |
| 585 if (_json.containsKey("displayName")) { |
| 586 displayName = _json["displayName"]; |
| 587 } |
| 588 if (_json.containsKey("name")) { |
| 589 name = _json["name"]; |
| 590 } |
| 591 } |
| 592 |
| 593 core.Map toJson() { |
| 594 var _json = new core.Map(); |
| 595 if (displayName != null) { |
| 596 _json["displayName"] = displayName; |
| 597 } |
| 598 if (name != null) { |
| 599 _json["name"] = name; |
| 600 } |
| 601 return _json; |
| 602 } |
| 603 } |
| 604 |
| 605 /** Record key for a finding in a Cloud Storage file. */ |
| 606 class CloudStorageKey { |
| 607 /** Path to the file. */ |
| 608 core.String filePath; |
| 609 /** Byte offset of the referenced data in the file. */ |
| 610 core.String startOffset; |
| 611 |
| 612 CloudStorageKey(); |
| 613 |
| 614 CloudStorageKey.fromJson(core.Map _json) { |
| 615 if (_json.containsKey("filePath")) { |
| 616 filePath = _json["filePath"]; |
| 617 } |
| 618 if (_json.containsKey("startOffset")) { |
| 619 startOffset = _json["startOffset"]; |
| 620 } |
| 621 } |
| 622 |
| 623 core.Map toJson() { |
| 624 var _json = new core.Map(); |
| 625 if (filePath != null) { |
| 626 _json["filePath"] = filePath; |
| 627 } |
| 628 if (startOffset != null) { |
| 629 _json["startOffset"] = startOffset; |
| 630 } |
| 631 return _json; |
| 632 } |
| 633 } |
| 634 |
| 635 /** |
| 636 * Options defining a file or a set of files (path ending with *) within |
| 637 * a Google Cloud Storage bucket. |
| 638 */ |
| 639 class CloudStorageOptions { |
| 640 FileSet fileSet; |
| 641 |
| 642 CloudStorageOptions(); |
| 643 |
| 644 CloudStorageOptions.fromJson(core.Map _json) { |
| 645 if (_json.containsKey("fileSet")) { |
| 646 fileSet = new FileSet.fromJson(_json["fileSet"]); |
| 647 } |
| 648 } |
| 649 |
| 650 core.Map toJson() { |
| 651 var _json = new core.Map(); |
| 652 if (fileSet != null) { |
| 653 _json["fileSet"] = (fileSet).toJson(); |
| 654 } |
| 655 return _json; |
| 656 } |
| 657 } |
| 658 |
| 659 /** Container structure for the content to inspect. */ |
| 660 class ContentItem { |
| 661 /** Content data to inspect or redact. */ |
| 662 core.String data; |
| 663 core.List<core.int> get dataAsBytes { |
| 664 return convert.BASE64.decode(data); |
| 665 } |
| 666 |
| 667 void set dataAsBytes(core.List<core.int> _bytes) { |
| 668 data = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-
"); |
| 669 } |
| 670 /** |
| 671 * Type of the content, as defined in Content-Type HTTP header. |
| 672 * Supported types are: all "text" types, octet streams, PNG images, |
| 673 * JPEG images. |
| 674 */ |
| 675 core.String type; |
| 676 /** String data to inspect or redact. */ |
| 677 core.String value; |
| 678 |
| 679 ContentItem(); |
| 680 |
| 681 ContentItem.fromJson(core.Map _json) { |
| 682 if (_json.containsKey("data")) { |
| 683 data = _json["data"]; |
| 684 } |
| 685 if (_json.containsKey("type")) { |
| 686 type = _json["type"]; |
| 687 } |
| 688 if (_json.containsKey("value")) { |
| 689 value = _json["value"]; |
| 690 } |
| 691 } |
| 692 |
| 693 core.Map toJson() { |
| 694 var _json = new core.Map(); |
| 695 if (data != null) { |
| 696 _json["data"] = data; |
| 697 } |
| 698 if (type != null) { |
| 699 _json["type"] = type; |
| 700 } |
| 701 if (value != null) { |
| 702 _json["value"] = value; |
| 703 } |
| 704 return _json; |
| 705 } |
| 706 } |
| 707 |
| 708 /** |
| 709 * Request for scheduling a scan of a data subset from a Google Platform data |
| 710 * repository. |
| 711 */ |
| 712 class CreateInspectOperationRequest { |
| 713 /** Configuration for the inspector. */ |
| 714 InspectConfig inspectConfig; |
| 715 /** Specification of the data set to process. */ |
| 716 StorageConfig storageConfig; |
| 717 |
| 718 CreateInspectOperationRequest(); |
| 719 |
| 720 CreateInspectOperationRequest.fromJson(core.Map _json) { |
| 721 if (_json.containsKey("inspectConfig")) { |
| 722 inspectConfig = new InspectConfig.fromJson(_json["inspectConfig"]); |
| 723 } |
| 724 if (_json.containsKey("storageConfig")) { |
| 725 storageConfig = new StorageConfig.fromJson(_json["storageConfig"]); |
| 726 } |
| 727 } |
| 728 |
| 729 core.Map toJson() { |
| 730 var _json = new core.Map(); |
| 731 if (inspectConfig != null) { |
| 732 _json["inspectConfig"] = (inspectConfig).toJson(); |
| 733 } |
| 734 if (storageConfig != null) { |
| 735 _json["storageConfig"] = (storageConfig).toJson(); |
| 736 } |
| 737 return _json; |
| 738 } |
| 739 } |
| 740 |
| 741 /** Record key for a finding in Cloud Datastore. */ |
| 742 class DatastoreKey { |
| 743 /** Datastore entity key. */ |
| 744 Key entityKey; |
| 745 |
| 746 DatastoreKey(); |
| 747 |
| 748 DatastoreKey.fromJson(core.Map _json) { |
| 749 if (_json.containsKey("entityKey")) { |
| 750 entityKey = new Key.fromJson(_json["entityKey"]); |
| 751 } |
| 752 } |
| 753 |
| 754 core.Map toJson() { |
| 755 var _json = new core.Map(); |
| 756 if (entityKey != null) { |
| 757 _json["entityKey"] = (entityKey).toJson(); |
| 758 } |
| 759 return _json; |
| 760 } |
| 761 } |
| 762 |
| 763 /** Options defining a data set within Google Cloud Datastore. */ |
| 764 class DatastoreOptions { |
| 765 /** The kind to process. */ |
| 766 KindExpression kind; |
| 767 /** |
| 768 * A partition ID identifies a grouping of entities. The grouping is always |
| 769 * by project and namespace, however the namespace ID may be empty. |
| 770 */ |
| 771 PartitionId partitionId; |
| 772 /** |
| 773 * Properties to scan. If none are specified, all properties will be scanned |
| 774 * by default. |
| 775 */ |
| 776 core.List<Projection> projection; |
| 777 |
| 778 DatastoreOptions(); |
| 779 |
| 780 DatastoreOptions.fromJson(core.Map _json) { |
| 781 if (_json.containsKey("kind")) { |
| 782 kind = new KindExpression.fromJson(_json["kind"]); |
| 783 } |
| 784 if (_json.containsKey("partitionId")) { |
| 785 partitionId = new PartitionId.fromJson(_json["partitionId"]); |
| 786 } |
| 787 if (_json.containsKey("projection")) { |
| 788 projection = _json["projection"].map((value) => new Projection.fromJson(va
lue)).toList(); |
| 789 } |
| 790 } |
| 791 |
| 792 core.Map toJson() { |
| 793 var _json = new core.Map(); |
| 794 if (kind != null) { |
| 795 _json["kind"] = (kind).toJson(); |
| 796 } |
| 797 if (partitionId != null) { |
| 798 _json["partitionId"] = (partitionId).toJson(); |
| 799 } |
| 800 if (projection != null) { |
| 801 _json["projection"] = projection.map((value) => (value).toJson()).toList()
; |
| 802 } |
| 803 return _json; |
| 804 } |
| 805 } |
| 806 |
| 807 /** |
| 808 * A generic empty message that you can re-use to avoid defining duplicated |
| 809 * empty messages in your APIs. A typical example is to use it as the request |
| 810 * or the response type of an API method. For instance: |
| 811 * |
| 812 * service Foo { |
| 813 * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 814 * } |
| 815 * |
| 816 * The JSON representation for `Empty` is empty JSON object `{}`. |
| 817 */ |
| 818 class Empty { |
| 819 |
| 820 Empty(); |
| 821 |
| 822 Empty.fromJson(core.Map _json) { |
| 823 } |
| 824 |
| 825 core.Map toJson() { |
| 826 var _json = new core.Map(); |
| 827 return _json; |
| 828 } |
| 829 } |
| 830 |
| 831 /** General identifier of a data field in a storage service. */ |
| 832 class FieldId { |
| 833 /** Column name describing the field. */ |
| 834 core.String columnName; |
| 835 |
| 836 FieldId(); |
| 837 |
| 838 FieldId.fromJson(core.Map _json) { |
| 839 if (_json.containsKey("columnName")) { |
| 840 columnName = _json["columnName"]; |
| 841 } |
| 842 } |
| 843 |
| 844 core.Map toJson() { |
| 845 var _json = new core.Map(); |
| 846 if (columnName != null) { |
| 847 _json["columnName"] = columnName; |
| 848 } |
| 849 return _json; |
| 850 } |
| 851 } |
| 852 |
| 853 /** Set of files to scan. */ |
| 854 class FileSet { |
| 855 /** |
| 856 * The url, in the format gs://<bucket>/<path>. Trailing wildcard in the |
| 857 * path is allowed. |
| 858 */ |
| 859 core.String url; |
| 860 |
| 861 FileSet(); |
| 862 |
| 863 FileSet.fromJson(core.Map _json) { |
| 864 if (_json.containsKey("url")) { |
| 865 url = _json["url"]; |
| 866 } |
| 867 } |
| 868 |
| 869 core.Map toJson() { |
| 870 var _json = new core.Map(); |
| 871 if (url != null) { |
| 872 _json["url"] = url; |
| 873 } |
| 874 return _json; |
| 875 } |
| 876 } |
| 877 |
| 878 /** |
| 879 * Container structure describing a single finding within a string or image. |
| 880 */ |
| 881 class Finding { |
| 882 /** Timestamp when finding was detected. */ |
| 883 core.String createTime; |
| 884 /** The specific type of info the string might be. */ |
| 885 InfoType infoType; |
| 886 /** |
| 887 * Estimate of how likely it is that the info_type is correct. |
| 888 * Possible string values are: |
| 889 * - "LIKELIHOOD_UNSPECIFIED" : Default value; information with all |
| 890 * likelihoods will be included. |
| 891 * - "VERY_UNLIKELY" : Few matching elements. |
| 892 * - "UNLIKELY" |
| 893 * - "POSSIBLE" : Some matching elements. |
| 894 * - "LIKELY" |
| 895 * - "VERY_LIKELY" : Many matching elements. |
| 896 */ |
| 897 core.String likelihood; |
| 898 /** Location of the info found. */ |
| 899 Location location; |
| 900 /** The specific string that may be potentially sensitive info. */ |
| 901 core.String quote; |
| 902 |
| 903 Finding(); |
| 904 |
| 905 Finding.fromJson(core.Map _json) { |
| 906 if (_json.containsKey("createTime")) { |
| 907 createTime = _json["createTime"]; |
| 908 } |
| 909 if (_json.containsKey("infoType")) { |
| 910 infoType = new InfoType.fromJson(_json["infoType"]); |
| 911 } |
| 912 if (_json.containsKey("likelihood")) { |
| 913 likelihood = _json["likelihood"]; |
| 914 } |
| 915 if (_json.containsKey("location")) { |
| 916 location = new Location.fromJson(_json["location"]); |
| 917 } |
| 918 if (_json.containsKey("quote")) { |
| 919 quote = _json["quote"]; |
| 920 } |
| 921 } |
| 922 |
| 923 core.Map toJson() { |
| 924 var _json = new core.Map(); |
| 925 if (createTime != null) { |
| 926 _json["createTime"] = createTime; |
| 927 } |
| 928 if (infoType != null) { |
| 929 _json["infoType"] = (infoType).toJson(); |
| 930 } |
| 931 if (likelihood != null) { |
| 932 _json["likelihood"] = likelihood; |
| 933 } |
| 934 if (location != null) { |
| 935 _json["location"] = (location).toJson(); |
| 936 } |
| 937 if (quote != null) { |
| 938 _json["quote"] = quote; |
| 939 } |
| 940 return _json; |
| 941 } |
| 942 } |
| 943 |
| 944 /** Bounding box encompassing detected text within an image. */ |
| 945 class ImageLocation { |
| 946 /** Height of the bounding box in pixels. */ |
| 947 core.int height; |
| 948 /** Left coordinate of the bounding box. (0,0) is upper left. */ |
| 949 core.int left; |
| 950 /** Top coordinate of the bounding box. (0,0) is upper left. */ |
| 951 core.int top; |
| 952 /** Width of the bounding box in pixels. */ |
| 953 core.int width; |
| 954 |
| 955 ImageLocation(); |
| 956 |
| 957 ImageLocation.fromJson(core.Map _json) { |
| 958 if (_json.containsKey("height")) { |
| 959 height = _json["height"]; |
| 960 } |
| 961 if (_json.containsKey("left")) { |
| 962 left = _json["left"]; |
| 963 } |
| 964 if (_json.containsKey("top")) { |
| 965 top = _json["top"]; |
| 966 } |
| 967 if (_json.containsKey("width")) { |
| 968 width = _json["width"]; |
| 969 } |
| 970 } |
| 971 |
| 972 core.Map toJson() { |
| 973 var _json = new core.Map(); |
| 974 if (height != null) { |
| 975 _json["height"] = height; |
| 976 } |
| 977 if (left != null) { |
| 978 _json["left"] = left; |
| 979 } |
| 980 if (top != null) { |
| 981 _json["top"] = top; |
| 982 } |
| 983 if (width != null) { |
| 984 _json["width"] = width; |
| 985 } |
| 986 return _json; |
| 987 } |
| 988 } |
| 989 |
| 990 /** Type of information detected by the API. */ |
| 991 class InfoType { |
| 992 /** Name of the information type, provided by the API call ListInfoTypes. */ |
| 993 core.String name; |
| 994 |
| 995 InfoType(); |
| 996 |
| 997 InfoType.fromJson(core.Map _json) { |
| 998 if (_json.containsKey("name")) { |
| 999 name = _json["name"]; |
| 1000 } |
| 1001 } |
| 1002 |
| 1003 core.Map toJson() { |
| 1004 var _json = new core.Map(); |
| 1005 if (name != null) { |
| 1006 _json["name"] = name; |
| 1007 } |
| 1008 return _json; |
| 1009 } |
| 1010 } |
| 1011 |
| 1012 /** Info type description. */ |
| 1013 class InfoTypeDescription { |
| 1014 /** List of categories this info type belongs to. */ |
| 1015 core.List<CategoryDescription> categories; |
| 1016 /** Human readable form of the info type name. */ |
| 1017 core.String displayName; |
| 1018 /** Internal name of the info type. */ |
| 1019 core.String name; |
| 1020 |
| 1021 InfoTypeDescription(); |
| 1022 |
| 1023 InfoTypeDescription.fromJson(core.Map _json) { |
| 1024 if (_json.containsKey("categories")) { |
| 1025 categories = _json["categories"].map((value) => new CategoryDescription.fr
omJson(value)).toList(); |
| 1026 } |
| 1027 if (_json.containsKey("displayName")) { |
| 1028 displayName = _json["displayName"]; |
| 1029 } |
| 1030 if (_json.containsKey("name")) { |
| 1031 name = _json["name"]; |
| 1032 } |
| 1033 } |
| 1034 |
| 1035 core.Map toJson() { |
| 1036 var _json = new core.Map(); |
| 1037 if (categories != null) { |
| 1038 _json["categories"] = categories.map((value) => (value).toJson()).toList()
; |
| 1039 } |
| 1040 if (displayName != null) { |
| 1041 _json["displayName"] = displayName; |
| 1042 } |
| 1043 if (name != null) { |
| 1044 _json["name"] = name; |
| 1045 } |
| 1046 return _json; |
| 1047 } |
| 1048 } |
| 1049 |
| 1050 /** |
| 1051 * Configuration description of the scanning process. |
| 1052 * When used with redactContent only info_types and min_likelihood are currently |
| 1053 * used. |
| 1054 */ |
| 1055 class InspectConfig { |
| 1056 /** When true, exclude type information of the findings. */ |
| 1057 core.bool excludeTypes; |
| 1058 /** |
| 1059 * When true, a contextual quote from the data that triggered a finding will |
| 1060 * be included in the response; see Finding.quote. |
| 1061 */ |
| 1062 core.bool includeQuote; |
| 1063 /** |
| 1064 * Restrict what info_types to look for. The values must correspond to |
| 1065 * InfoType values returned by ListInfoTypes or found in documentation. |
| 1066 * Empty info_types runs all enabled detectors. |
| 1067 */ |
| 1068 core.List<InfoType> infoTypes; |
| 1069 /** Limit the number of findings per content item. */ |
| 1070 core.int maxFindings; |
| 1071 /** |
| 1072 * Only return findings equal or above this threshold. |
| 1073 * Possible string values are: |
| 1074 * - "LIKELIHOOD_UNSPECIFIED" : Default value; information with all |
| 1075 * likelihoods will be included. |
| 1076 * - "VERY_UNLIKELY" : Few matching elements. |
| 1077 * - "UNLIKELY" |
| 1078 * - "POSSIBLE" : Some matching elements. |
| 1079 * - "LIKELY" |
| 1080 * - "VERY_LIKELY" : Many matching elements. |
| 1081 */ |
| 1082 core.String minLikelihood; |
| 1083 |
| 1084 InspectConfig(); |
| 1085 |
| 1086 InspectConfig.fromJson(core.Map _json) { |
| 1087 if (_json.containsKey("excludeTypes")) { |
| 1088 excludeTypes = _json["excludeTypes"]; |
| 1089 } |
| 1090 if (_json.containsKey("includeQuote")) { |
| 1091 includeQuote = _json["includeQuote"]; |
| 1092 } |
| 1093 if (_json.containsKey("infoTypes")) { |
| 1094 infoTypes = _json["infoTypes"].map((value) => new InfoType.fromJson(value)
).toList(); |
| 1095 } |
| 1096 if (_json.containsKey("maxFindings")) { |
| 1097 maxFindings = _json["maxFindings"]; |
| 1098 } |
| 1099 if (_json.containsKey("minLikelihood")) { |
| 1100 minLikelihood = _json["minLikelihood"]; |
| 1101 } |
| 1102 } |
| 1103 |
| 1104 core.Map toJson() { |
| 1105 var _json = new core.Map(); |
| 1106 if (excludeTypes != null) { |
| 1107 _json["excludeTypes"] = excludeTypes; |
| 1108 } |
| 1109 if (includeQuote != null) { |
| 1110 _json["includeQuote"] = includeQuote; |
| 1111 } |
| 1112 if (infoTypes != null) { |
| 1113 _json["infoTypes"] = infoTypes.map((value) => (value).toJson()).toList(); |
| 1114 } |
| 1115 if (maxFindings != null) { |
| 1116 _json["maxFindings"] = maxFindings; |
| 1117 } |
| 1118 if (minLikelihood != null) { |
| 1119 _json["minLikelihood"] = minLikelihood; |
| 1120 } |
| 1121 return _json; |
| 1122 } |
| 1123 } |
| 1124 |
| 1125 /** Request to search for potentially sensitive info in a list of items. */ |
| 1126 class InspectContentRequest { |
| 1127 /** Configuration for the inspector. */ |
| 1128 InspectConfig inspectConfig; |
| 1129 /** |
| 1130 * The list of items to inspect. Items in a single request are |
| 1131 * considered "related" unless inspect_config.independent_inputs is true. |
| 1132 * Up to 100 are allowed per request. |
| 1133 */ |
| 1134 core.List<ContentItem> items; |
| 1135 |
| 1136 InspectContentRequest(); |
| 1137 |
| 1138 InspectContentRequest.fromJson(core.Map _json) { |
| 1139 if (_json.containsKey("inspectConfig")) { |
| 1140 inspectConfig = new InspectConfig.fromJson(_json["inspectConfig"]); |
| 1141 } |
| 1142 if (_json.containsKey("items")) { |
| 1143 items = _json["items"].map((value) => new ContentItem.fromJson(value)).toL
ist(); |
| 1144 } |
| 1145 } |
| 1146 |
| 1147 core.Map toJson() { |
| 1148 var _json = new core.Map(); |
| 1149 if (inspectConfig != null) { |
| 1150 _json["inspectConfig"] = (inspectConfig).toJson(); |
| 1151 } |
| 1152 if (items != null) { |
| 1153 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 1154 } |
| 1155 return _json; |
| 1156 } |
| 1157 } |
| 1158 |
| 1159 /** Results of inspecting a list of items. */ |
| 1160 class InspectContentResponse { |
| 1161 /** |
| 1162 * Each content_item from the request will have a result in this list, in the |
| 1163 * same order as the request. |
| 1164 */ |
| 1165 core.List<InspectResult> results; |
| 1166 |
| 1167 InspectContentResponse(); |
| 1168 |
| 1169 InspectContentResponse.fromJson(core.Map _json) { |
| 1170 if (_json.containsKey("results")) { |
| 1171 results = _json["results"].map((value) => new InspectResult.fromJson(value
)).toList(); |
| 1172 } |
| 1173 } |
| 1174 |
| 1175 core.Map toJson() { |
| 1176 var _json = new core.Map(); |
| 1177 if (results != null) { |
| 1178 _json["results"] = results.map((value) => (value).toJson()).toList(); |
| 1179 } |
| 1180 return _json; |
| 1181 } |
| 1182 } |
| 1183 |
| 1184 /** All the findings for a single scanned item. */ |
| 1185 class InspectResult { |
| 1186 /** List of findings for an item. */ |
| 1187 core.List<Finding> findings; |
| 1188 /** |
| 1189 * If true, then this item might have more findings than were returned, |
| 1190 * and the findings returned are an arbitrary subset of all findings. |
| 1191 * The findings list might be truncated because the input items were too |
| 1192 * large, or because the server reached the maximum amount of resources |
| 1193 * allowed for a single API call. For best results, divide the input into |
| 1194 * smaller batches. |
| 1195 */ |
| 1196 core.bool findingsTruncated; |
| 1197 |
| 1198 InspectResult(); |
| 1199 |
| 1200 InspectResult.fromJson(core.Map _json) { |
| 1201 if (_json.containsKey("findings")) { |
| 1202 findings = _json["findings"].map((value) => new Finding.fromJson(value)).t
oList(); |
| 1203 } |
| 1204 if (_json.containsKey("findingsTruncated")) { |
| 1205 findingsTruncated = _json["findingsTruncated"]; |
| 1206 } |
| 1207 } |
| 1208 |
| 1209 core.Map toJson() { |
| 1210 var _json = new core.Map(); |
| 1211 if (findings != null) { |
| 1212 _json["findings"] = findings.map((value) => (value).toJson()).toList(); |
| 1213 } |
| 1214 if (findingsTruncated != null) { |
| 1215 _json["findingsTruncated"] = findingsTruncated; |
| 1216 } |
| 1217 return _json; |
| 1218 } |
| 1219 } |
| 1220 |
| 1221 /** |
| 1222 * A unique identifier for a Datastore entity. |
| 1223 * If a key's partition ID or any of its path kinds or names are |
| 1224 * reserved/read-only, the key is reserved/read-only. |
| 1225 * A reserved/read-only key is forbidden in certain documented contexts. |
| 1226 */ |
| 1227 class Key { |
| 1228 /** |
| 1229 * Entities are partitioned into subsets, currently identified by a project |
| 1230 * ID and namespace ID. |
| 1231 * Queries are scoped to a single partition. |
| 1232 */ |
| 1233 PartitionId partitionId; |
| 1234 /** |
| 1235 * The entity path. |
| 1236 * An entity path consists of one or more elements composed of a kind and a |
| 1237 * string or numerical identifier, which identify entities. The first |
| 1238 * element identifies a _root entity_, the second element identifies |
| 1239 * a _child_ of the root entity, the third element identifies a child of the |
| 1240 * second entity, and so forth. The entities identified by all prefixes of |
| 1241 * the path are called the element's _ancestors_. |
| 1242 * |
| 1243 * A path can never be empty, and a path can have at most 100 elements. |
| 1244 */ |
| 1245 core.List<PathElement> path; |
| 1246 |
| 1247 Key(); |
| 1248 |
| 1249 Key.fromJson(core.Map _json) { |
| 1250 if (_json.containsKey("partitionId")) { |
| 1251 partitionId = new PartitionId.fromJson(_json["partitionId"]); |
| 1252 } |
| 1253 if (_json.containsKey("path")) { |
| 1254 path = _json["path"].map((value) => new PathElement.fromJson(value)).toLis
t(); |
| 1255 } |
| 1256 } |
| 1257 |
| 1258 core.Map toJson() { |
| 1259 var _json = new core.Map(); |
| 1260 if (partitionId != null) { |
| 1261 _json["partitionId"] = (partitionId).toJson(); |
| 1262 } |
| 1263 if (path != null) { |
| 1264 _json["path"] = path.map((value) => (value).toJson()).toList(); |
| 1265 } |
| 1266 return _json; |
| 1267 } |
| 1268 } |
| 1269 |
| 1270 /** A representation of a Datastore kind. */ |
| 1271 class KindExpression { |
| 1272 /** The name of the kind. */ |
| 1273 core.String name; |
| 1274 |
| 1275 KindExpression(); |
| 1276 |
| 1277 KindExpression.fromJson(core.Map _json) { |
| 1278 if (_json.containsKey("name")) { |
| 1279 name = _json["name"]; |
| 1280 } |
| 1281 } |
| 1282 |
| 1283 core.Map toJson() { |
| 1284 var _json = new core.Map(); |
| 1285 if (name != null) { |
| 1286 _json["name"] = name; |
| 1287 } |
| 1288 return _json; |
| 1289 } |
| 1290 } |
| 1291 |
| 1292 /** Response to the ListInfoTypes request. */ |
| 1293 class ListInfoTypesResponse { |
| 1294 /** Set of sensitive info types belonging to a category. */ |
| 1295 core.List<InfoTypeDescription> infoTypes; |
| 1296 |
| 1297 ListInfoTypesResponse(); |
| 1298 |
| 1299 ListInfoTypesResponse.fromJson(core.Map _json) { |
| 1300 if (_json.containsKey("infoTypes")) { |
| 1301 infoTypes = _json["infoTypes"].map((value) => new InfoTypeDescription.from
Json(value)).toList(); |
| 1302 } |
| 1303 } |
| 1304 |
| 1305 core.Map toJson() { |
| 1306 var _json = new core.Map(); |
| 1307 if (infoTypes != null) { |
| 1308 _json["infoTypes"] = infoTypes.map((value) => (value).toJson()).toList(); |
| 1309 } |
| 1310 return _json; |
| 1311 } |
| 1312 } |
| 1313 |
| 1314 /** Response to the ListInspectFindings request. */ |
| 1315 class ListInspectFindingsResponse { |
| 1316 /** |
| 1317 * If not empty, indicates that there may be more results that match the |
| 1318 * request; this value should be passed in a new `ListInspectFindingsRequest`. |
| 1319 */ |
| 1320 core.String nextPageToken; |
| 1321 /** The results. */ |
| 1322 InspectResult result; |
| 1323 |
| 1324 ListInspectFindingsResponse(); |
| 1325 |
| 1326 ListInspectFindingsResponse.fromJson(core.Map _json) { |
| 1327 if (_json.containsKey("nextPageToken")) { |
| 1328 nextPageToken = _json["nextPageToken"]; |
| 1329 } |
| 1330 if (_json.containsKey("result")) { |
| 1331 result = new InspectResult.fromJson(_json["result"]); |
| 1332 } |
| 1333 } |
| 1334 |
| 1335 core.Map toJson() { |
| 1336 var _json = new core.Map(); |
| 1337 if (nextPageToken != null) { |
| 1338 _json["nextPageToken"] = nextPageToken; |
| 1339 } |
| 1340 if (result != null) { |
| 1341 _json["result"] = (result).toJson(); |
| 1342 } |
| 1343 return _json; |
| 1344 } |
| 1345 } |
| 1346 |
| 1347 /** The response message for Operations.ListOperations. */ |
| 1348 class ListOperationsResponse { |
| 1349 /** The standard List next-page token. */ |
| 1350 core.String nextPageToken; |
| 1351 /** A list of operations that matches the specified filter in the request. */ |
| 1352 core.List<Operation> operations; |
| 1353 |
| 1354 ListOperationsResponse(); |
| 1355 |
| 1356 ListOperationsResponse.fromJson(core.Map _json) { |
| 1357 if (_json.containsKey("nextPageToken")) { |
| 1358 nextPageToken = _json["nextPageToken"]; |
| 1359 } |
| 1360 if (_json.containsKey("operations")) { |
| 1361 operations = _json["operations"].map((value) => new Operation.fromJson(val
ue)).toList(); |
| 1362 } |
| 1363 } |
| 1364 |
| 1365 core.Map toJson() { |
| 1366 var _json = new core.Map(); |
| 1367 if (nextPageToken != null) { |
| 1368 _json["nextPageToken"] = nextPageToken; |
| 1369 } |
| 1370 if (operations != null) { |
| 1371 _json["operations"] = operations.map((value) => (value).toJson()).toList()
; |
| 1372 } |
| 1373 return _json; |
| 1374 } |
| 1375 } |
| 1376 |
| 1377 /** Response for ListRootCategories request. */ |
| 1378 class ListRootCategoriesResponse { |
| 1379 /** List of all into type categories supported by the API. */ |
| 1380 core.List<CategoryDescription> categories; |
| 1381 |
| 1382 ListRootCategoriesResponse(); |
| 1383 |
| 1384 ListRootCategoriesResponse.fromJson(core.Map _json) { |
| 1385 if (_json.containsKey("categories")) { |
| 1386 categories = _json["categories"].map((value) => new CategoryDescription.fr
omJson(value)).toList(); |
| 1387 } |
| 1388 } |
| 1389 |
| 1390 core.Map toJson() { |
| 1391 var _json = new core.Map(); |
| 1392 if (categories != null) { |
| 1393 _json["categories"] = categories.map((value) => (value).toJson()).toList()
; |
| 1394 } |
| 1395 return _json; |
| 1396 } |
| 1397 } |
| 1398 |
| 1399 /** Specifies the location of a finding within its source item. */ |
| 1400 class Location { |
| 1401 /** Zero-based byte offsets within a content item. */ |
| 1402 Range byteRange; |
| 1403 /** |
| 1404 * Character offsets within a content item, included when content type |
| 1405 * is a text. Default charset assumed to be UTF-8. |
| 1406 */ |
| 1407 Range codepointRange; |
| 1408 /** Field id of the field containing the finding. */ |
| 1409 FieldId fieldId; |
| 1410 /** Location within an image's pixels. */ |
| 1411 core.List<ImageLocation> imageBoxes; |
| 1412 /** Key of the finding. */ |
| 1413 RecordKey recordKey; |
| 1414 |
| 1415 Location(); |
| 1416 |
| 1417 Location.fromJson(core.Map _json) { |
| 1418 if (_json.containsKey("byteRange")) { |
| 1419 byteRange = new Range.fromJson(_json["byteRange"]); |
| 1420 } |
| 1421 if (_json.containsKey("codepointRange")) { |
| 1422 codepointRange = new Range.fromJson(_json["codepointRange"]); |
| 1423 } |
| 1424 if (_json.containsKey("fieldId")) { |
| 1425 fieldId = new FieldId.fromJson(_json["fieldId"]); |
| 1426 } |
| 1427 if (_json.containsKey("imageBoxes")) { |
| 1428 imageBoxes = _json["imageBoxes"].map((value) => new ImageLocation.fromJson
(value)).toList(); |
| 1429 } |
| 1430 if (_json.containsKey("recordKey")) { |
| 1431 recordKey = new RecordKey.fromJson(_json["recordKey"]); |
| 1432 } |
| 1433 } |
| 1434 |
| 1435 core.Map toJson() { |
| 1436 var _json = new core.Map(); |
| 1437 if (byteRange != null) { |
| 1438 _json["byteRange"] = (byteRange).toJson(); |
| 1439 } |
| 1440 if (codepointRange != null) { |
| 1441 _json["codepointRange"] = (codepointRange).toJson(); |
| 1442 } |
| 1443 if (fieldId != null) { |
| 1444 _json["fieldId"] = (fieldId).toJson(); |
| 1445 } |
| 1446 if (imageBoxes != null) { |
| 1447 _json["imageBoxes"] = imageBoxes.map((value) => (value).toJson()).toList()
; |
| 1448 } |
| 1449 if (recordKey != null) { |
| 1450 _json["recordKey"] = (recordKey).toJson(); |
| 1451 } |
| 1452 return _json; |
| 1453 } |
| 1454 } |
| 1455 |
| 1456 /** |
| 1457 * This resource represents a long-running operation that is the result of a |
| 1458 * network API call. |
| 1459 */ |
| 1460 class Operation { |
| 1461 /** |
| 1462 * If the value is `false`, it means the operation is still in progress. |
| 1463 * If true, the operation is completed, and either `error` or `response` is |
| 1464 * available. |
| 1465 */ |
| 1466 core.bool done; |
| 1467 /** The error result of the operation in case of failure or cancellation. */ |
| 1468 Status error; |
| 1469 /** |
| 1470 * This field will contain an `InspectOperationMetdata` object. |
| 1471 * |
| 1472 * The values for Object must be JSON objects. It can consist of `num`, |
| 1473 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 1474 */ |
| 1475 core.Map<core.String, core.Object> metadata; |
| 1476 /** |
| 1477 * The server-assigned name, The `name` should have the format of |
| 1478 * `inspect/operations/<identifier>`. |
| 1479 */ |
| 1480 core.String name; |
| 1481 /** |
| 1482 * This field will contain an `InspectOperationResult` object. |
| 1483 * |
| 1484 * The values for Object must be JSON objects. It can consist of `num`, |
| 1485 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 1486 */ |
| 1487 core.Map<core.String, core.Object> response; |
| 1488 |
| 1489 Operation(); |
| 1490 |
| 1491 Operation.fromJson(core.Map _json) { |
| 1492 if (_json.containsKey("done")) { |
| 1493 done = _json["done"]; |
| 1494 } |
| 1495 if (_json.containsKey("error")) { |
| 1496 error = new Status.fromJson(_json["error"]); |
| 1497 } |
| 1498 if (_json.containsKey("metadata")) { |
| 1499 metadata = _json["metadata"]; |
| 1500 } |
| 1501 if (_json.containsKey("name")) { |
| 1502 name = _json["name"]; |
| 1503 } |
| 1504 if (_json.containsKey("response")) { |
| 1505 response = _json["response"]; |
| 1506 } |
| 1507 } |
| 1508 |
| 1509 core.Map toJson() { |
| 1510 var _json = new core.Map(); |
| 1511 if (done != null) { |
| 1512 _json["done"] = done; |
| 1513 } |
| 1514 if (error != null) { |
| 1515 _json["error"] = (error).toJson(); |
| 1516 } |
| 1517 if (metadata != null) { |
| 1518 _json["metadata"] = metadata; |
| 1519 } |
| 1520 if (name != null) { |
| 1521 _json["name"] = name; |
| 1522 } |
| 1523 if (response != null) { |
| 1524 _json["response"] = response; |
| 1525 } |
| 1526 return _json; |
| 1527 } |
| 1528 } |
| 1529 |
| 1530 /** |
| 1531 * Datastore partition ID. |
| 1532 * A partition ID identifies a grouping of entities. The grouping is always |
| 1533 * by project and namespace, however the namespace ID may be empty. |
| 1534 * |
| 1535 * A partition ID contains several dimensions: |
| 1536 * project ID and namespace ID. |
| 1537 */ |
| 1538 class PartitionId { |
| 1539 /** |
| 1540 * If not empty, the ID of the database to which the entities |
| 1541 * belong. |
| 1542 */ |
| 1543 core.String databaseId; |
| 1544 /** If not empty, the ID of the namespace to which the entities belong. */ |
| 1545 core.String namespaceId; |
| 1546 /** The ID of the project to which the entities belong. */ |
| 1547 core.String projectId; |
| 1548 |
| 1549 PartitionId(); |
| 1550 |
| 1551 PartitionId.fromJson(core.Map _json) { |
| 1552 if (_json.containsKey("databaseId")) { |
| 1553 databaseId = _json["databaseId"]; |
| 1554 } |
| 1555 if (_json.containsKey("namespaceId")) { |
| 1556 namespaceId = _json["namespaceId"]; |
| 1557 } |
| 1558 if (_json.containsKey("projectId")) { |
| 1559 projectId = _json["projectId"]; |
| 1560 } |
| 1561 } |
| 1562 |
| 1563 core.Map toJson() { |
| 1564 var _json = new core.Map(); |
| 1565 if (databaseId != null) { |
| 1566 _json["databaseId"] = databaseId; |
| 1567 } |
| 1568 if (namespaceId != null) { |
| 1569 _json["namespaceId"] = namespaceId; |
| 1570 } |
| 1571 if (projectId != null) { |
| 1572 _json["projectId"] = projectId; |
| 1573 } |
| 1574 return _json; |
| 1575 } |
| 1576 } |
| 1577 |
| 1578 /** |
| 1579 * A (kind, ID/name) pair used to construct a key path. |
| 1580 * |
| 1581 * If either name or ID is set, the element is complete. |
| 1582 * If neither is set, the element is incomplete. |
| 1583 */ |
| 1584 class PathElement { |
| 1585 /** |
| 1586 * The auto-allocated ID of the entity. |
| 1587 * Never equal to zero. Values less than zero are discouraged and may not |
| 1588 * be supported in the future. |
| 1589 */ |
| 1590 core.String id; |
| 1591 /** |
| 1592 * The kind of the entity. |
| 1593 * A kind matching regex `__.*__` is reserved/read-only. |
| 1594 * A kind must not contain more than 1500 bytes when UTF-8 encoded. |
| 1595 * Cannot be `""`. |
| 1596 */ |
| 1597 core.String kind; |
| 1598 /** |
| 1599 * The name of the entity. |
| 1600 * A name matching regex `__.*__` is reserved/read-only. |
| 1601 * A name must not be more than 1500 bytes when UTF-8 encoded. |
| 1602 * Cannot be `""`. |
| 1603 */ |
| 1604 core.String name; |
| 1605 |
| 1606 PathElement(); |
| 1607 |
| 1608 PathElement.fromJson(core.Map _json) { |
| 1609 if (_json.containsKey("id")) { |
| 1610 id = _json["id"]; |
| 1611 } |
| 1612 if (_json.containsKey("kind")) { |
| 1613 kind = _json["kind"]; |
| 1614 } |
| 1615 if (_json.containsKey("name")) { |
| 1616 name = _json["name"]; |
| 1617 } |
| 1618 } |
| 1619 |
| 1620 core.Map toJson() { |
| 1621 var _json = new core.Map(); |
| 1622 if (id != null) { |
| 1623 _json["id"] = id; |
| 1624 } |
| 1625 if (kind != null) { |
| 1626 _json["kind"] = kind; |
| 1627 } |
| 1628 if (name != null) { |
| 1629 _json["name"] = name; |
| 1630 } |
| 1631 return _json; |
| 1632 } |
| 1633 } |
| 1634 |
| 1635 /** A representation of a Datastore property in a projection. */ |
| 1636 class Projection { |
| 1637 /** The property to project. */ |
| 1638 PropertyReference property; |
| 1639 |
| 1640 Projection(); |
| 1641 |
| 1642 Projection.fromJson(core.Map _json) { |
| 1643 if (_json.containsKey("property")) { |
| 1644 property = new PropertyReference.fromJson(_json["property"]); |
| 1645 } |
| 1646 } |
| 1647 |
| 1648 core.Map toJson() { |
| 1649 var _json = new core.Map(); |
| 1650 if (property != null) { |
| 1651 _json["property"] = (property).toJson(); |
| 1652 } |
| 1653 return _json; |
| 1654 } |
| 1655 } |
| 1656 |
| 1657 /** A reference to a property relative to the Datastore kind expressions. */ |
| 1658 class PropertyReference { |
| 1659 /** |
| 1660 * The name of the property. |
| 1661 * If name includes "."s, it may be interpreted as a property name path. |
| 1662 */ |
| 1663 core.String name; |
| 1664 |
| 1665 PropertyReference(); |
| 1666 |
| 1667 PropertyReference.fromJson(core.Map _json) { |
| 1668 if (_json.containsKey("name")) { |
| 1669 name = _json["name"]; |
| 1670 } |
| 1671 } |
| 1672 |
| 1673 core.Map toJson() { |
| 1674 var _json = new core.Map(); |
| 1675 if (name != null) { |
| 1676 _json["name"] = name; |
| 1677 } |
| 1678 return _json; |
| 1679 } |
| 1680 } |
| 1681 |
| 1682 /** Generic half-open interval [start, end) */ |
| 1683 class Range { |
| 1684 /** Index of the last character of the range (exclusive). */ |
| 1685 core.String end; |
| 1686 /** Index of the first character of the range (inclusive). */ |
| 1687 core.String start; |
| 1688 |
| 1689 Range(); |
| 1690 |
| 1691 Range.fromJson(core.Map _json) { |
| 1692 if (_json.containsKey("end")) { |
| 1693 end = _json["end"]; |
| 1694 } |
| 1695 if (_json.containsKey("start")) { |
| 1696 start = _json["start"]; |
| 1697 } |
| 1698 } |
| 1699 |
| 1700 core.Map toJson() { |
| 1701 var _json = new core.Map(); |
| 1702 if (end != null) { |
| 1703 _json["end"] = end; |
| 1704 } |
| 1705 if (start != null) { |
| 1706 _json["start"] = start; |
| 1707 } |
| 1708 return _json; |
| 1709 } |
| 1710 } |
| 1711 |
| 1712 /** Message for a unique key indicating a record that contains a finding. */ |
| 1713 class RecordKey { |
| 1714 CloudStorageKey cloudStorageKey; |
| 1715 DatastoreKey datastoreKey; |
| 1716 |
| 1717 RecordKey(); |
| 1718 |
| 1719 RecordKey.fromJson(core.Map _json) { |
| 1720 if (_json.containsKey("cloudStorageKey")) { |
| 1721 cloudStorageKey = new CloudStorageKey.fromJson(_json["cloudStorageKey"]); |
| 1722 } |
| 1723 if (_json.containsKey("datastoreKey")) { |
| 1724 datastoreKey = new DatastoreKey.fromJson(_json["datastoreKey"]); |
| 1725 } |
| 1726 } |
| 1727 |
| 1728 core.Map toJson() { |
| 1729 var _json = new core.Map(); |
| 1730 if (cloudStorageKey != null) { |
| 1731 _json["cloudStorageKey"] = (cloudStorageKey).toJson(); |
| 1732 } |
| 1733 if (datastoreKey != null) { |
| 1734 _json["datastoreKey"] = (datastoreKey).toJson(); |
| 1735 } |
| 1736 return _json; |
| 1737 } |
| 1738 } |
| 1739 |
| 1740 /** |
| 1741 * Request to search for potentially sensitive info in a list of items |
| 1742 * and replace it with a default or provided content. |
| 1743 */ |
| 1744 class RedactContentRequest { |
| 1745 /** Configuration for the inspector. */ |
| 1746 InspectConfig inspectConfig; |
| 1747 /** The list of items to inspect. Up to 100 are allowed per request. */ |
| 1748 core.List<ContentItem> items; |
| 1749 /** The strings to replace findings with. Must specify at least one. */ |
| 1750 core.List<ReplaceConfig> replaceConfigs; |
| 1751 |
| 1752 RedactContentRequest(); |
| 1753 |
| 1754 RedactContentRequest.fromJson(core.Map _json) { |
| 1755 if (_json.containsKey("inspectConfig")) { |
| 1756 inspectConfig = new InspectConfig.fromJson(_json["inspectConfig"]); |
| 1757 } |
| 1758 if (_json.containsKey("items")) { |
| 1759 items = _json["items"].map((value) => new ContentItem.fromJson(value)).toL
ist(); |
| 1760 } |
| 1761 if (_json.containsKey("replaceConfigs")) { |
| 1762 replaceConfigs = _json["replaceConfigs"].map((value) => new ReplaceConfig.
fromJson(value)).toList(); |
| 1763 } |
| 1764 } |
| 1765 |
| 1766 core.Map toJson() { |
| 1767 var _json = new core.Map(); |
| 1768 if (inspectConfig != null) { |
| 1769 _json["inspectConfig"] = (inspectConfig).toJson(); |
| 1770 } |
| 1771 if (items != null) { |
| 1772 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 1773 } |
| 1774 if (replaceConfigs != null) { |
| 1775 _json["replaceConfigs"] = replaceConfigs.map((value) => (value).toJson()).
toList(); |
| 1776 } |
| 1777 return _json; |
| 1778 } |
| 1779 } |
| 1780 |
| 1781 /** Results of deidentifying a list of items. */ |
| 1782 class RedactContentResponse { |
| 1783 /** The redacted content. */ |
| 1784 core.List<ContentItem> items; |
| 1785 |
| 1786 RedactContentResponse(); |
| 1787 |
| 1788 RedactContentResponse.fromJson(core.Map _json) { |
| 1789 if (_json.containsKey("items")) { |
| 1790 items = _json["items"].map((value) => new ContentItem.fromJson(value)).toL
ist(); |
| 1791 } |
| 1792 } |
| 1793 |
| 1794 core.Map toJson() { |
| 1795 var _json = new core.Map(); |
| 1796 if (items != null) { |
| 1797 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 1798 } |
| 1799 return _json; |
| 1800 } |
| 1801 } |
| 1802 |
| 1803 class ReplaceConfig { |
| 1804 /** |
| 1805 * Type of information to replace. Only one ReplaceConfig per info_type |
| 1806 * should be provided. If ReplaceConfig does not have an info_type, we'll |
| 1807 * match it against all info_types that are found but not specified in |
| 1808 * another ReplaceConfig. |
| 1809 */ |
| 1810 InfoType infoType; |
| 1811 /** Content replacing sensitive information of given type. Max 256 chars. */ |
| 1812 core.String replaceWith; |
| 1813 |
| 1814 ReplaceConfig(); |
| 1815 |
| 1816 ReplaceConfig.fromJson(core.Map _json) { |
| 1817 if (_json.containsKey("infoType")) { |
| 1818 infoType = new InfoType.fromJson(_json["infoType"]); |
| 1819 } |
| 1820 if (_json.containsKey("replaceWith")) { |
| 1821 replaceWith = _json["replaceWith"]; |
| 1822 } |
| 1823 } |
| 1824 |
| 1825 core.Map toJson() { |
| 1826 var _json = new core.Map(); |
| 1827 if (infoType != null) { |
| 1828 _json["infoType"] = (infoType).toJson(); |
| 1829 } |
| 1830 if (replaceWith != null) { |
| 1831 _json["replaceWith"] = replaceWith; |
| 1832 } |
| 1833 return _json; |
| 1834 } |
| 1835 } |
| 1836 |
| 1837 /** |
| 1838 * The `Status` type defines a logical error model that is suitable for |
| 1839 * different |
| 1840 * programming environments, including REST APIs and RPC APIs. It is used by |
| 1841 * [gRPC](https://github.com/grpc). The error model is designed to be: |
| 1842 * |
| 1843 * - Simple to use and understand for most users |
| 1844 * - Flexible enough to meet unexpected needs |
| 1845 * |
| 1846 * # Overview |
| 1847 * |
| 1848 * The `Status` message contains three pieces of data: error code, error |
| 1849 * message, |
| 1850 * and error details. The error code should be an enum value of |
| 1851 * google.rpc.Code, but it may accept additional error codes if needed. The |
| 1852 * error message should be a developer-facing English message that helps |
| 1853 * developers *understand* and *resolve* the error. If a localized user-facing |
| 1854 * error message is needed, put the localized message in the error details or |
| 1855 * localize it in the client. The optional error details may contain arbitrary |
| 1856 * information about the error. There is a predefined set of error detail types |
| 1857 * in the package `google.rpc` which can be used for common error conditions. |
| 1858 * |
| 1859 * # Language mapping |
| 1860 * |
| 1861 * The `Status` message is the logical representation of the error model, but it |
| 1862 * is not necessarily the actual wire format. When the `Status` message is |
| 1863 * exposed in different client libraries and different wire protocols, it can be |
| 1864 * mapped differently. For example, it will likely be mapped to some exceptions |
| 1865 * in Java, but more likely mapped to some error codes in C. |
| 1866 * |
| 1867 * # Other uses |
| 1868 * |
| 1869 * The error model and the `Status` message can be used in a variety of |
| 1870 * environments, either with or without APIs, to provide a |
| 1871 * consistent developer experience across different environments. |
| 1872 * |
| 1873 * Example uses of this error model include: |
| 1874 * |
| 1875 * - Partial errors. If a service needs to return partial errors to the client, |
| 1876 * it may embed the `Status` in the normal response to indicate the partial |
| 1877 * errors. |
| 1878 * |
| 1879 * - Workflow errors. A typical workflow has multiple steps. Each step may |
| 1880 * have a `Status` message for error reporting purpose. |
| 1881 * |
| 1882 * - Batch operations. If a client uses batch request and batch response, the |
| 1883 * `Status` message should be used directly inside batch response, one for |
| 1884 * each error sub-response. |
| 1885 * |
| 1886 * - Asynchronous operations. If an API call embeds asynchronous operation |
| 1887 * results in its response, the status of those operations should be |
| 1888 * represented directly using the `Status` message. |
| 1889 * |
| 1890 * - Logging. If some API errors are stored in logs, the message `Status` could |
| 1891 * be used directly after any stripping needed for security/privacy reasons. |
| 1892 */ |
| 1893 class Status { |
| 1894 /** The status code, which should be an enum value of google.rpc.Code. */ |
| 1895 core.int code; |
| 1896 /** |
| 1897 * A list of messages that carry the error details. There will be a |
| 1898 * common set of message types for APIs to use. |
| 1899 * |
| 1900 * The values for Object must be JSON objects. It can consist of `num`, |
| 1901 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 1902 */ |
| 1903 core.List<core.Map<core.String, core.Object>> details; |
| 1904 /** |
| 1905 * A developer-facing error message, which should be in English. Any |
| 1906 * user-facing error message should be localized and sent in the |
| 1907 * google.rpc.Status.details field, or localized by the client. |
| 1908 */ |
| 1909 core.String message; |
| 1910 |
| 1911 Status(); |
| 1912 |
| 1913 Status.fromJson(core.Map _json) { |
| 1914 if (_json.containsKey("code")) { |
| 1915 code = _json["code"]; |
| 1916 } |
| 1917 if (_json.containsKey("details")) { |
| 1918 details = _json["details"]; |
| 1919 } |
| 1920 if (_json.containsKey("message")) { |
| 1921 message = _json["message"]; |
| 1922 } |
| 1923 } |
| 1924 |
| 1925 core.Map toJson() { |
| 1926 var _json = new core.Map(); |
| 1927 if (code != null) { |
| 1928 _json["code"] = code; |
| 1929 } |
| 1930 if (details != null) { |
| 1931 _json["details"] = details; |
| 1932 } |
| 1933 if (message != null) { |
| 1934 _json["message"] = message; |
| 1935 } |
| 1936 return _json; |
| 1937 } |
| 1938 } |
| 1939 |
| 1940 /** Shared message indicating Cloud storage type. */ |
| 1941 class StorageConfig { |
| 1942 /** Google Cloud Storage options specification. */ |
| 1943 CloudStorageOptions cloudStorageOptions; |
| 1944 /** Google Cloud Datastore options specification. */ |
| 1945 DatastoreOptions datastoreOptions; |
| 1946 |
| 1947 StorageConfig(); |
| 1948 |
| 1949 StorageConfig.fromJson(core.Map _json) { |
| 1950 if (_json.containsKey("cloudStorageOptions")) { |
| 1951 cloudStorageOptions = new CloudStorageOptions.fromJson(_json["cloudStorage
Options"]); |
| 1952 } |
| 1953 if (_json.containsKey("datastoreOptions")) { |
| 1954 datastoreOptions = new DatastoreOptions.fromJson(_json["datastoreOptions"]
); |
| 1955 } |
| 1956 } |
| 1957 |
| 1958 core.Map toJson() { |
| 1959 var _json = new core.Map(); |
| 1960 if (cloudStorageOptions != null) { |
| 1961 _json["cloudStorageOptions"] = (cloudStorageOptions).toJson(); |
| 1962 } |
| 1963 if (datastoreOptions != null) { |
| 1964 _json["datastoreOptions"] = (datastoreOptions).toJson(); |
| 1965 } |
| 1966 return _json; |
| 1967 } |
| 1968 } |
OLD | NEW |