|
| 1 | +/* |
| 2 | + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except |
| 3 | + * in compliance with the License. You may obtain a copy of the License at |
| 4 | + * |
| 5 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | + * |
| 7 | + * Unless required by applicable law or agreed to in writing, software distributed under the License |
| 8 | + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
| 9 | + * or implied. See the License for the specific language governing permissions and limitations under |
| 10 | + * the License. |
| 11 | + */ |
| 12 | +/* |
| 13 | + * This code was generated by https://github.com/googleapis/google-api-java-client-services/ |
| 14 | + * Modify at your own risk. |
| 15 | + */ |
| 16 | + |
| 17 | +package com.google.api.services.cloudkms.v1.model; |
| 18 | + |
| 19 | +/** |
| 20 | + * Request message for KeyManagementService.Decapsulate. |
| 21 | + * |
| 22 | + * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is |
| 23 | + * transmitted over HTTP when working with the Cloud Key Management Service (KMS) API. For a |
| 24 | + * detailed explanation see: |
| 25 | + * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a> |
| 26 | + * </p> |
| 27 | + * |
| 28 | + * @author Google, Inc. |
| 29 | + */ |
| 30 | +@SuppressWarnings("javadoc") |
| 31 | +public final class DecapsulateRequest extends com.google.api.client.json.GenericJson { |
| 32 | + |
| 33 | + /** |
| 34 | + * Required. The ciphertext produced from encapsulation with the named CryptoKeyVersion public |
| 35 | + * key(s). |
| 36 | + * The value may be {@code null}. |
| 37 | + */ |
| 38 | + @com.google.api.client.util.Key |
| 39 | + private java.lang.String ciphertext; |
| 40 | + |
| 41 | + /** |
| 42 | + * Optional. A CRC32C checksum of the DecapsulateRequest.ciphertext. If specified, |
| 43 | + * KeyManagementService will verify the integrity of the received DecapsulateRequest.ciphertext |
| 44 | + * using this checksum. KeyManagementService will report an error if the checksum verification |
| 45 | + * fails. If you receive a checksum error, your client should verify that |
| 46 | + * CRC32C(DecapsulateRequest.ciphertext) is equal to DecapsulateRequest.ciphertext_crc32c, and if |
| 47 | + * so, perform a limited number of retries. A persistent mismatch may indicate an issue in your |
| 48 | + * computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of |
| 49 | + * compatibility across different languages. However, it is a non-negative integer, which will |
| 50 | + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this |
| 51 | + * type. |
| 52 | + * The value may be {@code null}. |
| 53 | + */ |
| 54 | + @com.google.api.client.util.Key @com.google.api.client.json.JsonString |
| 55 | + private java.lang.Long ciphertextCrc32c; |
| 56 | + |
| 57 | + /** |
| 58 | + * Required. The ciphertext produced from encapsulation with the named CryptoKeyVersion public |
| 59 | + * key(s). |
| 60 | + * @see #decodeCiphertext() |
| 61 | + * @return value or {@code null} for none |
| 62 | + */ |
| 63 | + public java.lang.String getCiphertext() { |
| 64 | + return ciphertext; |
| 65 | + } |
| 66 | + |
| 67 | + /** |
| 68 | + * Required. The ciphertext produced from encapsulation with the named CryptoKeyVersion public |
| 69 | + * key(s). |
| 70 | + * @see #getCiphertext() |
| 71 | + * @return Base64 decoded value or {@code null} for none |
| 72 | + * |
| 73 | + * @since 1.14 |
| 74 | + */ |
| 75 | + public byte[] decodeCiphertext() { |
| 76 | + return com.google.api.client.util.Base64.decodeBase64(ciphertext); |
| 77 | + } |
| 78 | + |
| 79 | + /** |
| 80 | + * Required. The ciphertext produced from encapsulation with the named CryptoKeyVersion public |
| 81 | + * key(s). |
| 82 | + * @see #encodeCiphertext() |
| 83 | + * @param ciphertext ciphertext or {@code null} for none |
| 84 | + */ |
| 85 | + public DecapsulateRequest setCiphertext(java.lang.String ciphertext) { |
| 86 | + this.ciphertext = ciphertext; |
| 87 | + return this; |
| 88 | + } |
| 89 | + |
| 90 | + /** |
| 91 | + * Required. The ciphertext produced from encapsulation with the named CryptoKeyVersion public |
| 92 | + * key(s). |
| 93 | + * @see #setCiphertext() |
| 94 | + * |
| 95 | + * <p> |
| 96 | + * The value is encoded Base64 or {@code null} for none. |
| 97 | + * </p> |
| 98 | + * |
| 99 | + * @since 1.14 |
| 100 | + */ |
| 101 | + public DecapsulateRequest encodeCiphertext(byte[] ciphertext) { |
| 102 | + this.ciphertext = com.google.api.client.util.Base64.encodeBase64URLSafeString(ciphertext); |
| 103 | + return this; |
| 104 | + } |
| 105 | + |
| 106 | + /** |
| 107 | + * Optional. A CRC32C checksum of the DecapsulateRequest.ciphertext. If specified, |
| 108 | + * KeyManagementService will verify the integrity of the received DecapsulateRequest.ciphertext |
| 109 | + * using this checksum. KeyManagementService will report an error if the checksum verification |
| 110 | + * fails. If you receive a checksum error, your client should verify that |
| 111 | + * CRC32C(DecapsulateRequest.ciphertext) is equal to DecapsulateRequest.ciphertext_crc32c, and if |
| 112 | + * so, perform a limited number of retries. A persistent mismatch may indicate an issue in your |
| 113 | + * computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of |
| 114 | + * compatibility across different languages. However, it is a non-negative integer, which will |
| 115 | + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this |
| 116 | + * type. |
| 117 | + * @return value or {@code null} for none |
| 118 | + */ |
| 119 | + public java.lang.Long getCiphertextCrc32c() { |
| 120 | + return ciphertextCrc32c; |
| 121 | + } |
| 122 | + |
| 123 | + /** |
| 124 | + * Optional. A CRC32C checksum of the DecapsulateRequest.ciphertext. If specified, |
| 125 | + * KeyManagementService will verify the integrity of the received DecapsulateRequest.ciphertext |
| 126 | + * using this checksum. KeyManagementService will report an error if the checksum verification |
| 127 | + * fails. If you receive a checksum error, your client should verify that |
| 128 | + * CRC32C(DecapsulateRequest.ciphertext) is equal to DecapsulateRequest.ciphertext_crc32c, and if |
| 129 | + * so, perform a limited number of retries. A persistent mismatch may indicate an issue in your |
| 130 | + * computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of |
| 131 | + * compatibility across different languages. However, it is a non-negative integer, which will |
| 132 | + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this |
| 133 | + * type. |
| 134 | + * @param ciphertextCrc32c ciphertextCrc32c or {@code null} for none |
| 135 | + */ |
| 136 | + public DecapsulateRequest setCiphertextCrc32c(java.lang.Long ciphertextCrc32c) { |
| 137 | + this.ciphertextCrc32c = ciphertextCrc32c; |
| 138 | + return this; |
| 139 | + } |
| 140 | + |
| 141 | + @Override |
| 142 | + public DecapsulateRequest set(String fieldName, Object value) { |
| 143 | + return (DecapsulateRequest) super.set(fieldName, value); |
| 144 | + } |
| 145 | + |
| 146 | + @Override |
| 147 | + public DecapsulateRequest clone() { |
| 148 | + return (DecapsulateRequest) super.clone(); |
| 149 | + } |
| 150 | + |
| 151 | +} |
0 commit comments