• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  * </pre>
26  *
27  * Protobuf type {@code google.cloud.compute.v1.CustomerEncryptionKey}
28  */
29 public final class CustomerEncryptionKey extends com.google.protobuf.GeneratedMessageV3
30     implements
31     // @@protoc_insertion_point(message_implements:google.cloud.compute.v1.CustomerEncryptionKey)
32     CustomerEncryptionKeyOrBuilder {
33   private static final long serialVersionUID = 0L;
34   // Use CustomerEncryptionKey.newBuilder() to construct.
CustomerEncryptionKey(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)35   private CustomerEncryptionKey(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
36     super(builder);
37   }
38 
CustomerEncryptionKey()39   private CustomerEncryptionKey() {
40     kmsKeyName_ = "";
41     kmsKeyServiceAccount_ = "";
42     rawKey_ = "";
43     rsaEncryptedKey_ = "";
44     sha256_ = "";
45   }
46 
47   @java.lang.Override
48   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)49   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
50     return new CustomerEncryptionKey();
51   }
52 
53   @java.lang.Override
getUnknownFields()54   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
55     return this.unknownFields;
56   }
57 
getDescriptor()58   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
59     return com.google.cloud.compute.v1.Compute
60         .internal_static_google_cloud_compute_v1_CustomerEncryptionKey_descriptor;
61   }
62 
63   @java.lang.Override
64   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()65       internalGetFieldAccessorTable() {
66     return com.google.cloud.compute.v1.Compute
67         .internal_static_google_cloud_compute_v1_CustomerEncryptionKey_fieldAccessorTable
68         .ensureFieldAccessorsInitialized(
69             com.google.cloud.compute.v1.CustomerEncryptionKey.class,
70             com.google.cloud.compute.v1.CustomerEncryptionKey.Builder.class);
71   }
72 
73   private int bitField0_;
74   public static final int KMS_KEY_NAME_FIELD_NUMBER = 484373913;
75 
76   @SuppressWarnings("serial")
77   private volatile java.lang.Object kmsKeyName_ = "";
78   /**
79    *
80    *
81    * <pre>
82    * The name of the encryption key that is stored in Google Cloud KMS. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key
83    * </pre>
84    *
85    * <code>optional string kms_key_name = 484373913;</code>
86    *
87    * @return Whether the kmsKeyName field is set.
88    */
89   @java.lang.Override
hasKmsKeyName()90   public boolean hasKmsKeyName() {
91     return ((bitField0_ & 0x00000001) != 0);
92   }
93   /**
94    *
95    *
96    * <pre>
97    * The name of the encryption key that is stored in Google Cloud KMS. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key
98    * </pre>
99    *
100    * <code>optional string kms_key_name = 484373913;</code>
101    *
102    * @return The kmsKeyName.
103    */
104   @java.lang.Override
getKmsKeyName()105   public java.lang.String getKmsKeyName() {
106     java.lang.Object ref = kmsKeyName_;
107     if (ref instanceof java.lang.String) {
108       return (java.lang.String) ref;
109     } else {
110       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
111       java.lang.String s = bs.toStringUtf8();
112       kmsKeyName_ = s;
113       return s;
114     }
115   }
116   /**
117    *
118    *
119    * <pre>
120    * The name of the encryption key that is stored in Google Cloud KMS. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key
121    * </pre>
122    *
123    * <code>optional string kms_key_name = 484373913;</code>
124    *
125    * @return The bytes for kmsKeyName.
126    */
127   @java.lang.Override
getKmsKeyNameBytes()128   public com.google.protobuf.ByteString getKmsKeyNameBytes() {
129     java.lang.Object ref = kmsKeyName_;
130     if (ref instanceof java.lang.String) {
131       com.google.protobuf.ByteString b =
132           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
133       kmsKeyName_ = b;
134       return b;
135     } else {
136       return (com.google.protobuf.ByteString) ref;
137     }
138   }
139 
140   public static final int KMS_KEY_SERVICE_ACCOUNT_FIELD_NUMBER = 209986261;
141 
142   @SuppressWarnings("serial")
143   private volatile java.lang.Object kmsKeyServiceAccount_ = "";
144   /**
145    *
146    *
147    * <pre>
148    * The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. For example: "kmsKeyServiceAccount": "name&#64;project_id.iam.gserviceaccount.com/
149    * </pre>
150    *
151    * <code>optional string kms_key_service_account = 209986261;</code>
152    *
153    * @return Whether the kmsKeyServiceAccount field is set.
154    */
155   @java.lang.Override
hasKmsKeyServiceAccount()156   public boolean hasKmsKeyServiceAccount() {
157     return ((bitField0_ & 0x00000002) != 0);
158   }
159   /**
160    *
161    *
162    * <pre>
163    * The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. For example: "kmsKeyServiceAccount": "name&#64;project_id.iam.gserviceaccount.com/
164    * </pre>
165    *
166    * <code>optional string kms_key_service_account = 209986261;</code>
167    *
168    * @return The kmsKeyServiceAccount.
169    */
170   @java.lang.Override
getKmsKeyServiceAccount()171   public java.lang.String getKmsKeyServiceAccount() {
172     java.lang.Object ref = kmsKeyServiceAccount_;
173     if (ref instanceof java.lang.String) {
174       return (java.lang.String) ref;
175     } else {
176       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
177       java.lang.String s = bs.toStringUtf8();
178       kmsKeyServiceAccount_ = s;
179       return s;
180     }
181   }
182   /**
183    *
184    *
185    * <pre>
186    * The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. For example: "kmsKeyServiceAccount": "name&#64;project_id.iam.gserviceaccount.com/
187    * </pre>
188    *
189    * <code>optional string kms_key_service_account = 209986261;</code>
190    *
191    * @return The bytes for kmsKeyServiceAccount.
192    */
193   @java.lang.Override
getKmsKeyServiceAccountBytes()194   public com.google.protobuf.ByteString getKmsKeyServiceAccountBytes() {
195     java.lang.Object ref = kmsKeyServiceAccount_;
196     if (ref instanceof java.lang.String) {
197       com.google.protobuf.ByteString b =
198           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
199       kmsKeyServiceAccount_ = b;
200       return b;
201     } else {
202       return (com.google.protobuf.ByteString) ref;
203     }
204   }
205 
206   public static final int RAW_KEY_FIELD_NUMBER = 449196488;
207 
208   @SuppressWarnings("serial")
209   private volatile java.lang.Object rawKey_ = "";
210   /**
211    *
212    *
213    * <pre>
214    * Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rawKey": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0="
215    * </pre>
216    *
217    * <code>optional string raw_key = 449196488;</code>
218    *
219    * @return Whether the rawKey field is set.
220    */
221   @java.lang.Override
hasRawKey()222   public boolean hasRawKey() {
223     return ((bitField0_ & 0x00000004) != 0);
224   }
225   /**
226    *
227    *
228    * <pre>
229    * Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rawKey": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0="
230    * </pre>
231    *
232    * <code>optional string raw_key = 449196488;</code>
233    *
234    * @return The rawKey.
235    */
236   @java.lang.Override
getRawKey()237   public java.lang.String getRawKey() {
238     java.lang.Object ref = rawKey_;
239     if (ref instanceof java.lang.String) {
240       return (java.lang.String) ref;
241     } else {
242       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
243       java.lang.String s = bs.toStringUtf8();
244       rawKey_ = s;
245       return s;
246     }
247   }
248   /**
249    *
250    *
251    * <pre>
252    * Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rawKey": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0="
253    * </pre>
254    *
255    * <code>optional string raw_key = 449196488;</code>
256    *
257    * @return The bytes for rawKey.
258    */
259   @java.lang.Override
getRawKeyBytes()260   public com.google.protobuf.ByteString getRawKeyBytes() {
261     java.lang.Object ref = rawKey_;
262     if (ref instanceof java.lang.String) {
263       com.google.protobuf.ByteString b =
264           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
265       rawKey_ = b;
266       return b;
267     } else {
268       return (com.google.protobuf.ByteString) ref;
269     }
270   }
271 
272   public static final int RSA_ENCRYPTED_KEY_FIELD_NUMBER = 335487397;
273 
274   @SuppressWarnings("serial")
275   private volatile java.lang.Object rsaEncryptedKey_ = "";
276   /**
277    *
278    *
279    * <pre>
280    * Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rsaEncryptedKey": "ieCx/NcW06PcT7Ep1X6LUTc/hLvUDYyzSZPPVCVPTVEohpeHASqC8uw5TzyO9U+Fka9JFH z0mBibXUInrC/jEk014kCK/NPjYgEMOyssZ4ZINPKxlUh2zn1bV+MCaTICrdmuSBTWlUUiFoD D6PYznLwh8ZNdaheCeZ8ewEXgFQ8V+sDroLaN3Xs3MDTXQEMMoNUXMCZEIpg9Vtp9x2oe==" The key must meet the following requirements before you can provide it to Compute Engine: 1. The key is wrapped using a RSA public key certificate provided by Google. 2. After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at: https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
281    * </pre>
282    *
283    * <code>optional string rsa_encrypted_key = 335487397;</code>
284    *
285    * @return Whether the rsaEncryptedKey field is set.
286    */
287   @java.lang.Override
hasRsaEncryptedKey()288   public boolean hasRsaEncryptedKey() {
289     return ((bitField0_ & 0x00000008) != 0);
290   }
291   /**
292    *
293    *
294    * <pre>
295    * Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rsaEncryptedKey": "ieCx/NcW06PcT7Ep1X6LUTc/hLvUDYyzSZPPVCVPTVEohpeHASqC8uw5TzyO9U+Fka9JFH z0mBibXUInrC/jEk014kCK/NPjYgEMOyssZ4ZINPKxlUh2zn1bV+MCaTICrdmuSBTWlUUiFoD D6PYznLwh8ZNdaheCeZ8ewEXgFQ8V+sDroLaN3Xs3MDTXQEMMoNUXMCZEIpg9Vtp9x2oe==" The key must meet the following requirements before you can provide it to Compute Engine: 1. The key is wrapped using a RSA public key certificate provided by Google. 2. After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at: https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
296    * </pre>
297    *
298    * <code>optional string rsa_encrypted_key = 335487397;</code>
299    *
300    * @return The rsaEncryptedKey.
301    */
302   @java.lang.Override
getRsaEncryptedKey()303   public java.lang.String getRsaEncryptedKey() {
304     java.lang.Object ref = rsaEncryptedKey_;
305     if (ref instanceof java.lang.String) {
306       return (java.lang.String) ref;
307     } else {
308       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
309       java.lang.String s = bs.toStringUtf8();
310       rsaEncryptedKey_ = s;
311       return s;
312     }
313   }
314   /**
315    *
316    *
317    * <pre>
318    * Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rsaEncryptedKey": "ieCx/NcW06PcT7Ep1X6LUTc/hLvUDYyzSZPPVCVPTVEohpeHASqC8uw5TzyO9U+Fka9JFH z0mBibXUInrC/jEk014kCK/NPjYgEMOyssZ4ZINPKxlUh2zn1bV+MCaTICrdmuSBTWlUUiFoD D6PYznLwh8ZNdaheCeZ8ewEXgFQ8V+sDroLaN3Xs3MDTXQEMMoNUXMCZEIpg9Vtp9x2oe==" The key must meet the following requirements before you can provide it to Compute Engine: 1. The key is wrapped using a RSA public key certificate provided by Google. 2. After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at: https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
319    * </pre>
320    *
321    * <code>optional string rsa_encrypted_key = 335487397;</code>
322    *
323    * @return The bytes for rsaEncryptedKey.
324    */
325   @java.lang.Override
getRsaEncryptedKeyBytes()326   public com.google.protobuf.ByteString getRsaEncryptedKeyBytes() {
327     java.lang.Object ref = rsaEncryptedKey_;
328     if (ref instanceof java.lang.String) {
329       com.google.protobuf.ByteString b =
330           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
331       rsaEncryptedKey_ = b;
332       return b;
333     } else {
334       return (com.google.protobuf.ByteString) ref;
335     }
336   }
337 
338   public static final int SHA256_FIELD_NUMBER = 170112551;
339 
340   @SuppressWarnings("serial")
341   private volatile java.lang.Object sha256_ = "";
342   /**
343    *
344    *
345    * <pre>
346    * [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
347    * </pre>
348    *
349    * <code>optional string sha256 = 170112551;</code>
350    *
351    * @return Whether the sha256 field is set.
352    */
353   @java.lang.Override
hasSha256()354   public boolean hasSha256() {
355     return ((bitField0_ & 0x00000010) != 0);
356   }
357   /**
358    *
359    *
360    * <pre>
361    * [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
362    * </pre>
363    *
364    * <code>optional string sha256 = 170112551;</code>
365    *
366    * @return The sha256.
367    */
368   @java.lang.Override
getSha256()369   public java.lang.String getSha256() {
370     java.lang.Object ref = sha256_;
371     if (ref instanceof java.lang.String) {
372       return (java.lang.String) ref;
373     } else {
374       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
375       java.lang.String s = bs.toStringUtf8();
376       sha256_ = s;
377       return s;
378     }
379   }
380   /**
381    *
382    *
383    * <pre>
384    * [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
385    * </pre>
386    *
387    * <code>optional string sha256 = 170112551;</code>
388    *
389    * @return The bytes for sha256.
390    */
391   @java.lang.Override
getSha256Bytes()392   public com.google.protobuf.ByteString getSha256Bytes() {
393     java.lang.Object ref = sha256_;
394     if (ref instanceof java.lang.String) {
395       com.google.protobuf.ByteString b =
396           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
397       sha256_ = b;
398       return b;
399     } else {
400       return (com.google.protobuf.ByteString) ref;
401     }
402   }
403 
404   private byte memoizedIsInitialized = -1;
405 
406   @java.lang.Override
isInitialized()407   public final boolean isInitialized() {
408     byte isInitialized = memoizedIsInitialized;
409     if (isInitialized == 1) return true;
410     if (isInitialized == 0) return false;
411 
412     memoizedIsInitialized = 1;
413     return true;
414   }
415 
416   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)417   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
418     if (((bitField0_ & 0x00000010) != 0)) {
419       com.google.protobuf.GeneratedMessageV3.writeString(output, 170112551, sha256_);
420     }
421     if (((bitField0_ & 0x00000002) != 0)) {
422       com.google.protobuf.GeneratedMessageV3.writeString(output, 209986261, kmsKeyServiceAccount_);
423     }
424     if (((bitField0_ & 0x00000008) != 0)) {
425       com.google.protobuf.GeneratedMessageV3.writeString(output, 335487397, rsaEncryptedKey_);
426     }
427     if (((bitField0_ & 0x00000004) != 0)) {
428       com.google.protobuf.GeneratedMessageV3.writeString(output, 449196488, rawKey_);
429     }
430     if (((bitField0_ & 0x00000001) != 0)) {
431       com.google.protobuf.GeneratedMessageV3.writeString(output, 484373913, kmsKeyName_);
432     }
433     getUnknownFields().writeTo(output);
434   }
435 
436   @java.lang.Override
getSerializedSize()437   public int getSerializedSize() {
438     int size = memoizedSize;
439     if (size != -1) return size;
440 
441     size = 0;
442     if (((bitField0_ & 0x00000010) != 0)) {
443       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(170112551, sha256_);
444     }
445     if (((bitField0_ & 0x00000002) != 0)) {
446       size +=
447           com.google.protobuf.GeneratedMessageV3.computeStringSize(
448               209986261, kmsKeyServiceAccount_);
449     }
450     if (((bitField0_ & 0x00000008) != 0)) {
451       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(335487397, rsaEncryptedKey_);
452     }
453     if (((bitField0_ & 0x00000004) != 0)) {
454       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(449196488, rawKey_);
455     }
456     if (((bitField0_ & 0x00000001) != 0)) {
457       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(484373913, kmsKeyName_);
458     }
459     size += getUnknownFields().getSerializedSize();
460     memoizedSize = size;
461     return size;
462   }
463 
464   @java.lang.Override
equals(final java.lang.Object obj)465   public boolean equals(final java.lang.Object obj) {
466     if (obj == this) {
467       return true;
468     }
469     if (!(obj instanceof com.google.cloud.compute.v1.CustomerEncryptionKey)) {
470       return super.equals(obj);
471     }
472     com.google.cloud.compute.v1.CustomerEncryptionKey other =
473         (com.google.cloud.compute.v1.CustomerEncryptionKey) obj;
474 
475     if (hasKmsKeyName() != other.hasKmsKeyName()) return false;
476     if (hasKmsKeyName()) {
477       if (!getKmsKeyName().equals(other.getKmsKeyName())) return false;
478     }
479     if (hasKmsKeyServiceAccount() != other.hasKmsKeyServiceAccount()) return false;
480     if (hasKmsKeyServiceAccount()) {
481       if (!getKmsKeyServiceAccount().equals(other.getKmsKeyServiceAccount())) return false;
482     }
483     if (hasRawKey() != other.hasRawKey()) return false;
484     if (hasRawKey()) {
485       if (!getRawKey().equals(other.getRawKey())) return false;
486     }
487     if (hasRsaEncryptedKey() != other.hasRsaEncryptedKey()) return false;
488     if (hasRsaEncryptedKey()) {
489       if (!getRsaEncryptedKey().equals(other.getRsaEncryptedKey())) return false;
490     }
491     if (hasSha256() != other.hasSha256()) return false;
492     if (hasSha256()) {
493       if (!getSha256().equals(other.getSha256())) return false;
494     }
495     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
496     return true;
497   }
498 
499   @java.lang.Override
hashCode()500   public int hashCode() {
501     if (memoizedHashCode != 0) {
502       return memoizedHashCode;
503     }
504     int hash = 41;
505     hash = (19 * hash) + getDescriptor().hashCode();
506     if (hasKmsKeyName()) {
507       hash = (37 * hash) + KMS_KEY_NAME_FIELD_NUMBER;
508       hash = (53 * hash) + getKmsKeyName().hashCode();
509     }
510     if (hasKmsKeyServiceAccount()) {
511       hash = (37 * hash) + KMS_KEY_SERVICE_ACCOUNT_FIELD_NUMBER;
512       hash = (53 * hash) + getKmsKeyServiceAccount().hashCode();
513     }
514     if (hasRawKey()) {
515       hash = (37 * hash) + RAW_KEY_FIELD_NUMBER;
516       hash = (53 * hash) + getRawKey().hashCode();
517     }
518     if (hasRsaEncryptedKey()) {
519       hash = (37 * hash) + RSA_ENCRYPTED_KEY_FIELD_NUMBER;
520       hash = (53 * hash) + getRsaEncryptedKey().hashCode();
521     }
522     if (hasSha256()) {
523       hash = (37 * hash) + SHA256_FIELD_NUMBER;
524       hash = (53 * hash) + getSha256().hashCode();
525     }
526     hash = (29 * hash) + getUnknownFields().hashCode();
527     memoizedHashCode = hash;
528     return hash;
529   }
530 
parseFrom( java.nio.ByteBuffer data)531   public static com.google.cloud.compute.v1.CustomerEncryptionKey parseFrom(
532       java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
533     return PARSER.parseFrom(data);
534   }
535 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)536   public static com.google.cloud.compute.v1.CustomerEncryptionKey parseFrom(
537       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
538       throws com.google.protobuf.InvalidProtocolBufferException {
539     return PARSER.parseFrom(data, extensionRegistry);
540   }
541 
parseFrom( com.google.protobuf.ByteString data)542   public static com.google.cloud.compute.v1.CustomerEncryptionKey parseFrom(
543       com.google.protobuf.ByteString data)
544       throws com.google.protobuf.InvalidProtocolBufferException {
545     return PARSER.parseFrom(data);
546   }
547 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)548   public static com.google.cloud.compute.v1.CustomerEncryptionKey parseFrom(
549       com.google.protobuf.ByteString data,
550       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
551       throws com.google.protobuf.InvalidProtocolBufferException {
552     return PARSER.parseFrom(data, extensionRegistry);
553   }
554 
parseFrom(byte[] data)555   public static com.google.cloud.compute.v1.CustomerEncryptionKey parseFrom(byte[] data)
556       throws com.google.protobuf.InvalidProtocolBufferException {
557     return PARSER.parseFrom(data);
558   }
559 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)560   public static com.google.cloud.compute.v1.CustomerEncryptionKey parseFrom(
561       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
562       throws com.google.protobuf.InvalidProtocolBufferException {
563     return PARSER.parseFrom(data, extensionRegistry);
564   }
565 
parseFrom( java.io.InputStream input)566   public static com.google.cloud.compute.v1.CustomerEncryptionKey parseFrom(
567       java.io.InputStream input) throws java.io.IOException {
568     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
569   }
570 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)571   public static com.google.cloud.compute.v1.CustomerEncryptionKey parseFrom(
572       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
573       throws java.io.IOException {
574     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
575         PARSER, input, extensionRegistry);
576   }
577 
parseDelimitedFrom( java.io.InputStream input)578   public static com.google.cloud.compute.v1.CustomerEncryptionKey parseDelimitedFrom(
579       java.io.InputStream input) throws java.io.IOException {
580     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
581   }
582 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)583   public static com.google.cloud.compute.v1.CustomerEncryptionKey parseDelimitedFrom(
584       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
585       throws java.io.IOException {
586     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
587         PARSER, input, extensionRegistry);
588   }
589 
parseFrom( com.google.protobuf.CodedInputStream input)590   public static com.google.cloud.compute.v1.CustomerEncryptionKey parseFrom(
591       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
592     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
593   }
594 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)595   public static com.google.cloud.compute.v1.CustomerEncryptionKey parseFrom(
596       com.google.protobuf.CodedInputStream input,
597       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
598       throws java.io.IOException {
599     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
600         PARSER, input, extensionRegistry);
601   }
602 
603   @java.lang.Override
newBuilderForType()604   public Builder newBuilderForType() {
605     return newBuilder();
606   }
607 
newBuilder()608   public static Builder newBuilder() {
609     return DEFAULT_INSTANCE.toBuilder();
610   }
611 
newBuilder(com.google.cloud.compute.v1.CustomerEncryptionKey prototype)612   public static Builder newBuilder(com.google.cloud.compute.v1.CustomerEncryptionKey prototype) {
613     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
614   }
615 
616   @java.lang.Override
toBuilder()617   public Builder toBuilder() {
618     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
619   }
620 
621   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)622   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
623     Builder builder = new Builder(parent);
624     return builder;
625   }
626   /**
627    *
628    *
629    * <pre>
630    * </pre>
631    *
632    * Protobuf type {@code google.cloud.compute.v1.CustomerEncryptionKey}
633    */
634   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
635       implements
636       // @@protoc_insertion_point(builder_implements:google.cloud.compute.v1.CustomerEncryptionKey)
637       com.google.cloud.compute.v1.CustomerEncryptionKeyOrBuilder {
getDescriptor()638     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
639       return com.google.cloud.compute.v1.Compute
640           .internal_static_google_cloud_compute_v1_CustomerEncryptionKey_descriptor;
641     }
642 
643     @java.lang.Override
644     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()645         internalGetFieldAccessorTable() {
646       return com.google.cloud.compute.v1.Compute
647           .internal_static_google_cloud_compute_v1_CustomerEncryptionKey_fieldAccessorTable
648           .ensureFieldAccessorsInitialized(
649               com.google.cloud.compute.v1.CustomerEncryptionKey.class,
650               com.google.cloud.compute.v1.CustomerEncryptionKey.Builder.class);
651     }
652 
653     // Construct using com.google.cloud.compute.v1.CustomerEncryptionKey.newBuilder()
Builder()654     private Builder() {}
655 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)656     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
657       super(parent);
658     }
659 
660     @java.lang.Override
clear()661     public Builder clear() {
662       super.clear();
663       bitField0_ = 0;
664       kmsKeyName_ = "";
665       kmsKeyServiceAccount_ = "";
666       rawKey_ = "";
667       rsaEncryptedKey_ = "";
668       sha256_ = "";
669       return this;
670     }
671 
672     @java.lang.Override
getDescriptorForType()673     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
674       return com.google.cloud.compute.v1.Compute
675           .internal_static_google_cloud_compute_v1_CustomerEncryptionKey_descriptor;
676     }
677 
678     @java.lang.Override
getDefaultInstanceForType()679     public com.google.cloud.compute.v1.CustomerEncryptionKey getDefaultInstanceForType() {
680       return com.google.cloud.compute.v1.CustomerEncryptionKey.getDefaultInstance();
681     }
682 
683     @java.lang.Override
build()684     public com.google.cloud.compute.v1.CustomerEncryptionKey build() {
685       com.google.cloud.compute.v1.CustomerEncryptionKey result = buildPartial();
686       if (!result.isInitialized()) {
687         throw newUninitializedMessageException(result);
688       }
689       return result;
690     }
691 
692     @java.lang.Override
buildPartial()693     public com.google.cloud.compute.v1.CustomerEncryptionKey buildPartial() {
694       com.google.cloud.compute.v1.CustomerEncryptionKey result =
695           new com.google.cloud.compute.v1.CustomerEncryptionKey(this);
696       if (bitField0_ != 0) {
697         buildPartial0(result);
698       }
699       onBuilt();
700       return result;
701     }
702 
buildPartial0(com.google.cloud.compute.v1.CustomerEncryptionKey result)703     private void buildPartial0(com.google.cloud.compute.v1.CustomerEncryptionKey result) {
704       int from_bitField0_ = bitField0_;
705       int to_bitField0_ = 0;
706       if (((from_bitField0_ & 0x00000001) != 0)) {
707         result.kmsKeyName_ = kmsKeyName_;
708         to_bitField0_ |= 0x00000001;
709       }
710       if (((from_bitField0_ & 0x00000002) != 0)) {
711         result.kmsKeyServiceAccount_ = kmsKeyServiceAccount_;
712         to_bitField0_ |= 0x00000002;
713       }
714       if (((from_bitField0_ & 0x00000004) != 0)) {
715         result.rawKey_ = rawKey_;
716         to_bitField0_ |= 0x00000004;
717       }
718       if (((from_bitField0_ & 0x00000008) != 0)) {
719         result.rsaEncryptedKey_ = rsaEncryptedKey_;
720         to_bitField0_ |= 0x00000008;
721       }
722       if (((from_bitField0_ & 0x00000010) != 0)) {
723         result.sha256_ = sha256_;
724         to_bitField0_ |= 0x00000010;
725       }
726       result.bitField0_ |= to_bitField0_;
727     }
728 
729     @java.lang.Override
clone()730     public Builder clone() {
731       return super.clone();
732     }
733 
734     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)735     public Builder setField(
736         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
737       return super.setField(field, value);
738     }
739 
740     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)741     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
742       return super.clearField(field);
743     }
744 
745     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)746     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
747       return super.clearOneof(oneof);
748     }
749 
750     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)751     public Builder setRepeatedField(
752         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
753       return super.setRepeatedField(field, index, value);
754     }
755 
756     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)757     public Builder addRepeatedField(
758         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
759       return super.addRepeatedField(field, value);
760     }
761 
762     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)763     public Builder mergeFrom(com.google.protobuf.Message other) {
764       if (other instanceof com.google.cloud.compute.v1.CustomerEncryptionKey) {
765         return mergeFrom((com.google.cloud.compute.v1.CustomerEncryptionKey) other);
766       } else {
767         super.mergeFrom(other);
768         return this;
769       }
770     }
771 
mergeFrom(com.google.cloud.compute.v1.CustomerEncryptionKey other)772     public Builder mergeFrom(com.google.cloud.compute.v1.CustomerEncryptionKey other) {
773       if (other == com.google.cloud.compute.v1.CustomerEncryptionKey.getDefaultInstance())
774         return this;
775       if (other.hasKmsKeyName()) {
776         kmsKeyName_ = other.kmsKeyName_;
777         bitField0_ |= 0x00000001;
778         onChanged();
779       }
780       if (other.hasKmsKeyServiceAccount()) {
781         kmsKeyServiceAccount_ = other.kmsKeyServiceAccount_;
782         bitField0_ |= 0x00000002;
783         onChanged();
784       }
785       if (other.hasRawKey()) {
786         rawKey_ = other.rawKey_;
787         bitField0_ |= 0x00000004;
788         onChanged();
789       }
790       if (other.hasRsaEncryptedKey()) {
791         rsaEncryptedKey_ = other.rsaEncryptedKey_;
792         bitField0_ |= 0x00000008;
793         onChanged();
794       }
795       if (other.hasSha256()) {
796         sha256_ = other.sha256_;
797         bitField0_ |= 0x00000010;
798         onChanged();
799       }
800       this.mergeUnknownFields(other.getUnknownFields());
801       onChanged();
802       return this;
803     }
804 
805     @java.lang.Override
isInitialized()806     public final boolean isInitialized() {
807       return true;
808     }
809 
810     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)811     public Builder mergeFrom(
812         com.google.protobuf.CodedInputStream input,
813         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
814         throws java.io.IOException {
815       if (extensionRegistry == null) {
816         throw new java.lang.NullPointerException();
817       }
818       try {
819         boolean done = false;
820         while (!done) {
821           int tag = input.readTag();
822           switch (tag) {
823             case 0:
824               done = true;
825               break;
826             case 1360900410:
827               {
828                 sha256_ = input.readStringRequireUtf8();
829                 bitField0_ |= 0x00000010;
830                 break;
831               } // case 1360900410
832             case 1679890090:
833               {
834                 kmsKeyServiceAccount_ = input.readStringRequireUtf8();
835                 bitField0_ |= 0x00000002;
836                 break;
837               } // case 1679890090
838             case -1611068118:
839               {
840                 rsaEncryptedKey_ = input.readStringRequireUtf8();
841                 bitField0_ |= 0x00000008;
842                 break;
843               } // case -1611068118
844             case -701395390:
845               {
846                 rawKey_ = input.readStringRequireUtf8();
847                 bitField0_ |= 0x00000004;
848                 break;
849               } // case -701395390
850             case -419975990:
851               {
852                 kmsKeyName_ = input.readStringRequireUtf8();
853                 bitField0_ |= 0x00000001;
854                 break;
855               } // case -419975990
856             default:
857               {
858                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
859                   done = true; // was an endgroup tag
860                 }
861                 break;
862               } // default:
863           } // switch (tag)
864         } // while (!done)
865       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
866         throw e.unwrapIOException();
867       } finally {
868         onChanged();
869       } // finally
870       return this;
871     }
872 
873     private int bitField0_;
874 
875     private java.lang.Object kmsKeyName_ = "";
876     /**
877      *
878      *
879      * <pre>
880      * The name of the encryption key that is stored in Google Cloud KMS. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key
881      * </pre>
882      *
883      * <code>optional string kms_key_name = 484373913;</code>
884      *
885      * @return Whether the kmsKeyName field is set.
886      */
hasKmsKeyName()887     public boolean hasKmsKeyName() {
888       return ((bitField0_ & 0x00000001) != 0);
889     }
890     /**
891      *
892      *
893      * <pre>
894      * The name of the encryption key that is stored in Google Cloud KMS. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key
895      * </pre>
896      *
897      * <code>optional string kms_key_name = 484373913;</code>
898      *
899      * @return The kmsKeyName.
900      */
getKmsKeyName()901     public java.lang.String getKmsKeyName() {
902       java.lang.Object ref = kmsKeyName_;
903       if (!(ref instanceof java.lang.String)) {
904         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
905         java.lang.String s = bs.toStringUtf8();
906         kmsKeyName_ = s;
907         return s;
908       } else {
909         return (java.lang.String) ref;
910       }
911     }
912     /**
913      *
914      *
915      * <pre>
916      * The name of the encryption key that is stored in Google Cloud KMS. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key
917      * </pre>
918      *
919      * <code>optional string kms_key_name = 484373913;</code>
920      *
921      * @return The bytes for kmsKeyName.
922      */
getKmsKeyNameBytes()923     public com.google.protobuf.ByteString getKmsKeyNameBytes() {
924       java.lang.Object ref = kmsKeyName_;
925       if (ref instanceof String) {
926         com.google.protobuf.ByteString b =
927             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
928         kmsKeyName_ = b;
929         return b;
930       } else {
931         return (com.google.protobuf.ByteString) ref;
932       }
933     }
934     /**
935      *
936      *
937      * <pre>
938      * The name of the encryption key that is stored in Google Cloud KMS. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key
939      * </pre>
940      *
941      * <code>optional string kms_key_name = 484373913;</code>
942      *
943      * @param value The kmsKeyName to set.
944      * @return This builder for chaining.
945      */
setKmsKeyName(java.lang.String value)946     public Builder setKmsKeyName(java.lang.String value) {
947       if (value == null) {
948         throw new NullPointerException();
949       }
950       kmsKeyName_ = value;
951       bitField0_ |= 0x00000001;
952       onChanged();
953       return this;
954     }
955     /**
956      *
957      *
958      * <pre>
959      * The name of the encryption key that is stored in Google Cloud KMS. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key
960      * </pre>
961      *
962      * <code>optional string kms_key_name = 484373913;</code>
963      *
964      * @return This builder for chaining.
965      */
clearKmsKeyName()966     public Builder clearKmsKeyName() {
967       kmsKeyName_ = getDefaultInstance().getKmsKeyName();
968       bitField0_ = (bitField0_ & ~0x00000001);
969       onChanged();
970       return this;
971     }
972     /**
973      *
974      *
975      * <pre>
976      * The name of the encryption key that is stored in Google Cloud KMS. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key
977      * </pre>
978      *
979      * <code>optional string kms_key_name = 484373913;</code>
980      *
981      * @param value The bytes for kmsKeyName to set.
982      * @return This builder for chaining.
983      */
setKmsKeyNameBytes(com.google.protobuf.ByteString value)984     public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) {
985       if (value == null) {
986         throw new NullPointerException();
987       }
988       checkByteStringIsUtf8(value);
989       kmsKeyName_ = value;
990       bitField0_ |= 0x00000001;
991       onChanged();
992       return this;
993     }
994 
995     private java.lang.Object kmsKeyServiceAccount_ = "";
996     /**
997      *
998      *
999      * <pre>
1000      * The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. For example: "kmsKeyServiceAccount": "name&#64;project_id.iam.gserviceaccount.com/
1001      * </pre>
1002      *
1003      * <code>optional string kms_key_service_account = 209986261;</code>
1004      *
1005      * @return Whether the kmsKeyServiceAccount field is set.
1006      */
hasKmsKeyServiceAccount()1007     public boolean hasKmsKeyServiceAccount() {
1008       return ((bitField0_ & 0x00000002) != 0);
1009     }
1010     /**
1011      *
1012      *
1013      * <pre>
1014      * The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. For example: "kmsKeyServiceAccount": "name&#64;project_id.iam.gserviceaccount.com/
1015      * </pre>
1016      *
1017      * <code>optional string kms_key_service_account = 209986261;</code>
1018      *
1019      * @return The kmsKeyServiceAccount.
1020      */
getKmsKeyServiceAccount()1021     public java.lang.String getKmsKeyServiceAccount() {
1022       java.lang.Object ref = kmsKeyServiceAccount_;
1023       if (!(ref instanceof java.lang.String)) {
1024         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1025         java.lang.String s = bs.toStringUtf8();
1026         kmsKeyServiceAccount_ = s;
1027         return s;
1028       } else {
1029         return (java.lang.String) ref;
1030       }
1031     }
1032     /**
1033      *
1034      *
1035      * <pre>
1036      * The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. For example: "kmsKeyServiceAccount": "name&#64;project_id.iam.gserviceaccount.com/
1037      * </pre>
1038      *
1039      * <code>optional string kms_key_service_account = 209986261;</code>
1040      *
1041      * @return The bytes for kmsKeyServiceAccount.
1042      */
getKmsKeyServiceAccountBytes()1043     public com.google.protobuf.ByteString getKmsKeyServiceAccountBytes() {
1044       java.lang.Object ref = kmsKeyServiceAccount_;
1045       if (ref instanceof String) {
1046         com.google.protobuf.ByteString b =
1047             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1048         kmsKeyServiceAccount_ = b;
1049         return b;
1050       } else {
1051         return (com.google.protobuf.ByteString) ref;
1052       }
1053     }
1054     /**
1055      *
1056      *
1057      * <pre>
1058      * The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. For example: "kmsKeyServiceAccount": "name&#64;project_id.iam.gserviceaccount.com/
1059      * </pre>
1060      *
1061      * <code>optional string kms_key_service_account = 209986261;</code>
1062      *
1063      * @param value The kmsKeyServiceAccount to set.
1064      * @return This builder for chaining.
1065      */
setKmsKeyServiceAccount(java.lang.String value)1066     public Builder setKmsKeyServiceAccount(java.lang.String value) {
1067       if (value == null) {
1068         throw new NullPointerException();
1069       }
1070       kmsKeyServiceAccount_ = value;
1071       bitField0_ |= 0x00000002;
1072       onChanged();
1073       return this;
1074     }
1075     /**
1076      *
1077      *
1078      * <pre>
1079      * The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. For example: "kmsKeyServiceAccount": "name&#64;project_id.iam.gserviceaccount.com/
1080      * </pre>
1081      *
1082      * <code>optional string kms_key_service_account = 209986261;</code>
1083      *
1084      * @return This builder for chaining.
1085      */
clearKmsKeyServiceAccount()1086     public Builder clearKmsKeyServiceAccount() {
1087       kmsKeyServiceAccount_ = getDefaultInstance().getKmsKeyServiceAccount();
1088       bitField0_ = (bitField0_ & ~0x00000002);
1089       onChanged();
1090       return this;
1091     }
1092     /**
1093      *
1094      *
1095      * <pre>
1096      * The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. For example: "kmsKeyServiceAccount": "name&#64;project_id.iam.gserviceaccount.com/
1097      * </pre>
1098      *
1099      * <code>optional string kms_key_service_account = 209986261;</code>
1100      *
1101      * @param value The bytes for kmsKeyServiceAccount to set.
1102      * @return This builder for chaining.
1103      */
setKmsKeyServiceAccountBytes(com.google.protobuf.ByteString value)1104     public Builder setKmsKeyServiceAccountBytes(com.google.protobuf.ByteString value) {
1105       if (value == null) {
1106         throw new NullPointerException();
1107       }
1108       checkByteStringIsUtf8(value);
1109       kmsKeyServiceAccount_ = value;
1110       bitField0_ |= 0x00000002;
1111       onChanged();
1112       return this;
1113     }
1114 
1115     private java.lang.Object rawKey_ = "";
1116     /**
1117      *
1118      *
1119      * <pre>
1120      * Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rawKey": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0="
1121      * </pre>
1122      *
1123      * <code>optional string raw_key = 449196488;</code>
1124      *
1125      * @return Whether the rawKey field is set.
1126      */
hasRawKey()1127     public boolean hasRawKey() {
1128       return ((bitField0_ & 0x00000004) != 0);
1129     }
1130     /**
1131      *
1132      *
1133      * <pre>
1134      * Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rawKey": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0="
1135      * </pre>
1136      *
1137      * <code>optional string raw_key = 449196488;</code>
1138      *
1139      * @return The rawKey.
1140      */
getRawKey()1141     public java.lang.String getRawKey() {
1142       java.lang.Object ref = rawKey_;
1143       if (!(ref instanceof java.lang.String)) {
1144         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1145         java.lang.String s = bs.toStringUtf8();
1146         rawKey_ = s;
1147         return s;
1148       } else {
1149         return (java.lang.String) ref;
1150       }
1151     }
1152     /**
1153      *
1154      *
1155      * <pre>
1156      * Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rawKey": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0="
1157      * </pre>
1158      *
1159      * <code>optional string raw_key = 449196488;</code>
1160      *
1161      * @return The bytes for rawKey.
1162      */
getRawKeyBytes()1163     public com.google.protobuf.ByteString getRawKeyBytes() {
1164       java.lang.Object ref = rawKey_;
1165       if (ref instanceof String) {
1166         com.google.protobuf.ByteString b =
1167             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1168         rawKey_ = b;
1169         return b;
1170       } else {
1171         return (com.google.protobuf.ByteString) ref;
1172       }
1173     }
1174     /**
1175      *
1176      *
1177      * <pre>
1178      * Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rawKey": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0="
1179      * </pre>
1180      *
1181      * <code>optional string raw_key = 449196488;</code>
1182      *
1183      * @param value The rawKey to set.
1184      * @return This builder for chaining.
1185      */
setRawKey(java.lang.String value)1186     public Builder setRawKey(java.lang.String value) {
1187       if (value == null) {
1188         throw new NullPointerException();
1189       }
1190       rawKey_ = value;
1191       bitField0_ |= 0x00000004;
1192       onChanged();
1193       return this;
1194     }
1195     /**
1196      *
1197      *
1198      * <pre>
1199      * Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rawKey": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0="
1200      * </pre>
1201      *
1202      * <code>optional string raw_key = 449196488;</code>
1203      *
1204      * @return This builder for chaining.
1205      */
clearRawKey()1206     public Builder clearRawKey() {
1207       rawKey_ = getDefaultInstance().getRawKey();
1208       bitField0_ = (bitField0_ & ~0x00000004);
1209       onChanged();
1210       return this;
1211     }
1212     /**
1213      *
1214      *
1215      * <pre>
1216      * Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rawKey": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0="
1217      * </pre>
1218      *
1219      * <code>optional string raw_key = 449196488;</code>
1220      *
1221      * @param value The bytes for rawKey to set.
1222      * @return This builder for chaining.
1223      */
setRawKeyBytes(com.google.protobuf.ByteString value)1224     public Builder setRawKeyBytes(com.google.protobuf.ByteString value) {
1225       if (value == null) {
1226         throw new NullPointerException();
1227       }
1228       checkByteStringIsUtf8(value);
1229       rawKey_ = value;
1230       bitField0_ |= 0x00000004;
1231       onChanged();
1232       return this;
1233     }
1234 
1235     private java.lang.Object rsaEncryptedKey_ = "";
1236     /**
1237      *
1238      *
1239      * <pre>
1240      * Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rsaEncryptedKey": "ieCx/NcW06PcT7Ep1X6LUTc/hLvUDYyzSZPPVCVPTVEohpeHASqC8uw5TzyO9U+Fka9JFH z0mBibXUInrC/jEk014kCK/NPjYgEMOyssZ4ZINPKxlUh2zn1bV+MCaTICrdmuSBTWlUUiFoD D6PYznLwh8ZNdaheCeZ8ewEXgFQ8V+sDroLaN3Xs3MDTXQEMMoNUXMCZEIpg9Vtp9x2oe==" The key must meet the following requirements before you can provide it to Compute Engine: 1. The key is wrapped using a RSA public key certificate provided by Google. 2. After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at: https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1241      * </pre>
1242      *
1243      * <code>optional string rsa_encrypted_key = 335487397;</code>
1244      *
1245      * @return Whether the rsaEncryptedKey field is set.
1246      */
hasRsaEncryptedKey()1247     public boolean hasRsaEncryptedKey() {
1248       return ((bitField0_ & 0x00000008) != 0);
1249     }
1250     /**
1251      *
1252      *
1253      * <pre>
1254      * Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rsaEncryptedKey": "ieCx/NcW06PcT7Ep1X6LUTc/hLvUDYyzSZPPVCVPTVEohpeHASqC8uw5TzyO9U+Fka9JFH z0mBibXUInrC/jEk014kCK/NPjYgEMOyssZ4ZINPKxlUh2zn1bV+MCaTICrdmuSBTWlUUiFoD D6PYznLwh8ZNdaheCeZ8ewEXgFQ8V+sDroLaN3Xs3MDTXQEMMoNUXMCZEIpg9Vtp9x2oe==" The key must meet the following requirements before you can provide it to Compute Engine: 1. The key is wrapped using a RSA public key certificate provided by Google. 2. After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at: https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1255      * </pre>
1256      *
1257      * <code>optional string rsa_encrypted_key = 335487397;</code>
1258      *
1259      * @return The rsaEncryptedKey.
1260      */
getRsaEncryptedKey()1261     public java.lang.String getRsaEncryptedKey() {
1262       java.lang.Object ref = rsaEncryptedKey_;
1263       if (!(ref instanceof java.lang.String)) {
1264         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1265         java.lang.String s = bs.toStringUtf8();
1266         rsaEncryptedKey_ = s;
1267         return s;
1268       } else {
1269         return (java.lang.String) ref;
1270       }
1271     }
1272     /**
1273      *
1274      *
1275      * <pre>
1276      * Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rsaEncryptedKey": "ieCx/NcW06PcT7Ep1X6LUTc/hLvUDYyzSZPPVCVPTVEohpeHASqC8uw5TzyO9U+Fka9JFH z0mBibXUInrC/jEk014kCK/NPjYgEMOyssZ4ZINPKxlUh2zn1bV+MCaTICrdmuSBTWlUUiFoD D6PYznLwh8ZNdaheCeZ8ewEXgFQ8V+sDroLaN3Xs3MDTXQEMMoNUXMCZEIpg9Vtp9x2oe==" The key must meet the following requirements before you can provide it to Compute Engine: 1. The key is wrapped using a RSA public key certificate provided by Google. 2. After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at: https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1277      * </pre>
1278      *
1279      * <code>optional string rsa_encrypted_key = 335487397;</code>
1280      *
1281      * @return The bytes for rsaEncryptedKey.
1282      */
getRsaEncryptedKeyBytes()1283     public com.google.protobuf.ByteString getRsaEncryptedKeyBytes() {
1284       java.lang.Object ref = rsaEncryptedKey_;
1285       if (ref instanceof String) {
1286         com.google.protobuf.ByteString b =
1287             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1288         rsaEncryptedKey_ = b;
1289         return b;
1290       } else {
1291         return (com.google.protobuf.ByteString) ref;
1292       }
1293     }
1294     /**
1295      *
1296      *
1297      * <pre>
1298      * Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rsaEncryptedKey": "ieCx/NcW06PcT7Ep1X6LUTc/hLvUDYyzSZPPVCVPTVEohpeHASqC8uw5TzyO9U+Fka9JFH z0mBibXUInrC/jEk014kCK/NPjYgEMOyssZ4ZINPKxlUh2zn1bV+MCaTICrdmuSBTWlUUiFoD D6PYznLwh8ZNdaheCeZ8ewEXgFQ8V+sDroLaN3Xs3MDTXQEMMoNUXMCZEIpg9Vtp9x2oe==" The key must meet the following requirements before you can provide it to Compute Engine: 1. The key is wrapped using a RSA public key certificate provided by Google. 2. After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at: https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1299      * </pre>
1300      *
1301      * <code>optional string rsa_encrypted_key = 335487397;</code>
1302      *
1303      * @param value The rsaEncryptedKey to set.
1304      * @return This builder for chaining.
1305      */
setRsaEncryptedKey(java.lang.String value)1306     public Builder setRsaEncryptedKey(java.lang.String value) {
1307       if (value == null) {
1308         throw new NullPointerException();
1309       }
1310       rsaEncryptedKey_ = value;
1311       bitField0_ |= 0x00000008;
1312       onChanged();
1313       return this;
1314     }
1315     /**
1316      *
1317      *
1318      * <pre>
1319      * Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rsaEncryptedKey": "ieCx/NcW06PcT7Ep1X6LUTc/hLvUDYyzSZPPVCVPTVEohpeHASqC8uw5TzyO9U+Fka9JFH z0mBibXUInrC/jEk014kCK/NPjYgEMOyssZ4ZINPKxlUh2zn1bV+MCaTICrdmuSBTWlUUiFoD D6PYznLwh8ZNdaheCeZ8ewEXgFQ8V+sDroLaN3Xs3MDTXQEMMoNUXMCZEIpg9Vtp9x2oe==" The key must meet the following requirements before you can provide it to Compute Engine: 1. The key is wrapped using a RSA public key certificate provided by Google. 2. After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at: https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1320      * </pre>
1321      *
1322      * <code>optional string rsa_encrypted_key = 335487397;</code>
1323      *
1324      * @return This builder for chaining.
1325      */
clearRsaEncryptedKey()1326     public Builder clearRsaEncryptedKey() {
1327       rsaEncryptedKey_ = getDefaultInstance().getRsaEncryptedKey();
1328       bitField0_ = (bitField0_ & ~0x00000008);
1329       onChanged();
1330       return this;
1331     }
1332     /**
1333      *
1334      *
1335      * <pre>
1336      * Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rsaEncryptedKey": "ieCx/NcW06PcT7Ep1X6LUTc/hLvUDYyzSZPPVCVPTVEohpeHASqC8uw5TzyO9U+Fka9JFH z0mBibXUInrC/jEk014kCK/NPjYgEMOyssZ4ZINPKxlUh2zn1bV+MCaTICrdmuSBTWlUUiFoD D6PYznLwh8ZNdaheCeZ8ewEXgFQ8V+sDroLaN3Xs3MDTXQEMMoNUXMCZEIpg9Vtp9x2oe==" The key must meet the following requirements before you can provide it to Compute Engine: 1. The key is wrapped using a RSA public key certificate provided by Google. 2. After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at: https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1337      * </pre>
1338      *
1339      * <code>optional string rsa_encrypted_key = 335487397;</code>
1340      *
1341      * @param value The bytes for rsaEncryptedKey to set.
1342      * @return This builder for chaining.
1343      */
setRsaEncryptedKeyBytes(com.google.protobuf.ByteString value)1344     public Builder setRsaEncryptedKeyBytes(com.google.protobuf.ByteString value) {
1345       if (value == null) {
1346         throw new NullPointerException();
1347       }
1348       checkByteStringIsUtf8(value);
1349       rsaEncryptedKey_ = value;
1350       bitField0_ |= 0x00000008;
1351       onChanged();
1352       return this;
1353     }
1354 
1355     private java.lang.Object sha256_ = "";
1356     /**
1357      *
1358      *
1359      * <pre>
1360      * [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1361      * </pre>
1362      *
1363      * <code>optional string sha256 = 170112551;</code>
1364      *
1365      * @return Whether the sha256 field is set.
1366      */
hasSha256()1367     public boolean hasSha256() {
1368       return ((bitField0_ & 0x00000010) != 0);
1369     }
1370     /**
1371      *
1372      *
1373      * <pre>
1374      * [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1375      * </pre>
1376      *
1377      * <code>optional string sha256 = 170112551;</code>
1378      *
1379      * @return The sha256.
1380      */
getSha256()1381     public java.lang.String getSha256() {
1382       java.lang.Object ref = sha256_;
1383       if (!(ref instanceof java.lang.String)) {
1384         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1385         java.lang.String s = bs.toStringUtf8();
1386         sha256_ = s;
1387         return s;
1388       } else {
1389         return (java.lang.String) ref;
1390       }
1391     }
1392     /**
1393      *
1394      *
1395      * <pre>
1396      * [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1397      * </pre>
1398      *
1399      * <code>optional string sha256 = 170112551;</code>
1400      *
1401      * @return The bytes for sha256.
1402      */
getSha256Bytes()1403     public com.google.protobuf.ByteString getSha256Bytes() {
1404       java.lang.Object ref = sha256_;
1405       if (ref instanceof String) {
1406         com.google.protobuf.ByteString b =
1407             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1408         sha256_ = b;
1409         return b;
1410       } else {
1411         return (com.google.protobuf.ByteString) ref;
1412       }
1413     }
1414     /**
1415      *
1416      *
1417      * <pre>
1418      * [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1419      * </pre>
1420      *
1421      * <code>optional string sha256 = 170112551;</code>
1422      *
1423      * @param value The sha256 to set.
1424      * @return This builder for chaining.
1425      */
setSha256(java.lang.String value)1426     public Builder setSha256(java.lang.String value) {
1427       if (value == null) {
1428         throw new NullPointerException();
1429       }
1430       sha256_ = value;
1431       bitField0_ |= 0x00000010;
1432       onChanged();
1433       return this;
1434     }
1435     /**
1436      *
1437      *
1438      * <pre>
1439      * [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1440      * </pre>
1441      *
1442      * <code>optional string sha256 = 170112551;</code>
1443      *
1444      * @return This builder for chaining.
1445      */
clearSha256()1446     public Builder clearSha256() {
1447       sha256_ = getDefaultInstance().getSha256();
1448       bitField0_ = (bitField0_ & ~0x00000010);
1449       onChanged();
1450       return this;
1451     }
1452     /**
1453      *
1454      *
1455      * <pre>
1456      * [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1457      * </pre>
1458      *
1459      * <code>optional string sha256 = 170112551;</code>
1460      *
1461      * @param value The bytes for sha256 to set.
1462      * @return This builder for chaining.
1463      */
setSha256Bytes(com.google.protobuf.ByteString value)1464     public Builder setSha256Bytes(com.google.protobuf.ByteString value) {
1465       if (value == null) {
1466         throw new NullPointerException();
1467       }
1468       checkByteStringIsUtf8(value);
1469       sha256_ = value;
1470       bitField0_ |= 0x00000010;
1471       onChanged();
1472       return this;
1473     }
1474 
1475     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1476     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
1477       return super.setUnknownFields(unknownFields);
1478     }
1479 
1480     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1481     public final Builder mergeUnknownFields(
1482         final com.google.protobuf.UnknownFieldSet unknownFields) {
1483       return super.mergeUnknownFields(unknownFields);
1484     }
1485 
1486     // @@protoc_insertion_point(builder_scope:google.cloud.compute.v1.CustomerEncryptionKey)
1487   }
1488 
1489   // @@protoc_insertion_point(class_scope:google.cloud.compute.v1.CustomerEncryptionKey)
1490   private static final com.google.cloud.compute.v1.CustomerEncryptionKey DEFAULT_INSTANCE;
1491 
1492   static {
1493     DEFAULT_INSTANCE = new com.google.cloud.compute.v1.CustomerEncryptionKey();
1494   }
1495 
getDefaultInstance()1496   public static com.google.cloud.compute.v1.CustomerEncryptionKey getDefaultInstance() {
1497     return DEFAULT_INSTANCE;
1498   }
1499 
1500   private static final com.google.protobuf.Parser<CustomerEncryptionKey> PARSER =
1501       new com.google.protobuf.AbstractParser<CustomerEncryptionKey>() {
1502         @java.lang.Override
1503         public CustomerEncryptionKey parsePartialFrom(
1504             com.google.protobuf.CodedInputStream input,
1505             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1506             throws com.google.protobuf.InvalidProtocolBufferException {
1507           Builder builder = newBuilder();
1508           try {
1509             builder.mergeFrom(input, extensionRegistry);
1510           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1511             throw e.setUnfinishedMessage(builder.buildPartial());
1512           } catch (com.google.protobuf.UninitializedMessageException e) {
1513             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1514           } catch (java.io.IOException e) {
1515             throw new com.google.protobuf.InvalidProtocolBufferException(e)
1516                 .setUnfinishedMessage(builder.buildPartial());
1517           }
1518           return builder.buildPartial();
1519         }
1520       };
1521 
parser()1522   public static com.google.protobuf.Parser<CustomerEncryptionKey> parser() {
1523     return PARSER;
1524   }
1525 
1526   @java.lang.Override
getParserForType()1527   public com.google.protobuf.Parser<CustomerEncryptionKey> getParserForType() {
1528     return PARSER;
1529   }
1530 
1531   @java.lang.Override
getDefaultInstanceForType()1532   public com.google.cloud.compute.v1.CustomerEncryptionKey getDefaultInstanceForType() {
1533     return DEFAULT_INSTANCE;
1534   }
1535 }
1536