• 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/kms/v1/service.proto
18 
19 package com.google.cloud.kms.v1;
20 
21 /**
22  *
23  *
24  * <pre>
25  * Request message for
26  * [KeyManagementService.Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt].
27  * </pre>
28  *
29  * Protobuf type {@code google.cloud.kms.v1.EncryptRequest}
30  */
31 public final class EncryptRequest extends com.google.protobuf.GeneratedMessageV3
32     implements
33     // @@protoc_insertion_point(message_implements:google.cloud.kms.v1.EncryptRequest)
34     EncryptRequestOrBuilder {
35   private static final long serialVersionUID = 0L;
36   // Use EncryptRequest.newBuilder() to construct.
EncryptRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)37   private EncryptRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
38     super(builder);
39   }
40 
EncryptRequest()41   private EncryptRequest() {
42     name_ = "";
43     plaintext_ = com.google.protobuf.ByteString.EMPTY;
44     additionalAuthenticatedData_ = com.google.protobuf.ByteString.EMPTY;
45   }
46 
47   @java.lang.Override
48   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)49   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
50     return new EncryptRequest();
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.kms.v1.KmsProto
60         .internal_static_google_cloud_kms_v1_EncryptRequest_descriptor;
61   }
62 
63   @java.lang.Override
64   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()65       internalGetFieldAccessorTable() {
66     return com.google.cloud.kms.v1.KmsProto
67         .internal_static_google_cloud_kms_v1_EncryptRequest_fieldAccessorTable
68         .ensureFieldAccessorsInitialized(
69             com.google.cloud.kms.v1.EncryptRequest.class,
70             com.google.cloud.kms.v1.EncryptRequest.Builder.class);
71   }
72 
73   public static final int NAME_FIELD_NUMBER = 1;
74 
75   @SuppressWarnings("serial")
76   private volatile java.lang.Object name_ = "";
77   /**
78    *
79    *
80    * <pre>
81    * Required. The resource name of the
82    * [CryptoKey][google.cloud.kms.v1.CryptoKey] or
83    * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for
84    * encryption.
85    * If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server
86    * will use its [primary version][google.cloud.kms.v1.CryptoKey.primary].
87    * </pre>
88    *
89    * <code>
90    * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
91    * </code>
92    *
93    * @return The name.
94    */
95   @java.lang.Override
getName()96   public java.lang.String getName() {
97     java.lang.Object ref = name_;
98     if (ref instanceof java.lang.String) {
99       return (java.lang.String) ref;
100     } else {
101       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
102       java.lang.String s = bs.toStringUtf8();
103       name_ = s;
104       return s;
105     }
106   }
107   /**
108    *
109    *
110    * <pre>
111    * Required. The resource name of the
112    * [CryptoKey][google.cloud.kms.v1.CryptoKey] or
113    * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for
114    * encryption.
115    * If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server
116    * will use its [primary version][google.cloud.kms.v1.CryptoKey.primary].
117    * </pre>
118    *
119    * <code>
120    * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
121    * </code>
122    *
123    * @return The bytes for name.
124    */
125   @java.lang.Override
getNameBytes()126   public com.google.protobuf.ByteString getNameBytes() {
127     java.lang.Object ref = name_;
128     if (ref instanceof java.lang.String) {
129       com.google.protobuf.ByteString b =
130           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
131       name_ = b;
132       return b;
133     } else {
134       return (com.google.protobuf.ByteString) ref;
135     }
136   }
137 
138   public static final int PLAINTEXT_FIELD_NUMBER = 2;
139   private com.google.protobuf.ByteString plaintext_ = com.google.protobuf.ByteString.EMPTY;
140   /**
141    *
142    *
143    * <pre>
144    * Required. The data to encrypt. Must be no larger than 64KiB.
145    * The maximum size depends on the key version's
146    * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level].
147    * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE],
148    * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and
149    * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys, the
150    * plaintext must be no larger than 64KiB. For
151    * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of
152    * the plaintext and additional_authenticated_data fields must be no larger
153    * than 8KiB.
154    * </pre>
155    *
156    * <code>bytes plaintext = 2 [(.google.api.field_behavior) = REQUIRED];</code>
157    *
158    * @return The plaintext.
159    */
160   @java.lang.Override
getPlaintext()161   public com.google.protobuf.ByteString getPlaintext() {
162     return plaintext_;
163   }
164 
165   public static final int ADDITIONAL_AUTHENTICATED_DATA_FIELD_NUMBER = 3;
166   private com.google.protobuf.ByteString additionalAuthenticatedData_ =
167       com.google.protobuf.ByteString.EMPTY;
168   /**
169    *
170    *
171    * <pre>
172    * Optional. Optional data that, if specified, must also be provided during
173    * decryption through
174    * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data].
175    * The maximum size depends on the key version's
176    * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level].
177    * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE],
178    * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and
179    * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys the
180    * AAD must be no larger than 64KiB. For
181    * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of
182    * the plaintext and additional_authenticated_data fields must be no larger
183    * than 8KiB.
184    * </pre>
185    *
186    * <code>bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
187    *
188    * @return The additionalAuthenticatedData.
189    */
190   @java.lang.Override
getAdditionalAuthenticatedData()191   public com.google.protobuf.ByteString getAdditionalAuthenticatedData() {
192     return additionalAuthenticatedData_;
193   }
194 
195   public static final int PLAINTEXT_CRC32C_FIELD_NUMBER = 7;
196   private com.google.protobuf.Int64Value plaintextCrc32C_;
197   /**
198    *
199    *
200    * <pre>
201    * Optional. An optional CRC32C checksum of the
202    * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext].
203    * If specified,
204    * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
205    * verify the integrity of the received
206    * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]
207    * using this checksum.
208    * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
209    * report an error if the checksum verification fails. If you receive a
210    * checksum error, your client should verify that
211    * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext])
212    * is equal to
213    * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c],
214    * and if so, perform a limited number of retries. A persistent mismatch may
215    * indicate an issue in your computation of the CRC32C checksum. Note: This
216    * field is defined as int64 for reasons of compatibility across different
217    * languages. However, it is a non-negative integer, which will never exceed
218    * 2^32-1, and can be safely downconverted to uint32 in languages that support
219    * this type.
220    * </pre>
221    *
222    * <code>
223    * .google.protobuf.Int64Value plaintext_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL];
224    * </code>
225    *
226    * @return Whether the plaintextCrc32c field is set.
227    */
228   @java.lang.Override
hasPlaintextCrc32C()229   public boolean hasPlaintextCrc32C() {
230     return plaintextCrc32C_ != null;
231   }
232   /**
233    *
234    *
235    * <pre>
236    * Optional. An optional CRC32C checksum of the
237    * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext].
238    * If specified,
239    * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
240    * verify the integrity of the received
241    * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]
242    * using this checksum.
243    * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
244    * report an error if the checksum verification fails. If you receive a
245    * checksum error, your client should verify that
246    * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext])
247    * is equal to
248    * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c],
249    * and if so, perform a limited number of retries. A persistent mismatch may
250    * indicate an issue in your computation of the CRC32C checksum. Note: This
251    * field is defined as int64 for reasons of compatibility across different
252    * languages. However, it is a non-negative integer, which will never exceed
253    * 2^32-1, and can be safely downconverted to uint32 in languages that support
254    * this type.
255    * </pre>
256    *
257    * <code>
258    * .google.protobuf.Int64Value plaintext_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL];
259    * </code>
260    *
261    * @return The plaintextCrc32c.
262    */
263   @java.lang.Override
getPlaintextCrc32C()264   public com.google.protobuf.Int64Value getPlaintextCrc32C() {
265     return plaintextCrc32C_ == null
266         ? com.google.protobuf.Int64Value.getDefaultInstance()
267         : plaintextCrc32C_;
268   }
269   /**
270    *
271    *
272    * <pre>
273    * Optional. An optional CRC32C checksum of the
274    * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext].
275    * If specified,
276    * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
277    * verify the integrity of the received
278    * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]
279    * using this checksum.
280    * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
281    * report an error if the checksum verification fails. If you receive a
282    * checksum error, your client should verify that
283    * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext])
284    * is equal to
285    * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c],
286    * and if so, perform a limited number of retries. A persistent mismatch may
287    * indicate an issue in your computation of the CRC32C checksum. Note: This
288    * field is defined as int64 for reasons of compatibility across different
289    * languages. However, it is a non-negative integer, which will never exceed
290    * 2^32-1, and can be safely downconverted to uint32 in languages that support
291    * this type.
292    * </pre>
293    *
294    * <code>
295    * .google.protobuf.Int64Value plaintext_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL];
296    * </code>
297    */
298   @java.lang.Override
getPlaintextCrc32COrBuilder()299   public com.google.protobuf.Int64ValueOrBuilder getPlaintextCrc32COrBuilder() {
300     return plaintextCrc32C_ == null
301         ? com.google.protobuf.Int64Value.getDefaultInstance()
302         : plaintextCrc32C_;
303   }
304 
305   public static final int ADDITIONAL_AUTHENTICATED_DATA_CRC32C_FIELD_NUMBER = 8;
306   private com.google.protobuf.Int64Value additionalAuthenticatedDataCrc32C_;
307   /**
308    *
309    *
310    * <pre>
311    * Optional. An optional CRC32C checksum of the
312    * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data].
313    * If specified,
314    * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
315    * verify the integrity of the received
316    * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]
317    * using this checksum.
318    * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
319    * report an error if the checksum verification fails. If you receive a
320    * checksum error, your client should verify that
321    * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data])
322    * is equal to
323    * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c],
324    * and if so, perform a limited number of retries. A persistent mismatch may
325    * indicate an issue in your computation of the CRC32C checksum. Note: This
326    * field is defined as int64 for reasons of compatibility across different
327    * languages. However, it is a non-negative integer, which will never exceed
328    * 2^32-1, and can be safely downconverted to uint32 in languages that support
329    * this type.
330    * </pre>
331    *
332    * <code>
333    * .google.protobuf.Int64Value additional_authenticated_data_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL];
334    * </code>
335    *
336    * @return Whether the additionalAuthenticatedDataCrc32c field is set.
337    */
338   @java.lang.Override
hasAdditionalAuthenticatedDataCrc32C()339   public boolean hasAdditionalAuthenticatedDataCrc32C() {
340     return additionalAuthenticatedDataCrc32C_ != null;
341   }
342   /**
343    *
344    *
345    * <pre>
346    * Optional. An optional CRC32C checksum of the
347    * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data].
348    * If specified,
349    * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
350    * verify the integrity of the received
351    * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]
352    * using this checksum.
353    * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
354    * report an error if the checksum verification fails. If you receive a
355    * checksum error, your client should verify that
356    * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data])
357    * is equal to
358    * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c],
359    * and if so, perform a limited number of retries. A persistent mismatch may
360    * indicate an issue in your computation of the CRC32C checksum. Note: This
361    * field is defined as int64 for reasons of compatibility across different
362    * languages. However, it is a non-negative integer, which will never exceed
363    * 2^32-1, and can be safely downconverted to uint32 in languages that support
364    * this type.
365    * </pre>
366    *
367    * <code>
368    * .google.protobuf.Int64Value additional_authenticated_data_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL];
369    * </code>
370    *
371    * @return The additionalAuthenticatedDataCrc32c.
372    */
373   @java.lang.Override
getAdditionalAuthenticatedDataCrc32C()374   public com.google.protobuf.Int64Value getAdditionalAuthenticatedDataCrc32C() {
375     return additionalAuthenticatedDataCrc32C_ == null
376         ? com.google.protobuf.Int64Value.getDefaultInstance()
377         : additionalAuthenticatedDataCrc32C_;
378   }
379   /**
380    *
381    *
382    * <pre>
383    * Optional. An optional CRC32C checksum of the
384    * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data].
385    * If specified,
386    * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
387    * verify the integrity of the received
388    * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]
389    * using this checksum.
390    * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
391    * report an error if the checksum verification fails. If you receive a
392    * checksum error, your client should verify that
393    * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data])
394    * is equal to
395    * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c],
396    * and if so, perform a limited number of retries. A persistent mismatch may
397    * indicate an issue in your computation of the CRC32C checksum. Note: This
398    * field is defined as int64 for reasons of compatibility across different
399    * languages. However, it is a non-negative integer, which will never exceed
400    * 2^32-1, and can be safely downconverted to uint32 in languages that support
401    * this type.
402    * </pre>
403    *
404    * <code>
405    * .google.protobuf.Int64Value additional_authenticated_data_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL];
406    * </code>
407    */
408   @java.lang.Override
getAdditionalAuthenticatedDataCrc32COrBuilder()409   public com.google.protobuf.Int64ValueOrBuilder getAdditionalAuthenticatedDataCrc32COrBuilder() {
410     return additionalAuthenticatedDataCrc32C_ == null
411         ? com.google.protobuf.Int64Value.getDefaultInstance()
412         : additionalAuthenticatedDataCrc32C_;
413   }
414 
415   private byte memoizedIsInitialized = -1;
416 
417   @java.lang.Override
isInitialized()418   public final boolean isInitialized() {
419     byte isInitialized = memoizedIsInitialized;
420     if (isInitialized == 1) return true;
421     if (isInitialized == 0) return false;
422 
423     memoizedIsInitialized = 1;
424     return true;
425   }
426 
427   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)428   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
429     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
430       com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
431     }
432     if (!plaintext_.isEmpty()) {
433       output.writeBytes(2, plaintext_);
434     }
435     if (!additionalAuthenticatedData_.isEmpty()) {
436       output.writeBytes(3, additionalAuthenticatedData_);
437     }
438     if (plaintextCrc32C_ != null) {
439       output.writeMessage(7, getPlaintextCrc32C());
440     }
441     if (additionalAuthenticatedDataCrc32C_ != null) {
442       output.writeMessage(8, getAdditionalAuthenticatedDataCrc32C());
443     }
444     getUnknownFields().writeTo(output);
445   }
446 
447   @java.lang.Override
getSerializedSize()448   public int getSerializedSize() {
449     int size = memoizedSize;
450     if (size != -1) return size;
451 
452     size = 0;
453     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
454       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
455     }
456     if (!plaintext_.isEmpty()) {
457       size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, plaintext_);
458     }
459     if (!additionalAuthenticatedData_.isEmpty()) {
460       size +=
461           com.google.protobuf.CodedOutputStream.computeBytesSize(3, additionalAuthenticatedData_);
462     }
463     if (plaintextCrc32C_ != null) {
464       size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getPlaintextCrc32C());
465     }
466     if (additionalAuthenticatedDataCrc32C_ != null) {
467       size +=
468           com.google.protobuf.CodedOutputStream.computeMessageSize(
469               8, getAdditionalAuthenticatedDataCrc32C());
470     }
471     size += getUnknownFields().getSerializedSize();
472     memoizedSize = size;
473     return size;
474   }
475 
476   @java.lang.Override
equals(final java.lang.Object obj)477   public boolean equals(final java.lang.Object obj) {
478     if (obj == this) {
479       return true;
480     }
481     if (!(obj instanceof com.google.cloud.kms.v1.EncryptRequest)) {
482       return super.equals(obj);
483     }
484     com.google.cloud.kms.v1.EncryptRequest other = (com.google.cloud.kms.v1.EncryptRequest) obj;
485 
486     if (!getName().equals(other.getName())) return false;
487     if (!getPlaintext().equals(other.getPlaintext())) return false;
488     if (!getAdditionalAuthenticatedData().equals(other.getAdditionalAuthenticatedData()))
489       return false;
490     if (hasPlaintextCrc32C() != other.hasPlaintextCrc32C()) return false;
491     if (hasPlaintextCrc32C()) {
492       if (!getPlaintextCrc32C().equals(other.getPlaintextCrc32C())) return false;
493     }
494     if (hasAdditionalAuthenticatedDataCrc32C() != other.hasAdditionalAuthenticatedDataCrc32C())
495       return false;
496     if (hasAdditionalAuthenticatedDataCrc32C()) {
497       if (!getAdditionalAuthenticatedDataCrc32C()
498           .equals(other.getAdditionalAuthenticatedDataCrc32C())) return false;
499     }
500     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
501     return true;
502   }
503 
504   @java.lang.Override
hashCode()505   public int hashCode() {
506     if (memoizedHashCode != 0) {
507       return memoizedHashCode;
508     }
509     int hash = 41;
510     hash = (19 * hash) + getDescriptor().hashCode();
511     hash = (37 * hash) + NAME_FIELD_NUMBER;
512     hash = (53 * hash) + getName().hashCode();
513     hash = (37 * hash) + PLAINTEXT_FIELD_NUMBER;
514     hash = (53 * hash) + getPlaintext().hashCode();
515     hash = (37 * hash) + ADDITIONAL_AUTHENTICATED_DATA_FIELD_NUMBER;
516     hash = (53 * hash) + getAdditionalAuthenticatedData().hashCode();
517     if (hasPlaintextCrc32C()) {
518       hash = (37 * hash) + PLAINTEXT_CRC32C_FIELD_NUMBER;
519       hash = (53 * hash) + getPlaintextCrc32C().hashCode();
520     }
521     if (hasAdditionalAuthenticatedDataCrc32C()) {
522       hash = (37 * hash) + ADDITIONAL_AUTHENTICATED_DATA_CRC32C_FIELD_NUMBER;
523       hash = (53 * hash) + getAdditionalAuthenticatedDataCrc32C().hashCode();
524     }
525     hash = (29 * hash) + getUnknownFields().hashCode();
526     memoizedHashCode = hash;
527     return hash;
528   }
529 
parseFrom(java.nio.ByteBuffer data)530   public static com.google.cloud.kms.v1.EncryptRequest parseFrom(java.nio.ByteBuffer data)
531       throws com.google.protobuf.InvalidProtocolBufferException {
532     return PARSER.parseFrom(data);
533   }
534 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)535   public static com.google.cloud.kms.v1.EncryptRequest parseFrom(
536       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
537       throws com.google.protobuf.InvalidProtocolBufferException {
538     return PARSER.parseFrom(data, extensionRegistry);
539   }
540 
parseFrom( com.google.protobuf.ByteString data)541   public static com.google.cloud.kms.v1.EncryptRequest parseFrom(
542       com.google.protobuf.ByteString data)
543       throws com.google.protobuf.InvalidProtocolBufferException {
544     return PARSER.parseFrom(data);
545   }
546 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)547   public static com.google.cloud.kms.v1.EncryptRequest parseFrom(
548       com.google.protobuf.ByteString data,
549       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
550       throws com.google.protobuf.InvalidProtocolBufferException {
551     return PARSER.parseFrom(data, extensionRegistry);
552   }
553 
parseFrom(byte[] data)554   public static com.google.cloud.kms.v1.EncryptRequest parseFrom(byte[] data)
555       throws com.google.protobuf.InvalidProtocolBufferException {
556     return PARSER.parseFrom(data);
557   }
558 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)559   public static com.google.cloud.kms.v1.EncryptRequest parseFrom(
560       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
561       throws com.google.protobuf.InvalidProtocolBufferException {
562     return PARSER.parseFrom(data, extensionRegistry);
563   }
564 
parseFrom(java.io.InputStream input)565   public static com.google.cloud.kms.v1.EncryptRequest parseFrom(java.io.InputStream input)
566       throws java.io.IOException {
567     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
568   }
569 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)570   public static com.google.cloud.kms.v1.EncryptRequest parseFrom(
571       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
572       throws java.io.IOException {
573     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
574         PARSER, input, extensionRegistry);
575   }
576 
parseDelimitedFrom(java.io.InputStream input)577   public static com.google.cloud.kms.v1.EncryptRequest parseDelimitedFrom(java.io.InputStream input)
578       throws java.io.IOException {
579     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
580   }
581 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)582   public static com.google.cloud.kms.v1.EncryptRequest parseDelimitedFrom(
583       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
584       throws java.io.IOException {
585     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
586         PARSER, input, extensionRegistry);
587   }
588 
parseFrom( com.google.protobuf.CodedInputStream input)589   public static com.google.cloud.kms.v1.EncryptRequest parseFrom(
590       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
591     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
592   }
593 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)594   public static com.google.cloud.kms.v1.EncryptRequest parseFrom(
595       com.google.protobuf.CodedInputStream input,
596       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
597       throws java.io.IOException {
598     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
599         PARSER, input, extensionRegistry);
600   }
601 
602   @java.lang.Override
newBuilderForType()603   public Builder newBuilderForType() {
604     return newBuilder();
605   }
606 
newBuilder()607   public static Builder newBuilder() {
608     return DEFAULT_INSTANCE.toBuilder();
609   }
610 
newBuilder(com.google.cloud.kms.v1.EncryptRequest prototype)611   public static Builder newBuilder(com.google.cloud.kms.v1.EncryptRequest prototype) {
612     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
613   }
614 
615   @java.lang.Override
toBuilder()616   public Builder toBuilder() {
617     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
618   }
619 
620   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)621   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
622     Builder builder = new Builder(parent);
623     return builder;
624   }
625   /**
626    *
627    *
628    * <pre>
629    * Request message for
630    * [KeyManagementService.Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt].
631    * </pre>
632    *
633    * Protobuf type {@code google.cloud.kms.v1.EncryptRequest}
634    */
635   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
636       implements
637       // @@protoc_insertion_point(builder_implements:google.cloud.kms.v1.EncryptRequest)
638       com.google.cloud.kms.v1.EncryptRequestOrBuilder {
getDescriptor()639     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
640       return com.google.cloud.kms.v1.KmsProto
641           .internal_static_google_cloud_kms_v1_EncryptRequest_descriptor;
642     }
643 
644     @java.lang.Override
645     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()646         internalGetFieldAccessorTable() {
647       return com.google.cloud.kms.v1.KmsProto
648           .internal_static_google_cloud_kms_v1_EncryptRequest_fieldAccessorTable
649           .ensureFieldAccessorsInitialized(
650               com.google.cloud.kms.v1.EncryptRequest.class,
651               com.google.cloud.kms.v1.EncryptRequest.Builder.class);
652     }
653 
654     // Construct using com.google.cloud.kms.v1.EncryptRequest.newBuilder()
Builder()655     private Builder() {}
656 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)657     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
658       super(parent);
659     }
660 
661     @java.lang.Override
clear()662     public Builder clear() {
663       super.clear();
664       bitField0_ = 0;
665       name_ = "";
666       plaintext_ = com.google.protobuf.ByteString.EMPTY;
667       additionalAuthenticatedData_ = com.google.protobuf.ByteString.EMPTY;
668       plaintextCrc32C_ = null;
669       if (plaintextCrc32CBuilder_ != null) {
670         plaintextCrc32CBuilder_.dispose();
671         plaintextCrc32CBuilder_ = null;
672       }
673       additionalAuthenticatedDataCrc32C_ = null;
674       if (additionalAuthenticatedDataCrc32CBuilder_ != null) {
675         additionalAuthenticatedDataCrc32CBuilder_.dispose();
676         additionalAuthenticatedDataCrc32CBuilder_ = null;
677       }
678       return this;
679     }
680 
681     @java.lang.Override
getDescriptorForType()682     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
683       return com.google.cloud.kms.v1.KmsProto
684           .internal_static_google_cloud_kms_v1_EncryptRequest_descriptor;
685     }
686 
687     @java.lang.Override
getDefaultInstanceForType()688     public com.google.cloud.kms.v1.EncryptRequest getDefaultInstanceForType() {
689       return com.google.cloud.kms.v1.EncryptRequest.getDefaultInstance();
690     }
691 
692     @java.lang.Override
build()693     public com.google.cloud.kms.v1.EncryptRequest build() {
694       com.google.cloud.kms.v1.EncryptRequest result = buildPartial();
695       if (!result.isInitialized()) {
696         throw newUninitializedMessageException(result);
697       }
698       return result;
699     }
700 
701     @java.lang.Override
buildPartial()702     public com.google.cloud.kms.v1.EncryptRequest buildPartial() {
703       com.google.cloud.kms.v1.EncryptRequest result =
704           new com.google.cloud.kms.v1.EncryptRequest(this);
705       if (bitField0_ != 0) {
706         buildPartial0(result);
707       }
708       onBuilt();
709       return result;
710     }
711 
buildPartial0(com.google.cloud.kms.v1.EncryptRequest result)712     private void buildPartial0(com.google.cloud.kms.v1.EncryptRequest result) {
713       int from_bitField0_ = bitField0_;
714       if (((from_bitField0_ & 0x00000001) != 0)) {
715         result.name_ = name_;
716       }
717       if (((from_bitField0_ & 0x00000002) != 0)) {
718         result.plaintext_ = plaintext_;
719       }
720       if (((from_bitField0_ & 0x00000004) != 0)) {
721         result.additionalAuthenticatedData_ = additionalAuthenticatedData_;
722       }
723       if (((from_bitField0_ & 0x00000008) != 0)) {
724         result.plaintextCrc32C_ =
725             plaintextCrc32CBuilder_ == null ? plaintextCrc32C_ : plaintextCrc32CBuilder_.build();
726       }
727       if (((from_bitField0_ & 0x00000010) != 0)) {
728         result.additionalAuthenticatedDataCrc32C_ =
729             additionalAuthenticatedDataCrc32CBuilder_ == null
730                 ? additionalAuthenticatedDataCrc32C_
731                 : additionalAuthenticatedDataCrc32CBuilder_.build();
732       }
733     }
734 
735     @java.lang.Override
clone()736     public Builder clone() {
737       return super.clone();
738     }
739 
740     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)741     public Builder setField(
742         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
743       return super.setField(field, value);
744     }
745 
746     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)747     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
748       return super.clearField(field);
749     }
750 
751     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)752     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
753       return super.clearOneof(oneof);
754     }
755 
756     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)757     public Builder setRepeatedField(
758         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
759       return super.setRepeatedField(field, index, value);
760     }
761 
762     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)763     public Builder addRepeatedField(
764         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
765       return super.addRepeatedField(field, value);
766     }
767 
768     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)769     public Builder mergeFrom(com.google.protobuf.Message other) {
770       if (other instanceof com.google.cloud.kms.v1.EncryptRequest) {
771         return mergeFrom((com.google.cloud.kms.v1.EncryptRequest) other);
772       } else {
773         super.mergeFrom(other);
774         return this;
775       }
776     }
777 
mergeFrom(com.google.cloud.kms.v1.EncryptRequest other)778     public Builder mergeFrom(com.google.cloud.kms.v1.EncryptRequest other) {
779       if (other == com.google.cloud.kms.v1.EncryptRequest.getDefaultInstance()) return this;
780       if (!other.getName().isEmpty()) {
781         name_ = other.name_;
782         bitField0_ |= 0x00000001;
783         onChanged();
784       }
785       if (other.getPlaintext() != com.google.protobuf.ByteString.EMPTY) {
786         setPlaintext(other.getPlaintext());
787       }
788       if (other.getAdditionalAuthenticatedData() != com.google.protobuf.ByteString.EMPTY) {
789         setAdditionalAuthenticatedData(other.getAdditionalAuthenticatedData());
790       }
791       if (other.hasPlaintextCrc32C()) {
792         mergePlaintextCrc32C(other.getPlaintextCrc32C());
793       }
794       if (other.hasAdditionalAuthenticatedDataCrc32C()) {
795         mergeAdditionalAuthenticatedDataCrc32C(other.getAdditionalAuthenticatedDataCrc32C());
796       }
797       this.mergeUnknownFields(other.getUnknownFields());
798       onChanged();
799       return this;
800     }
801 
802     @java.lang.Override
isInitialized()803     public final boolean isInitialized() {
804       return true;
805     }
806 
807     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)808     public Builder mergeFrom(
809         com.google.protobuf.CodedInputStream input,
810         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
811         throws java.io.IOException {
812       if (extensionRegistry == null) {
813         throw new java.lang.NullPointerException();
814       }
815       try {
816         boolean done = false;
817         while (!done) {
818           int tag = input.readTag();
819           switch (tag) {
820             case 0:
821               done = true;
822               break;
823             case 10:
824               {
825                 name_ = input.readStringRequireUtf8();
826                 bitField0_ |= 0x00000001;
827                 break;
828               } // case 10
829             case 18:
830               {
831                 plaintext_ = input.readBytes();
832                 bitField0_ |= 0x00000002;
833                 break;
834               } // case 18
835             case 26:
836               {
837                 additionalAuthenticatedData_ = input.readBytes();
838                 bitField0_ |= 0x00000004;
839                 break;
840               } // case 26
841             case 58:
842               {
843                 input.readMessage(getPlaintextCrc32CFieldBuilder().getBuilder(), extensionRegistry);
844                 bitField0_ |= 0x00000008;
845                 break;
846               } // case 58
847             case 66:
848               {
849                 input.readMessage(
850                     getAdditionalAuthenticatedDataCrc32CFieldBuilder().getBuilder(),
851                     extensionRegistry);
852                 bitField0_ |= 0x00000010;
853                 break;
854               } // case 66
855             default:
856               {
857                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
858                   done = true; // was an endgroup tag
859                 }
860                 break;
861               } // default:
862           } // switch (tag)
863         } // while (!done)
864       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
865         throw e.unwrapIOException();
866       } finally {
867         onChanged();
868       } // finally
869       return this;
870     }
871 
872     private int bitField0_;
873 
874     private java.lang.Object name_ = "";
875     /**
876      *
877      *
878      * <pre>
879      * Required. The resource name of the
880      * [CryptoKey][google.cloud.kms.v1.CryptoKey] or
881      * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for
882      * encryption.
883      * If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server
884      * will use its [primary version][google.cloud.kms.v1.CryptoKey.primary].
885      * </pre>
886      *
887      * <code>
888      * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
889      * </code>
890      *
891      * @return The name.
892      */
getName()893     public java.lang.String getName() {
894       java.lang.Object ref = name_;
895       if (!(ref instanceof java.lang.String)) {
896         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
897         java.lang.String s = bs.toStringUtf8();
898         name_ = s;
899         return s;
900       } else {
901         return (java.lang.String) ref;
902       }
903     }
904     /**
905      *
906      *
907      * <pre>
908      * Required. The resource name of the
909      * [CryptoKey][google.cloud.kms.v1.CryptoKey] or
910      * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for
911      * encryption.
912      * If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server
913      * will use its [primary version][google.cloud.kms.v1.CryptoKey.primary].
914      * </pre>
915      *
916      * <code>
917      * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
918      * </code>
919      *
920      * @return The bytes for name.
921      */
getNameBytes()922     public com.google.protobuf.ByteString getNameBytes() {
923       java.lang.Object ref = name_;
924       if (ref instanceof String) {
925         com.google.protobuf.ByteString b =
926             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
927         name_ = b;
928         return b;
929       } else {
930         return (com.google.protobuf.ByteString) ref;
931       }
932     }
933     /**
934      *
935      *
936      * <pre>
937      * Required. The resource name of the
938      * [CryptoKey][google.cloud.kms.v1.CryptoKey] or
939      * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for
940      * encryption.
941      * If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server
942      * will use its [primary version][google.cloud.kms.v1.CryptoKey.primary].
943      * </pre>
944      *
945      * <code>
946      * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
947      * </code>
948      *
949      * @param value The name to set.
950      * @return This builder for chaining.
951      */
setName(java.lang.String value)952     public Builder setName(java.lang.String value) {
953       if (value == null) {
954         throw new NullPointerException();
955       }
956       name_ = value;
957       bitField0_ |= 0x00000001;
958       onChanged();
959       return this;
960     }
961     /**
962      *
963      *
964      * <pre>
965      * Required. The resource name of the
966      * [CryptoKey][google.cloud.kms.v1.CryptoKey] or
967      * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for
968      * encryption.
969      * If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server
970      * will use its [primary version][google.cloud.kms.v1.CryptoKey.primary].
971      * </pre>
972      *
973      * <code>
974      * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
975      * </code>
976      *
977      * @return This builder for chaining.
978      */
clearName()979     public Builder clearName() {
980       name_ = getDefaultInstance().getName();
981       bitField0_ = (bitField0_ & ~0x00000001);
982       onChanged();
983       return this;
984     }
985     /**
986      *
987      *
988      * <pre>
989      * Required. The resource name of the
990      * [CryptoKey][google.cloud.kms.v1.CryptoKey] or
991      * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for
992      * encryption.
993      * If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server
994      * will use its [primary version][google.cloud.kms.v1.CryptoKey.primary].
995      * </pre>
996      *
997      * <code>
998      * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
999      * </code>
1000      *
1001      * @param value The bytes for name to set.
1002      * @return This builder for chaining.
1003      */
setNameBytes(com.google.protobuf.ByteString value)1004     public Builder setNameBytes(com.google.protobuf.ByteString value) {
1005       if (value == null) {
1006         throw new NullPointerException();
1007       }
1008       checkByteStringIsUtf8(value);
1009       name_ = value;
1010       bitField0_ |= 0x00000001;
1011       onChanged();
1012       return this;
1013     }
1014 
1015     private com.google.protobuf.ByteString plaintext_ = com.google.protobuf.ByteString.EMPTY;
1016     /**
1017      *
1018      *
1019      * <pre>
1020      * Required. The data to encrypt. Must be no larger than 64KiB.
1021      * The maximum size depends on the key version's
1022      * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level].
1023      * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE],
1024      * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and
1025      * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys, the
1026      * plaintext must be no larger than 64KiB. For
1027      * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of
1028      * the plaintext and additional_authenticated_data fields must be no larger
1029      * than 8KiB.
1030      * </pre>
1031      *
1032      * <code>bytes plaintext = 2 [(.google.api.field_behavior) = REQUIRED];</code>
1033      *
1034      * @return The plaintext.
1035      */
1036     @java.lang.Override
getPlaintext()1037     public com.google.protobuf.ByteString getPlaintext() {
1038       return plaintext_;
1039     }
1040     /**
1041      *
1042      *
1043      * <pre>
1044      * Required. The data to encrypt. Must be no larger than 64KiB.
1045      * The maximum size depends on the key version's
1046      * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level].
1047      * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE],
1048      * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and
1049      * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys, the
1050      * plaintext must be no larger than 64KiB. For
1051      * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of
1052      * the plaintext and additional_authenticated_data fields must be no larger
1053      * than 8KiB.
1054      * </pre>
1055      *
1056      * <code>bytes plaintext = 2 [(.google.api.field_behavior) = REQUIRED];</code>
1057      *
1058      * @param value The plaintext to set.
1059      * @return This builder for chaining.
1060      */
setPlaintext(com.google.protobuf.ByteString value)1061     public Builder setPlaintext(com.google.protobuf.ByteString value) {
1062       if (value == null) {
1063         throw new NullPointerException();
1064       }
1065       plaintext_ = value;
1066       bitField0_ |= 0x00000002;
1067       onChanged();
1068       return this;
1069     }
1070     /**
1071      *
1072      *
1073      * <pre>
1074      * Required. The data to encrypt. Must be no larger than 64KiB.
1075      * The maximum size depends on the key version's
1076      * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level].
1077      * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE],
1078      * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and
1079      * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys, the
1080      * plaintext must be no larger than 64KiB. For
1081      * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of
1082      * the plaintext and additional_authenticated_data fields must be no larger
1083      * than 8KiB.
1084      * </pre>
1085      *
1086      * <code>bytes plaintext = 2 [(.google.api.field_behavior) = REQUIRED];</code>
1087      *
1088      * @return This builder for chaining.
1089      */
clearPlaintext()1090     public Builder clearPlaintext() {
1091       bitField0_ = (bitField0_ & ~0x00000002);
1092       plaintext_ = getDefaultInstance().getPlaintext();
1093       onChanged();
1094       return this;
1095     }
1096 
1097     private com.google.protobuf.ByteString additionalAuthenticatedData_ =
1098         com.google.protobuf.ByteString.EMPTY;
1099     /**
1100      *
1101      *
1102      * <pre>
1103      * Optional. Optional data that, if specified, must also be provided during
1104      * decryption through
1105      * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data].
1106      * The maximum size depends on the key version's
1107      * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level].
1108      * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE],
1109      * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and
1110      * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys the
1111      * AAD must be no larger than 64KiB. For
1112      * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of
1113      * the plaintext and additional_authenticated_data fields must be no larger
1114      * than 8KiB.
1115      * </pre>
1116      *
1117      * <code>bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL];
1118      * </code>
1119      *
1120      * @return The additionalAuthenticatedData.
1121      */
1122     @java.lang.Override
getAdditionalAuthenticatedData()1123     public com.google.protobuf.ByteString getAdditionalAuthenticatedData() {
1124       return additionalAuthenticatedData_;
1125     }
1126     /**
1127      *
1128      *
1129      * <pre>
1130      * Optional. Optional data that, if specified, must also be provided during
1131      * decryption through
1132      * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data].
1133      * The maximum size depends on the key version's
1134      * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level].
1135      * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE],
1136      * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and
1137      * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys the
1138      * AAD must be no larger than 64KiB. For
1139      * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of
1140      * the plaintext and additional_authenticated_data fields must be no larger
1141      * than 8KiB.
1142      * </pre>
1143      *
1144      * <code>bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL];
1145      * </code>
1146      *
1147      * @param value The additionalAuthenticatedData to set.
1148      * @return This builder for chaining.
1149      */
setAdditionalAuthenticatedData(com.google.protobuf.ByteString value)1150     public Builder setAdditionalAuthenticatedData(com.google.protobuf.ByteString value) {
1151       if (value == null) {
1152         throw new NullPointerException();
1153       }
1154       additionalAuthenticatedData_ = value;
1155       bitField0_ |= 0x00000004;
1156       onChanged();
1157       return this;
1158     }
1159     /**
1160      *
1161      *
1162      * <pre>
1163      * Optional. Optional data that, if specified, must also be provided during
1164      * decryption through
1165      * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data].
1166      * The maximum size depends on the key version's
1167      * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level].
1168      * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE],
1169      * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and
1170      * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys the
1171      * AAD must be no larger than 64KiB. For
1172      * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of
1173      * the plaintext and additional_authenticated_data fields must be no larger
1174      * than 8KiB.
1175      * </pre>
1176      *
1177      * <code>bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL];
1178      * </code>
1179      *
1180      * @return This builder for chaining.
1181      */
clearAdditionalAuthenticatedData()1182     public Builder clearAdditionalAuthenticatedData() {
1183       bitField0_ = (bitField0_ & ~0x00000004);
1184       additionalAuthenticatedData_ = getDefaultInstance().getAdditionalAuthenticatedData();
1185       onChanged();
1186       return this;
1187     }
1188 
1189     private com.google.protobuf.Int64Value plaintextCrc32C_;
1190     private com.google.protobuf.SingleFieldBuilderV3<
1191             com.google.protobuf.Int64Value,
1192             com.google.protobuf.Int64Value.Builder,
1193             com.google.protobuf.Int64ValueOrBuilder>
1194         plaintextCrc32CBuilder_;
1195     /**
1196      *
1197      *
1198      * <pre>
1199      * Optional. An optional CRC32C checksum of the
1200      * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext].
1201      * If specified,
1202      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1203      * verify the integrity of the received
1204      * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]
1205      * using this checksum.
1206      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1207      * report an error if the checksum verification fails. If you receive a
1208      * checksum error, your client should verify that
1209      * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext])
1210      * is equal to
1211      * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c],
1212      * and if so, perform a limited number of retries. A persistent mismatch may
1213      * indicate an issue in your computation of the CRC32C checksum. Note: This
1214      * field is defined as int64 for reasons of compatibility across different
1215      * languages. However, it is a non-negative integer, which will never exceed
1216      * 2^32-1, and can be safely downconverted to uint32 in languages that support
1217      * this type.
1218      * </pre>
1219      *
1220      * <code>
1221      * .google.protobuf.Int64Value plaintext_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL];
1222      * </code>
1223      *
1224      * @return Whether the plaintextCrc32c field is set.
1225      */
hasPlaintextCrc32C()1226     public boolean hasPlaintextCrc32C() {
1227       return ((bitField0_ & 0x00000008) != 0);
1228     }
1229     /**
1230      *
1231      *
1232      * <pre>
1233      * Optional. An optional CRC32C checksum of the
1234      * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext].
1235      * If specified,
1236      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1237      * verify the integrity of the received
1238      * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]
1239      * using this checksum.
1240      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1241      * report an error if the checksum verification fails. If you receive a
1242      * checksum error, your client should verify that
1243      * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext])
1244      * is equal to
1245      * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c],
1246      * and if so, perform a limited number of retries. A persistent mismatch may
1247      * indicate an issue in your computation of the CRC32C checksum. Note: This
1248      * field is defined as int64 for reasons of compatibility across different
1249      * languages. However, it is a non-negative integer, which will never exceed
1250      * 2^32-1, and can be safely downconverted to uint32 in languages that support
1251      * this type.
1252      * </pre>
1253      *
1254      * <code>
1255      * .google.protobuf.Int64Value plaintext_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL];
1256      * </code>
1257      *
1258      * @return The plaintextCrc32c.
1259      */
getPlaintextCrc32C()1260     public com.google.protobuf.Int64Value getPlaintextCrc32C() {
1261       if (plaintextCrc32CBuilder_ == null) {
1262         return plaintextCrc32C_ == null
1263             ? com.google.protobuf.Int64Value.getDefaultInstance()
1264             : plaintextCrc32C_;
1265       } else {
1266         return plaintextCrc32CBuilder_.getMessage();
1267       }
1268     }
1269     /**
1270      *
1271      *
1272      * <pre>
1273      * Optional. An optional CRC32C checksum of the
1274      * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext].
1275      * If specified,
1276      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1277      * verify the integrity of the received
1278      * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]
1279      * using this checksum.
1280      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1281      * report an error if the checksum verification fails. If you receive a
1282      * checksum error, your client should verify that
1283      * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext])
1284      * is equal to
1285      * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c],
1286      * and if so, perform a limited number of retries. A persistent mismatch may
1287      * indicate an issue in your computation of the CRC32C checksum. Note: This
1288      * field is defined as int64 for reasons of compatibility across different
1289      * languages. However, it is a non-negative integer, which will never exceed
1290      * 2^32-1, and can be safely downconverted to uint32 in languages that support
1291      * this type.
1292      * </pre>
1293      *
1294      * <code>
1295      * .google.protobuf.Int64Value plaintext_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL];
1296      * </code>
1297      */
setPlaintextCrc32C(com.google.protobuf.Int64Value value)1298     public Builder setPlaintextCrc32C(com.google.protobuf.Int64Value value) {
1299       if (plaintextCrc32CBuilder_ == null) {
1300         if (value == null) {
1301           throw new NullPointerException();
1302         }
1303         plaintextCrc32C_ = value;
1304       } else {
1305         plaintextCrc32CBuilder_.setMessage(value);
1306       }
1307       bitField0_ |= 0x00000008;
1308       onChanged();
1309       return this;
1310     }
1311     /**
1312      *
1313      *
1314      * <pre>
1315      * Optional. An optional CRC32C checksum of the
1316      * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext].
1317      * If specified,
1318      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1319      * verify the integrity of the received
1320      * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]
1321      * using this checksum.
1322      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1323      * report an error if the checksum verification fails. If you receive a
1324      * checksum error, your client should verify that
1325      * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext])
1326      * is equal to
1327      * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c],
1328      * and if so, perform a limited number of retries. A persistent mismatch may
1329      * indicate an issue in your computation of the CRC32C checksum. Note: This
1330      * field is defined as int64 for reasons of compatibility across different
1331      * languages. However, it is a non-negative integer, which will never exceed
1332      * 2^32-1, and can be safely downconverted to uint32 in languages that support
1333      * this type.
1334      * </pre>
1335      *
1336      * <code>
1337      * .google.protobuf.Int64Value plaintext_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL];
1338      * </code>
1339      */
setPlaintextCrc32C(com.google.protobuf.Int64Value.Builder builderForValue)1340     public Builder setPlaintextCrc32C(com.google.protobuf.Int64Value.Builder builderForValue) {
1341       if (plaintextCrc32CBuilder_ == null) {
1342         plaintextCrc32C_ = builderForValue.build();
1343       } else {
1344         plaintextCrc32CBuilder_.setMessage(builderForValue.build());
1345       }
1346       bitField0_ |= 0x00000008;
1347       onChanged();
1348       return this;
1349     }
1350     /**
1351      *
1352      *
1353      * <pre>
1354      * Optional. An optional CRC32C checksum of the
1355      * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext].
1356      * If specified,
1357      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1358      * verify the integrity of the received
1359      * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]
1360      * using this checksum.
1361      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1362      * report an error if the checksum verification fails. If you receive a
1363      * checksum error, your client should verify that
1364      * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext])
1365      * is equal to
1366      * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c],
1367      * and if so, perform a limited number of retries. A persistent mismatch may
1368      * indicate an issue in your computation of the CRC32C checksum. Note: This
1369      * field is defined as int64 for reasons of compatibility across different
1370      * languages. However, it is a non-negative integer, which will never exceed
1371      * 2^32-1, and can be safely downconverted to uint32 in languages that support
1372      * this type.
1373      * </pre>
1374      *
1375      * <code>
1376      * .google.protobuf.Int64Value plaintext_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL];
1377      * </code>
1378      */
mergePlaintextCrc32C(com.google.protobuf.Int64Value value)1379     public Builder mergePlaintextCrc32C(com.google.protobuf.Int64Value value) {
1380       if (plaintextCrc32CBuilder_ == null) {
1381         if (((bitField0_ & 0x00000008) != 0)
1382             && plaintextCrc32C_ != null
1383             && plaintextCrc32C_ != com.google.protobuf.Int64Value.getDefaultInstance()) {
1384           getPlaintextCrc32CBuilder().mergeFrom(value);
1385         } else {
1386           plaintextCrc32C_ = value;
1387         }
1388       } else {
1389         plaintextCrc32CBuilder_.mergeFrom(value);
1390       }
1391       bitField0_ |= 0x00000008;
1392       onChanged();
1393       return this;
1394     }
1395     /**
1396      *
1397      *
1398      * <pre>
1399      * Optional. An optional CRC32C checksum of the
1400      * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext].
1401      * If specified,
1402      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1403      * verify the integrity of the received
1404      * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]
1405      * using this checksum.
1406      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1407      * report an error if the checksum verification fails. If you receive a
1408      * checksum error, your client should verify that
1409      * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext])
1410      * is equal to
1411      * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c],
1412      * and if so, perform a limited number of retries. A persistent mismatch may
1413      * indicate an issue in your computation of the CRC32C checksum. Note: This
1414      * field is defined as int64 for reasons of compatibility across different
1415      * languages. However, it is a non-negative integer, which will never exceed
1416      * 2^32-1, and can be safely downconverted to uint32 in languages that support
1417      * this type.
1418      * </pre>
1419      *
1420      * <code>
1421      * .google.protobuf.Int64Value plaintext_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL];
1422      * </code>
1423      */
clearPlaintextCrc32C()1424     public Builder clearPlaintextCrc32C() {
1425       bitField0_ = (bitField0_ & ~0x00000008);
1426       plaintextCrc32C_ = null;
1427       if (plaintextCrc32CBuilder_ != null) {
1428         plaintextCrc32CBuilder_.dispose();
1429         plaintextCrc32CBuilder_ = null;
1430       }
1431       onChanged();
1432       return this;
1433     }
1434     /**
1435      *
1436      *
1437      * <pre>
1438      * Optional. An optional CRC32C checksum of the
1439      * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext].
1440      * If specified,
1441      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1442      * verify the integrity of the received
1443      * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]
1444      * using this checksum.
1445      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1446      * report an error if the checksum verification fails. If you receive a
1447      * checksum error, your client should verify that
1448      * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext])
1449      * is equal to
1450      * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c],
1451      * and if so, perform a limited number of retries. A persistent mismatch may
1452      * indicate an issue in your computation of the CRC32C checksum. Note: This
1453      * field is defined as int64 for reasons of compatibility across different
1454      * languages. However, it is a non-negative integer, which will never exceed
1455      * 2^32-1, and can be safely downconverted to uint32 in languages that support
1456      * this type.
1457      * </pre>
1458      *
1459      * <code>
1460      * .google.protobuf.Int64Value plaintext_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL];
1461      * </code>
1462      */
getPlaintextCrc32CBuilder()1463     public com.google.protobuf.Int64Value.Builder getPlaintextCrc32CBuilder() {
1464       bitField0_ |= 0x00000008;
1465       onChanged();
1466       return getPlaintextCrc32CFieldBuilder().getBuilder();
1467     }
1468     /**
1469      *
1470      *
1471      * <pre>
1472      * Optional. An optional CRC32C checksum of the
1473      * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext].
1474      * If specified,
1475      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1476      * verify the integrity of the received
1477      * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]
1478      * using this checksum.
1479      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1480      * report an error if the checksum verification fails. If you receive a
1481      * checksum error, your client should verify that
1482      * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext])
1483      * is equal to
1484      * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c],
1485      * and if so, perform a limited number of retries. A persistent mismatch may
1486      * indicate an issue in your computation of the CRC32C checksum. Note: This
1487      * field is defined as int64 for reasons of compatibility across different
1488      * languages. However, it is a non-negative integer, which will never exceed
1489      * 2^32-1, and can be safely downconverted to uint32 in languages that support
1490      * this type.
1491      * </pre>
1492      *
1493      * <code>
1494      * .google.protobuf.Int64Value plaintext_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL];
1495      * </code>
1496      */
getPlaintextCrc32COrBuilder()1497     public com.google.protobuf.Int64ValueOrBuilder getPlaintextCrc32COrBuilder() {
1498       if (plaintextCrc32CBuilder_ != null) {
1499         return plaintextCrc32CBuilder_.getMessageOrBuilder();
1500       } else {
1501         return plaintextCrc32C_ == null
1502             ? com.google.protobuf.Int64Value.getDefaultInstance()
1503             : plaintextCrc32C_;
1504       }
1505     }
1506     /**
1507      *
1508      *
1509      * <pre>
1510      * Optional. An optional CRC32C checksum of the
1511      * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext].
1512      * If specified,
1513      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1514      * verify the integrity of the received
1515      * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]
1516      * using this checksum.
1517      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1518      * report an error if the checksum verification fails. If you receive a
1519      * checksum error, your client should verify that
1520      * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext])
1521      * is equal to
1522      * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c],
1523      * and if so, perform a limited number of retries. A persistent mismatch may
1524      * indicate an issue in your computation of the CRC32C checksum. Note: This
1525      * field is defined as int64 for reasons of compatibility across different
1526      * languages. However, it is a non-negative integer, which will never exceed
1527      * 2^32-1, and can be safely downconverted to uint32 in languages that support
1528      * this type.
1529      * </pre>
1530      *
1531      * <code>
1532      * .google.protobuf.Int64Value plaintext_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL];
1533      * </code>
1534      */
1535     private com.google.protobuf.SingleFieldBuilderV3<
1536             com.google.protobuf.Int64Value,
1537             com.google.protobuf.Int64Value.Builder,
1538             com.google.protobuf.Int64ValueOrBuilder>
getPlaintextCrc32CFieldBuilder()1539         getPlaintextCrc32CFieldBuilder() {
1540       if (plaintextCrc32CBuilder_ == null) {
1541         plaintextCrc32CBuilder_ =
1542             new com.google.protobuf.SingleFieldBuilderV3<
1543                 com.google.protobuf.Int64Value,
1544                 com.google.protobuf.Int64Value.Builder,
1545                 com.google.protobuf.Int64ValueOrBuilder>(
1546                 getPlaintextCrc32C(), getParentForChildren(), isClean());
1547         plaintextCrc32C_ = null;
1548       }
1549       return plaintextCrc32CBuilder_;
1550     }
1551 
1552     private com.google.protobuf.Int64Value additionalAuthenticatedDataCrc32C_;
1553     private com.google.protobuf.SingleFieldBuilderV3<
1554             com.google.protobuf.Int64Value,
1555             com.google.protobuf.Int64Value.Builder,
1556             com.google.protobuf.Int64ValueOrBuilder>
1557         additionalAuthenticatedDataCrc32CBuilder_;
1558     /**
1559      *
1560      *
1561      * <pre>
1562      * Optional. An optional CRC32C checksum of the
1563      * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data].
1564      * If specified,
1565      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1566      * verify the integrity of the received
1567      * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]
1568      * using this checksum.
1569      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1570      * report an error if the checksum verification fails. If you receive a
1571      * checksum error, your client should verify that
1572      * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data])
1573      * is equal to
1574      * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c],
1575      * and if so, perform a limited number of retries. A persistent mismatch may
1576      * indicate an issue in your computation of the CRC32C checksum. Note: This
1577      * field is defined as int64 for reasons of compatibility across different
1578      * languages. However, it is a non-negative integer, which will never exceed
1579      * 2^32-1, and can be safely downconverted to uint32 in languages that support
1580      * this type.
1581      * </pre>
1582      *
1583      * <code>
1584      * .google.protobuf.Int64Value additional_authenticated_data_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL];
1585      * </code>
1586      *
1587      * @return Whether the additionalAuthenticatedDataCrc32c field is set.
1588      */
hasAdditionalAuthenticatedDataCrc32C()1589     public boolean hasAdditionalAuthenticatedDataCrc32C() {
1590       return ((bitField0_ & 0x00000010) != 0);
1591     }
1592     /**
1593      *
1594      *
1595      * <pre>
1596      * Optional. An optional CRC32C checksum of the
1597      * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data].
1598      * If specified,
1599      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1600      * verify the integrity of the received
1601      * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]
1602      * using this checksum.
1603      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1604      * report an error if the checksum verification fails. If you receive a
1605      * checksum error, your client should verify that
1606      * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data])
1607      * is equal to
1608      * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c],
1609      * and if so, perform a limited number of retries. A persistent mismatch may
1610      * indicate an issue in your computation of the CRC32C checksum. Note: This
1611      * field is defined as int64 for reasons of compatibility across different
1612      * languages. However, it is a non-negative integer, which will never exceed
1613      * 2^32-1, and can be safely downconverted to uint32 in languages that support
1614      * this type.
1615      * </pre>
1616      *
1617      * <code>
1618      * .google.protobuf.Int64Value additional_authenticated_data_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL];
1619      * </code>
1620      *
1621      * @return The additionalAuthenticatedDataCrc32c.
1622      */
getAdditionalAuthenticatedDataCrc32C()1623     public com.google.protobuf.Int64Value getAdditionalAuthenticatedDataCrc32C() {
1624       if (additionalAuthenticatedDataCrc32CBuilder_ == null) {
1625         return additionalAuthenticatedDataCrc32C_ == null
1626             ? com.google.protobuf.Int64Value.getDefaultInstance()
1627             : additionalAuthenticatedDataCrc32C_;
1628       } else {
1629         return additionalAuthenticatedDataCrc32CBuilder_.getMessage();
1630       }
1631     }
1632     /**
1633      *
1634      *
1635      * <pre>
1636      * Optional. An optional CRC32C checksum of the
1637      * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data].
1638      * If specified,
1639      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1640      * verify the integrity of the received
1641      * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]
1642      * using this checksum.
1643      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1644      * report an error if the checksum verification fails. If you receive a
1645      * checksum error, your client should verify that
1646      * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data])
1647      * is equal to
1648      * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c],
1649      * and if so, perform a limited number of retries. A persistent mismatch may
1650      * indicate an issue in your computation of the CRC32C checksum. Note: This
1651      * field is defined as int64 for reasons of compatibility across different
1652      * languages. However, it is a non-negative integer, which will never exceed
1653      * 2^32-1, and can be safely downconverted to uint32 in languages that support
1654      * this type.
1655      * </pre>
1656      *
1657      * <code>
1658      * .google.protobuf.Int64Value additional_authenticated_data_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL];
1659      * </code>
1660      */
setAdditionalAuthenticatedDataCrc32C(com.google.protobuf.Int64Value value)1661     public Builder setAdditionalAuthenticatedDataCrc32C(com.google.protobuf.Int64Value value) {
1662       if (additionalAuthenticatedDataCrc32CBuilder_ == null) {
1663         if (value == null) {
1664           throw new NullPointerException();
1665         }
1666         additionalAuthenticatedDataCrc32C_ = value;
1667       } else {
1668         additionalAuthenticatedDataCrc32CBuilder_.setMessage(value);
1669       }
1670       bitField0_ |= 0x00000010;
1671       onChanged();
1672       return this;
1673     }
1674     /**
1675      *
1676      *
1677      * <pre>
1678      * Optional. An optional CRC32C checksum of the
1679      * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data].
1680      * If specified,
1681      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1682      * verify the integrity of the received
1683      * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]
1684      * using this checksum.
1685      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1686      * report an error if the checksum verification fails. If you receive a
1687      * checksum error, your client should verify that
1688      * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data])
1689      * is equal to
1690      * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c],
1691      * and if so, perform a limited number of retries. A persistent mismatch may
1692      * indicate an issue in your computation of the CRC32C checksum. Note: This
1693      * field is defined as int64 for reasons of compatibility across different
1694      * languages. However, it is a non-negative integer, which will never exceed
1695      * 2^32-1, and can be safely downconverted to uint32 in languages that support
1696      * this type.
1697      * </pre>
1698      *
1699      * <code>
1700      * .google.protobuf.Int64Value additional_authenticated_data_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL];
1701      * </code>
1702      */
setAdditionalAuthenticatedDataCrc32C( com.google.protobuf.Int64Value.Builder builderForValue)1703     public Builder setAdditionalAuthenticatedDataCrc32C(
1704         com.google.protobuf.Int64Value.Builder builderForValue) {
1705       if (additionalAuthenticatedDataCrc32CBuilder_ == null) {
1706         additionalAuthenticatedDataCrc32C_ = builderForValue.build();
1707       } else {
1708         additionalAuthenticatedDataCrc32CBuilder_.setMessage(builderForValue.build());
1709       }
1710       bitField0_ |= 0x00000010;
1711       onChanged();
1712       return this;
1713     }
1714     /**
1715      *
1716      *
1717      * <pre>
1718      * Optional. An optional CRC32C checksum of the
1719      * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data].
1720      * If specified,
1721      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1722      * verify the integrity of the received
1723      * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]
1724      * using this checksum.
1725      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1726      * report an error if the checksum verification fails. If you receive a
1727      * checksum error, your client should verify that
1728      * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data])
1729      * is equal to
1730      * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c],
1731      * and if so, perform a limited number of retries. A persistent mismatch may
1732      * indicate an issue in your computation of the CRC32C checksum. Note: This
1733      * field is defined as int64 for reasons of compatibility across different
1734      * languages. However, it is a non-negative integer, which will never exceed
1735      * 2^32-1, and can be safely downconverted to uint32 in languages that support
1736      * this type.
1737      * </pre>
1738      *
1739      * <code>
1740      * .google.protobuf.Int64Value additional_authenticated_data_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL];
1741      * </code>
1742      */
mergeAdditionalAuthenticatedDataCrc32C(com.google.protobuf.Int64Value value)1743     public Builder mergeAdditionalAuthenticatedDataCrc32C(com.google.protobuf.Int64Value value) {
1744       if (additionalAuthenticatedDataCrc32CBuilder_ == null) {
1745         if (((bitField0_ & 0x00000010) != 0)
1746             && additionalAuthenticatedDataCrc32C_ != null
1747             && additionalAuthenticatedDataCrc32C_
1748                 != com.google.protobuf.Int64Value.getDefaultInstance()) {
1749           getAdditionalAuthenticatedDataCrc32CBuilder().mergeFrom(value);
1750         } else {
1751           additionalAuthenticatedDataCrc32C_ = value;
1752         }
1753       } else {
1754         additionalAuthenticatedDataCrc32CBuilder_.mergeFrom(value);
1755       }
1756       bitField0_ |= 0x00000010;
1757       onChanged();
1758       return this;
1759     }
1760     /**
1761      *
1762      *
1763      * <pre>
1764      * Optional. An optional CRC32C checksum of the
1765      * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data].
1766      * If specified,
1767      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1768      * verify the integrity of the received
1769      * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]
1770      * using this checksum.
1771      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1772      * report an error if the checksum verification fails. If you receive a
1773      * checksum error, your client should verify that
1774      * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data])
1775      * is equal to
1776      * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c],
1777      * and if so, perform a limited number of retries. A persistent mismatch may
1778      * indicate an issue in your computation of the CRC32C checksum. Note: This
1779      * field is defined as int64 for reasons of compatibility across different
1780      * languages. However, it is a non-negative integer, which will never exceed
1781      * 2^32-1, and can be safely downconverted to uint32 in languages that support
1782      * this type.
1783      * </pre>
1784      *
1785      * <code>
1786      * .google.protobuf.Int64Value additional_authenticated_data_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL];
1787      * </code>
1788      */
clearAdditionalAuthenticatedDataCrc32C()1789     public Builder clearAdditionalAuthenticatedDataCrc32C() {
1790       bitField0_ = (bitField0_ & ~0x00000010);
1791       additionalAuthenticatedDataCrc32C_ = null;
1792       if (additionalAuthenticatedDataCrc32CBuilder_ != null) {
1793         additionalAuthenticatedDataCrc32CBuilder_.dispose();
1794         additionalAuthenticatedDataCrc32CBuilder_ = null;
1795       }
1796       onChanged();
1797       return this;
1798     }
1799     /**
1800      *
1801      *
1802      * <pre>
1803      * Optional. An optional CRC32C checksum of the
1804      * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data].
1805      * If specified,
1806      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1807      * verify the integrity of the received
1808      * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]
1809      * using this checksum.
1810      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1811      * report an error if the checksum verification fails. If you receive a
1812      * checksum error, your client should verify that
1813      * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data])
1814      * is equal to
1815      * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c],
1816      * and if so, perform a limited number of retries. A persistent mismatch may
1817      * indicate an issue in your computation of the CRC32C checksum. Note: This
1818      * field is defined as int64 for reasons of compatibility across different
1819      * languages. However, it is a non-negative integer, which will never exceed
1820      * 2^32-1, and can be safely downconverted to uint32 in languages that support
1821      * this type.
1822      * </pre>
1823      *
1824      * <code>
1825      * .google.protobuf.Int64Value additional_authenticated_data_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL];
1826      * </code>
1827      */
getAdditionalAuthenticatedDataCrc32CBuilder()1828     public com.google.protobuf.Int64Value.Builder getAdditionalAuthenticatedDataCrc32CBuilder() {
1829       bitField0_ |= 0x00000010;
1830       onChanged();
1831       return getAdditionalAuthenticatedDataCrc32CFieldBuilder().getBuilder();
1832     }
1833     /**
1834      *
1835      *
1836      * <pre>
1837      * Optional. An optional CRC32C checksum of the
1838      * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data].
1839      * If specified,
1840      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1841      * verify the integrity of the received
1842      * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]
1843      * using this checksum.
1844      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1845      * report an error if the checksum verification fails. If you receive a
1846      * checksum error, your client should verify that
1847      * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data])
1848      * is equal to
1849      * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c],
1850      * and if so, perform a limited number of retries. A persistent mismatch may
1851      * indicate an issue in your computation of the CRC32C checksum. Note: This
1852      * field is defined as int64 for reasons of compatibility across different
1853      * languages. However, it is a non-negative integer, which will never exceed
1854      * 2^32-1, and can be safely downconverted to uint32 in languages that support
1855      * this type.
1856      * </pre>
1857      *
1858      * <code>
1859      * .google.protobuf.Int64Value additional_authenticated_data_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL];
1860      * </code>
1861      */
getAdditionalAuthenticatedDataCrc32COrBuilder()1862     public com.google.protobuf.Int64ValueOrBuilder getAdditionalAuthenticatedDataCrc32COrBuilder() {
1863       if (additionalAuthenticatedDataCrc32CBuilder_ != null) {
1864         return additionalAuthenticatedDataCrc32CBuilder_.getMessageOrBuilder();
1865       } else {
1866         return additionalAuthenticatedDataCrc32C_ == null
1867             ? com.google.protobuf.Int64Value.getDefaultInstance()
1868             : additionalAuthenticatedDataCrc32C_;
1869       }
1870     }
1871     /**
1872      *
1873      *
1874      * <pre>
1875      * Optional. An optional CRC32C checksum of the
1876      * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data].
1877      * If specified,
1878      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1879      * verify the integrity of the received
1880      * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]
1881      * using this checksum.
1882      * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
1883      * report an error if the checksum verification fails. If you receive a
1884      * checksum error, your client should verify that
1885      * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data])
1886      * is equal to
1887      * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c],
1888      * and if so, perform a limited number of retries. A persistent mismatch may
1889      * indicate an issue in your computation of the CRC32C checksum. Note: This
1890      * field is defined as int64 for reasons of compatibility across different
1891      * languages. However, it is a non-negative integer, which will never exceed
1892      * 2^32-1, and can be safely downconverted to uint32 in languages that support
1893      * this type.
1894      * </pre>
1895      *
1896      * <code>
1897      * .google.protobuf.Int64Value additional_authenticated_data_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL];
1898      * </code>
1899      */
1900     private com.google.protobuf.SingleFieldBuilderV3<
1901             com.google.protobuf.Int64Value,
1902             com.google.protobuf.Int64Value.Builder,
1903             com.google.protobuf.Int64ValueOrBuilder>
getAdditionalAuthenticatedDataCrc32CFieldBuilder()1904         getAdditionalAuthenticatedDataCrc32CFieldBuilder() {
1905       if (additionalAuthenticatedDataCrc32CBuilder_ == null) {
1906         additionalAuthenticatedDataCrc32CBuilder_ =
1907             new com.google.protobuf.SingleFieldBuilderV3<
1908                 com.google.protobuf.Int64Value,
1909                 com.google.protobuf.Int64Value.Builder,
1910                 com.google.protobuf.Int64ValueOrBuilder>(
1911                 getAdditionalAuthenticatedDataCrc32C(), getParentForChildren(), isClean());
1912         additionalAuthenticatedDataCrc32C_ = null;
1913       }
1914       return additionalAuthenticatedDataCrc32CBuilder_;
1915     }
1916 
1917     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1918     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
1919       return super.setUnknownFields(unknownFields);
1920     }
1921 
1922     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1923     public final Builder mergeUnknownFields(
1924         final com.google.protobuf.UnknownFieldSet unknownFields) {
1925       return super.mergeUnknownFields(unknownFields);
1926     }
1927 
1928     // @@protoc_insertion_point(builder_scope:google.cloud.kms.v1.EncryptRequest)
1929   }
1930 
1931   // @@protoc_insertion_point(class_scope:google.cloud.kms.v1.EncryptRequest)
1932   private static final com.google.cloud.kms.v1.EncryptRequest DEFAULT_INSTANCE;
1933 
1934   static {
1935     DEFAULT_INSTANCE = new com.google.cloud.kms.v1.EncryptRequest();
1936   }
1937 
getDefaultInstance()1938   public static com.google.cloud.kms.v1.EncryptRequest getDefaultInstance() {
1939     return DEFAULT_INSTANCE;
1940   }
1941 
1942   private static final com.google.protobuf.Parser<EncryptRequest> PARSER =
1943       new com.google.protobuf.AbstractParser<EncryptRequest>() {
1944         @java.lang.Override
1945         public EncryptRequest parsePartialFrom(
1946             com.google.protobuf.CodedInputStream input,
1947             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1948             throws com.google.protobuf.InvalidProtocolBufferException {
1949           Builder builder = newBuilder();
1950           try {
1951             builder.mergeFrom(input, extensionRegistry);
1952           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1953             throw e.setUnfinishedMessage(builder.buildPartial());
1954           } catch (com.google.protobuf.UninitializedMessageException e) {
1955             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1956           } catch (java.io.IOException e) {
1957             throw new com.google.protobuf.InvalidProtocolBufferException(e)
1958                 .setUnfinishedMessage(builder.buildPartial());
1959           }
1960           return builder.buildPartial();
1961         }
1962       };
1963 
parser()1964   public static com.google.protobuf.Parser<EncryptRequest> parser() {
1965     return PARSER;
1966   }
1967 
1968   @java.lang.Override
getParserForType()1969   public com.google.protobuf.Parser<EncryptRequest> getParserForType() {
1970     return PARSER;
1971   }
1972 
1973   @java.lang.Override
getDefaultInstanceForType()1974   public com.google.cloud.kms.v1.EncryptRequest getDefaultInstanceForType() {
1975     return DEFAULT_INSTANCE;
1976   }
1977 }
1978