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/cloud/securitycenter/v1/source.proto 18 19 package com.google.cloud.securitycenter.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * Security Command Center finding source. A finding source 26 * is an entity or a mechanism that can produce a finding. A source is like a 27 * container of findings that come from the same scanner, logger, monitor, and 28 * other tools. 29 * </pre> 30 * 31 * Protobuf type {@code google.cloud.securitycenter.v1.Source} 32 */ 33 public final class Source extends com.google.protobuf.GeneratedMessageV3 34 implements 35 // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.Source) 36 SourceOrBuilder { 37 private static final long serialVersionUID = 0L; 38 // Use Source.newBuilder() to construct. Source(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)39 private Source(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 40 super(builder); 41 } 42 Source()43 private Source() { 44 name_ = ""; 45 displayName_ = ""; 46 description_ = ""; 47 canonicalName_ = ""; 48 } 49 50 @java.lang.Override 51 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)52 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 53 return new Source(); 54 } 55 56 @java.lang.Override getUnknownFields()57 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 58 return this.unknownFields; 59 } 60 getDescriptor()61 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 62 return com.google.cloud.securitycenter.v1.SourceOuterClass 63 .internal_static_google_cloud_securitycenter_v1_Source_descriptor; 64 } 65 66 @java.lang.Override 67 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()68 internalGetFieldAccessorTable() { 69 return com.google.cloud.securitycenter.v1.SourceOuterClass 70 .internal_static_google_cloud_securitycenter_v1_Source_fieldAccessorTable 71 .ensureFieldAccessorsInitialized( 72 com.google.cloud.securitycenter.v1.Source.class, 73 com.google.cloud.securitycenter.v1.Source.Builder.class); 74 } 75 76 public static final int NAME_FIELD_NUMBER = 1; 77 78 @SuppressWarnings("serial") 79 private volatile java.lang.Object name_ = ""; 80 /** 81 * 82 * 83 * <pre> 84 * The relative resource name of this source. See: 85 * https://cloud.google.com/apis/design/resource_names#relative_resource_name 86 * Example: 87 * "organizations/{organization_id}/sources/{source_id}" 88 * </pre> 89 * 90 * <code>string name = 1;</code> 91 * 92 * @return The name. 93 */ 94 @java.lang.Override getName()95 public java.lang.String getName() { 96 java.lang.Object ref = name_; 97 if (ref instanceof java.lang.String) { 98 return (java.lang.String) ref; 99 } else { 100 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 101 java.lang.String s = bs.toStringUtf8(); 102 name_ = s; 103 return s; 104 } 105 } 106 /** 107 * 108 * 109 * <pre> 110 * The relative resource name of this source. See: 111 * https://cloud.google.com/apis/design/resource_names#relative_resource_name 112 * Example: 113 * "organizations/{organization_id}/sources/{source_id}" 114 * </pre> 115 * 116 * <code>string name = 1;</code> 117 * 118 * @return The bytes for name. 119 */ 120 @java.lang.Override getNameBytes()121 public com.google.protobuf.ByteString getNameBytes() { 122 java.lang.Object ref = name_; 123 if (ref instanceof java.lang.String) { 124 com.google.protobuf.ByteString b = 125 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 126 name_ = b; 127 return b; 128 } else { 129 return (com.google.protobuf.ByteString) ref; 130 } 131 } 132 133 public static final int DISPLAY_NAME_FIELD_NUMBER = 2; 134 135 @SuppressWarnings("serial") 136 private volatile java.lang.Object displayName_ = ""; 137 /** 138 * 139 * 140 * <pre> 141 * The source's display name. 142 * A source's display name must be unique amongst its siblings, for example, 143 * two sources with the same parent can't share the same display name. 144 * The display name must have a length between 1 and 64 characters 145 * (inclusive). 146 * </pre> 147 * 148 * <code>string display_name = 2;</code> 149 * 150 * @return The displayName. 151 */ 152 @java.lang.Override getDisplayName()153 public java.lang.String getDisplayName() { 154 java.lang.Object ref = displayName_; 155 if (ref instanceof java.lang.String) { 156 return (java.lang.String) ref; 157 } else { 158 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 159 java.lang.String s = bs.toStringUtf8(); 160 displayName_ = s; 161 return s; 162 } 163 } 164 /** 165 * 166 * 167 * <pre> 168 * The source's display name. 169 * A source's display name must be unique amongst its siblings, for example, 170 * two sources with the same parent can't share the same display name. 171 * The display name must have a length between 1 and 64 characters 172 * (inclusive). 173 * </pre> 174 * 175 * <code>string display_name = 2;</code> 176 * 177 * @return The bytes for displayName. 178 */ 179 @java.lang.Override getDisplayNameBytes()180 public com.google.protobuf.ByteString getDisplayNameBytes() { 181 java.lang.Object ref = displayName_; 182 if (ref instanceof java.lang.String) { 183 com.google.protobuf.ByteString b = 184 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 185 displayName_ = b; 186 return b; 187 } else { 188 return (com.google.protobuf.ByteString) ref; 189 } 190 } 191 192 public static final int DESCRIPTION_FIELD_NUMBER = 3; 193 194 @SuppressWarnings("serial") 195 private volatile java.lang.Object description_ = ""; 196 /** 197 * 198 * 199 * <pre> 200 * The description of the source (max of 1024 characters). 201 * Example: 202 * "Web Security Scanner is a web security scanner for common 203 * vulnerabilities in App Engine applications. It can automatically 204 * scan and detect four common vulnerabilities, including cross-site-scripting 205 * (XSS), Flash injection, mixed content (HTTP in HTTPS), and 206 * outdated or insecure libraries." 207 * </pre> 208 * 209 * <code>string description = 3;</code> 210 * 211 * @return The description. 212 */ 213 @java.lang.Override getDescription()214 public java.lang.String getDescription() { 215 java.lang.Object ref = description_; 216 if (ref instanceof java.lang.String) { 217 return (java.lang.String) ref; 218 } else { 219 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 220 java.lang.String s = bs.toStringUtf8(); 221 description_ = s; 222 return s; 223 } 224 } 225 /** 226 * 227 * 228 * <pre> 229 * The description of the source (max of 1024 characters). 230 * Example: 231 * "Web Security Scanner is a web security scanner for common 232 * vulnerabilities in App Engine applications. It can automatically 233 * scan and detect four common vulnerabilities, including cross-site-scripting 234 * (XSS), Flash injection, mixed content (HTTP in HTTPS), and 235 * outdated or insecure libraries." 236 * </pre> 237 * 238 * <code>string description = 3;</code> 239 * 240 * @return The bytes for description. 241 */ 242 @java.lang.Override getDescriptionBytes()243 public com.google.protobuf.ByteString getDescriptionBytes() { 244 java.lang.Object ref = description_; 245 if (ref instanceof java.lang.String) { 246 com.google.protobuf.ByteString b = 247 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 248 description_ = b; 249 return b; 250 } else { 251 return (com.google.protobuf.ByteString) ref; 252 } 253 } 254 255 public static final int CANONICAL_NAME_FIELD_NUMBER = 14; 256 257 @SuppressWarnings("serial") 258 private volatile java.lang.Object canonicalName_ = ""; 259 /** 260 * 261 * 262 * <pre> 263 * The canonical name of the finding. It's either 264 * "organizations/{organization_id}/sources/{source_id}", 265 * "folders/{folder_id}/sources/{source_id}" or 266 * "projects/{project_number}/sources/{source_id}", 267 * depending on the closest CRM ancestor of the resource associated with the 268 * finding. 269 * </pre> 270 * 271 * <code>string canonical_name = 14;</code> 272 * 273 * @return The canonicalName. 274 */ 275 @java.lang.Override getCanonicalName()276 public java.lang.String getCanonicalName() { 277 java.lang.Object ref = canonicalName_; 278 if (ref instanceof java.lang.String) { 279 return (java.lang.String) ref; 280 } else { 281 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 282 java.lang.String s = bs.toStringUtf8(); 283 canonicalName_ = s; 284 return s; 285 } 286 } 287 /** 288 * 289 * 290 * <pre> 291 * The canonical name of the finding. It's either 292 * "organizations/{organization_id}/sources/{source_id}", 293 * "folders/{folder_id}/sources/{source_id}" or 294 * "projects/{project_number}/sources/{source_id}", 295 * depending on the closest CRM ancestor of the resource associated with the 296 * finding. 297 * </pre> 298 * 299 * <code>string canonical_name = 14;</code> 300 * 301 * @return The bytes for canonicalName. 302 */ 303 @java.lang.Override getCanonicalNameBytes()304 public com.google.protobuf.ByteString getCanonicalNameBytes() { 305 java.lang.Object ref = canonicalName_; 306 if (ref instanceof java.lang.String) { 307 com.google.protobuf.ByteString b = 308 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 309 canonicalName_ = b; 310 return b; 311 } else { 312 return (com.google.protobuf.ByteString) ref; 313 } 314 } 315 316 private byte memoizedIsInitialized = -1; 317 318 @java.lang.Override isInitialized()319 public final boolean isInitialized() { 320 byte isInitialized = memoizedIsInitialized; 321 if (isInitialized == 1) return true; 322 if (isInitialized == 0) return false; 323 324 memoizedIsInitialized = 1; 325 return true; 326 } 327 328 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)329 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 330 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { 331 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); 332 } 333 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { 334 com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); 335 } 336 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { 337 com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); 338 } 339 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(canonicalName_)) { 340 com.google.protobuf.GeneratedMessageV3.writeString(output, 14, canonicalName_); 341 } 342 getUnknownFields().writeTo(output); 343 } 344 345 @java.lang.Override getSerializedSize()346 public int getSerializedSize() { 347 int size = memoizedSize; 348 if (size != -1) return size; 349 350 size = 0; 351 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { 352 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); 353 } 354 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { 355 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); 356 } 357 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { 358 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); 359 } 360 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(canonicalName_)) { 361 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, canonicalName_); 362 } 363 size += getUnknownFields().getSerializedSize(); 364 memoizedSize = size; 365 return size; 366 } 367 368 @java.lang.Override equals(final java.lang.Object obj)369 public boolean equals(final java.lang.Object obj) { 370 if (obj == this) { 371 return true; 372 } 373 if (!(obj instanceof com.google.cloud.securitycenter.v1.Source)) { 374 return super.equals(obj); 375 } 376 com.google.cloud.securitycenter.v1.Source other = 377 (com.google.cloud.securitycenter.v1.Source) obj; 378 379 if (!getName().equals(other.getName())) return false; 380 if (!getDisplayName().equals(other.getDisplayName())) return false; 381 if (!getDescription().equals(other.getDescription())) return false; 382 if (!getCanonicalName().equals(other.getCanonicalName())) return false; 383 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 384 return true; 385 } 386 387 @java.lang.Override hashCode()388 public int hashCode() { 389 if (memoizedHashCode != 0) { 390 return memoizedHashCode; 391 } 392 int hash = 41; 393 hash = (19 * hash) + getDescriptor().hashCode(); 394 hash = (37 * hash) + NAME_FIELD_NUMBER; 395 hash = (53 * hash) + getName().hashCode(); 396 hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; 397 hash = (53 * hash) + getDisplayName().hashCode(); 398 hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; 399 hash = (53 * hash) + getDescription().hashCode(); 400 hash = (37 * hash) + CANONICAL_NAME_FIELD_NUMBER; 401 hash = (53 * hash) + getCanonicalName().hashCode(); 402 hash = (29 * hash) + getUnknownFields().hashCode(); 403 memoizedHashCode = hash; 404 return hash; 405 } 406 parseFrom(java.nio.ByteBuffer data)407 public static com.google.cloud.securitycenter.v1.Source parseFrom(java.nio.ByteBuffer data) 408 throws com.google.protobuf.InvalidProtocolBufferException { 409 return PARSER.parseFrom(data); 410 } 411 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)412 public static com.google.cloud.securitycenter.v1.Source parseFrom( 413 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 414 throws com.google.protobuf.InvalidProtocolBufferException { 415 return PARSER.parseFrom(data, extensionRegistry); 416 } 417 parseFrom( com.google.protobuf.ByteString data)418 public static com.google.cloud.securitycenter.v1.Source parseFrom( 419 com.google.protobuf.ByteString data) 420 throws com.google.protobuf.InvalidProtocolBufferException { 421 return PARSER.parseFrom(data); 422 } 423 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)424 public static com.google.cloud.securitycenter.v1.Source parseFrom( 425 com.google.protobuf.ByteString data, 426 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 427 throws com.google.protobuf.InvalidProtocolBufferException { 428 return PARSER.parseFrom(data, extensionRegistry); 429 } 430 parseFrom(byte[] data)431 public static com.google.cloud.securitycenter.v1.Source parseFrom(byte[] data) 432 throws com.google.protobuf.InvalidProtocolBufferException { 433 return PARSER.parseFrom(data); 434 } 435 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)436 public static com.google.cloud.securitycenter.v1.Source parseFrom( 437 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 438 throws com.google.protobuf.InvalidProtocolBufferException { 439 return PARSER.parseFrom(data, extensionRegistry); 440 } 441 parseFrom(java.io.InputStream input)442 public static com.google.cloud.securitycenter.v1.Source parseFrom(java.io.InputStream input) 443 throws java.io.IOException { 444 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 445 } 446 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)447 public static com.google.cloud.securitycenter.v1.Source parseFrom( 448 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 449 throws java.io.IOException { 450 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 451 PARSER, input, extensionRegistry); 452 } 453 parseDelimitedFrom( java.io.InputStream input)454 public static com.google.cloud.securitycenter.v1.Source parseDelimitedFrom( 455 java.io.InputStream input) throws java.io.IOException { 456 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 457 } 458 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)459 public static com.google.cloud.securitycenter.v1.Source parseDelimitedFrom( 460 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 461 throws java.io.IOException { 462 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 463 PARSER, input, extensionRegistry); 464 } 465 parseFrom( com.google.protobuf.CodedInputStream input)466 public static com.google.cloud.securitycenter.v1.Source parseFrom( 467 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 468 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 469 } 470 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)471 public static com.google.cloud.securitycenter.v1.Source parseFrom( 472 com.google.protobuf.CodedInputStream input, 473 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 474 throws java.io.IOException { 475 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 476 PARSER, input, extensionRegistry); 477 } 478 479 @java.lang.Override newBuilderForType()480 public Builder newBuilderForType() { 481 return newBuilder(); 482 } 483 newBuilder()484 public static Builder newBuilder() { 485 return DEFAULT_INSTANCE.toBuilder(); 486 } 487 newBuilder(com.google.cloud.securitycenter.v1.Source prototype)488 public static Builder newBuilder(com.google.cloud.securitycenter.v1.Source prototype) { 489 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 490 } 491 492 @java.lang.Override toBuilder()493 public Builder toBuilder() { 494 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 495 } 496 497 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)498 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 499 Builder builder = new Builder(parent); 500 return builder; 501 } 502 /** 503 * 504 * 505 * <pre> 506 * Security Command Center finding source. A finding source 507 * is an entity or a mechanism that can produce a finding. A source is like a 508 * container of findings that come from the same scanner, logger, monitor, and 509 * other tools. 510 * </pre> 511 * 512 * Protobuf type {@code google.cloud.securitycenter.v1.Source} 513 */ 514 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 515 implements 516 // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.Source) 517 com.google.cloud.securitycenter.v1.SourceOrBuilder { getDescriptor()518 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 519 return com.google.cloud.securitycenter.v1.SourceOuterClass 520 .internal_static_google_cloud_securitycenter_v1_Source_descriptor; 521 } 522 523 @java.lang.Override 524 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()525 internalGetFieldAccessorTable() { 526 return com.google.cloud.securitycenter.v1.SourceOuterClass 527 .internal_static_google_cloud_securitycenter_v1_Source_fieldAccessorTable 528 .ensureFieldAccessorsInitialized( 529 com.google.cloud.securitycenter.v1.Source.class, 530 com.google.cloud.securitycenter.v1.Source.Builder.class); 531 } 532 533 // Construct using com.google.cloud.securitycenter.v1.Source.newBuilder() Builder()534 private Builder() {} 535 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)536 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 537 super(parent); 538 } 539 540 @java.lang.Override clear()541 public Builder clear() { 542 super.clear(); 543 bitField0_ = 0; 544 name_ = ""; 545 displayName_ = ""; 546 description_ = ""; 547 canonicalName_ = ""; 548 return this; 549 } 550 551 @java.lang.Override getDescriptorForType()552 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 553 return com.google.cloud.securitycenter.v1.SourceOuterClass 554 .internal_static_google_cloud_securitycenter_v1_Source_descriptor; 555 } 556 557 @java.lang.Override getDefaultInstanceForType()558 public com.google.cloud.securitycenter.v1.Source getDefaultInstanceForType() { 559 return com.google.cloud.securitycenter.v1.Source.getDefaultInstance(); 560 } 561 562 @java.lang.Override build()563 public com.google.cloud.securitycenter.v1.Source build() { 564 com.google.cloud.securitycenter.v1.Source result = buildPartial(); 565 if (!result.isInitialized()) { 566 throw newUninitializedMessageException(result); 567 } 568 return result; 569 } 570 571 @java.lang.Override buildPartial()572 public com.google.cloud.securitycenter.v1.Source buildPartial() { 573 com.google.cloud.securitycenter.v1.Source result = 574 new com.google.cloud.securitycenter.v1.Source(this); 575 if (bitField0_ != 0) { 576 buildPartial0(result); 577 } 578 onBuilt(); 579 return result; 580 } 581 buildPartial0(com.google.cloud.securitycenter.v1.Source result)582 private void buildPartial0(com.google.cloud.securitycenter.v1.Source result) { 583 int from_bitField0_ = bitField0_; 584 if (((from_bitField0_ & 0x00000001) != 0)) { 585 result.name_ = name_; 586 } 587 if (((from_bitField0_ & 0x00000002) != 0)) { 588 result.displayName_ = displayName_; 589 } 590 if (((from_bitField0_ & 0x00000004) != 0)) { 591 result.description_ = description_; 592 } 593 if (((from_bitField0_ & 0x00000008) != 0)) { 594 result.canonicalName_ = canonicalName_; 595 } 596 } 597 598 @java.lang.Override clone()599 public Builder clone() { 600 return super.clone(); 601 } 602 603 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)604 public Builder setField( 605 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 606 return super.setField(field, value); 607 } 608 609 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)610 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 611 return super.clearField(field); 612 } 613 614 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)615 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 616 return super.clearOneof(oneof); 617 } 618 619 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)620 public Builder setRepeatedField( 621 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 622 return super.setRepeatedField(field, index, value); 623 } 624 625 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)626 public Builder addRepeatedField( 627 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 628 return super.addRepeatedField(field, value); 629 } 630 631 @java.lang.Override mergeFrom(com.google.protobuf.Message other)632 public Builder mergeFrom(com.google.protobuf.Message other) { 633 if (other instanceof com.google.cloud.securitycenter.v1.Source) { 634 return mergeFrom((com.google.cloud.securitycenter.v1.Source) other); 635 } else { 636 super.mergeFrom(other); 637 return this; 638 } 639 } 640 mergeFrom(com.google.cloud.securitycenter.v1.Source other)641 public Builder mergeFrom(com.google.cloud.securitycenter.v1.Source other) { 642 if (other == com.google.cloud.securitycenter.v1.Source.getDefaultInstance()) return this; 643 if (!other.getName().isEmpty()) { 644 name_ = other.name_; 645 bitField0_ |= 0x00000001; 646 onChanged(); 647 } 648 if (!other.getDisplayName().isEmpty()) { 649 displayName_ = other.displayName_; 650 bitField0_ |= 0x00000002; 651 onChanged(); 652 } 653 if (!other.getDescription().isEmpty()) { 654 description_ = other.description_; 655 bitField0_ |= 0x00000004; 656 onChanged(); 657 } 658 if (!other.getCanonicalName().isEmpty()) { 659 canonicalName_ = other.canonicalName_; 660 bitField0_ |= 0x00000008; 661 onChanged(); 662 } 663 this.mergeUnknownFields(other.getUnknownFields()); 664 onChanged(); 665 return this; 666 } 667 668 @java.lang.Override isInitialized()669 public final boolean isInitialized() { 670 return true; 671 } 672 673 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)674 public Builder mergeFrom( 675 com.google.protobuf.CodedInputStream input, 676 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 677 throws java.io.IOException { 678 if (extensionRegistry == null) { 679 throw new java.lang.NullPointerException(); 680 } 681 try { 682 boolean done = false; 683 while (!done) { 684 int tag = input.readTag(); 685 switch (tag) { 686 case 0: 687 done = true; 688 break; 689 case 10: 690 { 691 name_ = input.readStringRequireUtf8(); 692 bitField0_ |= 0x00000001; 693 break; 694 } // case 10 695 case 18: 696 { 697 displayName_ = input.readStringRequireUtf8(); 698 bitField0_ |= 0x00000002; 699 break; 700 } // case 18 701 case 26: 702 { 703 description_ = input.readStringRequireUtf8(); 704 bitField0_ |= 0x00000004; 705 break; 706 } // case 26 707 case 114: 708 { 709 canonicalName_ = input.readStringRequireUtf8(); 710 bitField0_ |= 0x00000008; 711 break; 712 } // case 114 713 default: 714 { 715 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 716 done = true; // was an endgroup tag 717 } 718 break; 719 } // default: 720 } // switch (tag) 721 } // while (!done) 722 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 723 throw e.unwrapIOException(); 724 } finally { 725 onChanged(); 726 } // finally 727 return this; 728 } 729 730 private int bitField0_; 731 732 private java.lang.Object name_ = ""; 733 /** 734 * 735 * 736 * <pre> 737 * The relative resource name of this source. See: 738 * https://cloud.google.com/apis/design/resource_names#relative_resource_name 739 * Example: 740 * "organizations/{organization_id}/sources/{source_id}" 741 * </pre> 742 * 743 * <code>string name = 1;</code> 744 * 745 * @return The name. 746 */ getName()747 public java.lang.String getName() { 748 java.lang.Object ref = name_; 749 if (!(ref instanceof java.lang.String)) { 750 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 751 java.lang.String s = bs.toStringUtf8(); 752 name_ = s; 753 return s; 754 } else { 755 return (java.lang.String) ref; 756 } 757 } 758 /** 759 * 760 * 761 * <pre> 762 * The relative resource name of this source. See: 763 * https://cloud.google.com/apis/design/resource_names#relative_resource_name 764 * Example: 765 * "organizations/{organization_id}/sources/{source_id}" 766 * </pre> 767 * 768 * <code>string name = 1;</code> 769 * 770 * @return The bytes for name. 771 */ getNameBytes()772 public com.google.protobuf.ByteString getNameBytes() { 773 java.lang.Object ref = name_; 774 if (ref instanceof String) { 775 com.google.protobuf.ByteString b = 776 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 777 name_ = b; 778 return b; 779 } else { 780 return (com.google.protobuf.ByteString) ref; 781 } 782 } 783 /** 784 * 785 * 786 * <pre> 787 * The relative resource name of this source. See: 788 * https://cloud.google.com/apis/design/resource_names#relative_resource_name 789 * Example: 790 * "organizations/{organization_id}/sources/{source_id}" 791 * </pre> 792 * 793 * <code>string name = 1;</code> 794 * 795 * @param value The name to set. 796 * @return This builder for chaining. 797 */ setName(java.lang.String value)798 public Builder setName(java.lang.String value) { 799 if (value == null) { 800 throw new NullPointerException(); 801 } 802 name_ = value; 803 bitField0_ |= 0x00000001; 804 onChanged(); 805 return this; 806 } 807 /** 808 * 809 * 810 * <pre> 811 * The relative resource name of this source. See: 812 * https://cloud.google.com/apis/design/resource_names#relative_resource_name 813 * Example: 814 * "organizations/{organization_id}/sources/{source_id}" 815 * </pre> 816 * 817 * <code>string name = 1;</code> 818 * 819 * @return This builder for chaining. 820 */ clearName()821 public Builder clearName() { 822 name_ = getDefaultInstance().getName(); 823 bitField0_ = (bitField0_ & ~0x00000001); 824 onChanged(); 825 return this; 826 } 827 /** 828 * 829 * 830 * <pre> 831 * The relative resource name of this source. See: 832 * https://cloud.google.com/apis/design/resource_names#relative_resource_name 833 * Example: 834 * "organizations/{organization_id}/sources/{source_id}" 835 * </pre> 836 * 837 * <code>string name = 1;</code> 838 * 839 * @param value The bytes for name to set. 840 * @return This builder for chaining. 841 */ setNameBytes(com.google.protobuf.ByteString value)842 public Builder setNameBytes(com.google.protobuf.ByteString value) { 843 if (value == null) { 844 throw new NullPointerException(); 845 } 846 checkByteStringIsUtf8(value); 847 name_ = value; 848 bitField0_ |= 0x00000001; 849 onChanged(); 850 return this; 851 } 852 853 private java.lang.Object displayName_ = ""; 854 /** 855 * 856 * 857 * <pre> 858 * The source's display name. 859 * A source's display name must be unique amongst its siblings, for example, 860 * two sources with the same parent can't share the same display name. 861 * The display name must have a length between 1 and 64 characters 862 * (inclusive). 863 * </pre> 864 * 865 * <code>string display_name = 2;</code> 866 * 867 * @return The displayName. 868 */ getDisplayName()869 public java.lang.String getDisplayName() { 870 java.lang.Object ref = displayName_; 871 if (!(ref instanceof java.lang.String)) { 872 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 873 java.lang.String s = bs.toStringUtf8(); 874 displayName_ = s; 875 return s; 876 } else { 877 return (java.lang.String) ref; 878 } 879 } 880 /** 881 * 882 * 883 * <pre> 884 * The source's display name. 885 * A source's display name must be unique amongst its siblings, for example, 886 * two sources with the same parent can't share the same display name. 887 * The display name must have a length between 1 and 64 characters 888 * (inclusive). 889 * </pre> 890 * 891 * <code>string display_name = 2;</code> 892 * 893 * @return The bytes for displayName. 894 */ getDisplayNameBytes()895 public com.google.protobuf.ByteString getDisplayNameBytes() { 896 java.lang.Object ref = displayName_; 897 if (ref instanceof String) { 898 com.google.protobuf.ByteString b = 899 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 900 displayName_ = b; 901 return b; 902 } else { 903 return (com.google.protobuf.ByteString) ref; 904 } 905 } 906 /** 907 * 908 * 909 * <pre> 910 * The source's display name. 911 * A source's display name must be unique amongst its siblings, for example, 912 * two sources with the same parent can't share the same display name. 913 * The display name must have a length between 1 and 64 characters 914 * (inclusive). 915 * </pre> 916 * 917 * <code>string display_name = 2;</code> 918 * 919 * @param value The displayName to set. 920 * @return This builder for chaining. 921 */ setDisplayName(java.lang.String value)922 public Builder setDisplayName(java.lang.String value) { 923 if (value == null) { 924 throw new NullPointerException(); 925 } 926 displayName_ = value; 927 bitField0_ |= 0x00000002; 928 onChanged(); 929 return this; 930 } 931 /** 932 * 933 * 934 * <pre> 935 * The source's display name. 936 * A source's display name must be unique amongst its siblings, for example, 937 * two sources with the same parent can't share the same display name. 938 * The display name must have a length between 1 and 64 characters 939 * (inclusive). 940 * </pre> 941 * 942 * <code>string display_name = 2;</code> 943 * 944 * @return This builder for chaining. 945 */ clearDisplayName()946 public Builder clearDisplayName() { 947 displayName_ = getDefaultInstance().getDisplayName(); 948 bitField0_ = (bitField0_ & ~0x00000002); 949 onChanged(); 950 return this; 951 } 952 /** 953 * 954 * 955 * <pre> 956 * The source's display name. 957 * A source's display name must be unique amongst its siblings, for example, 958 * two sources with the same parent can't share the same display name. 959 * The display name must have a length between 1 and 64 characters 960 * (inclusive). 961 * </pre> 962 * 963 * <code>string display_name = 2;</code> 964 * 965 * @param value The bytes for displayName to set. 966 * @return This builder for chaining. 967 */ setDisplayNameBytes(com.google.protobuf.ByteString value)968 public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { 969 if (value == null) { 970 throw new NullPointerException(); 971 } 972 checkByteStringIsUtf8(value); 973 displayName_ = value; 974 bitField0_ |= 0x00000002; 975 onChanged(); 976 return this; 977 } 978 979 private java.lang.Object description_ = ""; 980 /** 981 * 982 * 983 * <pre> 984 * The description of the source (max of 1024 characters). 985 * Example: 986 * "Web Security Scanner is a web security scanner for common 987 * vulnerabilities in App Engine applications. It can automatically 988 * scan and detect four common vulnerabilities, including cross-site-scripting 989 * (XSS), Flash injection, mixed content (HTTP in HTTPS), and 990 * outdated or insecure libraries." 991 * </pre> 992 * 993 * <code>string description = 3;</code> 994 * 995 * @return The description. 996 */ getDescription()997 public java.lang.String getDescription() { 998 java.lang.Object ref = description_; 999 if (!(ref instanceof java.lang.String)) { 1000 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1001 java.lang.String s = bs.toStringUtf8(); 1002 description_ = s; 1003 return s; 1004 } else { 1005 return (java.lang.String) ref; 1006 } 1007 } 1008 /** 1009 * 1010 * 1011 * <pre> 1012 * The description of the source (max of 1024 characters). 1013 * Example: 1014 * "Web Security Scanner is a web security scanner for common 1015 * vulnerabilities in App Engine applications. It can automatically 1016 * scan and detect four common vulnerabilities, including cross-site-scripting 1017 * (XSS), Flash injection, mixed content (HTTP in HTTPS), and 1018 * outdated or insecure libraries." 1019 * </pre> 1020 * 1021 * <code>string description = 3;</code> 1022 * 1023 * @return The bytes for description. 1024 */ getDescriptionBytes()1025 public com.google.protobuf.ByteString getDescriptionBytes() { 1026 java.lang.Object ref = description_; 1027 if (ref instanceof String) { 1028 com.google.protobuf.ByteString b = 1029 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1030 description_ = b; 1031 return b; 1032 } else { 1033 return (com.google.protobuf.ByteString) ref; 1034 } 1035 } 1036 /** 1037 * 1038 * 1039 * <pre> 1040 * The description of the source (max of 1024 characters). 1041 * Example: 1042 * "Web Security Scanner is a web security scanner for common 1043 * vulnerabilities in App Engine applications. It can automatically 1044 * scan and detect four common vulnerabilities, including cross-site-scripting 1045 * (XSS), Flash injection, mixed content (HTTP in HTTPS), and 1046 * outdated or insecure libraries." 1047 * </pre> 1048 * 1049 * <code>string description = 3;</code> 1050 * 1051 * @param value The description to set. 1052 * @return This builder for chaining. 1053 */ setDescription(java.lang.String value)1054 public Builder setDescription(java.lang.String value) { 1055 if (value == null) { 1056 throw new NullPointerException(); 1057 } 1058 description_ = value; 1059 bitField0_ |= 0x00000004; 1060 onChanged(); 1061 return this; 1062 } 1063 /** 1064 * 1065 * 1066 * <pre> 1067 * The description of the source (max of 1024 characters). 1068 * Example: 1069 * "Web Security Scanner is a web security scanner for common 1070 * vulnerabilities in App Engine applications. It can automatically 1071 * scan and detect four common vulnerabilities, including cross-site-scripting 1072 * (XSS), Flash injection, mixed content (HTTP in HTTPS), and 1073 * outdated or insecure libraries." 1074 * </pre> 1075 * 1076 * <code>string description = 3;</code> 1077 * 1078 * @return This builder for chaining. 1079 */ clearDescription()1080 public Builder clearDescription() { 1081 description_ = getDefaultInstance().getDescription(); 1082 bitField0_ = (bitField0_ & ~0x00000004); 1083 onChanged(); 1084 return this; 1085 } 1086 /** 1087 * 1088 * 1089 * <pre> 1090 * The description of the source (max of 1024 characters). 1091 * Example: 1092 * "Web Security Scanner is a web security scanner for common 1093 * vulnerabilities in App Engine applications. It can automatically 1094 * scan and detect four common vulnerabilities, including cross-site-scripting 1095 * (XSS), Flash injection, mixed content (HTTP in HTTPS), and 1096 * outdated or insecure libraries." 1097 * </pre> 1098 * 1099 * <code>string description = 3;</code> 1100 * 1101 * @param value The bytes for description to set. 1102 * @return This builder for chaining. 1103 */ setDescriptionBytes(com.google.protobuf.ByteString value)1104 public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { 1105 if (value == null) { 1106 throw new NullPointerException(); 1107 } 1108 checkByteStringIsUtf8(value); 1109 description_ = value; 1110 bitField0_ |= 0x00000004; 1111 onChanged(); 1112 return this; 1113 } 1114 1115 private java.lang.Object canonicalName_ = ""; 1116 /** 1117 * 1118 * 1119 * <pre> 1120 * The canonical name of the finding. It's either 1121 * "organizations/{organization_id}/sources/{source_id}", 1122 * "folders/{folder_id}/sources/{source_id}" or 1123 * "projects/{project_number}/sources/{source_id}", 1124 * depending on the closest CRM ancestor of the resource associated with the 1125 * finding. 1126 * </pre> 1127 * 1128 * <code>string canonical_name = 14;</code> 1129 * 1130 * @return The canonicalName. 1131 */ getCanonicalName()1132 public java.lang.String getCanonicalName() { 1133 java.lang.Object ref = canonicalName_; 1134 if (!(ref instanceof java.lang.String)) { 1135 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1136 java.lang.String s = bs.toStringUtf8(); 1137 canonicalName_ = s; 1138 return s; 1139 } else { 1140 return (java.lang.String) ref; 1141 } 1142 } 1143 /** 1144 * 1145 * 1146 * <pre> 1147 * The canonical name of the finding. It's either 1148 * "organizations/{organization_id}/sources/{source_id}", 1149 * "folders/{folder_id}/sources/{source_id}" or 1150 * "projects/{project_number}/sources/{source_id}", 1151 * depending on the closest CRM ancestor of the resource associated with the 1152 * finding. 1153 * </pre> 1154 * 1155 * <code>string canonical_name = 14;</code> 1156 * 1157 * @return The bytes for canonicalName. 1158 */ getCanonicalNameBytes()1159 public com.google.protobuf.ByteString getCanonicalNameBytes() { 1160 java.lang.Object ref = canonicalName_; 1161 if (ref instanceof String) { 1162 com.google.protobuf.ByteString b = 1163 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1164 canonicalName_ = b; 1165 return b; 1166 } else { 1167 return (com.google.protobuf.ByteString) ref; 1168 } 1169 } 1170 /** 1171 * 1172 * 1173 * <pre> 1174 * The canonical name of the finding. It's either 1175 * "organizations/{organization_id}/sources/{source_id}", 1176 * "folders/{folder_id}/sources/{source_id}" or 1177 * "projects/{project_number}/sources/{source_id}", 1178 * depending on the closest CRM ancestor of the resource associated with the 1179 * finding. 1180 * </pre> 1181 * 1182 * <code>string canonical_name = 14;</code> 1183 * 1184 * @param value The canonicalName to set. 1185 * @return This builder for chaining. 1186 */ setCanonicalName(java.lang.String value)1187 public Builder setCanonicalName(java.lang.String value) { 1188 if (value == null) { 1189 throw new NullPointerException(); 1190 } 1191 canonicalName_ = value; 1192 bitField0_ |= 0x00000008; 1193 onChanged(); 1194 return this; 1195 } 1196 /** 1197 * 1198 * 1199 * <pre> 1200 * The canonical name of the finding. It's either 1201 * "organizations/{organization_id}/sources/{source_id}", 1202 * "folders/{folder_id}/sources/{source_id}" or 1203 * "projects/{project_number}/sources/{source_id}", 1204 * depending on the closest CRM ancestor of the resource associated with the 1205 * finding. 1206 * </pre> 1207 * 1208 * <code>string canonical_name = 14;</code> 1209 * 1210 * @return This builder for chaining. 1211 */ clearCanonicalName()1212 public Builder clearCanonicalName() { 1213 canonicalName_ = getDefaultInstance().getCanonicalName(); 1214 bitField0_ = (bitField0_ & ~0x00000008); 1215 onChanged(); 1216 return this; 1217 } 1218 /** 1219 * 1220 * 1221 * <pre> 1222 * The canonical name of the finding. It's either 1223 * "organizations/{organization_id}/sources/{source_id}", 1224 * "folders/{folder_id}/sources/{source_id}" or 1225 * "projects/{project_number}/sources/{source_id}", 1226 * depending on the closest CRM ancestor of the resource associated with the 1227 * finding. 1228 * </pre> 1229 * 1230 * <code>string canonical_name = 14;</code> 1231 * 1232 * @param value The bytes for canonicalName to set. 1233 * @return This builder for chaining. 1234 */ setCanonicalNameBytes(com.google.protobuf.ByteString value)1235 public Builder setCanonicalNameBytes(com.google.protobuf.ByteString value) { 1236 if (value == null) { 1237 throw new NullPointerException(); 1238 } 1239 checkByteStringIsUtf8(value); 1240 canonicalName_ = value; 1241 bitField0_ |= 0x00000008; 1242 onChanged(); 1243 return this; 1244 } 1245 1246 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1247 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 1248 return super.setUnknownFields(unknownFields); 1249 } 1250 1251 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1252 public final Builder mergeUnknownFields( 1253 final com.google.protobuf.UnknownFieldSet unknownFields) { 1254 return super.mergeUnknownFields(unknownFields); 1255 } 1256 1257 // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1.Source) 1258 } 1259 1260 // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.Source) 1261 private static final com.google.cloud.securitycenter.v1.Source DEFAULT_INSTANCE; 1262 1263 static { 1264 DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.Source(); 1265 } 1266 getDefaultInstance()1267 public static com.google.cloud.securitycenter.v1.Source getDefaultInstance() { 1268 return DEFAULT_INSTANCE; 1269 } 1270 1271 private static final com.google.protobuf.Parser<Source> PARSER = 1272 new com.google.protobuf.AbstractParser<Source>() { 1273 @java.lang.Override 1274 public Source parsePartialFrom( 1275 com.google.protobuf.CodedInputStream input, 1276 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1277 throws com.google.protobuf.InvalidProtocolBufferException { 1278 Builder builder = newBuilder(); 1279 try { 1280 builder.mergeFrom(input, extensionRegistry); 1281 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1282 throw e.setUnfinishedMessage(builder.buildPartial()); 1283 } catch (com.google.protobuf.UninitializedMessageException e) { 1284 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 1285 } catch (java.io.IOException e) { 1286 throw new com.google.protobuf.InvalidProtocolBufferException(e) 1287 .setUnfinishedMessage(builder.buildPartial()); 1288 } 1289 return builder.buildPartial(); 1290 } 1291 }; 1292 parser()1293 public static com.google.protobuf.Parser<Source> parser() { 1294 return PARSER; 1295 } 1296 1297 @java.lang.Override getParserForType()1298 public com.google.protobuf.Parser<Source> getParserForType() { 1299 return PARSER; 1300 } 1301 1302 @java.lang.Override getDefaultInstanceForType()1303 public com.google.cloud.securitycenter.v1.Source getDefaultInstanceForType() { 1304 return DEFAULT_INSTANCE; 1305 } 1306 } 1307