1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 // Generated by the protocol buffer compiler. DO NOT EDIT! 17 // source: google/privacy/dlp/v2/storage.proto 18 19 package com.google.privacy.dlp.v2; 20 21 /** 22 * 23 * 24 * <pre> 25 * Message representing a set of files in a Cloud Storage bucket. Regular 26 * expressions are used to allow fine-grained control over which files in the 27 * bucket to include. 28 * Included files are those that match at least one item in `include_regex` and 29 * do not match any items in `exclude_regex`. Note that a file that matches 30 * items from both lists will _not_ be included. For a match to occur, the 31 * entire file path (i.e., everything in the url after the bucket name) must 32 * match the regular expression. 33 * For example, given the input `{bucket_name: "mybucket", include_regex: 34 * ["directory1/.*"], exclude_regex: 35 * ["directory1/excluded.*"]}`: 36 * * `gs://mybucket/directory1/myfile` will be included 37 * * `gs://mybucket/directory1/directory2/myfile` will be included (`.*` matches 38 * across `/`) 39 * * `gs://mybucket/directory0/directory1/myfile` will _not_ be included (the 40 * full path doesn't match any items in `include_regex`) 41 * * `gs://mybucket/directory1/excludedfile` will _not_ be included (the path 42 * matches an item in `exclude_regex`) 43 * If `include_regex` is left empty, it will match all files by default 44 * (this is equivalent to setting `include_regex: [".*"]`). 45 * Some other common use cases: 46 * * `{bucket_name: "mybucket", exclude_regex: [".*\.pdf"]}` will include all 47 * files in `mybucket` except for .pdf files 48 * * `{bucket_name: "mybucket", include_regex: ["directory/[^/]+"]}` will 49 * include all files directly under `gs://mybucket/directory/`, without matching 50 * across `/` 51 * </pre> 52 * 53 * Protobuf type {@code google.privacy.dlp.v2.CloudStorageRegexFileSet} 54 */ 55 public final class CloudStorageRegexFileSet extends com.google.protobuf.GeneratedMessageV3 56 implements 57 // @@protoc_insertion_point(message_implements:google.privacy.dlp.v2.CloudStorageRegexFileSet) 58 CloudStorageRegexFileSetOrBuilder { 59 private static final long serialVersionUID = 0L; 60 // Use CloudStorageRegexFileSet.newBuilder() to construct. CloudStorageRegexFileSet(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)61 private CloudStorageRegexFileSet(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 62 super(builder); 63 } 64 CloudStorageRegexFileSet()65 private CloudStorageRegexFileSet() { 66 bucketName_ = ""; 67 includeRegex_ = com.google.protobuf.LazyStringArrayList.EMPTY; 68 excludeRegex_ = com.google.protobuf.LazyStringArrayList.EMPTY; 69 } 70 71 @java.lang.Override 72 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)73 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 74 return new CloudStorageRegexFileSet(); 75 } 76 77 @java.lang.Override getUnknownFields()78 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 79 return this.unknownFields; 80 } 81 getDescriptor()82 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 83 return com.google.privacy.dlp.v2.DlpStorage 84 .internal_static_google_privacy_dlp_v2_CloudStorageRegexFileSet_descriptor; 85 } 86 87 @java.lang.Override 88 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()89 internalGetFieldAccessorTable() { 90 return com.google.privacy.dlp.v2.DlpStorage 91 .internal_static_google_privacy_dlp_v2_CloudStorageRegexFileSet_fieldAccessorTable 92 .ensureFieldAccessorsInitialized( 93 com.google.privacy.dlp.v2.CloudStorageRegexFileSet.class, 94 com.google.privacy.dlp.v2.CloudStorageRegexFileSet.Builder.class); 95 } 96 97 public static final int BUCKET_NAME_FIELD_NUMBER = 1; 98 99 @SuppressWarnings("serial") 100 private volatile java.lang.Object bucketName_ = ""; 101 /** 102 * 103 * 104 * <pre> 105 * The name of a Cloud Storage bucket. Required. 106 * </pre> 107 * 108 * <code>string bucket_name = 1;</code> 109 * 110 * @return The bucketName. 111 */ 112 @java.lang.Override getBucketName()113 public java.lang.String getBucketName() { 114 java.lang.Object ref = bucketName_; 115 if (ref instanceof java.lang.String) { 116 return (java.lang.String) ref; 117 } else { 118 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 119 java.lang.String s = bs.toStringUtf8(); 120 bucketName_ = s; 121 return s; 122 } 123 } 124 /** 125 * 126 * 127 * <pre> 128 * The name of a Cloud Storage bucket. Required. 129 * </pre> 130 * 131 * <code>string bucket_name = 1;</code> 132 * 133 * @return The bytes for bucketName. 134 */ 135 @java.lang.Override getBucketNameBytes()136 public com.google.protobuf.ByteString getBucketNameBytes() { 137 java.lang.Object ref = bucketName_; 138 if (ref instanceof java.lang.String) { 139 com.google.protobuf.ByteString b = 140 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 141 bucketName_ = b; 142 return b; 143 } else { 144 return (com.google.protobuf.ByteString) ref; 145 } 146 } 147 148 public static final int INCLUDE_REGEX_FIELD_NUMBER = 2; 149 150 @SuppressWarnings("serial") 151 private com.google.protobuf.LazyStringList includeRegex_; 152 /** 153 * 154 * 155 * <pre> 156 * A list of regular expressions matching file paths to include. All files in 157 * the bucket that match at least one of these regular expressions will be 158 * included in the set of files, except for those that also match an item in 159 * `exclude_regex`. Leaving this field empty will match all files by default 160 * (this is equivalent to including `.*` in the list). 161 * Regular expressions use RE2 162 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 163 * under the google/re2 repository on GitHub. 164 * </pre> 165 * 166 * <code>repeated string include_regex = 2;</code> 167 * 168 * @return A list containing the includeRegex. 169 */ getIncludeRegexList()170 public com.google.protobuf.ProtocolStringList getIncludeRegexList() { 171 return includeRegex_; 172 } 173 /** 174 * 175 * 176 * <pre> 177 * A list of regular expressions matching file paths to include. All files in 178 * the bucket that match at least one of these regular expressions will be 179 * included in the set of files, except for those that also match an item in 180 * `exclude_regex`. Leaving this field empty will match all files by default 181 * (this is equivalent to including `.*` in the list). 182 * Regular expressions use RE2 183 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 184 * under the google/re2 repository on GitHub. 185 * </pre> 186 * 187 * <code>repeated string include_regex = 2;</code> 188 * 189 * @return The count of includeRegex. 190 */ getIncludeRegexCount()191 public int getIncludeRegexCount() { 192 return includeRegex_.size(); 193 } 194 /** 195 * 196 * 197 * <pre> 198 * A list of regular expressions matching file paths to include. All files in 199 * the bucket that match at least one of these regular expressions will be 200 * included in the set of files, except for those that also match an item in 201 * `exclude_regex`. Leaving this field empty will match all files by default 202 * (this is equivalent to including `.*` in the list). 203 * Regular expressions use RE2 204 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 205 * under the google/re2 repository on GitHub. 206 * </pre> 207 * 208 * <code>repeated string include_regex = 2;</code> 209 * 210 * @param index The index of the element to return. 211 * @return The includeRegex at the given index. 212 */ getIncludeRegex(int index)213 public java.lang.String getIncludeRegex(int index) { 214 return includeRegex_.get(index); 215 } 216 /** 217 * 218 * 219 * <pre> 220 * A list of regular expressions matching file paths to include. All files in 221 * the bucket that match at least one of these regular expressions will be 222 * included in the set of files, except for those that also match an item in 223 * `exclude_regex`. Leaving this field empty will match all files by default 224 * (this is equivalent to including `.*` in the list). 225 * Regular expressions use RE2 226 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 227 * under the google/re2 repository on GitHub. 228 * </pre> 229 * 230 * <code>repeated string include_regex = 2;</code> 231 * 232 * @param index The index of the value to return. 233 * @return The bytes of the includeRegex at the given index. 234 */ getIncludeRegexBytes(int index)235 public com.google.protobuf.ByteString getIncludeRegexBytes(int index) { 236 return includeRegex_.getByteString(index); 237 } 238 239 public static final int EXCLUDE_REGEX_FIELD_NUMBER = 3; 240 241 @SuppressWarnings("serial") 242 private com.google.protobuf.LazyStringList excludeRegex_; 243 /** 244 * 245 * 246 * <pre> 247 * A list of regular expressions matching file paths to exclude. All files in 248 * the bucket that match at least one of these regular expressions will be 249 * excluded from the scan. 250 * Regular expressions use RE2 251 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 252 * under the google/re2 repository on GitHub. 253 * </pre> 254 * 255 * <code>repeated string exclude_regex = 3;</code> 256 * 257 * @return A list containing the excludeRegex. 258 */ getExcludeRegexList()259 public com.google.protobuf.ProtocolStringList getExcludeRegexList() { 260 return excludeRegex_; 261 } 262 /** 263 * 264 * 265 * <pre> 266 * A list of regular expressions matching file paths to exclude. All files in 267 * the bucket that match at least one of these regular expressions will be 268 * excluded from the scan. 269 * Regular expressions use RE2 270 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 271 * under the google/re2 repository on GitHub. 272 * </pre> 273 * 274 * <code>repeated string exclude_regex = 3;</code> 275 * 276 * @return The count of excludeRegex. 277 */ getExcludeRegexCount()278 public int getExcludeRegexCount() { 279 return excludeRegex_.size(); 280 } 281 /** 282 * 283 * 284 * <pre> 285 * A list of regular expressions matching file paths to exclude. All files in 286 * the bucket that match at least one of these regular expressions will be 287 * excluded from the scan. 288 * Regular expressions use RE2 289 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 290 * under the google/re2 repository on GitHub. 291 * </pre> 292 * 293 * <code>repeated string exclude_regex = 3;</code> 294 * 295 * @param index The index of the element to return. 296 * @return The excludeRegex at the given index. 297 */ getExcludeRegex(int index)298 public java.lang.String getExcludeRegex(int index) { 299 return excludeRegex_.get(index); 300 } 301 /** 302 * 303 * 304 * <pre> 305 * A list of regular expressions matching file paths to exclude. All files in 306 * the bucket that match at least one of these regular expressions will be 307 * excluded from the scan. 308 * Regular expressions use RE2 309 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 310 * under the google/re2 repository on GitHub. 311 * </pre> 312 * 313 * <code>repeated string exclude_regex = 3;</code> 314 * 315 * @param index The index of the value to return. 316 * @return The bytes of the excludeRegex at the given index. 317 */ getExcludeRegexBytes(int index)318 public com.google.protobuf.ByteString getExcludeRegexBytes(int index) { 319 return excludeRegex_.getByteString(index); 320 } 321 322 private byte memoizedIsInitialized = -1; 323 324 @java.lang.Override isInitialized()325 public final boolean isInitialized() { 326 byte isInitialized = memoizedIsInitialized; 327 if (isInitialized == 1) return true; 328 if (isInitialized == 0) return false; 329 330 memoizedIsInitialized = 1; 331 return true; 332 } 333 334 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)335 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 336 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucketName_)) { 337 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, bucketName_); 338 } 339 for (int i = 0; i < includeRegex_.size(); i++) { 340 com.google.protobuf.GeneratedMessageV3.writeString(output, 2, includeRegex_.getRaw(i)); 341 } 342 for (int i = 0; i < excludeRegex_.size(); i++) { 343 com.google.protobuf.GeneratedMessageV3.writeString(output, 3, excludeRegex_.getRaw(i)); 344 } 345 getUnknownFields().writeTo(output); 346 } 347 348 @java.lang.Override getSerializedSize()349 public int getSerializedSize() { 350 int size = memoizedSize; 351 if (size != -1) return size; 352 353 size = 0; 354 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucketName_)) { 355 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, bucketName_); 356 } 357 { 358 int dataSize = 0; 359 for (int i = 0; i < includeRegex_.size(); i++) { 360 dataSize += computeStringSizeNoTag(includeRegex_.getRaw(i)); 361 } 362 size += dataSize; 363 size += 1 * getIncludeRegexList().size(); 364 } 365 { 366 int dataSize = 0; 367 for (int i = 0; i < excludeRegex_.size(); i++) { 368 dataSize += computeStringSizeNoTag(excludeRegex_.getRaw(i)); 369 } 370 size += dataSize; 371 size += 1 * getExcludeRegexList().size(); 372 } 373 size += getUnknownFields().getSerializedSize(); 374 memoizedSize = size; 375 return size; 376 } 377 378 @java.lang.Override equals(final java.lang.Object obj)379 public boolean equals(final java.lang.Object obj) { 380 if (obj == this) { 381 return true; 382 } 383 if (!(obj instanceof com.google.privacy.dlp.v2.CloudStorageRegexFileSet)) { 384 return super.equals(obj); 385 } 386 com.google.privacy.dlp.v2.CloudStorageRegexFileSet other = 387 (com.google.privacy.dlp.v2.CloudStorageRegexFileSet) obj; 388 389 if (!getBucketName().equals(other.getBucketName())) return false; 390 if (!getIncludeRegexList().equals(other.getIncludeRegexList())) return false; 391 if (!getExcludeRegexList().equals(other.getExcludeRegexList())) return false; 392 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 393 return true; 394 } 395 396 @java.lang.Override hashCode()397 public int hashCode() { 398 if (memoizedHashCode != 0) { 399 return memoizedHashCode; 400 } 401 int hash = 41; 402 hash = (19 * hash) + getDescriptor().hashCode(); 403 hash = (37 * hash) + BUCKET_NAME_FIELD_NUMBER; 404 hash = (53 * hash) + getBucketName().hashCode(); 405 if (getIncludeRegexCount() > 0) { 406 hash = (37 * hash) + INCLUDE_REGEX_FIELD_NUMBER; 407 hash = (53 * hash) + getIncludeRegexList().hashCode(); 408 } 409 if (getExcludeRegexCount() > 0) { 410 hash = (37 * hash) + EXCLUDE_REGEX_FIELD_NUMBER; 411 hash = (53 * hash) + getExcludeRegexList().hashCode(); 412 } 413 hash = (29 * hash) + getUnknownFields().hashCode(); 414 memoizedHashCode = hash; 415 return hash; 416 } 417 parseFrom( java.nio.ByteBuffer data)418 public static com.google.privacy.dlp.v2.CloudStorageRegexFileSet parseFrom( 419 java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { 420 return PARSER.parseFrom(data); 421 } 422 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)423 public static com.google.privacy.dlp.v2.CloudStorageRegexFileSet parseFrom( 424 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 425 throws com.google.protobuf.InvalidProtocolBufferException { 426 return PARSER.parseFrom(data, extensionRegistry); 427 } 428 parseFrom( com.google.protobuf.ByteString data)429 public static com.google.privacy.dlp.v2.CloudStorageRegexFileSet parseFrom( 430 com.google.protobuf.ByteString data) 431 throws com.google.protobuf.InvalidProtocolBufferException { 432 return PARSER.parseFrom(data); 433 } 434 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)435 public static com.google.privacy.dlp.v2.CloudStorageRegexFileSet parseFrom( 436 com.google.protobuf.ByteString data, 437 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 438 throws com.google.protobuf.InvalidProtocolBufferException { 439 return PARSER.parseFrom(data, extensionRegistry); 440 } 441 parseFrom(byte[] data)442 public static com.google.privacy.dlp.v2.CloudStorageRegexFileSet parseFrom(byte[] data) 443 throws com.google.protobuf.InvalidProtocolBufferException { 444 return PARSER.parseFrom(data); 445 } 446 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)447 public static com.google.privacy.dlp.v2.CloudStorageRegexFileSet parseFrom( 448 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 449 throws com.google.protobuf.InvalidProtocolBufferException { 450 return PARSER.parseFrom(data, extensionRegistry); 451 } 452 parseFrom( java.io.InputStream input)453 public static com.google.privacy.dlp.v2.CloudStorageRegexFileSet parseFrom( 454 java.io.InputStream input) throws java.io.IOException { 455 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 456 } 457 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)458 public static com.google.privacy.dlp.v2.CloudStorageRegexFileSet parseFrom( 459 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 460 throws java.io.IOException { 461 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 462 PARSER, input, extensionRegistry); 463 } 464 parseDelimitedFrom( java.io.InputStream input)465 public static com.google.privacy.dlp.v2.CloudStorageRegexFileSet parseDelimitedFrom( 466 java.io.InputStream input) throws java.io.IOException { 467 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 468 } 469 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)470 public static com.google.privacy.dlp.v2.CloudStorageRegexFileSet parseDelimitedFrom( 471 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 472 throws java.io.IOException { 473 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 474 PARSER, input, extensionRegistry); 475 } 476 parseFrom( com.google.protobuf.CodedInputStream input)477 public static com.google.privacy.dlp.v2.CloudStorageRegexFileSet parseFrom( 478 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 479 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 480 } 481 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)482 public static com.google.privacy.dlp.v2.CloudStorageRegexFileSet parseFrom( 483 com.google.protobuf.CodedInputStream input, 484 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 485 throws java.io.IOException { 486 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 487 PARSER, input, extensionRegistry); 488 } 489 490 @java.lang.Override newBuilderForType()491 public Builder newBuilderForType() { 492 return newBuilder(); 493 } 494 newBuilder()495 public static Builder newBuilder() { 496 return DEFAULT_INSTANCE.toBuilder(); 497 } 498 newBuilder(com.google.privacy.dlp.v2.CloudStorageRegexFileSet prototype)499 public static Builder newBuilder(com.google.privacy.dlp.v2.CloudStorageRegexFileSet prototype) { 500 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 501 } 502 503 @java.lang.Override toBuilder()504 public Builder toBuilder() { 505 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 506 } 507 508 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)509 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 510 Builder builder = new Builder(parent); 511 return builder; 512 } 513 /** 514 * 515 * 516 * <pre> 517 * Message representing a set of files in a Cloud Storage bucket. Regular 518 * expressions are used to allow fine-grained control over which files in the 519 * bucket to include. 520 * Included files are those that match at least one item in `include_regex` and 521 * do not match any items in `exclude_regex`. Note that a file that matches 522 * items from both lists will _not_ be included. For a match to occur, the 523 * entire file path (i.e., everything in the url after the bucket name) must 524 * match the regular expression. 525 * For example, given the input `{bucket_name: "mybucket", include_regex: 526 * ["directory1/.*"], exclude_regex: 527 * ["directory1/excluded.*"]}`: 528 * * `gs://mybucket/directory1/myfile` will be included 529 * * `gs://mybucket/directory1/directory2/myfile` will be included (`.*` matches 530 * across `/`) 531 * * `gs://mybucket/directory0/directory1/myfile` will _not_ be included (the 532 * full path doesn't match any items in `include_regex`) 533 * * `gs://mybucket/directory1/excludedfile` will _not_ be included (the path 534 * matches an item in `exclude_regex`) 535 * If `include_regex` is left empty, it will match all files by default 536 * (this is equivalent to setting `include_regex: [".*"]`). 537 * Some other common use cases: 538 * * `{bucket_name: "mybucket", exclude_regex: [".*\.pdf"]}` will include all 539 * files in `mybucket` except for .pdf files 540 * * `{bucket_name: "mybucket", include_regex: ["directory/[^/]+"]}` will 541 * include all files directly under `gs://mybucket/directory/`, without matching 542 * across `/` 543 * </pre> 544 * 545 * Protobuf type {@code google.privacy.dlp.v2.CloudStorageRegexFileSet} 546 */ 547 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 548 implements 549 // @@protoc_insertion_point(builder_implements:google.privacy.dlp.v2.CloudStorageRegexFileSet) 550 com.google.privacy.dlp.v2.CloudStorageRegexFileSetOrBuilder { getDescriptor()551 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 552 return com.google.privacy.dlp.v2.DlpStorage 553 .internal_static_google_privacy_dlp_v2_CloudStorageRegexFileSet_descriptor; 554 } 555 556 @java.lang.Override 557 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()558 internalGetFieldAccessorTable() { 559 return com.google.privacy.dlp.v2.DlpStorage 560 .internal_static_google_privacy_dlp_v2_CloudStorageRegexFileSet_fieldAccessorTable 561 .ensureFieldAccessorsInitialized( 562 com.google.privacy.dlp.v2.CloudStorageRegexFileSet.class, 563 com.google.privacy.dlp.v2.CloudStorageRegexFileSet.Builder.class); 564 } 565 566 // Construct using com.google.privacy.dlp.v2.CloudStorageRegexFileSet.newBuilder() Builder()567 private Builder() {} 568 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)569 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 570 super(parent); 571 } 572 573 @java.lang.Override clear()574 public Builder clear() { 575 super.clear(); 576 bitField0_ = 0; 577 bucketName_ = ""; 578 includeRegex_ = com.google.protobuf.LazyStringArrayList.EMPTY; 579 bitField0_ = (bitField0_ & ~0x00000002); 580 excludeRegex_ = com.google.protobuf.LazyStringArrayList.EMPTY; 581 bitField0_ = (bitField0_ & ~0x00000004); 582 return this; 583 } 584 585 @java.lang.Override getDescriptorForType()586 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 587 return com.google.privacy.dlp.v2.DlpStorage 588 .internal_static_google_privacy_dlp_v2_CloudStorageRegexFileSet_descriptor; 589 } 590 591 @java.lang.Override getDefaultInstanceForType()592 public com.google.privacy.dlp.v2.CloudStorageRegexFileSet getDefaultInstanceForType() { 593 return com.google.privacy.dlp.v2.CloudStorageRegexFileSet.getDefaultInstance(); 594 } 595 596 @java.lang.Override build()597 public com.google.privacy.dlp.v2.CloudStorageRegexFileSet build() { 598 com.google.privacy.dlp.v2.CloudStorageRegexFileSet result = buildPartial(); 599 if (!result.isInitialized()) { 600 throw newUninitializedMessageException(result); 601 } 602 return result; 603 } 604 605 @java.lang.Override buildPartial()606 public com.google.privacy.dlp.v2.CloudStorageRegexFileSet buildPartial() { 607 com.google.privacy.dlp.v2.CloudStorageRegexFileSet result = 608 new com.google.privacy.dlp.v2.CloudStorageRegexFileSet(this); 609 buildPartialRepeatedFields(result); 610 if (bitField0_ != 0) { 611 buildPartial0(result); 612 } 613 onBuilt(); 614 return result; 615 } 616 buildPartialRepeatedFields( com.google.privacy.dlp.v2.CloudStorageRegexFileSet result)617 private void buildPartialRepeatedFields( 618 com.google.privacy.dlp.v2.CloudStorageRegexFileSet result) { 619 if (((bitField0_ & 0x00000002) != 0)) { 620 includeRegex_ = includeRegex_.getUnmodifiableView(); 621 bitField0_ = (bitField0_ & ~0x00000002); 622 } 623 result.includeRegex_ = includeRegex_; 624 if (((bitField0_ & 0x00000004) != 0)) { 625 excludeRegex_ = excludeRegex_.getUnmodifiableView(); 626 bitField0_ = (bitField0_ & ~0x00000004); 627 } 628 result.excludeRegex_ = excludeRegex_; 629 } 630 buildPartial0(com.google.privacy.dlp.v2.CloudStorageRegexFileSet result)631 private void buildPartial0(com.google.privacy.dlp.v2.CloudStorageRegexFileSet result) { 632 int from_bitField0_ = bitField0_; 633 if (((from_bitField0_ & 0x00000001) != 0)) { 634 result.bucketName_ = bucketName_; 635 } 636 } 637 638 @java.lang.Override clone()639 public Builder clone() { 640 return super.clone(); 641 } 642 643 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)644 public Builder setField( 645 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 646 return super.setField(field, value); 647 } 648 649 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)650 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 651 return super.clearField(field); 652 } 653 654 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)655 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 656 return super.clearOneof(oneof); 657 } 658 659 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)660 public Builder setRepeatedField( 661 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 662 return super.setRepeatedField(field, index, value); 663 } 664 665 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)666 public Builder addRepeatedField( 667 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 668 return super.addRepeatedField(field, value); 669 } 670 671 @java.lang.Override mergeFrom(com.google.protobuf.Message other)672 public Builder mergeFrom(com.google.protobuf.Message other) { 673 if (other instanceof com.google.privacy.dlp.v2.CloudStorageRegexFileSet) { 674 return mergeFrom((com.google.privacy.dlp.v2.CloudStorageRegexFileSet) other); 675 } else { 676 super.mergeFrom(other); 677 return this; 678 } 679 } 680 mergeFrom(com.google.privacy.dlp.v2.CloudStorageRegexFileSet other)681 public Builder mergeFrom(com.google.privacy.dlp.v2.CloudStorageRegexFileSet other) { 682 if (other == com.google.privacy.dlp.v2.CloudStorageRegexFileSet.getDefaultInstance()) 683 return this; 684 if (!other.getBucketName().isEmpty()) { 685 bucketName_ = other.bucketName_; 686 bitField0_ |= 0x00000001; 687 onChanged(); 688 } 689 if (!other.includeRegex_.isEmpty()) { 690 if (includeRegex_.isEmpty()) { 691 includeRegex_ = other.includeRegex_; 692 bitField0_ = (bitField0_ & ~0x00000002); 693 } else { 694 ensureIncludeRegexIsMutable(); 695 includeRegex_.addAll(other.includeRegex_); 696 } 697 onChanged(); 698 } 699 if (!other.excludeRegex_.isEmpty()) { 700 if (excludeRegex_.isEmpty()) { 701 excludeRegex_ = other.excludeRegex_; 702 bitField0_ = (bitField0_ & ~0x00000004); 703 } else { 704 ensureExcludeRegexIsMutable(); 705 excludeRegex_.addAll(other.excludeRegex_); 706 } 707 onChanged(); 708 } 709 this.mergeUnknownFields(other.getUnknownFields()); 710 onChanged(); 711 return this; 712 } 713 714 @java.lang.Override isInitialized()715 public final boolean isInitialized() { 716 return true; 717 } 718 719 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)720 public Builder mergeFrom( 721 com.google.protobuf.CodedInputStream input, 722 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 723 throws java.io.IOException { 724 if (extensionRegistry == null) { 725 throw new java.lang.NullPointerException(); 726 } 727 try { 728 boolean done = false; 729 while (!done) { 730 int tag = input.readTag(); 731 switch (tag) { 732 case 0: 733 done = true; 734 break; 735 case 10: 736 { 737 bucketName_ = input.readStringRequireUtf8(); 738 bitField0_ |= 0x00000001; 739 break; 740 } // case 10 741 case 18: 742 { 743 java.lang.String s = input.readStringRequireUtf8(); 744 ensureIncludeRegexIsMutable(); 745 includeRegex_.add(s); 746 break; 747 } // case 18 748 case 26: 749 { 750 java.lang.String s = input.readStringRequireUtf8(); 751 ensureExcludeRegexIsMutable(); 752 excludeRegex_.add(s); 753 break; 754 } // case 26 755 default: 756 { 757 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 758 done = true; // was an endgroup tag 759 } 760 break; 761 } // default: 762 } // switch (tag) 763 } // while (!done) 764 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 765 throw e.unwrapIOException(); 766 } finally { 767 onChanged(); 768 } // finally 769 return this; 770 } 771 772 private int bitField0_; 773 774 private java.lang.Object bucketName_ = ""; 775 /** 776 * 777 * 778 * <pre> 779 * The name of a Cloud Storage bucket. Required. 780 * </pre> 781 * 782 * <code>string bucket_name = 1;</code> 783 * 784 * @return The bucketName. 785 */ getBucketName()786 public java.lang.String getBucketName() { 787 java.lang.Object ref = bucketName_; 788 if (!(ref instanceof java.lang.String)) { 789 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 790 java.lang.String s = bs.toStringUtf8(); 791 bucketName_ = s; 792 return s; 793 } else { 794 return (java.lang.String) ref; 795 } 796 } 797 /** 798 * 799 * 800 * <pre> 801 * The name of a Cloud Storage bucket. Required. 802 * </pre> 803 * 804 * <code>string bucket_name = 1;</code> 805 * 806 * @return The bytes for bucketName. 807 */ getBucketNameBytes()808 public com.google.protobuf.ByteString getBucketNameBytes() { 809 java.lang.Object ref = bucketName_; 810 if (ref instanceof String) { 811 com.google.protobuf.ByteString b = 812 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 813 bucketName_ = b; 814 return b; 815 } else { 816 return (com.google.protobuf.ByteString) ref; 817 } 818 } 819 /** 820 * 821 * 822 * <pre> 823 * The name of a Cloud Storage bucket. Required. 824 * </pre> 825 * 826 * <code>string bucket_name = 1;</code> 827 * 828 * @param value The bucketName to set. 829 * @return This builder for chaining. 830 */ setBucketName(java.lang.String value)831 public Builder setBucketName(java.lang.String value) { 832 if (value == null) { 833 throw new NullPointerException(); 834 } 835 bucketName_ = value; 836 bitField0_ |= 0x00000001; 837 onChanged(); 838 return this; 839 } 840 /** 841 * 842 * 843 * <pre> 844 * The name of a Cloud Storage bucket. Required. 845 * </pre> 846 * 847 * <code>string bucket_name = 1;</code> 848 * 849 * @return This builder for chaining. 850 */ clearBucketName()851 public Builder clearBucketName() { 852 bucketName_ = getDefaultInstance().getBucketName(); 853 bitField0_ = (bitField0_ & ~0x00000001); 854 onChanged(); 855 return this; 856 } 857 /** 858 * 859 * 860 * <pre> 861 * The name of a Cloud Storage bucket. Required. 862 * </pre> 863 * 864 * <code>string bucket_name = 1;</code> 865 * 866 * @param value The bytes for bucketName to set. 867 * @return This builder for chaining. 868 */ setBucketNameBytes(com.google.protobuf.ByteString value)869 public Builder setBucketNameBytes(com.google.protobuf.ByteString value) { 870 if (value == null) { 871 throw new NullPointerException(); 872 } 873 checkByteStringIsUtf8(value); 874 bucketName_ = value; 875 bitField0_ |= 0x00000001; 876 onChanged(); 877 return this; 878 } 879 880 private com.google.protobuf.LazyStringList includeRegex_ = 881 com.google.protobuf.LazyStringArrayList.EMPTY; 882 ensureIncludeRegexIsMutable()883 private void ensureIncludeRegexIsMutable() { 884 if (!((bitField0_ & 0x00000002) != 0)) { 885 includeRegex_ = new com.google.protobuf.LazyStringArrayList(includeRegex_); 886 bitField0_ |= 0x00000002; 887 } 888 } 889 /** 890 * 891 * 892 * <pre> 893 * A list of regular expressions matching file paths to include. All files in 894 * the bucket that match at least one of these regular expressions will be 895 * included in the set of files, except for those that also match an item in 896 * `exclude_regex`. Leaving this field empty will match all files by default 897 * (this is equivalent to including `.*` in the list). 898 * Regular expressions use RE2 899 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 900 * under the google/re2 repository on GitHub. 901 * </pre> 902 * 903 * <code>repeated string include_regex = 2;</code> 904 * 905 * @return A list containing the includeRegex. 906 */ getIncludeRegexList()907 public com.google.protobuf.ProtocolStringList getIncludeRegexList() { 908 return includeRegex_.getUnmodifiableView(); 909 } 910 /** 911 * 912 * 913 * <pre> 914 * A list of regular expressions matching file paths to include. All files in 915 * the bucket that match at least one of these regular expressions will be 916 * included in the set of files, except for those that also match an item in 917 * `exclude_regex`. Leaving this field empty will match all files by default 918 * (this is equivalent to including `.*` in the list). 919 * Regular expressions use RE2 920 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 921 * under the google/re2 repository on GitHub. 922 * </pre> 923 * 924 * <code>repeated string include_regex = 2;</code> 925 * 926 * @return The count of includeRegex. 927 */ getIncludeRegexCount()928 public int getIncludeRegexCount() { 929 return includeRegex_.size(); 930 } 931 /** 932 * 933 * 934 * <pre> 935 * A list of regular expressions matching file paths to include. All files in 936 * the bucket that match at least one of these regular expressions will be 937 * included in the set of files, except for those that also match an item in 938 * `exclude_regex`. Leaving this field empty will match all files by default 939 * (this is equivalent to including `.*` in the list). 940 * Regular expressions use RE2 941 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 942 * under the google/re2 repository on GitHub. 943 * </pre> 944 * 945 * <code>repeated string include_regex = 2;</code> 946 * 947 * @param index The index of the element to return. 948 * @return The includeRegex at the given index. 949 */ getIncludeRegex(int index)950 public java.lang.String getIncludeRegex(int index) { 951 return includeRegex_.get(index); 952 } 953 /** 954 * 955 * 956 * <pre> 957 * A list of regular expressions matching file paths to include. All files in 958 * the bucket that match at least one of these regular expressions will be 959 * included in the set of files, except for those that also match an item in 960 * `exclude_regex`. Leaving this field empty will match all files by default 961 * (this is equivalent to including `.*` in the list). 962 * Regular expressions use RE2 963 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 964 * under the google/re2 repository on GitHub. 965 * </pre> 966 * 967 * <code>repeated string include_regex = 2;</code> 968 * 969 * @param index The index of the value to return. 970 * @return The bytes of the includeRegex at the given index. 971 */ getIncludeRegexBytes(int index)972 public com.google.protobuf.ByteString getIncludeRegexBytes(int index) { 973 return includeRegex_.getByteString(index); 974 } 975 /** 976 * 977 * 978 * <pre> 979 * A list of regular expressions matching file paths to include. All files in 980 * the bucket that match at least one of these regular expressions will be 981 * included in the set of files, except for those that also match an item in 982 * `exclude_regex`. Leaving this field empty will match all files by default 983 * (this is equivalent to including `.*` in the list). 984 * Regular expressions use RE2 985 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 986 * under the google/re2 repository on GitHub. 987 * </pre> 988 * 989 * <code>repeated string include_regex = 2;</code> 990 * 991 * @param index The index to set the value at. 992 * @param value The includeRegex to set. 993 * @return This builder for chaining. 994 */ setIncludeRegex(int index, java.lang.String value)995 public Builder setIncludeRegex(int index, java.lang.String value) { 996 if (value == null) { 997 throw new NullPointerException(); 998 } 999 ensureIncludeRegexIsMutable(); 1000 includeRegex_.set(index, value); 1001 onChanged(); 1002 return this; 1003 } 1004 /** 1005 * 1006 * 1007 * <pre> 1008 * A list of regular expressions matching file paths to include. All files in 1009 * the bucket that match at least one of these regular expressions will be 1010 * included in the set of files, except for those that also match an item in 1011 * `exclude_regex`. Leaving this field empty will match all files by default 1012 * (this is equivalent to including `.*` in the list). 1013 * Regular expressions use RE2 1014 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 1015 * under the google/re2 repository on GitHub. 1016 * </pre> 1017 * 1018 * <code>repeated string include_regex = 2;</code> 1019 * 1020 * @param value The includeRegex to add. 1021 * @return This builder for chaining. 1022 */ addIncludeRegex(java.lang.String value)1023 public Builder addIncludeRegex(java.lang.String value) { 1024 if (value == null) { 1025 throw new NullPointerException(); 1026 } 1027 ensureIncludeRegexIsMutable(); 1028 includeRegex_.add(value); 1029 onChanged(); 1030 return this; 1031 } 1032 /** 1033 * 1034 * 1035 * <pre> 1036 * A list of regular expressions matching file paths to include. All files in 1037 * the bucket that match at least one of these regular expressions will be 1038 * included in the set of files, except for those that also match an item in 1039 * `exclude_regex`. Leaving this field empty will match all files by default 1040 * (this is equivalent to including `.*` in the list). 1041 * Regular expressions use RE2 1042 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 1043 * under the google/re2 repository on GitHub. 1044 * </pre> 1045 * 1046 * <code>repeated string include_regex = 2;</code> 1047 * 1048 * @param values The includeRegex to add. 1049 * @return This builder for chaining. 1050 */ addAllIncludeRegex(java.lang.Iterable<java.lang.String> values)1051 public Builder addAllIncludeRegex(java.lang.Iterable<java.lang.String> values) { 1052 ensureIncludeRegexIsMutable(); 1053 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, includeRegex_); 1054 onChanged(); 1055 return this; 1056 } 1057 /** 1058 * 1059 * 1060 * <pre> 1061 * A list of regular expressions matching file paths to include. All files in 1062 * the bucket that match at least one of these regular expressions will be 1063 * included in the set of files, except for those that also match an item in 1064 * `exclude_regex`. Leaving this field empty will match all files by default 1065 * (this is equivalent to including `.*` in the list). 1066 * Regular expressions use RE2 1067 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 1068 * under the google/re2 repository on GitHub. 1069 * </pre> 1070 * 1071 * <code>repeated string include_regex = 2;</code> 1072 * 1073 * @return This builder for chaining. 1074 */ clearIncludeRegex()1075 public Builder clearIncludeRegex() { 1076 includeRegex_ = com.google.protobuf.LazyStringArrayList.EMPTY; 1077 bitField0_ = (bitField0_ & ~0x00000002); 1078 onChanged(); 1079 return this; 1080 } 1081 /** 1082 * 1083 * 1084 * <pre> 1085 * A list of regular expressions matching file paths to include. All files in 1086 * the bucket that match at least one of these regular expressions will be 1087 * included in the set of files, except for those that also match an item in 1088 * `exclude_regex`. Leaving this field empty will match all files by default 1089 * (this is equivalent to including `.*` in the list). 1090 * Regular expressions use RE2 1091 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 1092 * under the google/re2 repository on GitHub. 1093 * </pre> 1094 * 1095 * <code>repeated string include_regex = 2;</code> 1096 * 1097 * @param value The bytes of the includeRegex to add. 1098 * @return This builder for chaining. 1099 */ addIncludeRegexBytes(com.google.protobuf.ByteString value)1100 public Builder addIncludeRegexBytes(com.google.protobuf.ByteString value) { 1101 if (value == null) { 1102 throw new NullPointerException(); 1103 } 1104 checkByteStringIsUtf8(value); 1105 ensureIncludeRegexIsMutable(); 1106 includeRegex_.add(value); 1107 onChanged(); 1108 return this; 1109 } 1110 1111 private com.google.protobuf.LazyStringList excludeRegex_ = 1112 com.google.protobuf.LazyStringArrayList.EMPTY; 1113 ensureExcludeRegexIsMutable()1114 private void ensureExcludeRegexIsMutable() { 1115 if (!((bitField0_ & 0x00000004) != 0)) { 1116 excludeRegex_ = new com.google.protobuf.LazyStringArrayList(excludeRegex_); 1117 bitField0_ |= 0x00000004; 1118 } 1119 } 1120 /** 1121 * 1122 * 1123 * <pre> 1124 * A list of regular expressions matching file paths to exclude. All files in 1125 * the bucket that match at least one of these regular expressions will be 1126 * excluded from the scan. 1127 * Regular expressions use RE2 1128 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 1129 * under the google/re2 repository on GitHub. 1130 * </pre> 1131 * 1132 * <code>repeated string exclude_regex = 3;</code> 1133 * 1134 * @return A list containing the excludeRegex. 1135 */ getExcludeRegexList()1136 public com.google.protobuf.ProtocolStringList getExcludeRegexList() { 1137 return excludeRegex_.getUnmodifiableView(); 1138 } 1139 /** 1140 * 1141 * 1142 * <pre> 1143 * A list of regular expressions matching file paths to exclude. All files in 1144 * the bucket that match at least one of these regular expressions will be 1145 * excluded from the scan. 1146 * Regular expressions use RE2 1147 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 1148 * under the google/re2 repository on GitHub. 1149 * </pre> 1150 * 1151 * <code>repeated string exclude_regex = 3;</code> 1152 * 1153 * @return The count of excludeRegex. 1154 */ getExcludeRegexCount()1155 public int getExcludeRegexCount() { 1156 return excludeRegex_.size(); 1157 } 1158 /** 1159 * 1160 * 1161 * <pre> 1162 * A list of regular expressions matching file paths to exclude. All files in 1163 * the bucket that match at least one of these regular expressions will be 1164 * excluded from the scan. 1165 * Regular expressions use RE2 1166 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 1167 * under the google/re2 repository on GitHub. 1168 * </pre> 1169 * 1170 * <code>repeated string exclude_regex = 3;</code> 1171 * 1172 * @param index The index of the element to return. 1173 * @return The excludeRegex at the given index. 1174 */ getExcludeRegex(int index)1175 public java.lang.String getExcludeRegex(int index) { 1176 return excludeRegex_.get(index); 1177 } 1178 /** 1179 * 1180 * 1181 * <pre> 1182 * A list of regular expressions matching file paths to exclude. All files in 1183 * the bucket that match at least one of these regular expressions will be 1184 * excluded from the scan. 1185 * Regular expressions use RE2 1186 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 1187 * under the google/re2 repository on GitHub. 1188 * </pre> 1189 * 1190 * <code>repeated string exclude_regex = 3;</code> 1191 * 1192 * @param index The index of the value to return. 1193 * @return The bytes of the excludeRegex at the given index. 1194 */ getExcludeRegexBytes(int index)1195 public com.google.protobuf.ByteString getExcludeRegexBytes(int index) { 1196 return excludeRegex_.getByteString(index); 1197 } 1198 /** 1199 * 1200 * 1201 * <pre> 1202 * A list of regular expressions matching file paths to exclude. All files in 1203 * the bucket that match at least one of these regular expressions will be 1204 * excluded from the scan. 1205 * Regular expressions use RE2 1206 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 1207 * under the google/re2 repository on GitHub. 1208 * </pre> 1209 * 1210 * <code>repeated string exclude_regex = 3;</code> 1211 * 1212 * @param index The index to set the value at. 1213 * @param value The excludeRegex to set. 1214 * @return This builder for chaining. 1215 */ setExcludeRegex(int index, java.lang.String value)1216 public Builder setExcludeRegex(int index, java.lang.String value) { 1217 if (value == null) { 1218 throw new NullPointerException(); 1219 } 1220 ensureExcludeRegexIsMutable(); 1221 excludeRegex_.set(index, value); 1222 onChanged(); 1223 return this; 1224 } 1225 /** 1226 * 1227 * 1228 * <pre> 1229 * A list of regular expressions matching file paths to exclude. All files in 1230 * the bucket that match at least one of these regular expressions will be 1231 * excluded from the scan. 1232 * Regular expressions use RE2 1233 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 1234 * under the google/re2 repository on GitHub. 1235 * </pre> 1236 * 1237 * <code>repeated string exclude_regex = 3;</code> 1238 * 1239 * @param value The excludeRegex to add. 1240 * @return This builder for chaining. 1241 */ addExcludeRegex(java.lang.String value)1242 public Builder addExcludeRegex(java.lang.String value) { 1243 if (value == null) { 1244 throw new NullPointerException(); 1245 } 1246 ensureExcludeRegexIsMutable(); 1247 excludeRegex_.add(value); 1248 onChanged(); 1249 return this; 1250 } 1251 /** 1252 * 1253 * 1254 * <pre> 1255 * A list of regular expressions matching file paths to exclude. All files in 1256 * the bucket that match at least one of these regular expressions will be 1257 * excluded from the scan. 1258 * Regular expressions use RE2 1259 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 1260 * under the google/re2 repository on GitHub. 1261 * </pre> 1262 * 1263 * <code>repeated string exclude_regex = 3;</code> 1264 * 1265 * @param values The excludeRegex to add. 1266 * @return This builder for chaining. 1267 */ addAllExcludeRegex(java.lang.Iterable<java.lang.String> values)1268 public Builder addAllExcludeRegex(java.lang.Iterable<java.lang.String> values) { 1269 ensureExcludeRegexIsMutable(); 1270 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, excludeRegex_); 1271 onChanged(); 1272 return this; 1273 } 1274 /** 1275 * 1276 * 1277 * <pre> 1278 * A list of regular expressions matching file paths to exclude. All files in 1279 * the bucket that match at least one of these regular expressions will be 1280 * excluded from the scan. 1281 * Regular expressions use RE2 1282 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 1283 * under the google/re2 repository on GitHub. 1284 * </pre> 1285 * 1286 * <code>repeated string exclude_regex = 3;</code> 1287 * 1288 * @return This builder for chaining. 1289 */ clearExcludeRegex()1290 public Builder clearExcludeRegex() { 1291 excludeRegex_ = com.google.protobuf.LazyStringArrayList.EMPTY; 1292 bitField0_ = (bitField0_ & ~0x00000004); 1293 onChanged(); 1294 return this; 1295 } 1296 /** 1297 * 1298 * 1299 * <pre> 1300 * A list of regular expressions matching file paths to exclude. All files in 1301 * the bucket that match at least one of these regular expressions will be 1302 * excluded from the scan. 1303 * Regular expressions use RE2 1304 * [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 1305 * under the google/re2 repository on GitHub. 1306 * </pre> 1307 * 1308 * <code>repeated string exclude_regex = 3;</code> 1309 * 1310 * @param value The bytes of the excludeRegex to add. 1311 * @return This builder for chaining. 1312 */ addExcludeRegexBytes(com.google.protobuf.ByteString value)1313 public Builder addExcludeRegexBytes(com.google.protobuf.ByteString value) { 1314 if (value == null) { 1315 throw new NullPointerException(); 1316 } 1317 checkByteStringIsUtf8(value); 1318 ensureExcludeRegexIsMutable(); 1319 excludeRegex_.add(value); 1320 onChanged(); 1321 return this; 1322 } 1323 1324 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1325 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 1326 return super.setUnknownFields(unknownFields); 1327 } 1328 1329 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1330 public final Builder mergeUnknownFields( 1331 final com.google.protobuf.UnknownFieldSet unknownFields) { 1332 return super.mergeUnknownFields(unknownFields); 1333 } 1334 1335 // @@protoc_insertion_point(builder_scope:google.privacy.dlp.v2.CloudStorageRegexFileSet) 1336 } 1337 1338 // @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CloudStorageRegexFileSet) 1339 private static final com.google.privacy.dlp.v2.CloudStorageRegexFileSet DEFAULT_INSTANCE; 1340 1341 static { 1342 DEFAULT_INSTANCE = new com.google.privacy.dlp.v2.CloudStorageRegexFileSet(); 1343 } 1344 getDefaultInstance()1345 public static com.google.privacy.dlp.v2.CloudStorageRegexFileSet getDefaultInstance() { 1346 return DEFAULT_INSTANCE; 1347 } 1348 1349 private static final com.google.protobuf.Parser<CloudStorageRegexFileSet> PARSER = 1350 new com.google.protobuf.AbstractParser<CloudStorageRegexFileSet>() { 1351 @java.lang.Override 1352 public CloudStorageRegexFileSet parsePartialFrom( 1353 com.google.protobuf.CodedInputStream input, 1354 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1355 throws com.google.protobuf.InvalidProtocolBufferException { 1356 Builder builder = newBuilder(); 1357 try { 1358 builder.mergeFrom(input, extensionRegistry); 1359 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1360 throw e.setUnfinishedMessage(builder.buildPartial()); 1361 } catch (com.google.protobuf.UninitializedMessageException e) { 1362 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 1363 } catch (java.io.IOException e) { 1364 throw new com.google.protobuf.InvalidProtocolBufferException(e) 1365 .setUnfinishedMessage(builder.buildPartial()); 1366 } 1367 return builder.buildPartial(); 1368 } 1369 }; 1370 parser()1371 public static com.google.protobuf.Parser<CloudStorageRegexFileSet> parser() { 1372 return PARSER; 1373 } 1374 1375 @java.lang.Override getParserForType()1376 public com.google.protobuf.Parser<CloudStorageRegexFileSet> getParserForType() { 1377 return PARSER; 1378 } 1379 1380 @java.lang.Override getDefaultInstanceForType()1381 public com.google.privacy.dlp.v2.CloudStorageRegexFileSet getDefaultInstanceForType() { 1382 return DEFAULT_INSTANCE; 1383 } 1384 } 1385