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/compute/v1/compute.proto 18 19 package com.google.cloud.compute.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * The authentication and authorization settings for a BackendService. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.compute.v1.SecuritySettings} 29 */ 30 public final class SecuritySettings extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.compute.v1.SecuritySettings) 33 SecuritySettingsOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use SecuritySettings.newBuilder() to construct. SecuritySettings(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private SecuritySettings(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 SecuritySettings()40 private SecuritySettings() { 41 clientTlsPolicy_ = ""; 42 subjectAltNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; 43 } 44 45 @java.lang.Override 46 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)47 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 48 return new SecuritySettings(); 49 } 50 51 @java.lang.Override getUnknownFields()52 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 53 return this.unknownFields; 54 } 55 getDescriptor()56 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 57 return com.google.cloud.compute.v1.Compute 58 .internal_static_google_cloud_compute_v1_SecuritySettings_descriptor; 59 } 60 61 @java.lang.Override 62 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()63 internalGetFieldAccessorTable() { 64 return com.google.cloud.compute.v1.Compute 65 .internal_static_google_cloud_compute_v1_SecuritySettings_fieldAccessorTable 66 .ensureFieldAccessorsInitialized( 67 com.google.cloud.compute.v1.SecuritySettings.class, 68 com.google.cloud.compute.v1.SecuritySettings.Builder.class); 69 } 70 71 private int bitField0_; 72 public static final int CLIENT_TLS_POLICY_FIELD_NUMBER = 462325226; 73 74 @SuppressWarnings("serial") 75 private volatile java.lang.Object clientTlsPolicy_ = ""; 76 /** 77 * 78 * 79 * <pre> 80 * Optional. A URL referring to a networksecurity.ClientTlsPolicy resource that describes how clients should authenticate with this service's backends. clientTlsPolicy only applies to a global BackendService with the loadBalancingScheme set to INTERNAL_SELF_MANAGED. If left blank, communications are not encrypted. Note: This field currently has no impact. 81 * </pre> 82 * 83 * <code>optional string client_tls_policy = 462325226;</code> 84 * 85 * @return Whether the clientTlsPolicy field is set. 86 */ 87 @java.lang.Override hasClientTlsPolicy()88 public boolean hasClientTlsPolicy() { 89 return ((bitField0_ & 0x00000001) != 0); 90 } 91 /** 92 * 93 * 94 * <pre> 95 * Optional. A URL referring to a networksecurity.ClientTlsPolicy resource that describes how clients should authenticate with this service's backends. clientTlsPolicy only applies to a global BackendService with the loadBalancingScheme set to INTERNAL_SELF_MANAGED. If left blank, communications are not encrypted. Note: This field currently has no impact. 96 * </pre> 97 * 98 * <code>optional string client_tls_policy = 462325226;</code> 99 * 100 * @return The clientTlsPolicy. 101 */ 102 @java.lang.Override getClientTlsPolicy()103 public java.lang.String getClientTlsPolicy() { 104 java.lang.Object ref = clientTlsPolicy_; 105 if (ref instanceof java.lang.String) { 106 return (java.lang.String) ref; 107 } else { 108 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 109 java.lang.String s = bs.toStringUtf8(); 110 clientTlsPolicy_ = s; 111 return s; 112 } 113 } 114 /** 115 * 116 * 117 * <pre> 118 * Optional. A URL referring to a networksecurity.ClientTlsPolicy resource that describes how clients should authenticate with this service's backends. clientTlsPolicy only applies to a global BackendService with the loadBalancingScheme set to INTERNAL_SELF_MANAGED. If left blank, communications are not encrypted. Note: This field currently has no impact. 119 * </pre> 120 * 121 * <code>optional string client_tls_policy = 462325226;</code> 122 * 123 * @return The bytes for clientTlsPolicy. 124 */ 125 @java.lang.Override getClientTlsPolicyBytes()126 public com.google.protobuf.ByteString getClientTlsPolicyBytes() { 127 java.lang.Object ref = clientTlsPolicy_; 128 if (ref instanceof java.lang.String) { 129 com.google.protobuf.ByteString b = 130 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 131 clientTlsPolicy_ = b; 132 return b; 133 } else { 134 return (com.google.protobuf.ByteString) ref; 135 } 136 } 137 138 public static final int SUBJECT_ALT_NAMES_FIELD_NUMBER = 330029535; 139 140 @SuppressWarnings("serial") 141 private com.google.protobuf.LazyStringList subjectAltNames_; 142 /** 143 * 144 * 145 * <pre> 146 * Optional. A list of Subject Alternative Names (SANs) that the client verifies during a mutual TLS handshake with an server/endpoint for this BackendService. When the server presents its X.509 certificate to the client, the client inspects the certificate's subjectAltName field. If the field contains one of the specified values, the communication continues. Otherwise, it fails. This additional check enables the client to verify that the server is authorized to run the requested service. Note that the contents of the server certificate's subjectAltName field are configured by the Public Key Infrastructure which provisions server identities. Only applies to a global BackendService with loadBalancingScheme set to INTERNAL_SELF_MANAGED. Only applies when BackendService has an attached clientTlsPolicy with clientCertificate (mTLS mode). Note: This field currently has no impact. 147 * </pre> 148 * 149 * <code>repeated string subject_alt_names = 330029535;</code> 150 * 151 * @return A list containing the subjectAltNames. 152 */ getSubjectAltNamesList()153 public com.google.protobuf.ProtocolStringList getSubjectAltNamesList() { 154 return subjectAltNames_; 155 } 156 /** 157 * 158 * 159 * <pre> 160 * Optional. A list of Subject Alternative Names (SANs) that the client verifies during a mutual TLS handshake with an server/endpoint for this BackendService. When the server presents its X.509 certificate to the client, the client inspects the certificate's subjectAltName field. If the field contains one of the specified values, the communication continues. Otherwise, it fails. This additional check enables the client to verify that the server is authorized to run the requested service. Note that the contents of the server certificate's subjectAltName field are configured by the Public Key Infrastructure which provisions server identities. Only applies to a global BackendService with loadBalancingScheme set to INTERNAL_SELF_MANAGED. Only applies when BackendService has an attached clientTlsPolicy with clientCertificate (mTLS mode). Note: This field currently has no impact. 161 * </pre> 162 * 163 * <code>repeated string subject_alt_names = 330029535;</code> 164 * 165 * @return The count of subjectAltNames. 166 */ getSubjectAltNamesCount()167 public int getSubjectAltNamesCount() { 168 return subjectAltNames_.size(); 169 } 170 /** 171 * 172 * 173 * <pre> 174 * Optional. A list of Subject Alternative Names (SANs) that the client verifies during a mutual TLS handshake with an server/endpoint for this BackendService. When the server presents its X.509 certificate to the client, the client inspects the certificate's subjectAltName field. If the field contains one of the specified values, the communication continues. Otherwise, it fails. This additional check enables the client to verify that the server is authorized to run the requested service. Note that the contents of the server certificate's subjectAltName field are configured by the Public Key Infrastructure which provisions server identities. Only applies to a global BackendService with loadBalancingScheme set to INTERNAL_SELF_MANAGED. Only applies when BackendService has an attached clientTlsPolicy with clientCertificate (mTLS mode). Note: This field currently has no impact. 175 * </pre> 176 * 177 * <code>repeated string subject_alt_names = 330029535;</code> 178 * 179 * @param index The index of the element to return. 180 * @return The subjectAltNames at the given index. 181 */ getSubjectAltNames(int index)182 public java.lang.String getSubjectAltNames(int index) { 183 return subjectAltNames_.get(index); 184 } 185 /** 186 * 187 * 188 * <pre> 189 * Optional. A list of Subject Alternative Names (SANs) that the client verifies during a mutual TLS handshake with an server/endpoint for this BackendService. When the server presents its X.509 certificate to the client, the client inspects the certificate's subjectAltName field. If the field contains one of the specified values, the communication continues. Otherwise, it fails. This additional check enables the client to verify that the server is authorized to run the requested service. Note that the contents of the server certificate's subjectAltName field are configured by the Public Key Infrastructure which provisions server identities. Only applies to a global BackendService with loadBalancingScheme set to INTERNAL_SELF_MANAGED. Only applies when BackendService has an attached clientTlsPolicy with clientCertificate (mTLS mode). Note: This field currently has no impact. 190 * </pre> 191 * 192 * <code>repeated string subject_alt_names = 330029535;</code> 193 * 194 * @param index The index of the value to return. 195 * @return The bytes of the subjectAltNames at the given index. 196 */ getSubjectAltNamesBytes(int index)197 public com.google.protobuf.ByteString getSubjectAltNamesBytes(int index) { 198 return subjectAltNames_.getByteString(index); 199 } 200 201 private byte memoizedIsInitialized = -1; 202 203 @java.lang.Override isInitialized()204 public final boolean isInitialized() { 205 byte isInitialized = memoizedIsInitialized; 206 if (isInitialized == 1) return true; 207 if (isInitialized == 0) return false; 208 209 memoizedIsInitialized = 1; 210 return true; 211 } 212 213 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)214 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 215 for (int i = 0; i < subjectAltNames_.size(); i++) { 216 com.google.protobuf.GeneratedMessageV3.writeString( 217 output, 330029535, subjectAltNames_.getRaw(i)); 218 } 219 if (((bitField0_ & 0x00000001) != 0)) { 220 com.google.protobuf.GeneratedMessageV3.writeString(output, 462325226, clientTlsPolicy_); 221 } 222 getUnknownFields().writeTo(output); 223 } 224 225 @java.lang.Override getSerializedSize()226 public int getSerializedSize() { 227 int size = memoizedSize; 228 if (size != -1) return size; 229 230 size = 0; 231 { 232 int dataSize = 0; 233 for (int i = 0; i < subjectAltNames_.size(); i++) { 234 dataSize += computeStringSizeNoTag(subjectAltNames_.getRaw(i)); 235 } 236 size += dataSize; 237 size += 5 * getSubjectAltNamesList().size(); 238 } 239 if (((bitField0_ & 0x00000001) != 0)) { 240 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(462325226, clientTlsPolicy_); 241 } 242 size += getUnknownFields().getSerializedSize(); 243 memoizedSize = size; 244 return size; 245 } 246 247 @java.lang.Override equals(final java.lang.Object obj)248 public boolean equals(final java.lang.Object obj) { 249 if (obj == this) { 250 return true; 251 } 252 if (!(obj instanceof com.google.cloud.compute.v1.SecuritySettings)) { 253 return super.equals(obj); 254 } 255 com.google.cloud.compute.v1.SecuritySettings other = 256 (com.google.cloud.compute.v1.SecuritySettings) obj; 257 258 if (hasClientTlsPolicy() != other.hasClientTlsPolicy()) return false; 259 if (hasClientTlsPolicy()) { 260 if (!getClientTlsPolicy().equals(other.getClientTlsPolicy())) return false; 261 } 262 if (!getSubjectAltNamesList().equals(other.getSubjectAltNamesList())) return false; 263 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 264 return true; 265 } 266 267 @java.lang.Override hashCode()268 public int hashCode() { 269 if (memoizedHashCode != 0) { 270 return memoizedHashCode; 271 } 272 int hash = 41; 273 hash = (19 * hash) + getDescriptor().hashCode(); 274 if (hasClientTlsPolicy()) { 275 hash = (37 * hash) + CLIENT_TLS_POLICY_FIELD_NUMBER; 276 hash = (53 * hash) + getClientTlsPolicy().hashCode(); 277 } 278 if (getSubjectAltNamesCount() > 0) { 279 hash = (37 * hash) + SUBJECT_ALT_NAMES_FIELD_NUMBER; 280 hash = (53 * hash) + getSubjectAltNamesList().hashCode(); 281 } 282 hash = (29 * hash) + getUnknownFields().hashCode(); 283 memoizedHashCode = hash; 284 return hash; 285 } 286 parseFrom(java.nio.ByteBuffer data)287 public static com.google.cloud.compute.v1.SecuritySettings parseFrom(java.nio.ByteBuffer data) 288 throws com.google.protobuf.InvalidProtocolBufferException { 289 return PARSER.parseFrom(data); 290 } 291 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)292 public static com.google.cloud.compute.v1.SecuritySettings parseFrom( 293 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 294 throws com.google.protobuf.InvalidProtocolBufferException { 295 return PARSER.parseFrom(data, extensionRegistry); 296 } 297 parseFrom( com.google.protobuf.ByteString data)298 public static com.google.cloud.compute.v1.SecuritySettings parseFrom( 299 com.google.protobuf.ByteString data) 300 throws com.google.protobuf.InvalidProtocolBufferException { 301 return PARSER.parseFrom(data); 302 } 303 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)304 public static com.google.cloud.compute.v1.SecuritySettings parseFrom( 305 com.google.protobuf.ByteString data, 306 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 307 throws com.google.protobuf.InvalidProtocolBufferException { 308 return PARSER.parseFrom(data, extensionRegistry); 309 } 310 parseFrom(byte[] data)311 public static com.google.cloud.compute.v1.SecuritySettings parseFrom(byte[] data) 312 throws com.google.protobuf.InvalidProtocolBufferException { 313 return PARSER.parseFrom(data); 314 } 315 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)316 public static com.google.cloud.compute.v1.SecuritySettings parseFrom( 317 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 318 throws com.google.protobuf.InvalidProtocolBufferException { 319 return PARSER.parseFrom(data, extensionRegistry); 320 } 321 parseFrom(java.io.InputStream input)322 public static com.google.cloud.compute.v1.SecuritySettings parseFrom(java.io.InputStream input) 323 throws java.io.IOException { 324 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 325 } 326 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)327 public static com.google.cloud.compute.v1.SecuritySettings parseFrom( 328 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 329 throws java.io.IOException { 330 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 331 PARSER, input, extensionRegistry); 332 } 333 parseDelimitedFrom( java.io.InputStream input)334 public static com.google.cloud.compute.v1.SecuritySettings parseDelimitedFrom( 335 java.io.InputStream input) throws java.io.IOException { 336 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 337 } 338 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)339 public static com.google.cloud.compute.v1.SecuritySettings parseDelimitedFrom( 340 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 341 throws java.io.IOException { 342 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 343 PARSER, input, extensionRegistry); 344 } 345 parseFrom( com.google.protobuf.CodedInputStream input)346 public static com.google.cloud.compute.v1.SecuritySettings parseFrom( 347 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 348 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 349 } 350 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)351 public static com.google.cloud.compute.v1.SecuritySettings parseFrom( 352 com.google.protobuf.CodedInputStream input, 353 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 354 throws java.io.IOException { 355 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 356 PARSER, input, extensionRegistry); 357 } 358 359 @java.lang.Override newBuilderForType()360 public Builder newBuilderForType() { 361 return newBuilder(); 362 } 363 newBuilder()364 public static Builder newBuilder() { 365 return DEFAULT_INSTANCE.toBuilder(); 366 } 367 newBuilder(com.google.cloud.compute.v1.SecuritySettings prototype)368 public static Builder newBuilder(com.google.cloud.compute.v1.SecuritySettings prototype) { 369 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 370 } 371 372 @java.lang.Override toBuilder()373 public Builder toBuilder() { 374 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 375 } 376 377 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)378 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 379 Builder builder = new Builder(parent); 380 return builder; 381 } 382 /** 383 * 384 * 385 * <pre> 386 * The authentication and authorization settings for a BackendService. 387 * </pre> 388 * 389 * Protobuf type {@code google.cloud.compute.v1.SecuritySettings} 390 */ 391 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 392 implements 393 // @@protoc_insertion_point(builder_implements:google.cloud.compute.v1.SecuritySettings) 394 com.google.cloud.compute.v1.SecuritySettingsOrBuilder { getDescriptor()395 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 396 return com.google.cloud.compute.v1.Compute 397 .internal_static_google_cloud_compute_v1_SecuritySettings_descriptor; 398 } 399 400 @java.lang.Override 401 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()402 internalGetFieldAccessorTable() { 403 return com.google.cloud.compute.v1.Compute 404 .internal_static_google_cloud_compute_v1_SecuritySettings_fieldAccessorTable 405 .ensureFieldAccessorsInitialized( 406 com.google.cloud.compute.v1.SecuritySettings.class, 407 com.google.cloud.compute.v1.SecuritySettings.Builder.class); 408 } 409 410 // Construct using com.google.cloud.compute.v1.SecuritySettings.newBuilder() Builder()411 private Builder() {} 412 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)413 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 414 super(parent); 415 } 416 417 @java.lang.Override clear()418 public Builder clear() { 419 super.clear(); 420 bitField0_ = 0; 421 clientTlsPolicy_ = ""; 422 subjectAltNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; 423 bitField0_ = (bitField0_ & ~0x00000002); 424 return this; 425 } 426 427 @java.lang.Override getDescriptorForType()428 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 429 return com.google.cloud.compute.v1.Compute 430 .internal_static_google_cloud_compute_v1_SecuritySettings_descriptor; 431 } 432 433 @java.lang.Override getDefaultInstanceForType()434 public com.google.cloud.compute.v1.SecuritySettings getDefaultInstanceForType() { 435 return com.google.cloud.compute.v1.SecuritySettings.getDefaultInstance(); 436 } 437 438 @java.lang.Override build()439 public com.google.cloud.compute.v1.SecuritySettings build() { 440 com.google.cloud.compute.v1.SecuritySettings result = buildPartial(); 441 if (!result.isInitialized()) { 442 throw newUninitializedMessageException(result); 443 } 444 return result; 445 } 446 447 @java.lang.Override buildPartial()448 public com.google.cloud.compute.v1.SecuritySettings buildPartial() { 449 com.google.cloud.compute.v1.SecuritySettings result = 450 new com.google.cloud.compute.v1.SecuritySettings(this); 451 buildPartialRepeatedFields(result); 452 if (bitField0_ != 0) { 453 buildPartial0(result); 454 } 455 onBuilt(); 456 return result; 457 } 458 buildPartialRepeatedFields(com.google.cloud.compute.v1.SecuritySettings result)459 private void buildPartialRepeatedFields(com.google.cloud.compute.v1.SecuritySettings result) { 460 if (((bitField0_ & 0x00000002) != 0)) { 461 subjectAltNames_ = subjectAltNames_.getUnmodifiableView(); 462 bitField0_ = (bitField0_ & ~0x00000002); 463 } 464 result.subjectAltNames_ = subjectAltNames_; 465 } 466 buildPartial0(com.google.cloud.compute.v1.SecuritySettings result)467 private void buildPartial0(com.google.cloud.compute.v1.SecuritySettings result) { 468 int from_bitField0_ = bitField0_; 469 int to_bitField0_ = 0; 470 if (((from_bitField0_ & 0x00000001) != 0)) { 471 result.clientTlsPolicy_ = clientTlsPolicy_; 472 to_bitField0_ |= 0x00000001; 473 } 474 result.bitField0_ |= to_bitField0_; 475 } 476 477 @java.lang.Override clone()478 public Builder clone() { 479 return super.clone(); 480 } 481 482 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)483 public Builder setField( 484 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 485 return super.setField(field, value); 486 } 487 488 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)489 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 490 return super.clearField(field); 491 } 492 493 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)494 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 495 return super.clearOneof(oneof); 496 } 497 498 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)499 public Builder setRepeatedField( 500 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 501 return super.setRepeatedField(field, index, value); 502 } 503 504 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)505 public Builder addRepeatedField( 506 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 507 return super.addRepeatedField(field, value); 508 } 509 510 @java.lang.Override mergeFrom(com.google.protobuf.Message other)511 public Builder mergeFrom(com.google.protobuf.Message other) { 512 if (other instanceof com.google.cloud.compute.v1.SecuritySettings) { 513 return mergeFrom((com.google.cloud.compute.v1.SecuritySettings) other); 514 } else { 515 super.mergeFrom(other); 516 return this; 517 } 518 } 519 mergeFrom(com.google.cloud.compute.v1.SecuritySettings other)520 public Builder mergeFrom(com.google.cloud.compute.v1.SecuritySettings other) { 521 if (other == com.google.cloud.compute.v1.SecuritySettings.getDefaultInstance()) return this; 522 if (other.hasClientTlsPolicy()) { 523 clientTlsPolicy_ = other.clientTlsPolicy_; 524 bitField0_ |= 0x00000001; 525 onChanged(); 526 } 527 if (!other.subjectAltNames_.isEmpty()) { 528 if (subjectAltNames_.isEmpty()) { 529 subjectAltNames_ = other.subjectAltNames_; 530 bitField0_ = (bitField0_ & ~0x00000002); 531 } else { 532 ensureSubjectAltNamesIsMutable(); 533 subjectAltNames_.addAll(other.subjectAltNames_); 534 } 535 onChanged(); 536 } 537 this.mergeUnknownFields(other.getUnknownFields()); 538 onChanged(); 539 return this; 540 } 541 542 @java.lang.Override isInitialized()543 public final boolean isInitialized() { 544 return true; 545 } 546 547 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)548 public Builder mergeFrom( 549 com.google.protobuf.CodedInputStream input, 550 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 551 throws java.io.IOException { 552 if (extensionRegistry == null) { 553 throw new java.lang.NullPointerException(); 554 } 555 try { 556 boolean done = false; 557 while (!done) { 558 int tag = input.readTag(); 559 switch (tag) { 560 case 0: 561 done = true; 562 break; 563 case -1654731014: 564 { 565 java.lang.String s = input.readStringRequireUtf8(); 566 ensureSubjectAltNamesIsMutable(); 567 subjectAltNames_.add(s); 568 break; 569 } // case -1654731014 570 case -596365486: 571 { 572 clientTlsPolicy_ = input.readStringRequireUtf8(); 573 bitField0_ |= 0x00000001; 574 break; 575 } // case -596365486 576 default: 577 { 578 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 579 done = true; // was an endgroup tag 580 } 581 break; 582 } // default: 583 } // switch (tag) 584 } // while (!done) 585 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 586 throw e.unwrapIOException(); 587 } finally { 588 onChanged(); 589 } // finally 590 return this; 591 } 592 593 private int bitField0_; 594 595 private java.lang.Object clientTlsPolicy_ = ""; 596 /** 597 * 598 * 599 * <pre> 600 * Optional. A URL referring to a networksecurity.ClientTlsPolicy resource that describes how clients should authenticate with this service's backends. clientTlsPolicy only applies to a global BackendService with the loadBalancingScheme set to INTERNAL_SELF_MANAGED. If left blank, communications are not encrypted. Note: This field currently has no impact. 601 * </pre> 602 * 603 * <code>optional string client_tls_policy = 462325226;</code> 604 * 605 * @return Whether the clientTlsPolicy field is set. 606 */ hasClientTlsPolicy()607 public boolean hasClientTlsPolicy() { 608 return ((bitField0_ & 0x00000001) != 0); 609 } 610 /** 611 * 612 * 613 * <pre> 614 * Optional. A URL referring to a networksecurity.ClientTlsPolicy resource that describes how clients should authenticate with this service's backends. clientTlsPolicy only applies to a global BackendService with the loadBalancingScheme set to INTERNAL_SELF_MANAGED. If left blank, communications are not encrypted. Note: This field currently has no impact. 615 * </pre> 616 * 617 * <code>optional string client_tls_policy = 462325226;</code> 618 * 619 * @return The clientTlsPolicy. 620 */ getClientTlsPolicy()621 public java.lang.String getClientTlsPolicy() { 622 java.lang.Object ref = clientTlsPolicy_; 623 if (!(ref instanceof java.lang.String)) { 624 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 625 java.lang.String s = bs.toStringUtf8(); 626 clientTlsPolicy_ = s; 627 return s; 628 } else { 629 return (java.lang.String) ref; 630 } 631 } 632 /** 633 * 634 * 635 * <pre> 636 * Optional. A URL referring to a networksecurity.ClientTlsPolicy resource that describes how clients should authenticate with this service's backends. clientTlsPolicy only applies to a global BackendService with the loadBalancingScheme set to INTERNAL_SELF_MANAGED. If left blank, communications are not encrypted. Note: This field currently has no impact. 637 * </pre> 638 * 639 * <code>optional string client_tls_policy = 462325226;</code> 640 * 641 * @return The bytes for clientTlsPolicy. 642 */ getClientTlsPolicyBytes()643 public com.google.protobuf.ByteString getClientTlsPolicyBytes() { 644 java.lang.Object ref = clientTlsPolicy_; 645 if (ref instanceof String) { 646 com.google.protobuf.ByteString b = 647 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 648 clientTlsPolicy_ = b; 649 return b; 650 } else { 651 return (com.google.protobuf.ByteString) ref; 652 } 653 } 654 /** 655 * 656 * 657 * <pre> 658 * Optional. A URL referring to a networksecurity.ClientTlsPolicy resource that describes how clients should authenticate with this service's backends. clientTlsPolicy only applies to a global BackendService with the loadBalancingScheme set to INTERNAL_SELF_MANAGED. If left blank, communications are not encrypted. Note: This field currently has no impact. 659 * </pre> 660 * 661 * <code>optional string client_tls_policy = 462325226;</code> 662 * 663 * @param value The clientTlsPolicy to set. 664 * @return This builder for chaining. 665 */ setClientTlsPolicy(java.lang.String value)666 public Builder setClientTlsPolicy(java.lang.String value) { 667 if (value == null) { 668 throw new NullPointerException(); 669 } 670 clientTlsPolicy_ = value; 671 bitField0_ |= 0x00000001; 672 onChanged(); 673 return this; 674 } 675 /** 676 * 677 * 678 * <pre> 679 * Optional. A URL referring to a networksecurity.ClientTlsPolicy resource that describes how clients should authenticate with this service's backends. clientTlsPolicy only applies to a global BackendService with the loadBalancingScheme set to INTERNAL_SELF_MANAGED. If left blank, communications are not encrypted. Note: This field currently has no impact. 680 * </pre> 681 * 682 * <code>optional string client_tls_policy = 462325226;</code> 683 * 684 * @return This builder for chaining. 685 */ clearClientTlsPolicy()686 public Builder clearClientTlsPolicy() { 687 clientTlsPolicy_ = getDefaultInstance().getClientTlsPolicy(); 688 bitField0_ = (bitField0_ & ~0x00000001); 689 onChanged(); 690 return this; 691 } 692 /** 693 * 694 * 695 * <pre> 696 * Optional. A URL referring to a networksecurity.ClientTlsPolicy resource that describes how clients should authenticate with this service's backends. clientTlsPolicy only applies to a global BackendService with the loadBalancingScheme set to INTERNAL_SELF_MANAGED. If left blank, communications are not encrypted. Note: This field currently has no impact. 697 * </pre> 698 * 699 * <code>optional string client_tls_policy = 462325226;</code> 700 * 701 * @param value The bytes for clientTlsPolicy to set. 702 * @return This builder for chaining. 703 */ setClientTlsPolicyBytes(com.google.protobuf.ByteString value)704 public Builder setClientTlsPolicyBytes(com.google.protobuf.ByteString value) { 705 if (value == null) { 706 throw new NullPointerException(); 707 } 708 checkByteStringIsUtf8(value); 709 clientTlsPolicy_ = value; 710 bitField0_ |= 0x00000001; 711 onChanged(); 712 return this; 713 } 714 715 private com.google.protobuf.LazyStringList subjectAltNames_ = 716 com.google.protobuf.LazyStringArrayList.EMPTY; 717 ensureSubjectAltNamesIsMutable()718 private void ensureSubjectAltNamesIsMutable() { 719 if (!((bitField0_ & 0x00000002) != 0)) { 720 subjectAltNames_ = new com.google.protobuf.LazyStringArrayList(subjectAltNames_); 721 bitField0_ |= 0x00000002; 722 } 723 } 724 /** 725 * 726 * 727 * <pre> 728 * Optional. A list of Subject Alternative Names (SANs) that the client verifies during a mutual TLS handshake with an server/endpoint for this BackendService. When the server presents its X.509 certificate to the client, the client inspects the certificate's subjectAltName field. If the field contains one of the specified values, the communication continues. Otherwise, it fails. This additional check enables the client to verify that the server is authorized to run the requested service. Note that the contents of the server certificate's subjectAltName field are configured by the Public Key Infrastructure which provisions server identities. Only applies to a global BackendService with loadBalancingScheme set to INTERNAL_SELF_MANAGED. Only applies when BackendService has an attached clientTlsPolicy with clientCertificate (mTLS mode). Note: This field currently has no impact. 729 * </pre> 730 * 731 * <code>repeated string subject_alt_names = 330029535;</code> 732 * 733 * @return A list containing the subjectAltNames. 734 */ getSubjectAltNamesList()735 public com.google.protobuf.ProtocolStringList getSubjectAltNamesList() { 736 return subjectAltNames_.getUnmodifiableView(); 737 } 738 /** 739 * 740 * 741 * <pre> 742 * Optional. A list of Subject Alternative Names (SANs) that the client verifies during a mutual TLS handshake with an server/endpoint for this BackendService. When the server presents its X.509 certificate to the client, the client inspects the certificate's subjectAltName field. If the field contains one of the specified values, the communication continues. Otherwise, it fails. This additional check enables the client to verify that the server is authorized to run the requested service. Note that the contents of the server certificate's subjectAltName field are configured by the Public Key Infrastructure which provisions server identities. Only applies to a global BackendService with loadBalancingScheme set to INTERNAL_SELF_MANAGED. Only applies when BackendService has an attached clientTlsPolicy with clientCertificate (mTLS mode). Note: This field currently has no impact. 743 * </pre> 744 * 745 * <code>repeated string subject_alt_names = 330029535;</code> 746 * 747 * @return The count of subjectAltNames. 748 */ getSubjectAltNamesCount()749 public int getSubjectAltNamesCount() { 750 return subjectAltNames_.size(); 751 } 752 /** 753 * 754 * 755 * <pre> 756 * Optional. A list of Subject Alternative Names (SANs) that the client verifies during a mutual TLS handshake with an server/endpoint for this BackendService. When the server presents its X.509 certificate to the client, the client inspects the certificate's subjectAltName field. If the field contains one of the specified values, the communication continues. Otherwise, it fails. This additional check enables the client to verify that the server is authorized to run the requested service. Note that the contents of the server certificate's subjectAltName field are configured by the Public Key Infrastructure which provisions server identities. Only applies to a global BackendService with loadBalancingScheme set to INTERNAL_SELF_MANAGED. Only applies when BackendService has an attached clientTlsPolicy with clientCertificate (mTLS mode). Note: This field currently has no impact. 757 * </pre> 758 * 759 * <code>repeated string subject_alt_names = 330029535;</code> 760 * 761 * @param index The index of the element to return. 762 * @return The subjectAltNames at the given index. 763 */ getSubjectAltNames(int index)764 public java.lang.String getSubjectAltNames(int index) { 765 return subjectAltNames_.get(index); 766 } 767 /** 768 * 769 * 770 * <pre> 771 * Optional. A list of Subject Alternative Names (SANs) that the client verifies during a mutual TLS handshake with an server/endpoint for this BackendService. When the server presents its X.509 certificate to the client, the client inspects the certificate's subjectAltName field. If the field contains one of the specified values, the communication continues. Otherwise, it fails. This additional check enables the client to verify that the server is authorized to run the requested service. Note that the contents of the server certificate's subjectAltName field are configured by the Public Key Infrastructure which provisions server identities. Only applies to a global BackendService with loadBalancingScheme set to INTERNAL_SELF_MANAGED. Only applies when BackendService has an attached clientTlsPolicy with clientCertificate (mTLS mode). Note: This field currently has no impact. 772 * </pre> 773 * 774 * <code>repeated string subject_alt_names = 330029535;</code> 775 * 776 * @param index The index of the value to return. 777 * @return The bytes of the subjectAltNames at the given index. 778 */ getSubjectAltNamesBytes(int index)779 public com.google.protobuf.ByteString getSubjectAltNamesBytes(int index) { 780 return subjectAltNames_.getByteString(index); 781 } 782 /** 783 * 784 * 785 * <pre> 786 * Optional. A list of Subject Alternative Names (SANs) that the client verifies during a mutual TLS handshake with an server/endpoint for this BackendService. When the server presents its X.509 certificate to the client, the client inspects the certificate's subjectAltName field. If the field contains one of the specified values, the communication continues. Otherwise, it fails. This additional check enables the client to verify that the server is authorized to run the requested service. Note that the contents of the server certificate's subjectAltName field are configured by the Public Key Infrastructure which provisions server identities. Only applies to a global BackendService with loadBalancingScheme set to INTERNAL_SELF_MANAGED. Only applies when BackendService has an attached clientTlsPolicy with clientCertificate (mTLS mode). Note: This field currently has no impact. 787 * </pre> 788 * 789 * <code>repeated string subject_alt_names = 330029535;</code> 790 * 791 * @param index The index to set the value at. 792 * @param value The subjectAltNames to set. 793 * @return This builder for chaining. 794 */ setSubjectAltNames(int index, java.lang.String value)795 public Builder setSubjectAltNames(int index, java.lang.String value) { 796 if (value == null) { 797 throw new NullPointerException(); 798 } 799 ensureSubjectAltNamesIsMutable(); 800 subjectAltNames_.set(index, value); 801 onChanged(); 802 return this; 803 } 804 /** 805 * 806 * 807 * <pre> 808 * Optional. A list of Subject Alternative Names (SANs) that the client verifies during a mutual TLS handshake with an server/endpoint for this BackendService. When the server presents its X.509 certificate to the client, the client inspects the certificate's subjectAltName field. If the field contains one of the specified values, the communication continues. Otherwise, it fails. This additional check enables the client to verify that the server is authorized to run the requested service. Note that the contents of the server certificate's subjectAltName field are configured by the Public Key Infrastructure which provisions server identities. Only applies to a global BackendService with loadBalancingScheme set to INTERNAL_SELF_MANAGED. Only applies when BackendService has an attached clientTlsPolicy with clientCertificate (mTLS mode). Note: This field currently has no impact. 809 * </pre> 810 * 811 * <code>repeated string subject_alt_names = 330029535;</code> 812 * 813 * @param value The subjectAltNames to add. 814 * @return This builder for chaining. 815 */ addSubjectAltNames(java.lang.String value)816 public Builder addSubjectAltNames(java.lang.String value) { 817 if (value == null) { 818 throw new NullPointerException(); 819 } 820 ensureSubjectAltNamesIsMutable(); 821 subjectAltNames_.add(value); 822 onChanged(); 823 return this; 824 } 825 /** 826 * 827 * 828 * <pre> 829 * Optional. A list of Subject Alternative Names (SANs) that the client verifies during a mutual TLS handshake with an server/endpoint for this BackendService. When the server presents its X.509 certificate to the client, the client inspects the certificate's subjectAltName field. If the field contains one of the specified values, the communication continues. Otherwise, it fails. This additional check enables the client to verify that the server is authorized to run the requested service. Note that the contents of the server certificate's subjectAltName field are configured by the Public Key Infrastructure which provisions server identities. Only applies to a global BackendService with loadBalancingScheme set to INTERNAL_SELF_MANAGED. Only applies when BackendService has an attached clientTlsPolicy with clientCertificate (mTLS mode). Note: This field currently has no impact. 830 * </pre> 831 * 832 * <code>repeated string subject_alt_names = 330029535;</code> 833 * 834 * @param values The subjectAltNames to add. 835 * @return This builder for chaining. 836 */ addAllSubjectAltNames(java.lang.Iterable<java.lang.String> values)837 public Builder addAllSubjectAltNames(java.lang.Iterable<java.lang.String> values) { 838 ensureSubjectAltNamesIsMutable(); 839 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, subjectAltNames_); 840 onChanged(); 841 return this; 842 } 843 /** 844 * 845 * 846 * <pre> 847 * Optional. A list of Subject Alternative Names (SANs) that the client verifies during a mutual TLS handshake with an server/endpoint for this BackendService. When the server presents its X.509 certificate to the client, the client inspects the certificate's subjectAltName field. If the field contains one of the specified values, the communication continues. Otherwise, it fails. This additional check enables the client to verify that the server is authorized to run the requested service. Note that the contents of the server certificate's subjectAltName field are configured by the Public Key Infrastructure which provisions server identities. Only applies to a global BackendService with loadBalancingScheme set to INTERNAL_SELF_MANAGED. Only applies when BackendService has an attached clientTlsPolicy with clientCertificate (mTLS mode). Note: This field currently has no impact. 848 * </pre> 849 * 850 * <code>repeated string subject_alt_names = 330029535;</code> 851 * 852 * @return This builder for chaining. 853 */ clearSubjectAltNames()854 public Builder clearSubjectAltNames() { 855 subjectAltNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; 856 bitField0_ = (bitField0_ & ~0x00000002); 857 onChanged(); 858 return this; 859 } 860 /** 861 * 862 * 863 * <pre> 864 * Optional. A list of Subject Alternative Names (SANs) that the client verifies during a mutual TLS handshake with an server/endpoint for this BackendService. When the server presents its X.509 certificate to the client, the client inspects the certificate's subjectAltName field. If the field contains one of the specified values, the communication continues. Otherwise, it fails. This additional check enables the client to verify that the server is authorized to run the requested service. Note that the contents of the server certificate's subjectAltName field are configured by the Public Key Infrastructure which provisions server identities. Only applies to a global BackendService with loadBalancingScheme set to INTERNAL_SELF_MANAGED. Only applies when BackendService has an attached clientTlsPolicy with clientCertificate (mTLS mode). Note: This field currently has no impact. 865 * </pre> 866 * 867 * <code>repeated string subject_alt_names = 330029535;</code> 868 * 869 * @param value The bytes of the subjectAltNames to add. 870 * @return This builder for chaining. 871 */ addSubjectAltNamesBytes(com.google.protobuf.ByteString value)872 public Builder addSubjectAltNamesBytes(com.google.protobuf.ByteString value) { 873 if (value == null) { 874 throw new NullPointerException(); 875 } 876 checkByteStringIsUtf8(value); 877 ensureSubjectAltNamesIsMutable(); 878 subjectAltNames_.add(value); 879 onChanged(); 880 return this; 881 } 882 883 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)884 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 885 return super.setUnknownFields(unknownFields); 886 } 887 888 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)889 public final Builder mergeUnknownFields( 890 final com.google.protobuf.UnknownFieldSet unknownFields) { 891 return super.mergeUnknownFields(unknownFields); 892 } 893 894 // @@protoc_insertion_point(builder_scope:google.cloud.compute.v1.SecuritySettings) 895 } 896 897 // @@protoc_insertion_point(class_scope:google.cloud.compute.v1.SecuritySettings) 898 private static final com.google.cloud.compute.v1.SecuritySettings DEFAULT_INSTANCE; 899 900 static { 901 DEFAULT_INSTANCE = new com.google.cloud.compute.v1.SecuritySettings(); 902 } 903 getDefaultInstance()904 public static com.google.cloud.compute.v1.SecuritySettings getDefaultInstance() { 905 return DEFAULT_INSTANCE; 906 } 907 908 private static final com.google.protobuf.Parser<SecuritySettings> PARSER = 909 new com.google.protobuf.AbstractParser<SecuritySettings>() { 910 @java.lang.Override 911 public SecuritySettings parsePartialFrom( 912 com.google.protobuf.CodedInputStream input, 913 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 914 throws com.google.protobuf.InvalidProtocolBufferException { 915 Builder builder = newBuilder(); 916 try { 917 builder.mergeFrom(input, extensionRegistry); 918 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 919 throw e.setUnfinishedMessage(builder.buildPartial()); 920 } catch (com.google.protobuf.UninitializedMessageException e) { 921 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 922 } catch (java.io.IOException e) { 923 throw new com.google.protobuf.InvalidProtocolBufferException(e) 924 .setUnfinishedMessage(builder.buildPartial()); 925 } 926 return builder.buildPartial(); 927 } 928 }; 929 parser()930 public static com.google.protobuf.Parser<SecuritySettings> parser() { 931 return PARSER; 932 } 933 934 @java.lang.Override getParserForType()935 public com.google.protobuf.Parser<SecuritySettings> getParserForType() { 936 return PARSER; 937 } 938 939 @java.lang.Override getDefaultInstanceForType()940 public com.google.cloud.compute.v1.SecuritySettings getDefaultInstanceForType() { 941 return DEFAULT_INSTANCE; 942 } 943 } 944